Hot answers tagged

12

I view QAOA as an algorithm for solving (approximately) a special class of problems, namely combinatorial problems and VQE as a possible subroutine to QAOA (but not necessarily as in the case of MaxCut). Let me explain The VQE - Variational Quantum Eigensolver - solves the problem of approximating the smallest eigenvalue of some Hermitian operator $H$ which ...


8

The paper doesn't address very much the "fully classical" approach to their problems, so I don't think they are making a judgment one way or another about quantum advantage with VQA. But they are part of a growing body of literature arguing very wisely that the complexity of classical optimization cannot be ignored, when assessing the complexity of ...


7

Qiskit currently supports measurements in the computational basis from Qiskit Terra and Aer, that is, returning 1 if the qubit is in state $|1\rangle$, and 0 if the qubit is measured to be in state $|0\rangle$. However, it is relatively easy to perform a change of basis unitary to our quantum circuit just prior to measurement, in order to instead measure in ...


7

If you want to extract the exact value then would need infinite number of samples. However, assume no hardware noise, based in the Chebyshev's inequality you would need to do $O(1/\epsilon^2)$ to get within $\epsilon$ accuracy for each circuit in your experiment. Here, each circuit correspond to a Pauli term that your operator $O$ decomposed into. For ...


7

Welcome to Quantum Computing StackExchange. In general, finding the ground state energy of a k-local Hamiltonian is QMA-hard for k ≥ 2. That means, any problem in the complexity class QMA can be solved by reducing it to a k-local Hamiltonian and finding its ground state. And since NP is a subclass of QMA, any NP problem can be solved this way including NP-...


7

You can select a basis of unitary matrices with respect to which you can decompose your matrix. For example, if your matrix $A$ is $2^n\times 2^n$, then you can select the Pauli basis $$ \sigma_y,\qquad y\in\{0,1,2,3\}^n $$ You can find the decomposition very easily. Notice that if $$ A=\sum_yA_y\sigma_y $$ then calculating $$ \text{Tr}(A\sigma_x)=A_x2^n $$ ...


6

You're right in the sense that the cost unitary, which is composed of all the $Z$ and $CZ$ gates does not affect the underlying probabilities of measuring a specific state by itself, however when we apply the mixer (the layer of $Rx$ gates), the probabilities are changed, due to these added phases. Let's look at a basic example, to convince you that ...


6

The computational advantage of using quantum computers can be reached if the classical resources (memory; number of operations), required to solve a particular problem, grow exponentially in a certain parameter, while the quantum resources (memory; number of operations; number of measurements) grow polynomially in the same parameter. Finding the lowest ...


6

Let's denote $P$ as a Pauli tensor product term (Pauli term: e.g. $Z \otimes Z$, $X \otimes X$ or $Y \otimes X \otimes X$), then note that $P$ is a Hermitian matrix whose expectation value is real, the eigenvalues are $+1$ and $-1$ with corresponding eigenspaces. The expectation value of $P$ will be equal to: $$ \langle \psi | P |\psi\rangle = p_{+} - p_{-}$$...


5

VQE has an initial_point parameter, which is the starting point it uses for the optimization. In the absence on one being provided (or suggested via the variational form) it will pick a random one. You can seed Aqua, like you did the simulator, so it will end up with the same random one each time, to get a predictable outcome. Add the following to do this ...


5

