1
$\begingroup$

I am trying to change the appearance of the circuit_drawer in output='mpl' mode. The registers of the Quantum Circuit are named like ($q0_0$, $q0_1$, $q1_0$, $q2_0$, $q2_1$,..) but I'd like to name them myself. I can't find a style function or option which is able to do that... any ideas?

To be clear what I would like to change:

enter image description here

$\endgroup$
3
$\begingroup$

When initializing the registers for the quantum circuit you need to set the parameter 'name'. For example:

f_in = QuantumRegister(n, name='f_in')
###add other registers here### 
qc = QuantumCircuit(f_in, ...)
qc.draw(ouput='mpl')

Gives the output:

enter image description here

| improve this answer | |
$\endgroup$

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.