cirq_superstaq.validation
Attributes
Functions
|
Validates that the input is an acceptable cirq-core object for cirq-superstaq. |
|
Verifies that circuits consists of valid (cirq-core) qubit types only. |
Module Contents
- cirq_superstaq.validation.validate_cirq_circuits(circuits: object, require_measurements: bool = False) None
Validates that the input is an acceptable cirq-core object for cirq-superstaq.
In particular, this function verifies that circuits is either a single cirq.Circuit or a list of cirq.Circuit instances. Additionally, also validates that circuits contains supported qubit types only.
- Parameters:
circuits – The circuit(s) to run.
require_measurements – An optional boolean flag to check if all of the circuits have measurements.
- Raises:
ValueError – If the input is not a cirq.Circuit or a list of cirq.Circuit instances.
TypeError – If an unsupported qubit type is found in circuits.
- cirq_superstaq.validation.validate_qubit_types(circuits: cirq.Circuit | collections.abc.Sequence[cirq.Circuit]) None
Verifies that circuits consists of valid (cirq-core) qubit types only.
- Parameters:
circuits – The input circuit(s) to validate.
- Raises:
TypeError – If an unsupported qubit type is found in circuits.
- cirq_superstaq.validation.SUPPORTED_QID_TYPES