Skip to content

Commit

Permalink
fixed dag , batch_dag
Browse files Browse the repository at this point in the history
  • Loading branch information
Phionx committed Feb 27, 2024
1 parent 3792305 commit 4e69b7e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion jaxquantum/quantum/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,17 @@ def dag(op: jnp.ndarray) -> jnp.ndarray:
Returns:
conjugate transpose of op
"""
# return jnp.conj(op).T
return jnp.conj(op).T

def batch_dag(op: jnp.ndarray) -> jnp.ndarray:
"""Conjugate transpose.
Args:
op: operator
Returns:
conjugate of op, and transposes last two axes
"""
return jnp.moveaxis(jnp.conj(op), -1, -2) # transposes last two axes, good for batching


Expand Down

0 comments on commit 4e69b7e

Please sign in to comment.