GateValidator
- class braket.emulation.passes.circuit_passes.gate_validator.GateValidator(supported_gates=None, native_gates=None)[source]
Bases:
ValidationPass- A GateValidator instance validates that a circuit uses the supported gates of the device, or
native gates within a verbatim box if any.
- Parameters:
supported_gates (Iterable[str] | None) – A list of gates supported outside of verbatim modeby the emulator. A gate is a Braket gate name.
native_gates (Iterable[str] | None) – A list of gates supported inside of verbatim mode by the emulator.
- Raises:
ValueError – If supported_gates and native_gates are empty or any of the provided
gate are not supported by the Braket BDK. –
- validate(circuit)[source]
Checks that all non-verbatim gates used in the circuit are in this validator’s supported gate set and that all verbatim gates used in the circuit are in this validator’s native gate set.
- Parameters:
circuit (Circuit) – The Braket circuit whose gates to validate.
- Raises:
ValueError – If a gate operation or verbatim gate operation is not in this validator’s
supported or native gate set, respectively. –
- Return type:
None