I have just tried to apply initialize
function to a simple circuit. There is any way to display how is done internally the initialization circuit instead of a single block with label "initialize"?
Here is the output of the minimal working example you can find below:
┌──────────────────────────────────┐
q2476_0: |0>┤0 ├
│ initialize(0.70711,0,0,0.70711) │
q2476_1: |0>┤1 ├
└──────────────────────────────────┘
Minimal working example:
import numpy as np
import math
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
desired_vector = [
1 / math.sqrt(2) * complex(1, 0),
0,
0,
1 / math.sqrt(2) * complex(1,0 )]
q = QuantumRegister(2)
qc = QuantumCircuit(q)
qc.initialize(desired_vector, [q[0],q[1]])
qc.draw(output='mpl')
print(qc)