Skip to content

Commit

Permalink
Merge pull request #769 from qiboteam/depolarizing_channel
Browse files Browse the repository at this point in the history
Depolarizing channel on gpu
  • Loading branch information
scarrazza authored Jan 25, 2023
2 parents 4ed2fe6 + cfba10c commit 980e841
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/qibo/gates/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ def __init__(self, q, lam=0):

def apply_density_matrix(self, backend, state, nqubits):
lam = self.init_kwargs["lam"]
return (1 - lam) * backend.cast(state) + lam / 2**nqubits * I(
*range(nqubits)
).asmatrix(backend)
return (1 - lam) * backend.cast(state) + lam / 2**nqubits * backend.cast(
I(*range(nqubits)).asmatrix(backend)
)

def apply(self, backend, state, nqubits):
num_qubits = len(self.target_qubits)
Expand Down

0 comments on commit 980e841

Please sign in to comment.