CrosstalkAdaptiveSchedule

class CrosstalkAdaptiveSchedule(*args, **kwargs)[source]

Crosstalk mitigation through adaptive instruction scheduling.

CrosstalkAdaptiveSchedule initializer.

Parameters
  • backend_prop (BackendProperties) – backend properties object

  • crosstalk_prop (dict) –

    crosstalk properties object crosstalk_prop[g1][g2] specifies the conditional error rate of g1 when g1 and g2 are executed simultaneously. g1 should be a two-qubit tuple of the form (x,y) where x and y are physical qubit ids. g2 can be either two-qubit tuple (x,y) or single-qubit tuple (x). We currently ignore crosstalk between pairs of single-qubit gates. Gate pairs which are not specified are assumed to be crosstalk free.

    Example:

    crosstalk_prop = {(0, 1) : {(2, 3) : 0.2, (2) : 0.15},
                                (4, 5) : {(2, 3) : 0.1},
                                (2, 3) : {(0, 1) : 0.05, (4, 5): 0.05}}
    

    The keys of the crosstalk_prop are tuples for ordered tuples for CX gates e.g., (0, 1) corresponding to CX 0, 1 in the hardware. Each key has an associated value dict which specifies the conditional error rates with nearby gates e.g., (0, 1) : {(2, 3) : 0.2, (2) : 0.15} means that CNOT 0, 1 has an error rate of 0.2 when it is executed in parallel with CNOT 2,3 and an error rate of 0.15 when it is executed in parallel with a single qubit gate on qubit 2.

  • weight_factor (float) – weight of gate error/crosstalk terms in the objective \(weight_factor*fidelities + (1-weight_factor)*decoherence errors\). Weight can be varied from 0 to 1, with 0 meaning that only decoherence errors are optimized and 1 meaning that only crosstalk errors are optimized. weight_factor should be tuned per application to get the best results.

  • measured_qubits (list) – a list of qubits that will be measured in a particular circuit. This arg need not be specified for circuits which already include measure gates. The arg is useful when a subsequent module such as state_tomography_circuits inserts the measure gates. If CrosstalkAdaptiveSchedule is made aware of those measurements, it is included in the optimization.

Raises

ImportError – if unable to import z3 solver

Attributes

CrosstalkAdaptiveSchedule.is_analysis_pass

Check if the pass is an analysis pass.

CrosstalkAdaptiveSchedule.is_transformation_pass

Check if the pass is a transformation pass.

Methods

CrosstalkAdaptiveSchedule.assign_gate_id(dag)

ID for each gate

CrosstalkAdaptiveSchedule.basic_bounds()

Basic variable bounds for optimization

CrosstalkAdaptiveSchedule.check_dag_dependency(…)

gate2 is a DAG dependent of gate1 if it is a descendant of gate1

CrosstalkAdaptiveSchedule.check_xtalk_dependency(…)

Check if two gates have a crosstalk dependency.

CrosstalkAdaptiveSchedule.coherence_constraints()

Set decoherence errors based on qubit lifetimes

CrosstalkAdaptiveSchedule.create_updated_dag(…)

Given a set of layers and barries, construct a new dag

CrosstalkAdaptiveSchedule.create_z3_vars()

Setup the variables required for Z3 optimization

CrosstalkAdaptiveSchedule.cx_tuple(gate)

Representation for two-qubit gate Note: current implementation assumes that the CX error rates and crosstalk behavior are independent of gate direction

CrosstalkAdaptiveSchedule.enforce_schedule_on_dag(…)

Z3 outputs start times for each gate.

CrosstalkAdaptiveSchedule.extract_crosstalk_relevant_sets()

Extract the set of program gates which potentially have crosstalk noise

CrosstalkAdaptiveSchedule.extract_dag_overlap_sets(dag)

Gate A, B are overlapping if A is neither a descendant nor an ancestor of B.

CrosstalkAdaptiveSchedule.extract_solution()

Extract gate start and finish times from Z3 solution

CrosstalkAdaptiveSchedule.fidelity_constraints()

Set gate fidelity based on gate overlap conditions

CrosstalkAdaptiveSchedule.filter_candidates(…)

For a gate G and layer L, L is a candidate layer for G if no gate in L has a DAG dependency with G, and if Z3 allows gates in L and G to overlap.

CrosstalkAdaptiveSchedule.find_layer(layers, …)

Find the appropriate layer for a gate

CrosstalkAdaptiveSchedule.gate_tuple(gate)

Representation for gate

CrosstalkAdaptiveSchedule.generate_barriers(layers)

For each gate g, see if a barrier is required to serialize it with some previously processed gate

CrosstalkAdaptiveSchedule.is_significant_xtalk(…)

Given two conditional gate error rates check if there is high crosstalk by comparing with independent error rates.

CrosstalkAdaptiveSchedule.name()

Return the name of the pass.

CrosstalkAdaptiveSchedule.objective_function()

Objective function is a weighted combination of gate errors and decoherence errors

CrosstalkAdaptiveSchedule.parse_backend_properties()

This function assumes that gate durations and coherence times are in seconds in backend.properties() This function converts gate durations and coherence times to nanoseconds.

CrosstalkAdaptiveSchedule.powerset(iterable)

Finds the set of all subsets of the given iterable This function is used to generate constraints for the Z3 optimization

CrosstalkAdaptiveSchedule.r2f(val)

Convert Z3 Real to Python float

CrosstalkAdaptiveSchedule.reset()

Reset variables

CrosstalkAdaptiveSchedule.run(dag)

Main scheduling function

CrosstalkAdaptiveSchedule.scheduling_constraints()

DAG scheduling constraints optimization Sets overlap indicator variables

CrosstalkAdaptiveSchedule.singleq_tuple(gate)

Representation for single-qubit gate

CrosstalkAdaptiveSchedule.solve_optimization()

Setup and solve a Z3 optimization for finding the best schedule