Skip to content

Commit

Permalink
Merge pull request #5 from KsushaRychkova/main
Browse files Browse the repository at this point in the history
Some small fixes to Rz gates
  • Loading branch information
PP501 committed May 17, 2024
2 parents f916c6e + 6c4a2fb commit c96b8ab
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sqdtoolz/Utilities/QubitGates.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def generate_gates(self, gate_list, gate_set_prefix='gate'):
if isinstance(cur_gate, (tuple, list)):
assert len(cur_gate) == 2, "Arbitrary rotations must be specified as a tuple - e.g. ('Rx',0.02)."
if cur_gate[0] == 'Rz':
phase_offset = angle
phase_offset = phase_offset + angle # in case prev gate was also Rz
else:
#Calculate the amplitude for the rotation
if self._arb_rot_func == 'simple_sine':
Expand Down Expand Up @@ -171,11 +171,11 @@ def generate_gates(self, gate_list, gate_set_prefix='gate'):
ret_gates.append(self._env_func(f"{gate_set_prefix}{m}", self._wfmt_qubit_drive.apply(phase_offset=phase_offset, phase_segment=3*np.pi/2), self._spec_qubit['GE X/2-Gate Time'].Value, self._spec_qubit['GE X/2-Gate Amplitude'].Value))
phase_offset = 0
elif cur_gate == 'Z':
phase_offset = np.pi
phase_offset = phase_offset + np.pi
elif cur_gate == 'Z/2':
phase_offset = np.pi/2
phase_offset = phase_offset + np.pi/2
elif cur_gate == '-Z/2':
phase_offset = -np.pi/2
phase_offset = phase_offset - np.pi/2
else:
assert False, f"Gate \'{cur_gate}\' is not a valid gate."
return ret_gates
Expand Down

0 comments on commit c96b8ab

Please sign in to comment.