Skip to content

Commit

Permalink
Merge pull request #66 from akataba/cf/default-noise-update
Browse files Browse the repository at this point in the history
Sampling T1, T2, and detuning noise is now default
  • Loading branch information
Farquhar13 authored Jul 17, 2024
2 parents ec794fa + 099fb2d commit c08c4bf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/relaqs/environments/noisy_single_qubit_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
import scipy.linalg as la
from qutip import Qobj
from qutip.superoperator import liouvillian, spre, spost
from qutip.operators import sigmam
from qutip.operators import sigmam, sigmaz
from relaqs.environments.single_qubit_env import SingleQubitEnv
from relaqs.api import gates
from relaqs.api.utils import sample_noise_parameters

I = gates.I().get_matrix()
X = gates.X().get_matrix()
Expand All @@ -17,10 +18,11 @@ class NoisySingleQubitEnv(SingleQubitEnv):
@classmethod
def get_default_env_config(cls):
env_config = super().get_default_env_config()
env_config.update({"detuning_list": [0], # qubit detuning
"relaxation_rates_list": [[314159]], # relaxation lists of list of floats to be sampled from when resetting environment. (10 usec)
"relaxation_ops": [sigmam()], #relaxation operator lists for T1 and T2, respectively
"observation_space_size": 2*16 + 1 + 1 + 1}) # 2*16 = (complex number)*(density matrix elements = 4)^2, + 1 for fidelity + 1 for relaxation rate + 1 for detuning})
t1_list, t2_list, detuning_list = sample_noise_parameters()
env_config.update({"detuning_list": detuning_list, # qubit detuning
"relaxation_rates_list": [t1_list, t2_list], # relaxation lists of list of floats to be sampled from when resetting environment. (10 usec)
"relaxation_ops": [sigmam(), sigmaz()], #relaxation operator lists for T1 and T2, respectively
"observation_space_size": 2*16 + 1 + 2 + 1}) # 2*16 = (complex number)*(density matrix elements = 4)^2, + 1 for fidelity + 2 for relaxation rates + 1 for detuning})
return env_config

def __init__(self, env_config):
Expand Down

0 comments on commit c08c4bf

Please sign in to comment.