cirq.work.observable_measurement.CheckpointFileOptions

Options to configure "checkpointing" to save intermediate results.

checkpoint If set to True, save cumulative raw results at the end of each iteration of the sampling loop. Load in these results with cirq.read_json.
checkpoint_fn The filename for the checkpoint file. If checkpoint is set to True and this is not specified, a file in a temporary directory will be used.
checkpoint_other_fn The filename for another checkpoint file, which contains the previous checkpoint. This lets us avoid losing data if a failure occurs during checkpoint writing. If checkpoint is set to True and this is not specified, a file in a temporary directory will be used. If checkpoint is set to True and checkpoint_fn is specified but this argument is not specified, "{checkpoint_fn}.prev.json" will be used.

checkpoint Dataclass field
checkpoint_fn Dataclass field
checkpoint_other_fn Dataclass field

Methods

maybe_to_json

View source

Call cirq.to_json withvalue` according to the configuration options in this class.

If checkpoint=False, nothing will happen. Otherwise, we will use checkpoint_fn and checkpoint_other_fn as the destination JSON file as described in the class docstring.

__eq__

checkpoint False
checkpoint_fn None
checkpoint_other_fn None