CompilerDirective
- class braket.circuits.compiler_directive.CompilerDirective(ascii_symbols)[source]
Bases:
OperatorA directive specifying how the compiler should process a part of the circuit.
For example, a directive may tell the compiler not to modify some gates in the circuit.
- Parameters:
ascii_symbols (
Sequence[str])
Inits a
CompilerDirective.- Parameters:
ascii_symbols (Sequence[str]) – ASCII string symbols for the compiler directiver. These are used when printing a diagram of circuits.
- property name: str
The name of the operator.
- Returns:
str – The name of the operator.
- property ascii_symbols: tuple[str, ...]
Returns the ascii symbols for the compiler directive.
- Type:
tuple[str, …]
- to_ir(target=None, ir_type=IRType.JAQCD, serialization_properties=None, **kwargs)[source]
Returns IR object of the compiler directive.
- Parameters:
target (QubitSet | None) – target qubit(s). Defaults to None
ir_type (IRType) – The IRType to use for converting the compiler directive object to its IR representation. Defaults to IRType.JAQCD.
serialization_properties (SerializationProperties | None) – The serialization properties to use while serializing the object to the IR representation. The serialization properties supplied must correspond to the supplied
ir_type. Defaults to None.
- Return type:
Any- Returns:
Any – IR object of the compiler directive.
- Raises:
ValueError – If the supplied
ir_typeis not supported.