qrunch.quantum.circuits.synthesis.clifford
Functionality for synthesizing Clifford circuits from stabilizers.
Functions
|
Synthesize a Clifford circuit that prepares a stabilizer state. |
Classes
The synthesis of a set of commuting Pauli strings. |
|
A relation expressing a Pauli string as a product of other Pauli strings. |
- class CliffordSynthesisResult
Bases:
objectThe synthesis of a set of commuting Pauli strings.
- Parameters:
circuit – The Clifford circuit with the property that applying it after preparing a state, and measuring in the Z basis, is equivalent to measuring the independent Pauli strings. The ordering is such that the first Pauli string corresponds to the measurement of the first qubit.
independent_pauli_strings – A list of independent Pauli strings; the ones which are directly measured by the circuit.
relations – A dictionary mapping dependent Pauli strings to their relations with the independent ones.
- __init__(circuit: Circuit, independent_pauli_strings: tuple[PauliString, ...], relations: tuple[PauliStringRelation, ...]) None
- Parameters:
circuit (Circuit)
independent_pauli_strings (tuple[PauliString, ...])
relations (tuple[PauliStringRelation, ...])
- Return type:
None
- independent_pauli_strings: tuple[PauliString, ...]
- relations: tuple[PauliStringRelation, ...]
- class PauliStringRelation
Bases:
objectA relation expressing a Pauli string as a product of other Pauli strings.
- Parameters:
pauli_string – The target Pauli string being expressed.
phase – The complex phase factor in the relation.
related_pauli_strings – The list of Pauli strings which, when multiplied together (and multiplied by the phase), yield the target Pauli string.
- __init__(pauli_string: PauliString, phase: complex, related_pauli_strings: tuple[PauliString, ...]) None
- Parameters:
pauli_string (PauliString)
phase (complex)
related_pauli_strings (tuple[PauliString, ...])
- Return type:
None
- pauli_string: PauliString
- phase: complex
- synthesize_commuting_pauli_strings(pauli_strings: Sequence[PauliString]) CliffordSynthesisResult
Synthesize a Clifford circuit that prepares a stabilizer state.
The method returns a CliffordSynthesisResult containing the circuit, together with a collection of independent Pauli strings and relations for the dependent ones. The circuit has the property that measuring in the Z basis after applying the circuit is equivalent to measuring the independent Pauli strings, and the ordering is such that the first Pauli string corresponds to the measurement of the first qubit.
We synthesize a stabilizer state for the list of Pauli strings. Several algorithms exist for this purpose; see e.g. https://arxiv.org/abs/1907.13623 (Algorithm 2) for a simple one. Here, we rely on the implementation available in stim; see also Qiskit’s StabilizerState.from_stabilizer_list and synth_circuit_from_stabilizers. One downside of all of these is that they simply ignore linear dependencies between the Pauli strings in the stabilizer representation, or error out completely if they exist (e.g. if given the set {XX, YY, ZZ} which are linearly dependent since YY = -(XX)(ZZ). We need to track such dependencies to be able to estimate expectation values at the end of the day.
Were we to write our own synthesis algorithm, we could handle this case by tracking the linear dependencies along the way, but to avoid having to do that, we instead find them beforehand.
- Parameters:
pauli_strings (Sequence[PauliString]) – A list of commuting Pauli strings.
- Return type: