Skip to content

Commit

Permalink
Merge pull request #47 from akataba/cf/delta-detuning
Browse files Browse the repository at this point in the history
detuning, delta, hamiltonian difference
  • Loading branch information
akataba authored Mar 13, 2024
2 parents 435d99b + 3687ce7 commit 701b4a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/relaqs/environments/noisy_single_qubit_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions src/relaqs/environments/single_qubit_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 701b4a4

Please sign in to comment.