StabilizerCode

class guppyft.code_def.StabilizerCode(num_physical_qubits: 'int', num_logical_qubits: 'int', distance: 'int', generators: 'pauli.SignTermSet', x_logicals: 'pauli.SignTerms', z_logicals: 'pauli.SignTerms')[source]
__delattr__(name)

Implement delattr(self, name).

__eq__(other)

Return self==value.

__init__(num_physical_qubits: int, num_logical_qubits: int, distance: int, generators: SignTermSet, x_logicals: SignTerms, z_logicals: SignTerms) None
__repr__()

Return repr(self).

__setattr__(name, value)

Implement setattr(self, name, value).

static from_python_strings(num_physical_qubits: int, num_logical_qubits: int, distance: int, generators: list[str], x_logicals: list[str], z_logicals: list[str]) StabilizerCode[source]

Helper to create a StabilizerCode from lists of Python strings.

The strings must be defined over the alphabet {I, X, Y, Z} and must be of length equal to the number of physical qubits. A sign may be provided at the front. If a string is missing a sign, it is assumed to be positive.

Parameters:
  • num_physical_qubits – The number of physical qubits in the code.

  • num_logical_qubits – The number of logical qubits in the code.

  • distance – The distance of the code.

  • generators – A list of stabilizer generators as Pauli strings.

  • x_logicals – A list of X logical operators as Pauli strings.

  • z_logicals – A list of Z logical operators as Pauli strings.

Returns:

A StabilizerCode instance representing the code.