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

Before Change


                circuit = QuantumCircuit()

                // if register is actually a list of qubits
                if type(register) is list:

                    // 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)

                if self._state is None or self._state == "random":
                    svc = StateVectorCircuit(self._state_vector)
                    svc.construct_circuit(circuit, register)
                elif self._state == "zero":

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: e871556bad89d632b549f0c5184a5c5159d34930
Time: 2019-01-11
Author: shaohan.hu@ibm.com
File Name: qiskit_aqua/algorithms/single_sample/iqpe/iqpe.py
Class Name: IQPE
Method Name: _estimate_phase_iteratively