loom.cliffordsim.data_store

Copyright (c) Entropica Labs Pte Ltd 2025.

Use, distribution and reproduction of this program in its source or compiled form is prohibited without the express written consent of Entropica Labs Pte Ltd.

class loom.cliffordsim.data_store.DataStore[source]

Bases: object

An Object that records relevant information users might want recorded from a particular computation.

get_pframe_measurements(pauliframe_id)[source]

Helper function to aggregate all measurement results belonging to the same Pframe. The keys of returned dict are the uuids of meausurements in the circuit.

Returns:

A dictionary where keys are measurement ids and values are the PauliFrame flip results for the given Pframe id.

Return type:

dict

get_pframes(temporal_direction='forward')[source]

A helper function to return a tuple of all Pframes (dict)

temporal_direction can be either “forward” or “backward”.

Returns:

A tuple of dictionaries, where each dictionary corresponds to a PauliFrame that was created in the circuit, and the computed output — for frames propagated forwards.

Return type:

tuple

record_classical_register(input_classical_register)[source]

Records the Snapshot of the Classical Register into the DataStore.

Return type:

None

record_measurement_from_pauliframes(measurement_id, results, init_pauliframes)[source]

Records measurement flips that result from the interaction of Pauli frames and measurement operations.

Measurement flips is passed as a list as there could be multiple Pframes.

Return type:

None

record_measurements(measurement_id, measurement_result, is_result_random)[source]

Records the measurement result in the DataStore. Raises a ValueError if no time step was found in the Moment.

Return type:

None

record_pauli_frame(init_pauliframe, recorded_pauliframe)[source]

Records the PauliFrame in the DataStore. Raises a ValueError if no time step was found in the Moment.

Return type:

None

set_time_step(time_step)[source]

Sets the time step of the current Moment being processed.

Return type:

None