# How to suppress long parameters list that appears in the initialize gate?

Below is a simplified code which I am using for a quantum circuit.

from qiskit import QuantumCircuit

qc = QuantumCircuit(5)
qc.initialize(Statevector.from_label('r'*5))
qc.h(0)
qc.crx(180, 0, 1)
qc.cx(0, 2)
qc.draw("mpl")


When I draw the circuit it looks something like this:

As you can see, the generated matplotlib image of quantum circuit has a huge block of initialize gate. I can see that the size of initialize instruction is because of the long list of parameters. So my question is, is there a way to suppress this long list of parameters from appearing in the initialize gate when I initialize my quantum circuit to a specific state?

If your aim is to make a quantum circuit plot that doesn't have this big chunk of initialization state, you can make use of decompose function by qiskit.

from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector
qc = QuantumCircuit(5)
qc.initialize(Statevector.from_label('r'*5))
qc.h(0)
qc.crx(180, 0, 1)
qc.cx(0, 2)
qc.decompose(reps=9).draw("mpl",fold=-1)


You can vary the value of reps and select what suits you the best, maybe 3 or 4.

Like the above code gives me this:

• I was aware of the decompose function but I don't want to decompose the circuit. I want to keep the block of initialize gate but without the long parameter list. Commented Apr 20 at 0:40
• Then maybe this article might help medium.com/qiskit/… Commented Apr 21 at 5:20
• After digging deep into the qiskit source code, I was able to find the list of functions and classes that are causing this. Unfortunately, there is no direct way to achieve what I want. But I have figured out a not so elegant way to decrease the size of the initialize gate without tampering with the source code. Thanks for your help! Commented Apr 22 at 2:57