merlin.core.circuit module
Circuit is a simple container of components with metadata.
- class merlin.core.circuit.Circuit(n_modes, components=<factory>, metadata=<factory>)
Bases:
objectSimple circuit container.
- Parameters:
- add(component)
Append a component and return the circuit for chained calls.
- Parameters:
component (Any) – Circuit element such as a rotation, beam splitter, or measurement.
- Returns:
selfto support fluent-style chaining.- Return type:
- clear()
Remove every component and metadata entry from the circuit.
- get_parameters()
Collect parameter placeholders exposed by each component.