hybridlane.measurements.base.FockTruncation

class hybridlane.measurements.base.FockTruncation(/, **data)

Bases: Truncation, pydantic.BaseModel

Truncation in Fock space up to a desired photon count

For each wire, a size should be provided indicating the dimension of that subsystem. If no size is provided for a wire, it is defaulted to 2 (a qubit).

Note that we allow continuous-variable bases in the schema even though we have a hard system-size cutoff in Fock space. This is because someone might want to simulate position measurements while truncating the maximum energy of a qumode.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

basis_schema: BasisSchema

Schema holding the basis for each wire

dim_sizes: dict[Hashable, int]

Mapping from wires to their truncated system dimension

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

dim(wire)

Returns the hilbert dimension of a wire

classmethod all_fock_space(wires, dim_sizes)
Parameters:
__eq__(other)