pauli_tracker.live.vec.Live

class pauli_tracker.live.vec.Live

Bases: object

Live<NaiveVector<PauliDense>>.

__init__(len=0)

Create a new Live tracker.

Parameters:

len (int) – The number of qubits to track

Return type:

Live

Methods

__init__([len])

Create a new Live tracker.

cx(control, target)

cy(control, target)

cz(bit_a, bit_b)

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(bit)

Get the Pauli of a qubit in the tracker, returning None if the qubit was not initialized.

h(bit)

hs(bit)

hxy(bit)

hyz(bit)

id(bit)

into_py_array()

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

into_py_array_recursive()

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

iswap(bit_a, bit_b)

iswapdg(bit_a, bit_b)

measure(bit)

Remove a qubit in the tracker, returning the according Pauli and erroring if the qubit was not initialized.

move_x_to_x(source, destination)

move_x_to_z(source, destination)

move_z_to_x(source, destination)

move_z_to_z(source, destination)

new_qubit(bit)

Create a new qubit in the tracker, returning the old Pauli if the qubit was already initialized.

remove_x(bit)

remove_z(bit)

s(bit)

sdg(bit)

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.

sh(bit)

shs(bit)

swap(bit_a, bit_b)

sx(bit)

sxdg(bit)

sz(bit)

szdg(bit)

take_into_py_array()

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

take_into_py_array_recursive()

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

track_x(bit)

track_y(bit)

track_z(bit)

x(bit)

y(bit)

z(bit)

zcx(bit_a, bit_b)

zcy(control, target)

zcz(control, target)

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.

get(bit)

Get the Pauli of a qubit in the tracker, returning None if the qubit was not initialized.

into_py_array()

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.

Return type:

list[PauliDense]

into_py_array_recursive()

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.

Return type:

list[int]

measure(bit)

Remove a qubit in the tracker, returning the according Pauli and erroring if the qubit was not initialized.

new_qubit(bit)

Create a new qubit in the tracker, returning the old Pauli if the qubit was already initialized.

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_array()

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

Return type:

list[PauliDense]

take_into_py_array_recursive()

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

Return type:

list[int]