# Tag Info

12

A first remark This same phenomenon of 'control' qubits changing states in some circumstances also occurs with controlled-NOT gates; in fact, this is the entire basis of eigenvalue estimation. So not only is it possible, it is an important fact about quantum computation that it is possible. It even has a name: a "phase kick", in which the control qubits (or ...

9

Imagine you have an eigenvector $|u\rangle$ of $U$. If you have a state such as $|1\rangle|u\rangle$ and you apply controlled-$U$ to it, you get out $e^{i\phi}|1\rangle|u\rangle$. The phase isn't attached to a specific register, it's just an overall multiplicative factor. Now let's use a superposition on the first register: $$(|0\rangle+|1\rangle)|u\rangle\... 8 You should know a bound on the eigenvalues (both upper and lower). As you say, you can then normalise A by rescaling t. Indeed, you should do this to get the most accurate estimate possible, spreading the values \lambda t over the full 2\pi range. Bounding the eigenvalues is not typically a problem. For example, you're probably requiring your matrix ... 6 Good question. The answer turns out to be Yes. You don't even need the vector to be normalized. Watch: Start with the definition of eigenvalues and eigenvectors:$$ \begin{align} U|\psi\rangle &= \lambda |\psi\rangle\\ \end{align} $$Conjugate and transpose both sides of the equation:$$ \begin{align} \langle\psi|U^\dagger &= \langle \psi| \...

5

It depends on the papers but I saw 2 approaches: In most of the papers I read about the HHL algorithm and its implementation, the Hamiltonian evolution time $t$ is taken such that this factor disappear, i.e. $t = t_0 = 2\pi$. The approximate eigenvalue is often written $\tilde \lambda$. In some paper this notation really means "the approximation of the ...

5

@user1271772's answer is excellent, and absolutely the right answer. I just wanted to add in some additional perspective, given recent questions regarding Hamiltonians. Many physicists start from the Hamiltonian being the underlying thing that determines evolution, and unitaries are derived as a consequence. They start from the Schrödinger equation, $$i\... 5 Neither. Phase estimation algorithm does not estimate a property of a qubit state (and the angles \theta and \varphi in your question are exactly that - a property of a given qubit state). Rather, it estimates the eigenvalue of a given unitary U that corresponds to the given eigenvector |\psi\rangle - the angle \alpha in the following equation: ... 3 As a general rule, just because you can produce controlled-U, it does not mean that you can produce controlled-U^{2^k} with the same complexity. Modular exponentiation is a very special case where it turns out that you can. It is probably worth noting (iirc) that even if the best way of implementing controlled-U^{2^k} is with 2^k controlled-Us, ... 3 These two circuits produce the same results - in both cases you'll get |0\rangle \otimes |\psi\rangle with 50% probability or |1\rangle \otimes U|\psi\rangle with 50% probability. But I don't think this is going to help you with the phase estimation algorithm. In quantum phase estimation application of U^c is followed by inverse Fourier transform ... 3 Let me augment the discussion by adding some insight into the derivation of the estimate provided. This will give you a good understanding of when the result is an approximation and when it is precise. After the algorithm has run, we are left with the following state on the first register:$$\frac{1}{2^{n}}\sum_{x=0}^{2^n - 1} \sum_{k=0}^{2^n - 1}e^{-\frac{...

3

The $U$ used in phase estimation is not only a diagonal matrix with the same diagonal elements. Instead, it is an arbitrary unitary matrix. The way that you analyse it, instead, is that the input $|u\rangle$ is specifically chosen to be an eigenvector of $U$. That means $U|u\rangle=e^{i\phi}|u\rangle$. But there are different eigenvectors with different ...

3

I don't see the need for the swap gate either. Although I also don't think you need the set of swap gates that you're wanting. Remember that the standard implementation of the Fourier transform outputs the binary string $j\in\{0,1\}^4$ where the eigenvalues are of the form $2\pi j/16$ but in reverse order, so the least significant bit is at the top, and the ...

3

If this is part of a debugging effort then you can use the DumpRegister function. If you have a qubit q which is in the general state $\alpha|0\rangle + \beta|1\rangle$ where $\alpha$ and $\beta$ are complex numbers such that $|\alpha|^2+|\beta|^2=1$. DumpRegister([q]) will give an output like this (Having Different Numbers) # wave function for qubits with ...

2

What am I missing here? Where did the factor of $\frac{t}{2\pi}$ vanish in their algorithm? Remember that in Dirac notation, whatever you write inside the ket is an arbitrary label referring to something more abstract. So, it is true that you are finding the (approximate) eigenvector to $U$, which has eigenvalue $e^{-i\lambda t}$ and therefore what you're ...

2

$$x^0 \bmod N = 1 \implies x^r \bmod N = 1$$ as by definition, $r$ is the order of $x \bmod N$ i.e. $r$ is the least integer that satisfies $x^r=pN+1$ for some integer $p$.

2

Was a clarifying comment: If I'm interpreting your confusion correctly. You're thinking you just need to say $e+1 \leq l$ not the $l \leq 2^{t-1}$ part. After all there is no such coefficient as $\alpha_{100000}$ if $t$ is only 3 for example. All that $2^{t-1}$ is doing is making sure there are only $2^t$ coefficients. That is it is a qudit with $d=t$. Is ...

2

Based on comment by DaftWullie and my experience with the algortihm, it seems that a title of the article is misleading. The authors claim that algorithm they proposed is efficient. However, this is true only partialy. The authors devised only part of an algorithm for solving TSP. In particular, they are able to calculate length of a Hamiltonian cycle ...

2

One thing that I noticed. If cu3 gate from $q$ to $q$ is some $U$, then the cu3 from $q$ to $q$ should be $U^2$ in the phase estimation algorithm, but the comparisons of operators with the help of numpy.array showed me that it's not true here. I tried to implement by replacing cu3 part of the QASM code with the following: cu3(1.6, -1.12, 2.03) q[...

2

I would just like to share a code for testing a phase measurement on IBM Q: OPENQASM 2.0; include "qelib1.inc"; qreg q; creg c; //measuring theta in //(|0> + |1>*exp(i*theta)) h q; //(|0> + |1>) t q; //(|0> + |1>*exp(i*pi/4)) //s q; //(|0> + |1>*exp(i*pi/2)) //u1 (pi/8) q; //(|0> + |1>*exp(i*pi/8)) h q; ...

2

Answer to the second question: Here is the circuit for measuring in $M{{({{\theta }_{k}})}_{\pm }}=\left\{ 1/\sqrt{2}\left( |0\rangle \pm {{e}^{-i{{\theta }_{k}}}}|1\rangle \right) \right\}$ basis. I assume here that $\theta_k$ is given: circuit.u1(theta_k, q) # q is one of the qubits circuit.h(q) circuit.measure(q, c) #c is a ...

2

An example of constructing (with help of Qiskit) a controlled version of some simple 4x4 unitary matrix: $$U = \begin{pmatrix} \mathrm{e}^{i g_1} & 0 & 0 & 0 \\ 0 & \mathrm{e}^{i g_2} & 0 & 0 \\ 0 & 0 & \mathrm{e}^{i g_3} & 0 \\ 0 & 0 & 0 & \mathrm{e}^{i g_4} \\ \end{pmatrix}$$ where $g_s$ are some given ...

2

I have not read the full details of the paper, but have attempted to skim over the most relevant bits to the question (i.e. I could easily have missed something). As I read the paper, they are doing some calculation with a fixed size of input, and they repeat it many times (see equation 58). They ask how many times do you have to repeat it to get the same ...

2

If you want to learn more generally about phase estimation, the book I am helping write has a whole chapter on it, Learn Quantum Computing with Python and Q# (chapter 8). Ping me here or via email and I can get you a discount code!

2

Phase estimation is the process by which you are given a controlled-$U$ unitary, and a state that you are promised is an eigenvector of $U$ with eigenvalue $e^{2\pi ix/2^t}$, then you can use a $t$-qubit register to affect the change $$|0\rangle^{\otimes t}|u\rangle\mapsto|y\rangle|u\rangle.$$ If $x$ is in integer, then the outcome is guaranteed to be $y=x$...

2

The statement that you’ve made about the size of the register that you use for phase estimation (the value of t) is correct. However, you don’t seem to have made any attempt to count the number of gates used in the circuit. To implement the phase estimation you need controlled-U, $U^2$, $U^4$, $U^8$, $U^{16}\ldots$ If you have to make these out of just ...

1

The expression you obtain after applying the QFT contains sums of the unit square, $e^{2\pi i/2^n}$, which sum up to 0 if you sum over the full range of $2^n$: $$\sum_{k=0}^{2^n - 1} e^{\frac{2\pi i}{2^n} k} = 0$$ See here for explanations why this is the case. Now the inner sum in the amplitudes will also sum up to 0, if $(x - 2^n\theta)$ is an integer,...

1

If you have the circuit, you can get the registers the circuit acts on from eigs_circ.qregs. You can then create another circuit using the returned quantum register, add an instruction to it (initialize) and then add these two circuits together. Your final code should look something like qregs = eigs_circ.qregs # NB this is a list qc = ...

1

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

1

3 things I see from your implementation of inverse QFT: SWAP gates are missing prior to applying Hadamard gates and cu1 gates. The Hadamard gate should come first before cu1 gates. The angles of cu1 gates, how I understand inverse QFT, should be different. Here is inverse QFT that worked for me with not touching other parts of the code: def qft_dagger(...

1

So, are you asking whether it's possible (in the qubit case) to perform an arbitrary map of the form $$ae^{i\theta}|0\rangle+be^{i\phi}|1\rangle\rightarrow \frac{1}{\sqrt{2}}(e^{i\theta}|0\rangle+e^{i\phi}|1\rangle),$$ if $a$ and $b$ are unknown real numbers satisfying $a^2+b^2=1$? If this is the case, this is impossible. Consider a simple case where ...

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