Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrea-pasquale committed Sep 25, 2023
1 parent aacc5bd commit 6ef4b00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ def _plot(data: ChevronData, fit: ChevronResults, qubit):


def _update(results: ChevronResults, platform: Platform, qubit_pair: QubitPairId):
if qubit_pair not in results.duration:
qubit_pair = (qubit_pair[1], qubit_pair[0])
update.CZ_duration(results.duration[qubit_pair], platform, qubit_pair)
update.CZ_amplitude(results.amplitude[qubit_pair], platform, qubit_pair)

Expand Down
4 changes: 4 additions & 0 deletions src/qibocal/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,17 @@ def virtual_phases(phases: dict[QubitId, float], platform: Platform, pair: Qubit

def CZ_duration(duration: int, platform: Platform, pair: QubitPairId):
"""Update CZ duration for specific pair."""
if pair not in platform.pairs:
pair = (pair[1], pair[0])
for pulse in platform.pairs[pair].native_gates.CZ.pulses:
if pulse.qubit.name == pair[1]:
pulse.duration = int(duration)


def CZ_amplitude(amp: float, platform: Platform, pair: QubitPairId):
"""Update CZ amplitude for specific pair."""
if pair not in platform.pairs:
pair = (pair[1], pair[0])
for pulse in platform.pairs[pair].native_gates.CZ.pulses:
if pulse.qubit.name == pair[1]:
pulse.amplitude = float(amp)
Expand Down

0 comments on commit 6ef4b00

Please sign in to comment.