Skip to content

Commit

Permalink
Fix compiler unnecessarily pushing pulses to late start in certain si…
Browse files Browse the repository at this point in the history
…tuations
  • Loading branch information
hay-k committed Nov 8, 2024
1 parent 49b6572 commit f44a37e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/qibolab/compilers/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def _compile_gate(
platform,
sequence,
virtual_z_phases,
moment_start,
delays,
wire_names,
):
Expand All @@ -120,13 +119,12 @@ def _compile_gate(

# update global pulse sequence
# determine the right start time based on the availability of the qubits involved
all_qubits = {*gate_sequence.qubits, *gate.qubits}
all_qubits = {*gate_sequence.qubits, *gate.qubits, *gate_phases.keys()}
start = max(
*[
[
sequence.get_qubit_pulses(qubit).finish + delays[qubit]
for qubit in all_qubits
],
moment_start,
]
)
# shift start time and phase according to the global sequence
for pulse in gate_sequence:
Expand Down Expand Up @@ -159,7 +157,6 @@ def compile(self, circuit, platform):
# process circuit gates
delays = defaultdict(int)
for moment in circuit.queue.moments:
moment_start = sequence.finish
for gate in set(filter(lambda x: x is not None, moment)):
if isinstance(gate, gates.Align):
for qubit in gate.qubits:
Expand All @@ -170,7 +167,6 @@ def compile(self, circuit, platform):
platform,
sequence,
virtual_z_phases,
moment_start,
delays,
circuit.wire_names,
)
Expand Down

0 comments on commit f44a37e

Please sign in to comment.