pauli_tracker.frames.PartialOrderGraph

class pauli_tracker.frames.PartialOrderGraph

Bases: object

Compare PartialOrderGraph. Use into_py_graph() to turn it into a Python type.

__init__(graph)

Create a new PartialOrderGraph.

Parameters:

graph (list[list[tuple[int, list[int]]]]) – The graph to wrap.

Return type:

PartialOrderGraph

Methods

__init__(graph)

Create a new PartialOrderGraph.

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.

into_py_graph()

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.

take_into_py_graph()

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

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

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[list[tuple[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_graph()

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

Return type:

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