AlignMeasures#

class qiskit.transpiler.passes.AlignMeasures(*args, **kwargs)[source]#

Bases : TransformationPass

Measurement alignment.

This is a control electronics aware optimization pass.

In many quantum computing architectures gates (instructions) are implemented with shaped analog stimulus signals. These signals are digitally stored in the waveform memory of the control electronics and converted into analog voltage signals by electronic components called digital to analog converters (DAC).

In a typical hardware implementation of superconducting quantum processors, a single qubit instruction is implemented by a microwave signal with the duration of around several tens of ns with a per-sample time resolution of ~0.1-10ns, as reported by backend.configuration().dt. In such systems requiring higher DAC bandwidth, control electronics often defines a pulse granularity, in other words a data chunk, to allow the DAC to perform the signal conversion in parallel to gain the bandwidth.

Measurement alignment is required if a backend only allows triggering measure instructions at a certain multiple value of this pulse granularity. This value is usually provided by backend.configuration().timing_constraints.

In Qiskit SDK, the duration of delay can take arbitrary value in units of dt, thus circuits involving delays may violate the above alignment constraint (i.e. misalignment). This pass shifts measurement instructions to a new time position to fix the misalignment, by inserting extra delay right before the measure instructions. The input of this pass should be scheduled DAGCircuit, thus one should select one of the scheduling passes (ALAPSchedule or ASAPSchedule) before calling this.

Exemples

We assume executing the following circuit on a backend with alignment=16.

     β”Œβ”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”
q_0: ─ X β”œβ”€ Delay(100[dt]) β”œβ”€Mβ”œ
     β””β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β•₯β”˜
c: 1/════════════════════════╩═
                             0

Note that delay of 100 dt induces a misalignment of 4 dt at the measurement. This pass appends an extra 12 dt time shift to the input circuit.

     β”Œβ”€β”€β”€β”β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”β”Œβ”€β”
q_0: ─ X β”œβ”€ Delay(112[dt]) β”œβ”€Mβ”œ
     β””β”€β”€β”€β”˜β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜β””β•₯β”˜
c: 1/════════════════════════╩═
                             0

This pass always inserts a positive delay before measurements rather than reducing other delays.

Notes

The Backend may allow users to execute circuits violating the alignment constraint. However, it may return meaningless measurement data mainly due to the phase error.

Create new pass.

Obsolète depuis la version 0.21.0_pending: The class qiskit.transpiler.passes.scheduling.alignments.align_measures.AlignMeasures is pending deprecation as of qiskit-terra 0.21.0. It will be marked deprecated in a future release, and then removed no earlier than 3 months after the release date. Instead, use ConstrainedReschedule, which performs the same function but also supports aligning to additional timing constraints.

Paramètres:

alignment – Integer number representing the minimum time resolution to trigger measure instruction in units of dt. This value depends on the control electronics of your quantum processor.

Attributes

is_analysis_pass#

Check if the pass is an analysis pass.

If the pass is an AnalysisPass, that means that the pass can analyze the DAG and write the results of that analysis in the property set. Modifications on the DAG are not allowed by this kind of pass.

is_transformation_pass#

Check if the pass is a transformation pass.

If the pass is a TransformationPass, that means that the pass can manipulate the DAG, but cannot modify the property set (but it can be read).

Methods

name()#

Return the name of the pass.

run(dag)[source]#

Run the measurement alignment pass on dag.

Paramètres:

dag (DAGCircuit) – DAG to be checked.

Renvoie:

DAG with consistent timing and op nodes annotated with duration.

Type renvoyΓ©:

DAGCircuit

Lève:

TranspilerError – If circuit is not scheduled.