transpiled_circuit#
- iqm.qaoa.circuits.transpiled_circuit(qaoa, backend=None, transpiler=None, **kwargs)[source]#
The function to return a
QuantumCircuittailored tobackend.This function has highly varying outputs based on which transpiler is used. If no transpiler is used, the perfect
QuantumCircuitis returned usingqiskit_circuit(). Otherwise, the QAOA circuit is transpiled using one of the transpilers, respecting the topology ofbackend.- Parameters:
qaoa (QUBOQAOA) – The
QUBOQAOAobject whose quantum circuit is constructed.backend (BackendV2 | None) – A backend that the circuit is to be run on. The connectivity of the backend is required for the transpilation.
transpiler (str | None) – A string that describes which algorithm should be used for transpilation (if any). Should be one of:
None, “Default”, “HardwiredTranspiler”, “SparseTranspiler”, “SwapNetwork” or “MinimumVertexCover”.**kwargs (Any) – Additional keyword arguments passed to
transpile()used inside oftranspiled_circuit(). For example: - initial_layout (list[int]): The list of hardware qubits onto which the circuit is to be laid out. - seed_transpiler (int): A random seed to derandomize the transpilation.
- Returns:
A quantum circuit transpiled to the topology of
backend.- Raises:
TypeError – If the
backendis not an IQM backend and a customtranspileris selected (i.e., other thanNoneor “Default”).ValueError – If the provided
transpileris not one of the allowed transpilers.
- Return type:
QuantumCircuit