diff --git a/src/relaqs/environments/noisy_single_qubit_env.py b/src/relaqs/environments/noisy_single_qubit_env.py index 47ba7448..d639c26a 100644 --- a/src/relaqs/environments/noisy_single_qubit_env.py +++ b/src/relaqs/environments/noisy_single_qubit_env.py @@ -81,7 +81,7 @@ def step(self, action): # gamma is the complex amplitude of the control field gamma_magnitude, gamma_phase, alpha = self.parse_actions(action) - self.hamiltonian_update(alpha, gamma_magnitude, gamma_phase) + self.hamiltonian_update(self.detuning, alpha, gamma_magnitude, gamma_phase) self.H_tot_upate(num_time_bins) self.operator_update(num_time_bins) diff --git a/src/relaqs/environments/single_qubit_env.py b/src/relaqs/environments/single_qubit_env.py index e83177ac..c72ff02a 100644 --- a/src/relaqs/environments/single_qubit_env.py +++ b/src/relaqs/environments/single_qubit_env.py @@ -86,8 +86,9 @@ def reset(self, *, seed=None, options=None): self.episode_id += 1 return starting_observeration, info - def hamiltonian_update(self, alpha, gamma_magnitude, gamma_phase): - H = self.hamiltonian(self.delta, alpha, gamma_magnitude, gamma_phase) + #def hamiltonian_update(self, alpha, gamma_magnitude, gamma_phase): + def hamiltonian_update(self, delta, alpha, gamma_magnitude, gamma_phase): + H = self.hamiltonian(delta, alpha, gamma_magnitude, gamma_phase) self.H_array.append(H) def H_tot_upate(self, num_time_bins): @@ -134,7 +135,7 @@ def step(self, action): # Get actions gamma_magnitude, gamma_phase, alpha = self.parse_actions(action) - self.hamiltonian_update(alpha, gamma_magnitude, gamma_phase) + self.hamiltonian_update(self.delta, alpha, gamma_magnitude, gamma_phase) self.H_tot_upate(num_time_bins) # U update