People who code: we want your input. Take the Survey

New answers tagged

3

Easy Fix: It seems like it is because of the way you define $H$. You need the parenthesis around each of the term! So something like: H = (504.0 * I^I^I^I^I^I^I^Z) + (1008.0 * I^I^I^I^I^I^Z^I) + ( 2016.0 * I^I^I^I^I^Z^I^I) Just replace this in your code then it will work! Alternative (longer) way: Here I will offer another way to define the Hamiltonian ...


2

There was an issue that was fixed with QAOA https://github.com/Qiskit/qiskit-aqua/pull/1316 whereby using all zeros as an initial point was changed since the optimizer could easily get stuck there. Given the version you have the easiest way to change things would just be to pass an initial point that is non-zero. I.e. instead of [0,0] which it uses with the ...


2

For diagonal Hamiltonians, you might not need entanglement at all. The intuition for why a more complicated ansatz might be useful is that the optimization landscape is somehow better, in the sense that the minimum is easier to find. However, in this paper, the author applies VQE to some combinatorial optimization problems and finds that variational forms ...


3

With just single qubit gate in your circuit, you can only generate a small subset of quantum states. In fact, the states that you can generate are called separable states. These states have no entanglement in them. Here is an example to see why you need to be able to generate entangle state to have successful VQE calculation, supposed you have the ...


2

Probably the easiest way to understand this is to pretend that the mixer is NOT there and see what happens. So, let's assume you have some initial state $\lvert \psi \rangle = \sum_x \psi_x \lvert x \rangle$ and you want to use QAOA to find the ground state of some cost Hamiltonian $H_C$. I'm using the notation $\big\{\lvert x \rangle : x \in \{\pm 1\}^n \...


3

You can set the attribute parameters_bounds of a circuit to the desired intervals like below: from qiskit import QuantumCircuit from qiskit.circuit import Parameter a=Parameter('a') b=Parameter('b') ansatz=QuantumCircuit(2) ansatz.ry(a,0) ansatz.ry(b,1) ansatz.parameter_bounds=[[0,np.pi]]*2 Then you can run your vqe program.


Top 50 recent answers are included