I am trying to work with Qiskit's PauliTrotterEvolution() module, but the resulting circuits contain weird gates that I know nothing about.

Here is a simple example: I want to implement the fermionic creation operator on one of two qubits

from qiskit_nature.mappers.second_quantization import BravyiKitaevMapper
from qiskit_nature.operators.second_quantization import FermionicOp 
from qiskit.opflow.evolutions import PauliTrotterEvolution

fermi_op = FermionicOp("+I", display_format="dense") 

The fermionic operator is mapped to a sum of Pauli gates using the Bravyi-Kitaev mapper:

mapper = BravyiKitaevMapper()
bosonic_op = mapper.map(fermi_op)

Now we apply the PauliTrotterEvolution to the exponential of the bosonic operator:

pauli_trotter = PauliTrotterEvolution("trotter", reps=1)

conv = pauli_trotter.convert(bosonic_op.exp_i())

circ = conv.to_circuit()


I have no clue what these "circuit" gates are. Has anyone seen something similar before?


These "circuit" gates are empty, if you transpile the circuit to a basis gate set they will disappear:

from qiskit import transpile

circ = # your circuit
transpiled = transpile(circ, basis_gates=["h", "s", "sdg", "rz", "cx"])

As the answer of @viwosh points out, that behavior is also fixed in the newer versions of Qiskit.


When I do this in a recent version (0.19.0.dev0+6e0926f) I get enter image description here

For your version perhaps try "circ.decompose().draw('latex')" to see how "circuit-24" is defined.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.