cunqa.transpile

Holds the transpiler() function that translates circuit instructions into native instructions that a certain virtual QPU understands.

It is important and it is assumed that the circuit that is sent to the virtual QPU for its simulation is transplated into the propper native gates and adapted to te backend’s topology.

Once the user has decribed the circuit CunqaCircuit, qiskit.QuantumCircuit or json dict, cunqa provides two alternatives for transpiling it accordingly to a certain backend:

  • When submmiting the circuit, set transpile as True and provide the rest of transpilation instructions:

    >>> qpu.run(circuit, transpile = True, ...)
    

    This option is False by default.

  • Use transpiler() function before sending the circuit:

    >>> circuit_transpiled = transpiler(circuit, backend = qpu.backend)
    >>> qpu.run(circuit_transpiled)
    

Warning

If the circuit is not transpiled, errors will not raise, but the output of the simulation will not be coherent.

Functions

transpiler(circuit, backend[, opt_level, ...])

Function to transpile a circuit according to a given Backend.

Exceptions

TranspileError

Exception for error during the transpilation of a circuit to a given Backend.