ac6b297b39c548db783a3ba7d437517121f93989,qiskit/aqua/components/initial_states/custom.py,Custom,construct_circuit,#Custom#Any#Any#,104

Before Change


                    // loop over all qubits and add the required registers
                    for q in register:
                        if not circuit.has_register(q[0]):
                            circuit.add_register(q[0])
                else:
                    // if an actual register is given, add it
                    circuit.add_register(register)

After Change


                if self._state is None or self._state == "random":
                    svc = StateVectorCircuit(self._state_vector)
                    svc.construct_circuit(circuit=circuit, qubits=qubits)
                elif self._state == "uniform":
                    // in case `qubits` is a list of Qubits
                    if isinstance(qubits, list):
                        // loop over all qubits and add the required registers
                        for q in qubits:
                            if not isinstance(q, Qubit):
                                raise AquaError("Unexpected element type {} in qubit list.".format(type(q)))
                            if not circuit.has_register(q.register):
                                circuit.add_register(q.register)
                    // otherwise, if it is a QuantumRegister
                    elif isinstance(qubits, QuantumRegister):
                        if not circuit.has_register(qubits):
                            circuit.add_register(qubits)
                    else:
                        raise AquaError("Unexpected qubits type {}.".format(type(qubits)))

                    for i in range(self._num_qubits):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: Qiskit/qiskit-aqua
Commit Name: ac6b297b39c548db783a3ba7d437517121f93989
Time: 2019-06-13
Author: shaohan.hu@ibm.com
File Name: qiskit/aqua/components/initial_states/custom.py
Class Name: Custom
Method Name: construct_circuit


Project Name: Qiskit/qiskit-aqua
Commit Name: ec2185f92eb3794e03e3b4e438befdc81f253cce
Time: 2019-05-21
Author: shaohan.hu@ibm.com
File Name: qiskit/aqua/circuits/fourier_transform_circuits.py
Class Name: FourierTransformCircuits
Method Name: construct_circuit


Project Name: Qiskit/qiskit-aqua
Commit Name: e44bb209a41d9f85a0f115b21b3b150bff65ee66
Time: 2020-09-15
Author: jules.gacon@googlemail.com
File Name: qiskit/aqua/algorithms/amplitude_estimators/iqae.py
Class Name: IterativeAmplitudeEstimation
Method Name: construct_circuit