Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing compiler rules when dealing with qubit strings #937

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading