qbraid.interface.convert_to_contiguous
- convert_to_contiguous(program, **kwargs)[source]
Checks whether the quantum program uses contiguous qubits/indices, and if not, adds identity gates to vacant registers as needed.
- Parameters
program (
QPROGRAM
) – Any quantum quantum object supported by qBraid.- Raises
ProgramTypeError – If the input circuit is not supported.
ContiguousConversionError – If qubit indexing could not be converted
- Returns
Program of the same type as the input quantum program.
- Return type