tqec.plaquette.library.pauli.pauli_memory_plaquette

pauli_memory_plaquette(qubits: PlaquetteQubits, pauli_string: str, schedule: list[int], data_qubit_reset_basis: ResetBasis | None = None, data_qubit_measurement_basis: MeasurementBasis | None = None) Plaquette[source]

Generic function to create a Plaquette instance measuring a given Pauli string.

Warning

This function cannot change the order in which data qubits, Pauli “chars” (one character of the provided Pauli string) and schedule are provided. That means that it cannot group X and Z basis measurements. In practice, an input Pauli string “XZXZXZ” will lead to 3 pairs of Hadamard gates being included to measure the 3 X Pauli strings. The schedule provided by the user have to take that into account and schedule gates accordingly.

For that reason, this function should be considered semi-public. You can use it, but take extra care if you do so.

As a safeguard, this function will end up raising an error if the provided schedule is clearly incorrect (not in ascending order, missing entries, …).

Parameters:
  • qubits – qubits on which the provided Pauli string will be measured. Includes the syndrome(s) qubit(s).

  • pauli_string – the Pauli string to measure on data qubit(s).

  • schedule – scheduling of each time slice of the resulting circuit.

  • data_qubit_reset_basis – if None, data qubits are not touched before measuring the provided Pauli operator. Else, data qubits are reset in the provided basis at the same time slice as the syndrome qubit (the first). Defaults to None.

  • data_qubit_measurement_basis – if None, data qubits are not touched after measuring the provided Pauli operator. Else, data qubits are measured in the provided basis at the same time slice as the syndrome qubit (the last). Defaults to None.

Raises:
  • TQECException – if the number of data qubits and the length of the provided Pauli string are not exactly equal.

  • TQECException – if the provided schedule is incorrect.

Returns:

a Plaquette instance measuring the provided Pauli string.