Skip to content

Commit

Permalink
Defining dephasing and depolarizing operators with projectors (#715)
Browse files Browse the repository at this point in the history
  • Loading branch information
HGSilveri authored Jul 29, 2024
1 parent 03fbb6e commit acf136f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions pulser-simulation/pulser_simulation/hamiltonian.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@ def basis_check(noise_type: str) -> None:
f"Cannot include {noise_type} noise in all-basis."
)

# NOTE: These operators only make sense when basis != "all"
b, a = self.eigenbasis[:2]
pauli_2d = {
"x": self.op_matrix[f"sigma_{a}{b}"]
+ self.op_matrix[f"sigma_{b}{a}"],
"y": 1j * self.op_matrix[f"sigma_{a}{b}"]
- 1j * self.op_matrix[f"sigma_{b}{a}"],
"z": self.op_matrix[f"sigma_{b}{b}"]
- self.op_matrix[f"sigma_{a}{a}"],
}

local_collapse_ops = []
if "dephasing" in config.noise_types:
basis_check("dephasing")
Expand All @@ -122,7 +133,7 @@ def basis_check(noise_type: str) -> None:
if self.basis_name == "digital"
else config.dephasing_rate
)
local_collapse_ops.append(np.sqrt(rate / 2) * qutip.sigmaz())
local_collapse_ops.append(np.sqrt(rate / 2) * pauli_2d["z"])

if "relaxation" in config.noise_types:
coeff = np.sqrt(config.relaxation_rate)
Expand All @@ -137,9 +148,9 @@ def basis_check(noise_type: str) -> None:
if "depolarizing" in config.noise_types:
basis_check("depolarizing")
coeff = np.sqrt(config.depolarizing_rate / 4)
local_collapse_ops.append(coeff * qutip.sigmax())
local_collapse_ops.append(coeff * qutip.sigmay())
local_collapse_ops.append(coeff * qutip.sigmaz())
local_collapse_ops.append(coeff * pauli_2d["x"])
local_collapse_ops.append(coeff * pauli_2d["y"])
local_collapse_ops.append(coeff * pauli_2d["z"])

if "eff_noise" in config.noise_types:
basis_check("effective")
Expand Down

0 comments on commit acf136f

Please sign in to comment.