Skip to content

Commit

Permalink
Merge pull request #937 from qiboteam/fix_compiler_str_qubits
Browse files Browse the repository at this point in the history
Fixing compiler rules when dealing with qubit strings
  • Loading branch information
andrea-pasquale authored Jul 18, 2024
2 parents 11a34bd + 1d8e3e2 commit c566eac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/qibolab/compilers/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ def identity_rule(gate, platform):

def z_rule(gate, platform):
"""Z gate applied virtually."""
qubit = gate.target_qubits[0]
qubit = list(platform.qubits)[gate.target_qubits[0]]
return PulseSequence(), {qubit: math.pi}


def rz_rule(gate, platform):
"""RZ gate applied virtually."""
qubit = gate.target_qubits[0]
qubit = list(platform.qubits)[gate.target_qubits[0]]
return PulseSequence(), {qubit: gate.parameters[0]}


def gpi2_rule(gate, platform):
"""Rule for GPI2."""
qubit = gate.target_qubits[0]
qubit = list(platform.qubits)[gate.target_qubits[0]]
theta = gate.parameters[0]
sequence = PulseSequence()
pulse = platform.create_RX90_pulse(qubit, start=0, relative_phase=theta)
Expand All @@ -37,7 +37,7 @@ def gpi2_rule(gate, platform):

def gpi_rule(gate, platform):
"""Rule for GPI."""
qubit = gate.target_qubits[0]
qubit = list(platform.qubits)[gate.target_qubits[0]]
theta = gate.parameters[0]
sequence = PulseSequence()
# the following definition has a global phase difference compare to
Expand All @@ -51,7 +51,7 @@ def gpi_rule(gate, platform):

def u3_rule(gate, platform):
"""U3 applied as RZ-RX90-RZ-RX90-RZ."""
qubit = gate.target_qubits[0]
qubit = list(platform.qubits)[gate.target_qubits[0]]
# Transform gate to U3 and add pi/2-pulses
theta, phi, lam = gate.parameters
# apply RZ(lam)
Expand Down

0 comments on commit c566eac

Please sign in to comment.