Closed ElePT closed 1 year ago
@MarcDrudis would you like to be assigned to this issue?
@ElePT For time evolvers we also have the classical time ones and TrotterQRTE (as well as PVQD - a tutorial for this underway). Is there someway to include these algorithms too, something a bit more comprehensive? Maybe a general time evolvers tutorial/section that guides your selection towards one or more of the algorithms - which includes/links to examples then built with these?
@woodsp-ibm you're right, we should add a TrotterQRTE tutorial and maybe we could combine it with classical time evolution, and maybe we could just have a generic time evolution tutorial that guides you through all of these. I like the idea.
The reason why I did not open an issue yet is because I wanted to double check with @Cryoris first. He had some refactoring ideas for the current trotter class, and I though that it would probably be more time efficient to not start designing the tutorial until the class is refactored. But I am keeping it in mind.
Variational Quantum Time Evolution:
1.Variational quantum time evolution leverages variational principles to approximate the time evolution of quantum systems. It aims to find the optimal parameters that minimize the discrepancy between the simulated time evolution and the desired target evolution.
Import Required Libraries
Define the Hamiltonian: Specify the Hamiltonian of the quantum system you want to simulate. You can represent it using the SparsePauliOp from Qiskit's quantum_info module.
Initialize the Ansatz: Create an ansatz, which is a parameterized quantum circuit, using Qiskit's circuit library.
Set Initial Parameter Values: Initialize the parameter values of the ansatz. These values will be iteratively updated during the optimization process.
Define the Variational Principle: Specify the variational principle to be used. For variational quantum time evolution, you can use ImaginaryMcLachlanPrinciple from Qiskit's qiskit.algorithms.time_evolvers.variational module.
Define the Time Evolution Problem: Create a TimeEvolutionProblem object by specifying the Hamiltonian and the desired evolution time.
Run Variational Quantum Time Evolution: Create a VarQITE object with the ansatz, variational principle, and initial parameter values. Then, call the evolve method with the time evolution problem.
By following these steps, you can leverage Qiskit's qiskit.algorithms.time_evolvers.variational package to perform variational quantum imaginary and real-time evolution based on McLachlan's variational principle.
By specifying qgt=ReverseQGT() and gradient=ReverseEstimatorGradient() when creating the ImaginaryMcLachlanPrinciple object, you can benchmark the new classically efficient gradients introduced in the qiskit.algorithms.gradients.reverse_gradient package.
I'm interested, can I assign to this issue
Hi, We are also interested in this issue. Wondering if we can also be considered as a potential assignee for this unitaryHACK? We are planning to submit our first PR next week (by 06/04). Thanks!
I'm interested, can I assign to this issue
Yeah you can
Hi, We are also interested in this issue. Wondering if we can also be considered as a potential assignee for this unitaryHACK? We are planning to submit our first PR next week (by 06/04). Thanks!
Yes, you can. Kindly go ahead
Variational Quantum Time Evolution:
1.Variational quantum time evolution leverages variational principles to approximate the time evolution of quantum systems. It aims to find the optimal parameters that minimize the discrepancy between the simulated time evolution and the desired target evolution.
2. Import Required Libraries 3. Define the Hamiltonian: Specify the Hamiltonian of the quantum system you want to simulate. You can represent it using the SparsePauliOp from Qiskit's quantum_info module. 4. Initialize the Ansatz: Create an ansatz, which is a parameterized quantum circuit, using Qiskit's circuit library. 5. Set Initial Parameter Values: Initialize the parameter values of the ansatz. These values will be iteratively updated during the optimization process. 6. Define the Variational Principle: Specify the variational principle to be used. For variational quantum time evolution, you can use ImaginaryMcLachlanPrinciple from Qiskit's qiskit.algorithms.time_evolvers.variational module. 7. Define the Time Evolution Problem: Create a TimeEvolutionProblem object by specifying the Hamiltonian and the desired evolution time. 8. Run Variational Quantum Time Evolution: Create a VarQITE object with the ansatz, variational principle, and initial parameter values. Then, call the evolve method with the time evolution problem.
By following these steps, you can leverage Qiskit's qiskit.algorithms.time_evolvers.variational package to perform variational quantum imaginary and real-time evolution based on McLachlan's variational principle.
By specifying qgt=ReverseQGT() and gradient=ReverseEstimatorGradient() when creating the ImaginaryMcLachlanPrinciple object, you can benchmark the new classically efficient gradients introduced in the qiskit.algorithms.gradients.reverse_gradient package.
9. Make sure to import the necessary modules for the reverse gradients. This allows you to evaluate and compare the performance of the default gradient/QGT methods with the new classically efficient gradients.
Please take into account that this is not considered a contribution towards the Unitary Hack bounty. The contribution must be made as a PR and follow the content standards and style guidelines specified above.
@MihirsinhChauhan, @wenxh0718 (and others) please note that ptwnimbe1 is not a Qiskit maintainer and cannot assign you to this issue (or tell you to go ahead). You can both go ahead and open a PR making sure you follow the updated style guidelines. You must note that, for the Unitary Hack challenge, we will take into account the quality of the contribution to decide whether it wins the bounty or not, and in principle, there is only one winner.
Once you open the PR, make sure to tag this issue or mention me so I can follow-up on the contribution.
I am interested in this issue @ElePT
I am interested in this issue.
I did not understand why doing "evolve" command wrt VarQITE give me error :- TypeError: Unsupported type of param_values provided.
I imagine this is the method that is checking it https://github.com/Qiskit/qiskit-terra/blob/332bd9fe0bea82c0fdf7329cea3da115d86e3fc2/qiskit/algorithms/time_evolvers/variational/var_qte.py#L234, maybe that's of help, where param_values seems to relate to initial_parameters passed. You can see the type checks its doing and the failing type should have been part of the error message.
@ElePT Hi , @ichen17 @huckstar and I have submitted a PR https://github.com/Qiskit/qiskit-tutorials/pull/1470 for this tutorial, please let us know if you have any questions and need any from our side. Thanks and looking forward to your response!
Hey! I have joined Unitary hack 2023 late. Can i contribute to this problem ?
Hi @wenxh0718, thanks for your contribution. As this is the only open PR at the moment, I have left you as the only person assigned to the issue. As you have collaborated with @ichen17 and @huckstar, would you like us to distribute the potential bounty among you three (in that case, I need them to comment on the issue so that I can assign them)??
I have a question about the source code of Quantum Imaginary Evolution. I have tried QAOA with Qiskit QAOA module from the tutorial https://qiskit.org/documentation/tutorials/algorithms/05_qaoa.html It has a code result = qaoa.compute_minimum_eigenvalue(qubit_op) If I want to compute the minimum eigenvalue of an ising model by QITE, is it possible to use this module?
Hi @wenxh0718, thanks for your contribution. As this is the only open PR at the moment, I have left you as the only person assigned to the issue. As you have collaborated with @ichen17 and @huckstar, would you like us to distribute the potential bounty among you three (in that case, I need them to comment on the issue so that I can assign them)??
Hi @ElePT Yes, that works for us. @ichen17 @huckstar please feel free to comment here. thanks!
Hi, @ElePT Plases assign me to the issue. Thanks.
Hi @ElePT, please assign me to this issue. Thanks!
Create a tutorial in
qiskit.algorithms
to show how to use the newtime_evolvers.variational
package.The tutorial should introduce variational quantum imaginary and real time evolution based on McLachlan's variational principle, and show how this can be leveraged using Qiskit classes.
References for VarQTE:
Reference code (extracted from the
VarQITE
documentation):As a follow-up, it would also be nice to benchmark the default gradient/qgt methods with the new classically efficient gradients introduced in the
qiskit.algorithms.gradients.reverse_gradient
package.These could be set by doing:
Style guidelines:
Here are some references of the style of tutorial we are looking for
Make sure to follow the Qiskit documentation tutorial guidelines: https://qiskit.github.io/qiskit_sphinx_theme/tutorials/tutorials_guidelines.html
More examples for further reference: https://qiskit.github.io/qiskit_sphinx_theme/tutorials/tutorials_examples.html