You can plug any parameterized QuantumCircuit into the VQE. Parameterized means it contains Parameter objects e.g. as rotation angles. For instance from qiskit.circuit import QuantumCircuit, ParameterVector from qiskit.aqua.algorithms import VQE params = ParameterVector(3) wavefunction = QuantumCircuit(3) wavefunction.ry(params[0], 0) wavefunction.ry(...


5

You can use a callback function to save the parameters for each iterations of your vqe algorithm and even store the mean, std. Below an example: # Create the callback function to store intermediate values in vqe counts = [] values = [] parameters_list=[] std_list=[] def store_intermediate_result(eval_count, parameters, mean, std): counts.append(...


5

Interesting question! An ansatz circuit is a parameterized circuit, say $V(\theta)$ where $\theta$ are a set of parameters, used to prepare a trial state for your problem: $$ |\Psi(\theta)\rangle = V(\theta)|0\rangle $$ In a variational algorithm, such as VQE, the trial state encodes your solution and is iteratively updated until some termination criterion ...


5

In term of the $RY$ Ansatze, from my understanding, this is because many systems of interest, the Hamiltonian contains only real terms. And if we have real Hamiltonian, then the decomposition of the matrix representation of the Hamiltonian can be achieved with real eigenvectors. Now, a single-qubit $RY$ rotation confined the qubit state remains real. That is,...


5

"As far as I understand there aren't many rigorous results on performance of these algorithms, similar to many classic machine learning approaches." You are correct in that, unlike Grover's algorithm where we can prove that a search that would cost $\mathcal{O}(N)$ on a classical computer can be done with only $\mathcal{O}(\sqrt{N})$ on a quantum ...


5

2-local forms As I have seen the term, 2-local Hamiltonians are those Hamiltonians $\hat H$ which can be written as a sum of independent qubit operators $\hat H = \sum_i \sum_j \hat O_{ij}$, where each $\hat O_{ij}$ acts non-trivially only on two qubits $i$ and $j$. This is as opposed to a global Hamiltonian, whose terms may act on any number of qubits. This ...


4

The proof of the variational theorem (the theorem that the ground state energy is the lowest possible energy you can get from $\frac{\langle \psi|H|\psi\rangle}{ \langle \psi | \psi \rangle}$) is very simple: https://en.wikipedia.org/wiki/Variational_method_(quantum_mechanics) If you get a lower energy, it means you don't actually have $\frac{\langle \psi|...


4

You can create the unitary gate for operator $U(\theta)=e^{-i\frac{\theta}{2}Z_{0}Z{1}}$ using two $CNOT$ operations and single rotation gate $R_z$: For operators which contain different tensor products of Pauli matrices beside the product of $Z$ you have to change basis using appropriate unitary transformation: $R_y(-\frac{\pi}{2})$ changes $X$ basis to $Z$...


4

You can create an arbitrary number of parameters in your circuit by using the qiskit.circuit.Parameter class. Here's a brief example from qiskit.circuit import Parameter, QuantumCircuit # define your parameters a, b, c = Parameter('a'), Parameter('b'), Parameter('c') circuit = QuantumCircuit(2) circuit.rx(a, 0) # RX(a) on qubit 0 circuit.ry(b, 0) # RY(b) ...


4

When you have $\langle \varphi | I \otimes Z | \varphi \rangle $ It means you are calculating the expectation of the operator $I \otimes Z$ with respect to some state $|\varphi \rangle$. Since $I$ is on the first qubit, we would not need to do anything there, no need to do any rotation or even measurement. The eigenspace is decomposed into two halves ...


4

First, note that we can only measure in the computational basis in quantum computing (at least at the moment). But this is not a problem since \begin{align} \langle \psi | H | \psi \rangle = \langle \psi | 2X + 0.5 Z | \psi \rangle &= 2\langle \psi | X |\psi \rangle + 0.5\langle \psi|Z|\psi\rangle \\ &= 2\langle \psi|HZH|\psi\rangle + 0.5\langle\...


4

Short answer: The units of your result will be the same as the units of your input problem to VQE (units of your Hamiltonian coefficients). Long answer: In a VQE calculation, some problem Hamiltonian is mapped to a representation that is suitable for implementation in a quantum circuit. Often, this means mapping all Hamiltonian operators to strings of Pauli ...


3

I think that $UCC$ ansatz is good for chemistry related problems. However, if you an arbitrary Hamiltonian and want to find its smallest eigenvalue then it's not very obvious what the anstaz form should look like.... it will also depend on how you initialize your state. And if you define an anstaz with polynomial number of gates, you don't expect to be able ...


3

This can actually be easily done using the Qiskit Terra qiskit.quantum.info.analysis.average.average_data function that takes the counts data returned by a backend and the desired observable defined by a dict, list, or ndarray. The doc-string for that function actually has the ZZ your looking for as an example.


3

If you decomposed your Hamiltonian into Pauli strings, and it has 100 different terms, then yes you can use one machine to do the quantum subroutine to evaluate the expectation for each of the term. $$ \langle H \rangle = \sum_{i} h_i \langle P_i \rangle $$ So you can evaluate $\langle P_1 \rangle$ on one machine and $\langle P_2 \rangle$ on another machine.....


3

Here I am going to show why $\langle Z_1 Z_3 \rangle$ generally cannot be estimated from $\langle Z_1 Z_2 \rangle$ and $\langle Z_2 Z_3 \rangle$. Let's start with an arbitrary three-qubit state: \begin{align*} |\psi \rangle = c_{000} &|000\rangle + c_{001} |001\rangle + c_{010} |010\rangle + c_{011} |011\rangle + \\ +c_{100} &|100\rangle + c_{101} |...


3

The line: exact_result = NumPyMinimumEigensolver(qubit_op, aux_operators=aux_ops) should be exact_result = NumPyMinimumEigensolver(qubit_op, aux_operators=aux_ops).run() Here is the full code that I ran and its output: # %% import numpy as np import pylab import copy from qiskit import BasicAer from qiskit.aqua import aqua_globals, QuantumInstance from ...


3

I don't see why not since in VQE the only thing that being done on the quantum computer is the evaluation of $ \langle H \rangle $, where $H$ is some Hermitian matrix. For quantum chemistry purpose, $H$ usually represents the electronic Hamiltonian of the molecular system. Because $\langle H \rangle$ cannot be measured directly on a quantum computer, but ...


3

Seems like you are mixing a couple of things here. The VQEUCCSDFactory uses the HartreeFock state as an initial_state by default. See also here VQEUCCSDFactory. The initial_point that you are specifying is the initial values of the variational parameters to start the optimization from. One more point, seeing you snippet seems like you want to calculate a PES ...


3

Although the documentation says that the entanglement_blocks parameter can be specified via the name of a gate or the gate type itself, not all gates can be used this way. You can check the code to get the list of supported gate names. Since "pass by name" is not supported for iSWAP, you can use the gate type: ansatz = TwoLocal(num_spin_orbitals, ['...


Only top voted, non community-wiki answers of a minimum length are eligible