braket.circuits.serialization module

class braket.circuits.serialization.IRType(value)[source]

Bases: str, Enum

Defines the available IRTypes for circuit serialization.

OPENQASM = 'OPENQASM'
JAQCD = 'JAQCD'
class braket.circuits.serialization.QubitReferenceType(value)[source]

Bases: str, Enum

Defines how qubits should be referenced in the generated OpenQASM string. See https://qiskit.github.io/openqasm/language/types.html#quantum-types for details.

VIRTUAL = 'VIRTUAL'
PHYSICAL = 'PHYSICAL'
class braket.circuits.serialization.OpenQASMSerializationProperties(qubit_reference_type: QubitReferenceType = QubitReferenceType.VIRTUAL)[source]

Bases: object

Properties for serializing a circuit to OpenQASM.

qubit_reference_type (QubitReferenceType): determines whether to use

logical qubits or physical qubits (q[i] vs $i).

qubit_reference_type: QubitReferenceType = 'VIRTUAL'
format_target(target: int) str[source]

Format a target qubit to the appropriate OpenQASM representation.

Parameters:

target (int) – The target qubit.

Returns:

str – The OpenQASM representation of the target qubit.

braket.circuits.serialization.SerializationProperties

alias of OpenQASMSerializationProperties