pauli_tracker.pauli.PauliStack

class pauli_tracker.pauli.PauliStack

Bases: object

PauliStack<BitVec>.

The Pauli Z and X stacks are bitvectors where each chunk consists of 64 bits. In the chunk the bits are ordered from least to most significant.

__init__()

Not defined

Methods

__init__()

Not defined

deserialize(file_path[, serialization_format])

Deserialize the internal data structure from a file.

deserialize_from_string(string[, ...])

Deserialize the internal data structure from a string.

get(idx)

into_py_bool_tuple()

Transform the internal Rust data structure into the according Python tuple of lists of booleans.

into_py_tuple()

Transform and return the internal Rust data representation into the according Python representation.

serialize(file_path[, serialization_format])

Serialize the internal data structure into a file.

serialize_to_string([serialization_format])

Serialize the internal data structure into a string.

sum_up(filter)

take_into_py_bool_tuple()

Transform the internal Rust data structure into the according Python tuple of list of booleans, replacing the internal data with its default value.

take_into_py_tuple()

Transform and return the internal Rust data representation into the according Python representation replacing the internal data with its default value.

xor_inplace(other)

zeros(len)

static deserialize(file_path, serialization_format='serde_json')

Deserialize the internal data structure from a file.

Parameters:
  • file_path (str) – The path to the file to read from.

  • serialization_format (str) – The serialization format to use. The supported formats are: serde_json and bincode.

static deserialize_from_string(string, serialization_format='serde_json')

Deserialize the internal data structure from a string.

Parameters:
  • string (str) – The string to read from.

  • serialization_format (str) – The serialization format to use. The supported formats are: serde_json.

into_py_bool_tuple()

Transform the internal Rust data structure into the according Python tuple of lists of booleans. If you do this mutiple times consider using the according take_ method to avoid an additional clone, however, be aware that the internal data is replaced with its default value.

Returns:

The Z (left tuple element) and X (right tuple element) components

Return type:

tuple[list[bool], list[bool]]

into_py_tuple()

Transform and return the internal Rust data representation into the according Python representation. If you do this mutiple times consider using the according take_ method to avoid an additional clone, however, be aware that the internal data is replaced with its default value. You can use bitvector_to_boolvector() to convert the bitvector to a list of booleans, or directly use into_py_bool_tuple().

Returns:

The Z (left tuple element) and X (right tuple element) components

Return type:

tuple[list[int], list[int]]

serialize(file_path, serialization_format='serde_json')

Serialize the internal data structure into a file.

Parameters:
  • file_path (str) – The path to the file to write to.

  • serialization_format (str) – The serialization format to use. The supported formats are: serde_json and bincode.

serialize_to_string(serialization_format='serde_json')

Serialize the internal data structure into a string.

Parameters:

serialization_format (str) – The serialization format to use. The supported formats are: serde_json.

take_into_py_bool_tuple()

Transform the internal Rust data structure into the according Python tuple of list of booleans, replacing the internal data with its default value.

Returns:

The Z (left tuple element) and X (right tuple element) components

Return type:

tuple[list[bool], list[bool]]

take_into_py_tuple()

Transform and return the internal Rust data representation into the according Python representation replacing the internal data with its default value. You can use bitvector_to_boolvector() to convert the bitvector to a list of booleans, or directly use take_into_py_bool_tuple().

Returns:

The Z (left tuple element) and X (right tuple element) components

Return type:

tuple[list[int], list[int]]