pygsti.circuits.cloudcircuitconstruction
Defines classes which represent gates, as well as supporting functions
Module Contents
Functions

Constructs a set of circuits that amplify all the parameters of a clouldnoise model. 

Construct a template for how to create a "kcoverage" set of lengthn sequences. 
Attributes
 pygsti.circuits.cloudcircuitconstruction.RANK_TOL = '1e09'
 pygsti.circuits.cloudcircuitconstruction.create_cloudnoise_circuits(processor_spec, max_lengths, single_q_fiducials, max_idle_weight=1, maxhops=0, extra_weight_1_hops=0, extra_gate_weight=0, parameterization='H+S', verbosity=0, cache=None, idle_only=False, idt_pauli_dicts=None, algorithm='greedy', idle_op_str=((),), comm=None)
Constructs a set of circuits that amplify all the parameters of a clouldnoise model.
Create a set of fiducial1+germ^power+fiducial2 sequences which amplify all of the parameters of a CloudNoiseModel created by passing the arguments of this function to function:create_cloudnoise_model_from_hops_and_weights.
Note that this function essentialy performs fiducial selection, germ selection, and fiducialpair reduction simultaneously. It is used to generate a short (ideally minimal) list of sequences needed for multi qubit GST.
Parameters
 processor_specProcessorSpec
Defines the prcoessor interface (API) for which circuits are created. This API includes the number of qubits and their labels, gate names, qubit geometry or gate availability, etc.
 max_lengthslist
A list of integers specifying the different maximum lengths for germ powers. Typically these values start a 1 and increase by powers of 2, e.g. [1,2,4,8,16].
 single_q_fiducialslist
A list of gatenametuples, e.g. [(), (‘Gx’,), (‘Gy’,), (‘Gx’,’Gx’)], which form a set of 1qubit fiducials for the given model (compatible with both the gates it posseses and their parameterizations  for instance, only [(), (‘Gx’,), (‘Gy’,)] is needed for just Hamiltonian and Stochastic errors. If a list of two such lists is given, they specify preparation and measurement fiducials, respectively, e.g. [ [(), (‘Gx’,), (‘Gx’,’Gz’)], [(), (‘Gx’,), (‘Gz’,’Gx’)] ].
 max_idle_weightint, optional
The maximumweight for errors on the global idle gate.
 maxhopsint
The locality constraint: for a gate, errors (of weight up to the maximum weight for the gate) are allowed to occur on the gate’s target qubits and those reachable by hopping at most maxhops times from a target qubit along nearestneighbor links (defined by the geometry).
 extra_weight_1_hopsint, optional
Additional hops (adds to maxhops) for weight1 errors. A value > 0 can be useful for allowing just weight1 errors (of which there are relatively few) to be dispersed farther from a gate’s target qubits. For example, a crosstalkdetecting model might use this.
 extra_gate_weightint, optional
Addtional weight, beyond the number of target qubits (taken as a “base weight”  i.e. weight 2 for a 2Q gate), allowed for gate errors. If this equals 1, for instance, then 1qubit gates can have up to weight2 errors and 2qubit gates can have up to weight3 errors.
 parameterization{“CPTP”, “H+S+A”, “H+S”, “S”, “H+D+A”, “D+A”, “D”}
The parameterization used to define which parameters need to be amplified.
 verbosityint, optional
The level of detail printed to stdout. 0 means silent.
 cachedict, optional
A cache dictionary which holds template information so that repeated calls to create_cloudnoise_circuits can draw on the same pool of templates.
 idle_onlybool, optional
If True, only sequences for the idle germ are returned. This is useful for idle tomography in particular.
 idt_pauli_dictstuple, optional
A (prepDict,measDict) tuple of dicts that maps a 1qubit Pauli basis string (e.g. ‘X’ or ‘Y’) to a sequence of gate names. If given, the idlegerm fiducial pairs chosen by this function are restricted to those where either 1) each qubit is prepared and measured in the same basis or 2) each qubits is prepared and measured in different bases (note: ‘X’ and ‘X” are considered the same basis). This restriction makes the resulting sequences more like the “standard” ones of idle tomography, and thereby easier to interpret.
 algorithm{“greedy”,”sequential”}
The algorithm is used internall by
_find_amped_polynomials_for_syntheticidle()
. You should leave this as the default unless you know what you’re doing. idle_op_strCircuit or tuple, optional
The circuit or label that is used to indicate a completely idle layer (all qubits idle).
 commmpi4py.MPI.Comm, optional
When not
None
, an MPI communicator for distributing the computation across multiple processors.
Returns
 PlaquetteGridCircuitStructure
An object holding a structured (using germ and fiducial subsequences) list of circuits.
 pygsti.circuits.cloudcircuitconstruction.create_kcoverage_template(n, k, verbosity=0)
Construct a template for how to create a “kcoverage” set of lengthn sequences.
Consider a set of lengthn words from a kletter alphabet. These words (sequences of letters) have the “kcoverage” property if, for any choice of k different letter positions (indexed from 0 to n1), every permutation of the k distinct letters (symbols) appears in those positions for at least one element (word) in the set. Such a set of sequences is returned by this function, namely a list lengthn lists containing the integers 0 to k1.
This notion has application to idlegate fiducial pair tiling, when we have found a set of fiducial pairs for k qubits and want to find a set of sequences on n > k qubits such that any subset of k qubits experiences the entire set of (kqubit) fiducial pairs. Simply take the kcoverage template and replace the letters (0 to k1) with the perqubit 1Q pieces of each kqubit fiducial pair.
Parameters
 nint
The sequences length (see description above).
 kint
The coverage number (see description above).
 verbosityint, optional
Amount of detail to print to stdout.
Returns
 list
A list of lengthn lists containing the integers 0 to k1. The length of the outer lists depends on the particular values of n and k and is not guaranteed to be minimal.