qbraid.interface.qbraid_qasm package

Submodules

qbraid.interface.qbraid_qasm.circuits module

Module containing qasm programs used for testing

qasm2_bell()[source]

Returns OpenQASM2 bell circuit

Return type

str

qasm2_shared15()[source]

Returns OpenQASM2 15 gate test circuit.

Return type

str

qasm2_raw_shared15()[source]

Returns OpenQASM 2 15 gate test circuit with no gate defs.

Return type

str

qbraid.interface.qbraid_qasm.qasm_preprocess module

Module for preprocessing qasm string to before it is passed to parser.

convert_to_supported_qasm(qasm_str)[source]

Dev version of convert_to_supported_qasm function, compatible with qiskit>=0.43.0. Returns a copy of the input QASM compatible with the QasmParser. Conversion includes deconstruction of custom defined gates, and decomposition of unsupported gates/operations.

qbraid.interface.qbraid_qasm.qelib1_defs module

Module that implements qelib1.inc qasm gate definitions as python functions

replace_qelib1_defs(qasm_str)[source]

Replace edge-case qelib1 gates with equivalent decomposition.

Return type

str

qbraid.interface.qbraid_qasm.tools module

Module containing OpenQASM 2 tools

qasm_qubits(qasm_str)[source]

Use regex to extract all qreg definitions from the string

Return type

List[str]

qasm_num_qubits(qasmstr)[source]

Calculate number of qubits in a qasm2 string.

Return type

int

qasm_depth(qasm_str)[source]

Calculates circuit depth of OpenQASM 2 string

Return type

int