qbraid.programs

Module containing quantum circuit wrapper classes providing uniform suite of methods and functionality for supported program types.

Data Types

QPROGRAM

alias of str | QuantumTape | Circuit | Program | Circuit | Circuit | QuantumCircuit | Program

Functions

get_qasm_version(qasm_str)

Gets OpenQASM program version, either qasm2 or qasm3.

get_program_type(program[, require_supported])

Get the type of a quantum program.

load_program(program)

Apply qbraid quantum program wrapper to a supported quantum program.

remove_qasm_barriers(qasm_str)

Returns a copy of the input QASM with all barriers removed.

unfold_qasm_gate_defs(qasm_string)

Recursively expands gate definitions in the input OpenQASM string.

flatten_qasm_program(qasm_str)

Returns a copy of the input QASM compatible with the QasmParser.

decompose_qasm_qelib1(qasm_str)

Replace edge-case qelib1 gates with equivalent decomposition.

convert_qasm_pi_to_decimal(qasm_str)

Convert all instances of 'pi' in the QASM string to their decimal value.

register_program_type(program_type[, alias])

Registers a user-defined program type under the specified alias.

Classes

QuantumProgram(program)

Abstract class for qbraid program wrapper objects.

Exceptions

PackageValueError(package)

Class for errors raised due to unsupported quantum frontend package

ProgramTypeError([program, message])

Exception raised for errors encountered with unsupported quantum programs.

QasmError

For errors raised while processing OpenQASM programs.

Submodules

libs

Module containing sub-modules for interfacing with various quantum software libraries and program types.