0
$\begingroup$

I have been experimenting with Qiskit lately, but I have found the implementation of algorithms in Aqua extremely confusing. Currently I am trying to implement a very simple circuit that will return the eigenvalues of a 2x2 unitary operator, for example Pauli X. The problem is that I don't know which class I should use: is it PhaseEstimationCircuit from qiskit.aqua.circuits.phase_estimation_circuit or EigsQPE from qiskit.aqua.components.eigs.eigs_qpe or any of the many similarly named modules. An example tentative is shown below.

pauli = Pauli( z=[0], x=[1], label=None) weighted_pauli = WeightedPauliOperator(paulis=[(1,pauli)]) a = qpc.construct_circuit()

The circuit a does not seem to be the correct one. More objectively, is there anyway to reproduce a QPE circuit as the one shown in Wikipedia through Aqua?

$\endgroup$
1
$\begingroup$

As a general comment Aqua has function at different levels, algorithms such as VQE, QPE, HHL etc, pluggable components that were designed to be replaceable 'parts' of algorithms such as Variational Forms, Optimizers, Uncertainty models etc, and then there are circuits which can be used to build any of the above.

When it comes to Phase Estimation it's a technique used in a number of places in algorithms and components as well. QPE, IQPE expose phase estimation in the form of as an algorithm with an intent of finding the min eigenvalue. AmplitudeEstimation algorithm is another example of an algorithm that uses phase estimation. The eigs component you indicated was designed initially for HHL to allow different forms of eigenvalue support for it, and uses phase estimation. PhaseEstimationCircuit is used by all the above and is the lowest level 'building block' for this in Aqua.

PhaseEstimationCircuit can take either an Aqua Operator, such as WeightedPauliOperator, which you can create from Paulis, or a unitary circuit that implements the circuit factory in utils folder. The components and algorithms that use PhaseEstimation circuit may just work with one of these types that the circuit supports. Ultimately the 'right way' depends on what you want to do and the set of functionality in Aqua that can address what you want to do.

Hope this helps explain why you see phase estimation in a number of places. I see you have already been indicated the HHL tutorial that has eigs_qpe used. Hopefully the above explanation and that tutorial helps. You can find other tutorials on QPE and IQPE etc if they might be of help too.

|improve this answer|||||
$\endgroup$
0
$\begingroup$

I believe this tutorial takes you through how to find eigenvectors. They use EigsQPE, through a helper function they define themselves, called create_eigs().

|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.