register = QuantumRegister(self._num_qubits, name="q")
if circuit is None:
circuit = QuantumCircuit()
circuit.add_register(register)
for j in range(self._num_qubits):
for k in range(j):
lam = 1.0 * pi / float(2 ** (j - k))
After Change
register = QuantumRegister(self._num_qubits, name="q")
if circuit is None:
circuit = QuantumCircuit()
if not circuit.has_register(register):
circuit.add_register(register)
for j in range(self._num_qubits):
for k in range(j):
lam = 1.0 * pi / float(2 ** (j - k))
circuit.u1(lam / 2, register[j])