All Questions
Tagged with vqe programming
65 questions
2
votes
1
answer
142
views
The number of qubits of the ansatz does not match the operator
I am trying to run my below code on FakeSherbrooke() system, but I am getting an error as shown below:
...
1
vote
0
answers
75
views
SparsePauliOp' object has no attribute 'primitive_strings' warning for a max-cut problem using QAOA and MinimuEigenOptimizer
I am using Qiskit to implement QAOA for a max-cut problem. I am using inbuilt qiskit implemetation of QAOA and, the MinimuEigenOptimizer. The MinimuEigenOptimizer.solve() throws the warning.
...
1
vote
0
answers
36
views
How to combine a VQE circuit with normal qiskit quantum circuit without parameters and give the measured set of qubits to the estimator?
I want to use a parameterized quantum-circuit which is $\text{CNOT}$ with another quantum-circuit that has no parameters, then after a series of gates on the second quantum-circuit, I want to measure ...
1
vote
1
answer
62
views
vqe.compute_minimum_eigenvalue API of qiskit produces different eigenstate results for statevector_simulator ands qasm_simulator
I am trying to understand the usage of vqe.compute_minimum_eigenvalue API of qiskit for the statevector_simulator and qasm_simulator. I am only interested in the <...
1
vote
0
answers
84
views
Usage of qiskit API MatrixOp.to_pauli_op()
I am quite confused with the MatrixOp.to_pauli_op() API.
I have a hamiltonian, and it is given as input to a
API MatrixOp.
...
1
vote
1
answer
92
views
Reusing Parameters for Multiple Runs with Qiskit's SPSA Optimization
I am using Qiskit's SPSA optimization algorithm to find the ground state energy of various lattices (Fermi-Hubbard model) by running different circuits through it and having the algorithm modify the ...
1
vote
1
answer
107
views
Need help regarding building a custom VQE
I want to write code for a custom Variational Quantum Eigensolver (VQE) capable of computing eigenvalue(s) for non-Hermitian systems, based on this paper. I have formulated a cost function (provided ...
0
votes
1
answer
257
views
How does the Active Space Transform work theoretically?
I have a question about the ActiveSpaceTransformer which is used in vqe calculations for a molecule of LiH in Qiskit. In the documentation the inactive Fock operator is defined.I don't understand why ...
0
votes
1
answer
571
views
References for two-local forms in QISKIT
I am using 'Two local' form of QISKIT as a waveform ansatz in VQE to compute ground state. QISKIT documentation does not provide references to all the entangling options. Is there any other place ...
3
votes
1
answer
380
views
Performance metrics in QSVM
I have implemented QSVM on breast cancer dataset using link: "https://qiskit.org/documentation/stable/0.24/tutorials/machine_learning/01_qsvm_classification.html" but unable to compute other ...
1
vote
2
answers
464
views
Expectation value of Pauli strings for VQE
I am studying VQE and have boiled it down to a matter of determining the expectation value of Pauli strings:
$$\langle H \rangle = \sum_i \alpha_i \langle\psi|\hat{P_i}|\psi\rangle.$$
I have been ...
0
votes
0
answers
381
views
Hamiltonian & QubitMappingType cannot be imported from qiskit.chemistry.core
I'm trying to implement the same Jupyter notebook in The Variational Quantum Eigensolver — Programming on Quantum Computers — Coding with Qiskit S2E4;however,I found a problem:
Error:
...
3
votes
2
answers
855
views
Qiskit best programming practices - how to speed up qiskit code?
I am currently doing some experiments using Variational Quantum Eigensolver in molecular dynamics using qiskit, and noticed that the time for execution on real backend is significantly higher than the ...
0
votes
1
answer
237
views
QVA with local Hadamard Overlap
I am trying to implement in Qiskit the quantum variational linear solver given here (https://arxiv.org/pdf/1909.05820.pdf) with a local Hadamard overlap test and failing substantially. The cost is not ...
3
votes
1
answer
455
views
Variational quantum eigensolver in qiskit
I have implemented a hybrid quantum NN on a dataset to perform classification. Now I want to apply quantum PCA to my dataset to find the eigenvalues. After going through a few qiskit tutorials, I ...
3
votes
1
answer
270
views
VQE from scratch, what have I got wrong?
I've been working on a code to run VQE with a grouped measurement. For some reason, my expectation values are slightly off from those computed by pennylane, the software I decided to use for this ...
3
votes
1
answer
2k
views
Qiskit - Simpler way to create a Hamiltonian
I am looking for an efficient way to create a Hamiltonian in Qiskit.
Following are my desired input and outputs
input: 'ZZI'
output: Z^Z^I, where Z and I are operators.
Here is how I am doing it ...
1
vote
0
answers
298
views
Ground state compute issue by qiskit
I use the following code to calculate the ground state for the LiH molecule in an active space. I come across two problems. The first is I found that the Hartree Fock state gave energy that is far ...
7
votes
1
answer
939
views
How can I run a VQE on one of IBMQ's Quantum Computers
I have implemented a VQE based on Qiskit's VQE function and want to run that on an actual quantum computer. My understanding was, that an IBMQ backend can be passed into the function as a Quantum ...
2
votes
0
answers
70
views
What is the input for the interpret of Quantum Variational Regressors?
I'm trying to implement my first variational regressor using qiskit. I would like to understand how the interpret of a CircuitQNN works.
I need to define an interpret that works on the amplitudes of a ...
3
votes
1
answer
166
views
Trouble when implement a self designed gradient in qiskit
everyone! I have trouble when implement a self-designed gradient to the VQE algorithm. The following code will pop the 'ListOp' object is not callable exception to the last line of the code when ...
3
votes
1
answer
296
views
How to find the expectation value of several circuits using Qiskit aqua operator logic?
I am using the method from this SE answer to calculate the expectation value using qiskit aqua operator logic which works well for a single circuit. Here is a simplified code snippet to demonstrate ...
1
vote
0
answers
211
views
Are inconsistent results between different VQE runs justified?
I made this post a while ago, where I learned I could use qiskit's VQE to calculate (or approximate) the Transverse Field Ising Hamiltonian and other similar Hamiltonians. After working with my code ...
4
votes
2
answers
344
views
How do I identify a VQE job run in real hardware?
I am running a VQEUCCFactory for H2 on a real hardware device.
...
6
votes
1
answer
390
views
Use one_body_integrals to know which orbitals to freeze in ElectronicStructureProblem
In exercise 5 of the this year's IBM Quantum Challenge, you need to use the FreezeCoreTransformer (along two_qubit_reduction and ...
3
votes
1
answer
176
views
What explains my anomalously scaled up VQE?
I am trying to implement VQE from the Qiskit to obtain the ground state of a very specific Hamiltonian that has been generated via a docplex minimized quadratic ...
2
votes
2
answers
400
views
How to measure a qubit Hamiltonian in qiskit
I am using qiskit to get some measurement results of observables similar to the Hamiltonian. Can someone provide the way how qiskit measures the Hamiltonian (Jordan-Wigner transformed) when using VQE? ...
1
vote
1
answer
160
views
Unable to use iSWAP in Qiskit TwoLocal entangling_block
I would like to use a general entangler in the entanglement_block of the TwoLocal function. The function seems to work with 'cz', 'cx', 'swap' gates, but it fails for 'iswap' gate. Below is the error ...
0
votes
1
answer
289
views
Getting the current variational parameters in Qiskit
I am right now using variational quantum eigensolver (VQE) to calculate the ground state of some molecules, like H2, by qiskit. The quesiton is that how to get the current parameters of the varaional ...
2
votes
2
answers
535
views
Need some help with simulating molecules with VQE
I have studied the example of the simulation of LiH molecule in Learning Quantum Computation using Qiskit. It is available on this link: https://qiskit.org/textbook/ch-applications/vqe-molecules.html#...
1
vote
1
answer
363
views
Why does the Qiskit tutorial for the Variational Quantum Linear Solver not work properly?
I am following this very nice qiskit tutorial on how to implement a simple variational quantum linear solver (VQLS). There are 3 examples implemented in the tutorial all of which are solving the $Ax=b$...
2
votes
3
answers
468
views
error when running VQE in Qiskit
I am running the code, which gets the ground state energy with different atomic distances of LiH. However, I encountered this error. The code is as follow
...
5
votes
1
answer
738
views
Simulation of a helium molecule using Qiskit
I am trying to compute the ground state energy of He-He using VQE. For this purpose I have utilized Qiskit and have written the following script:
...
2
votes
1
answer
174
views
Qiskit: getting QAOA expectation
Suppose I run the Qiskit's QAOA algorithm.
qaoa = QAOA(operator=qubit_operator, p=p, optimizer=optimizer)
result = qaoa.run(quantum_instance)
There is a built-in ...
2
votes
1
answer
323
views
How to improve accuracy of ground energy values from a VQE
Using the Qiskit textbook I have been using a VQE to find the ground state energy of Hydrogen at different interatomic distances on a quantum machine. However, the average energy value I will always ...
4
votes
0
answers
232
views
Implemented QAOA returns wrong result
I try to apply QAOA algorithm to find minimal energy state of the Hamiltonian:
$H_A = \frac{1}{2}\sigma_z^1 + \frac{1}{2}\sigma_z^1\sigma_z^2$
It is expected that with p=2 my variational should ...
7
votes
0
answers
210
views
Run VQE for parametrized quantum circuit with ancilla qubits
Let's say we have the following circuit (picture and code shown below), and now the $q_0$ is an ancilla qubit. If the system of interest has only two qubits, Is there a way to use only $q_{1,2}$ as my ...
2
votes
1
answer
475
views
Increase maximum shots on IBM Hardware when running Quantum Variational Algorithms
I am interested to know whether there is a quick and elegant way of increasing the number of shots (more than 8192 shots) on IBM hardware when running variational algorithms like VQE or QAOA.
I know ...
3
votes
1
answer
950
views
Using Qiskit VQE for solving an eigenvalue problem
I am a new user of Qiskit and I believe there is a simple answer to my question but I have had a very hard time finding a straightforward answer. I am trying to transform a given $3 \times 3$ (...
4
votes
3
answers
2k
views
Creating a parameterized Operator in Qiskit
I'm trying to run a VQE for a specific custom Anzats. The Anzats is built up of an unitary matrix $U_H$, which I'm trying to created in this way:
...
1
vote
1
answer
205
views
Recording the time taken by a VQE to find ground state energy
I want to record the time that a VQE solver takes to find the ground state. At the moment I am using:
...
4
votes
1
answer
488
views
TypeError: 'NumPyMinimumEigensolver' object is not subscriptable
I'm trying to implement the same Jupyter notebook Jin-Sung Kim gave in his YouTube video The Variational Quantum Eigensolver — Programming on Quantum Computers — Coding with Qiskit S2E4; however, I'm ...
2
votes
0
answers
104
views
How to implement the Mixer of Quantum Alternating Operator Ansatz for Max-Independent-Set
I am trying to implement the Mixer of the Max-Independent Set from The Quantum Alternating Operator Ansatz from this paper (arXiv) in Chapter 4.2, page 15 to 17.
For every verice $v$ in the Graph this ...
10
votes
1
answer
1k
views
Intuition behind the construction of an ansatz circuit
I'm learning about the VQE algorithm. When I looked at the declaration in Qiskit I saw you need to pass an ansatz which prepares the state. I looked at some commonly used ansatz functions, e.g. ...
3
votes
2
answers
463
views
How to use VQE function in Qiskit
As part of a project I'm working on, I want to use VQE algorithm to calculate the minimal eigenvalue for given Hamiltonian. I use Qiskit on IBM UI online.
The Hamiltonian is given as a sum of tensor ...
10
votes
1
answer
2k
views
QUBO, Ising Hamiltonians and VQA
I understand that usually the combinatorial optimisation problems are turned into QUBO, which has a very simple mapping to Ising Hamiltonians. Ising Hamiltonians in turn have the desired properties of ...
1
vote
1
answer
353
views
An effective way to submit all the jobs for VQE/QAOA at a time to an IBMQ machine?
In Qiskit, I am solving a VRP for 5 nodes and it creates 20 variables for a QUBO. It runs in a 65 qubit machines (any machine below that many fails). Now, in such a typical solvers for optimization (...
2
votes
1
answer
515
views
Why VQE gives an incorrect ground state energy for a chain of 4 hydrogen atoms?
I am a bit hesitant to ask this very specific question, as I feel other people need not benefit from it. But since I have struggled for a while, and I think I should get some help.
So I am using VQE ...
2
votes
0
answers
138
views
Wrong Expectation value when implementing a VQE for the Heisenberg Hamiltonian
I tried to implement an extended Heisenberg-Hamiltonian as an extra exercise further than my homework.
My Hamiltonian is the following: $H = \sum_{NN} \sigma_x\sigma_x + \sigma_z\sigma_z$
I try to ...
1
vote
1
answer
342
views
Why do the qasm_simulator runtimes vary significantly for different IBMQ CouplingMap/NoiseModels?
I have been running VQE experiments locally using the qasm_simulator with actual IBMQBackend NoiseModels as shown in the Qiskit Textbook. I have noticed that the ...