diff --git "a/stack_exchange/QC/QCQ&A 2019.csv" "b/stack_exchange/QC/QCQ&A 2019.csv" new file mode 100644--- /dev/null +++ "b/stack_exchange/QC/QCQ&A 2019.csv" @@ -0,0 +1,44018 @@ +Id,PostTypeId,AcceptedAnswerId,ParentId,CreationDate,DeletionDate,Score,ViewCount,Body,OwnerUserId,OwnerDisplayName,LastEditorUserId,LastEditorDisplayName,LastEditDate,LastActivityDate,Title,Tags,AnswerCount,CommentCount,FavoriteCount,ClosedDate,CommunityOwnedDate,ContentLicense +8770,2,,8760,11/14/2019 18:22,,2,,"

In general, given two matrices $A$ and $B$ of dimensions $n_1\times n_2$ and $m_1\times m_2$, respectively, their tensor product $A\otimes B$ can be represented using the Kronecker product as +$$(A\otimes B)_{n_1 m_1,n_2m_2}=A_{n_1,n_2}B_{m_1, m_2}.$$ +The indices on the left hand side are a standard way to enumerate the integers from $1$ to $n_1 m_1$ and from $1$ to $n_2 m_2$. This is what you already observed in the case of $H\otimes H$, where two $2\times 2$ matrices become one $4\times 4$ matrix, whose elements are the product of elements of the two copies of $H$.

+",55,,,,,11/14/2019 18:22,,,,1,,,,CC BY-SA 4.0 +8775,1,,,11/14/2019 21:40,,3,99,"

Recently, I saw this article, Classical and Quantum Bounded Depth Approximation Algorithms where the author discusses the limitations of QAOA relative to classical approaches.

+ +

In particular, they state in the discussion:

+ +
+

""More generally, however, the results here point to a pattern. It seems like the QAOA is simply + a way of writing a quantum circuit which does something similar to a very simple classical algorithm: initialize spins + in some configuration and then update spins depending on those around it. For a one-step version of the algorithm, + the update is usually very simple: if the spins around it apply a strong enough force to the given spin, then it changes + in a way to increase the objective function. To the extent that the QAOA works, it seems that it works because + the classical algorithm works; there does not seem to be any general explanation in the literature as to why such a + quantum circuit should be better than such a classical algorithm.""

+
+ +

Caveat: I'm just coming to understand QAOA. That said, from my reading of the paper, it seems that the 'local' QAOA approaches discussed don't yield better approximation bounds than the comparable classical heuristics. Indeed, the authors appear to indicate that classical approaches may be better in some respects given the additional guarantees they can offer. Of course, QAOA can be applied to multiple optimization problems, so this may not be generalizable. Further, even the global QAOA doesn't appear to do much better – with classical approaches still offering better approximation.

+ +

Thus, my question is: Given our current understanding of quantum algorithms and the approaches they enable, can quantum approaches (like QAOA) yield provably better approximation bounds than classical algorithmic approaches on optimization problems?

+ +

Any specific example of a quantum approach with a known better approximation bound would be great; even better would be a complexity argument demonstrating that a quantum model of computation can enable better approximation than classical models.

+",1937,,26,,11/26/2019 20:04,11/26/2019 20:04,"Quantum algorithms, combinatorial optimization, and approximation bounds",,0,0,,,,CC BY-SA 4.0 +8776,1,8793,,11/14/2019 22:16,,3,711,"

In finance, a European call gives the buyer the right to buy some underlying asset such as a stock at some pre-determined strike price at a specific expiration date. The Black-Scholes equation is a fairly simple formula that can be easily written in Python for classical computing to value financial derivatives like the call option.

+ +

At the link below, IBM's cross-displinary quantum package for Python, Qiskit Aqua, seems to use qubits to price a European call option instead. Could someone give me a walk-through of what the code is doing line by line and how it compares to a classical Python code for pricing a European call? Are there any theoretical or numerical differences between classical and quantum pricing?

+ +

https://github.com/Qiskit/qiskit-aqua/blob/master/qiskit/finance/components/uncertainty_problems/european_call_expected_value.py

+ +

Also, is there an article being used as the source for the above Python script? My guess is that it's this one, but not sure since I don't yet have a background in matching quantum code with quantum formulas:

+ +

""Towards Pricing Financial Derivatives with an IBM Quantum Computer"" +https://arxiv.org/pdf/1904.05803.pdf

+",9118,,9006,,1/10/2020 14:14,5/4/2020 3:54,Quantum pricing of financial derivatives (call option) in Qiskit Aqua,,1,2,,,,CC BY-SA 4.0 +8778,1,8782,,11/14/2019 23:18,,2,222,"

I am starting to see a lot of classical quantitative problems such as linear regression being represented in quantum math, which suggests that almost anything based on frequentist statistics could be upgraded to the fancy 'braket' notation found in quantum math, in the same way that Bayesian interpretations of classical math models are currently abundant on the side line.

+

Ignoring the fact that anyone without a Masters in physics does not have the background to grasp or make a career out of quantum programming applied to their own discipline, at least what fundamental tenets, principles, and approaches, beyond just the qubit and circuitry theory, would help with the practical translation of existing classical math and Python code to their quantum counterparts? And is there a foreseeable demand in this sort of work, assuming that the quantumification of maths and code for some antiquated problem specific to some discipline at least generates a small speed-up over classical formulas and code?

+

Any holistic sources that discuss the impending migration from the classical to quantum paradigm math-wise would be great as well.

+",9118,,1768,,11/2/2022 7:21,11/2/2022 7:21,Translating classical math and code to quantum math and code,,2,0,,,,CC BY-SA 4.0 +8779,2,,8778,11/14/2019 23:59,,3,,"

At least currently, most of the translations being made are in extraordinarily specialized areas - for example, quantum chemistry / computational chemistry. A lot of the math involves mapping domain math to quantum computers - ab initio molecular simulations need to map their traditional annihilation/creation operators to the X, Y, Z gates in quantum computers (https://arxiv.org/abs/1001.3855).

+ +

There likely will be demand for people who are able to effectively create new domain-specific quantum algorithms / apply existing quantum algorithms to solve new problems.

+ +

A big point is that quantum computers will not be stronger at all operations! We will likely not need to mitigate over much common classical code; instead, quantum computers will act as accelerators for specific operations (much like GPUs for graphical operations).

+",8343,,26,,11/21/2019 20:01,11/21/2019 20:01,,,,0,,,,CC BY-SA 4.0 +8780,1,,,11/15/2019 0:06,,2,69,"

The Harrow-Hassidim-Lloyd (HHL) algorithm for quantum matrix inversion (linear algebra) bridges classical math to quantum math and has been adopted for quantumizing many classical applications, such as linear regression and deep neural networks.

+ +

Since solving a system of linear equations can alternatively be solved with optimization algorithms to attain an equivalent solution, how has the progress been with developing quantum versions of simple gradient-based and gradient-free algorithms used in classical optimization (e.g. gradient descent, coordinate descent, other gradient-free heuristics)? I've only come across quantum annealing so far. Some explanation of linked research articles or Python code would be nice.

+",9118,,,,,11/15/2019 0:06,Quantum Optimization algorithms,,0,0,,,,CC BY-SA 4.0 +8781,1,8784,,11/15/2019 0:48,,3,92,"

The idea of a qubit being able to exist for several values between 0 and 1 (superposition) makes it sound like it can do alot for probabilistic math problems, but for one task that comes instantly to mind, probabilistic sampling, or random number generation from a target probability distribution, how would the quantum version of doing this be implemented, and where exactly does superposition kick in? For this task, does superposition get its edge due to it capturing the entire distribution all at once somehow? And are other quantum properties like entanglement also being exploited.

+ +

Besides sampling, the usage of quantum to map and pre-emptively evaluate all possible outcomes for a utility, reward or loss function, for example, all seem to be related somehow, but I still can’t see what role superposition is playing in these sort of probabilistic tasks mathematically, compared to the binary 0 (false/off/no) and 1 (true/on/yes) classical case, which itself doesn’t invoke some correspondence to the task at hand either.

+",9118,,,,,11/15/2019 4:16,What does superposition do for quantum probabilistic sampling?,,1,0,,,,CC BY-SA 4.0 +8782,2,,8778,11/15/2019 1:13,,3,,"

Bra-ket notation is not necessarily tied to ""quantum math,"" it's simply a convenient notation in many circumstances. It may seem intimidating at first, but once you understand the basics (ket = vector, bra = covector) it's straightforward to grasp, as long as you have a solid understanding of Linear Algebra. If you are shaky on Linear Algebra, different notation is unlikely to help.

+ +

Quantum algorithms on the other hand are entirely different. These involve deep insights that may span several fields (particularly Math, CS and Physics), and I doubt that understanding them is easy for anybody (including physicists). Anybody from one of these three fields will certainly have a head start, but anyone with a STEM background and sufficient motivation should be able to learn the material. Nielsen and Chuang cite ""mathematical maturity"" as the key prerequisite.

+ +

Once the hardware is available to run meaningful quantum algorithms, I have no doubt that demand will vastly exceed supply of people capable of applying quantum algorithms to domain specific tasks. There is, however, a fair amount of uncertainty as to when that day will come.

+ +

I don't really know any references that match your request well, but you might find John Preskill's keynote address on NISQ era quantum computing helpful.

+",8623,,,,,11/15/2019 1:13,,,,0,,,,CC BY-SA 4.0 +8783,1,12030,,11/15/2019 1:40,,3,106,"

Are there, any journals out there that have been steadily publishing, or are dedicated to, research on existing or new and innovative quantum algorithms? Generalist titles are fine, but they can also be field-specific.

+",9118,,26,,11/16/2019 15:16,5/15/2020 7:16,Academic journals dedicated to quantum algorithms,,1,0,,,,CC BY-SA 4.0 +8784,2,,8781,11/15/2019 4:04,,4,,"

Classical computers are inherently deterministic, so they either generate pseudorandom numbers, or use an external physical process with statistically random noise to generate random numbers.

+ +

Quantum computers are inherently probabilistic, so generating true random numbers is very natural for them. Quantum random number generators are already on the market (e.g., IDQ).

+ +

This circuit

+ +

+ +

generates 0 or 1 on $c_0$, both with probability 0.5. Using $n$ quantum and classical registers configured identical to those above would randomly generate a number between $0$ and $2^n-1$.

+ +

In the circuit above, the Hadamard gate ($H$) transforms the qubit from a known state $\vert 0 \rangle$ to a superposition of states described by

+ +

$$H \vert 0 \rangle = \frac{\vert 0 \rangle + \vert 1 \rangle}{\sqrt{2}}.$$

+ +

If the Hadamard gate was removed, i.e. no superposition, there would be no randomness in the output since the measurement would read $\vert 0 \rangle$ every time (apart from noise).

+ +

More complicated circuits can be built to do more interesting sampling tasks, but I'm not sure what you are looking for specifically. This talk goes into more detail on the subject.

+ +

If you are new to quantum computing, you might need to work through a good textbook on the subject (the standard text is Nielson and Chuang) before any of this will make much sense.

+",8623,,8623,,11/15/2019 4:16,11/15/2019 4:16,,,,1,,,,CC BY-SA 4.0 +8785,2,,4179,11/15/2019 6:21,,0,,"

We can physically realise Quantum Randomness using Quantum Random Number Generators which harness quantum randomness through various processes such as boson sampling. When you look at a physical implementation of Quantum Randomness from Quantum Circuits, Hadamard transforms on Qubits would be an interesting approach. In addition, we can try techniques such as Bernoulli Trials or Quantum Oracles for realising Quantum Randomness from deterministic quantum circuits. Random Sampling of deterministic circuit is a recommended approach in this regard. Please find an interesting research concept note in this area. +http://www.hri.res.in/~iwqi12/iwqi12_talks/Poster_Akshata.pdf

+",4501,,,,,11/15/2019 6:21,,,,0,,,,CC BY-SA 4.0 +8786,1,,,11/15/2019 6:24,,-3,111,"

+ +

How can I have 150 or more credits? +I mean I want to have '150/150 credits'.

+",8901,,26,,11/16/2019 15:00,11/16/2019 15:00,How to get more credits?,,1,0,,11/16/2019 15:00,,CC BY-SA 4.0 +8787,1,,,11/15/2019 6:32,,2,72,"

I'm John and I have a question which I have been thinking about. I'm studying quantum information, especially, quantum error-correcting codes. When I learned some types of quantum codes (e.g. 5 qubits code or quantum Hamming code), I thought the following condition is also a necessary condition for quantum codes, but I have no idea to prove it. Could anyone prove it although it might be false?

+ +

Let $\mathbb{P}=\{P_1,...,P_n\}$ be a projection measurement, $\rho$ an $m$ qubits codeword and $U_i$ a unitary operator which represents an error ($i=1,...,m$:position of error). Then, the condition is +$$\forall k_1,k_2\in \{1,...,n\}, \forall i\in \{1,...,m\},\mathrm{Tr}(P_{k_1}U_i\rho U_i^\dagger)\neq 0 \land \mathrm{Tr}(P_{k_2}U_i\rho U_i^\dagger)\neq 0\\ \Rightarrow \frac{P_{k_1}U_i\rho U_i^\dagger P_{k_1}}{\mathrm{Tr}(P_{k_1}U_i\rho U_i^\dagger)}=\frac{P_{k_2}U_i\rho U_i^\dagger P_{k_2}}{\mathrm{Tr}(P_{k_2}U_i\rho U_i^\dagger)}$$

+",9136,,55,,12/7/2020 11:55,12/7/2020 11:55,About a necessary condition for quantum error correcting codes,,1,0,,,,CC BY-SA 4.0 +8788,2,,8767,11/15/2019 6:44,,5,,"

D-Wave's 2000Q is a quantum annealer, not a circuit-based quantum computer like Google's Sycamore. The qubits in D-Wave's system are much noisier, less controlled and perform a fundamentally different type of computation compared to Google and IBM's circuit-based quantum computers.

+ +

D-Wave's current system cannot simulate the observable universe or the human brain. What led you to believe this? Despite the large number of qubits, noise and lack of control prevent their present system from any hope of demonstrating quantum supremacy.

+ +

According to John Preskill (here)

+ +
+

...as of now we don't have a convincing theoretical argument or + persuasive experimental evidence indicating that quantum annealers can + really speed up the time to solution compared to the best classical + hardware running the best algorithms for the same problems.

+
+",8623,,,,,11/15/2019 6:44,,,,0,,,,CC BY-SA 4.0 +8789,2,,8769,11/15/2019 7:18,,1,,"

The way that I approach the calculation is quite different. I think of +$$ +e^{i\frac{\theta}{2}\sum_n X_i}=\prod_ne^{i\frac{\theta}{2}X_i}. +$$ +So, this means that you can consider the term +$$ +e^{i\frac{\theta}{2}\sum_n X_i}S_Me^{-i\frac{\theta}{2}\sum_n X_i} +$$ +on a qubit-by-qubit basis. You'll have terms like +$$ +e^{i\frac{\theta}{2}X}Ze^{-i\frac{\theta}{2}X}, +$$ +where $Z$ might be replaced by $Y$ (doesn't make any difference to the forthcoming analysis). Recall that $e^{i\frac{\theta}{2}X}=\cos\frac{\theta}{2} I+i\sin\frac{\theta}{2} X$. This lets us use the anti-commutation of $Z$ with $X$: +$$ +Z(\cos\frac{\theta}{2} I-i\sin\frac{\theta}{2} X)=(\cos\frac{\theta}{2} I+i\sin\frac{\theta}{2} X)Z. +$$ +This means that our per-qubit term has become +$$ +e^{i\frac{\theta}{2}X}Ze^{-i\frac{\theta}{2}X}=e^{i\frac{\theta}{2}X}e^{i\frac{\theta}{2}X}Z=e^{i\theta X}Z. +$$ +So, overall we have +$$ +\text{Tr}\left(e^{i\theta\sum_n X_i}S_MG\right), +$$ +at which point we just use that $S_MG=G$.

+",1837,,,,,11/15/2019 7:18,,,,4,,,,CC BY-SA 4.0 +8790,2,,8787,11/15/2019 7:30,,1,,"

I don't believe that this is true (at least without further qualifiers). If I'm correctly understanding what you're trying to convey, I think we can essentially simplify this statement to asking whether there can exists a state $|\psi\rangle$ and two projectors $P_1$ and $P_2$ such that $$P_1|\psi\rangle\neq P_2|\psi\rangle$$ (ignoring normalisation for simplicity). If so, your statement is false.

+ +

Now, let $|\phi\rangle$ be a state that is orthogonal to $|\psi\rangle$. Then we can choose +$$ +P_1=\frac{1}{2}(|\psi\rangle+|\phi\rangle)(\langle\psi|+\langle\phi|),\qquad P_2=\frac{1}{2}(|\psi\rangle-|\phi\rangle)(\langle\psi|-\langle\phi|) +$$ +Now if you want to start imposing specific properties of syndrome measurements for error correcting codes, that might be a different story... (even then, you might want to distinguish between non-degenerate codes and degenerate codes. Without much thought, I guess your statement is true for syndrome measurements on a non-degenerate code).

+",1837,,,,,11/15/2019 7:30,,,,1,,,,CC BY-SA 4.0 +8791,2,,8763,11/15/2019 8:02,,4,,"

This is a neat idea. However, having individual overlaps being small isn't sufficient in a quantum system. For example, imagine the set of overlaps +$$ +\langle V_1|V_N\rangle=0,\qquad \langle V_1|V_n\rangle=\langle V_N|V_n\rangle=\epsilon \quad \forall n=2,\ldots,N-1, \langle V_n|V_m\rangle=0 \quad \forall n,m=2,\ldots,N-2 +$$ +Remember that these are supposed to be simulating orthogonal states, so starting from $|V_1\rangle$, you should never be able to get to $|V_N\rangle$. Now consider the Hamiltonian +$$ +H=\sum_{n=2}^{N-1}|V_n\rangle\langle V_n|, +$$ +evolving the state +$$ +e^{-iHt}|V_1\rangle. +$$ +The evolution occurs in a 3-dimensional subspace spanned by +$$ +|V_1\rangle, |\Psi\rangle=\frac{1}{\sqrt{N-2}}P\sum_{n=2}^{N-2}|V_n\rangle, |V_N\rangle +$$ +where $P$ represents the projection onto the subspace orthogonal to $|V_1\rangle,|V_N\rangle$ and normalisation.

+ +

Now, $\langle \Psi|H|V_1\rangle=\langle \Psi|H|V_N\rangle\sim\epsilon\sqrt{N}$ (I'm not calculating this carefully here), and we can calculate other similar terms so that the Hamiltonian in this 3-dimensional subspace becomes +$$ +\approx\left(\begin{array}{ccc} +N\epsilon^2 & \sqrt{N}\epsilon & N\epsilon^2 \\ +\sqrt{N}\epsilon & 1 & \sqrt{N}\epsilon \\ +N\epsilon^2 & \sqrt{N}\epsilon & \sqrt{N}\epsilon +\end{array}\right), +$$ +where the matrix it's supposed to be simulating is +$$ +\left(\begin{array}{ccc} 0 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 0 \end{array}\right). +$$ +For large $N$, these are very different. For example, the first matrix can almost perfectly transfer the state $|V_1\rangle$ to $|V_N\rangle$ in time $\pi/(1+2N\epsilon^2)$, and this is something you could easily measure for reasonable choices of, say $|V_1\rangle=|0\rangle^{\otimes N'}$ and $|V_N\rangle=|1\rangle^{\otimes N'}$ because to detect that the state is no longer in $|V_1\rangle$, it would be sufficient to perform a simple magnetisation measurement, or similar.

+",1837,,1837,,11/16/2019 7:32,11/16/2019 7:32,,,,6,,,,CC BY-SA 4.0 +8792,2,,8786,11/15/2019 8:21,,2,,"

The point of the credits system is to make access to the devices fair so that everyone can take a turn at using them. You cannot get that number of credits as it would mean you could add a lot of jobs to the queue, slowing down response times for everyone else. I don't think there is any simple way to increase the number of credits you have.

+ +

I would suggest running jobs on the simulator if you need to run that many credits worth of jobs, as simulator jobs don't use up any credits.

+",5955,,,,,11/15/2019 8:21,,,,1,,,,CC BY-SA 4.0 +8793,2,,8776,11/15/2019 8:27,,2,,"

There are tutorials for a lot of the Qiskit Aqua functions kept in the tutorials repository, and I think this talks about the finance problem you are interested in.

+ +

All of these tutorials are also available on the IBM Q Experience where you can run them in a browser.

+",5955,,,,,11/15/2019 8:27,,,,0,,,,CC BY-SA 4.0 +8794,1,,,11/15/2019 10:32,,6,1082,"

I understand that the partial trace is a linear map, a completely positive map and a trace-preserving map. However, I have no idea how to define a quantum channel with the partial trace because partial trace depends on an index $i$(i.e. $i$ of $\mathrm{Tr}_i(\rho)$). Intuitively, the index $i$ is random, but then I don't know how to define a map that represents the partial trace. Could anyone teach me the definition of a quantum channel using the partial trace?

+",9136,,55,,11/24/2020 14:22,5/17/2021 9:08,How to define a quantum channel for the partial trace?,,2,1,,,,CC BY-SA 4.0 +8795,2,,8794,11/15/2019 11:23,,6,,"

The first and foremost thing to realize is that the partial trace over a density matrix is indeed a linear CPTP map $\Lambda$, but it is not a map from any $\mathcal{C}^{n\times n} \rightarrow \mathcal{C}^{n\times n}$ (i.e. to `itself' - the same dimension), but rather to a density operator space with a lower dimension: $\mathcal{C}^{n\times n} \rightarrow \mathcal{C}^{m\times m}$ with $m < n$.

+

For this reason, some of the common representations are not really usable; representations of a map $\Lambda$ like the Choi matrix or the $\chi$-matrix are often only used for maps that preserve the dimension.

+

However, if you are familiar with Kraus operators, they do offer a very straightforward representation. A partial trace over some index $i$ can be seen as the following operation:

+

\begin{equation} +tr_{i} \big[\rho\big] = \sum_{j} \Big(I^{\otimes i-1}\otimes \langle{j}|\otimes I^{\otimes n-i}\Big) \rho \Big(I^{\otimes i-1}\otimes |{j}\rangle\otimes I^{\otimes n-i}\Big) +\end{equation} +That is, if I want to trace out the $i$-th qubit of some system of $n$ qubits described by $\rho$, I sum over an entire basis $\{|j\rangle \}$ on that qubit, and I do nothing (i.e. $I$, the identity operator) on all other $n-1$ qubits.

+

This representation allows us to obtain a straightforward Kraus representation of the map:

+

\begin{equation} +A_{j} = I^{\otimes i-1}\otimes \langle{j}|\otimes I^{\otimes n-i}, +\end{equation}

+

which is an operation that acts trivially on the first $i-1$ qubits and last $n-i$ qubits, and only acts nontrivially on the $i$-th qubit. Note that the Kraus operator is not square, which reflects the fact that the linear map is from a space of higher dimension to a space of lower dimension.

+

Furthermore, note that we are free to choose what basis we use for $\{|j\rangle \}$; the computational basis is often used. This reflects the fact that a set of Kraus operators for a map is not unique.

+

Generalization to tracing out more qubits is easily done by either applying the single-qubit trace in succession, or by replacing the $I$ operator of the specific qubit by a ket state as well - an important thing to notice here is that one needs to sum over the entire basis of the combined qubits that are being traced out. (That means that to trace out $k$ qubits there are $2^{k}$ Kraus operators associated with that map.)

+",8141,,8141,,11/24/2020 22:02,11/24/2020 22:02,,,,5,,,,CC BY-SA 4.0 +8797,1,8798,,11/15/2019 13:14,,3,172,"

The problem of quantum simulation can be formulated as follows:

+ +
+

Given a Hamiltonian $H$ ( $2^n \times 2^n$ hermitian matrix acting on $n$ qubits), a time $t$ and maximum simulation error $\epsilon$, the goal is to find an algorithm that approximates $U$ such that $ || U - e^{-iHt}|| \leq \epsilon $, where $ e^{-iHt}$ is the ideal evolution and $|| \cdot ||$ is the spectral norm.

+
+ +

I was wondering, how can you compare the result of your algorithm with an ideal evolution? It would make sense, if this ideal evolution could be calculated analytically, but I think it's rarely the case. This $e^{-iHt}$ could be also given by an oracle, but in a real world scenario we just cannot use such an approach.

+ +

So, how can you actually compare the result of your approach with something, that cannot be efficiently obtained (in fact, if it could be obtained efficiently, then the whole idea of designing other algorithm to approximate this result doesn't make sense anymore).

+",2098,,,,,11/15/2019 14:58,How is the precision of a quantum simulation algorithm actually proved?,,1,0,,,,CC BY-SA 4.0 +8798,2,,8797,11/15/2019 14:58,,4,,"
+

how can you compare the result of your algorithm with an ideal evolution?

+
+ +

You cannot and you do not need to.

+ +

As you said, computing $e^{-iHt}$ is intractable for most of the interesting cases. If it was not, chemistry simulations would be easy, solving the Schrödinger equation too.

+ +

The thing you can do though is to prove that your algorithm will, for a (potentially restricted) set of Hamiltonians, output a unitary $U$ that satisfy the condition $||U - e^{-iHt}|| \leqslant \epsilon$. You do not compare the output of your algorithm with the ideal evolution, you prove that your algorithm is guaranteed to return a result that satisfy the condition.

+ +

If you are more familiar with computer science, these are pre/post-conditions. +Applied to the definition of Hamiltonian simulation you gave:

+ +
    +
  • Pre-conditions are: + +
      +
    1. The matrix given should be Hermitian.
    2. +
    3. The matrix given should be of size $\left( 2^n, 2^n \right)$ with $n \in \mathbb{N}^*$.
    4. +
    5. $t \in \mathbb{R}$ (note that I did not excluded negative times, it might be an error from my side).
    6. +
    7. $\epsilon \in \mathbb{R}^*_+$.
    8. +
  • +
  • Post-conditions are: + +
      +
    1. $U$ is a quantum circuit composed of quantum gates.
    2. +
    3. The unitary matrix ""implemented"" by $U$ satisfy $||U - e^{-iHt}|| \leqslant \epsilon$.
    4. +
  • +
+ +

Any algorithm that solve the Hamiltonian Simulation problem should, when the pre-conditions are checked (i.e. the user gave correct inputs), return a result that verify the post-conditions above.

+",1386,,,,,11/15/2019 14:58,,,,1,,,,CC BY-SA 4.0 +8799,1,9661,,11/15/2019 15:48,,1,217,"

In Nielsen and Chuang Quantum Computation and Quantum Information book section 1.5.1 describing the Stern-Garlach experiment, it says: ""Hydrogen atoms contain a proton and an orbiting electron. You can think of this electron as a little 'electric current' around the proton. This electric current causes the atom to have a magnetic field;"" I thought the view of an electron orbiting the nucleus is outdated, replaced by the model of a probabilistic cloud around the nucleus in modern quantum physics view.

+ +

Can anyone help me to understand the relationship between the two views today? (I majored in computer science, without much formal education in modern physics.) Thanks.

+",8321,,26,,11/16/2019 14:53,1/26/2020 19:14,Atom magnetic moment caused by orbiting electron,,3,1,,,,CC BY-SA 4.0 +8800,1,8801,,11/15/2019 16:25,,-2,1370,"

When I try to install Qiskit using Pip install Qiskit I get the error as shown in the attached snapshot.

+ +

Any help will be highly appreciated.

+ +

+",9141,,26,,11/16/2019 14:51,11/16/2019 14:51,Problem in installing Qiskit,,1,2,,9/8/2022 10:18,,CC BY-SA 4.0 +8801,2,,8800,11/15/2019 18:45,,1,,"

This issue is within the pyscf package that is required by qiskit. It says here that this error may occur with certain versions of python, and I have seen it commonly coming up with python 3.8. There are some workarounds in that link, but if you have nothing forcing you to use python 3.8, I would suggest downgrading to the next newest version before that.

+ +

I have been running on python 3.7.5 (which you should be able to install by simply specifying python=3.7 when creating a new anaconda environment) and I do not see this error.

+",6180,,,,,11/15/2019 18:45,,,,2,,,,CC BY-SA 4.0 +8802,1,8803,,11/15/2019 19:28,,1,56,"

Suppose you had an ""analog"" quantum computer, where a register would store a wavefunction $\psi(x)$ where $x$ is a continuous variable (with $0\leq x\leq 1$, say). Instead of gates, you would somehow apply unitary operators to the wavefunction. In this context, it seems to me that the QFT would essentially be equivalent to changing to the momentum basis, $\psi(k)$. This could be done by using a different physical apparatus to measure the state of the register, and wouldn't require the actual application of any unitary operators to the wavefunction. Could there be a similar result for a qubit register which could be measured in two different non-commuting bases? If not, why?

+",9144,,,,,11/15/2019 21:40,Can a QFT be implemented as a physical change of the measurement basis?,,1,4,,,,CC BY-SA 4.0 +8803,2,,8802,11/15/2019 21:40,,2,,"

Yes, you can in principle do any measurement as a direct physical operation. The real obstacle is to come up with a way of actually doing it in practice.

+ +

The basis states of QFT-ish measurement span every qubit in the register. This means that whatever physical mechanism you are using must be merging together information as large as the register. But physics is local, and your measurement is not, implying you need to build up your big information-merging measurement out of many local interactions. That set of local interactions will probably be isomorphic to quantum gates.

+ +

For example, you can do a QFT-ish measurement on photons by putting a diffraction grating between them and the detectors... but isn't putting down the grating just a ultimately roundabout way of applying a gate before measuring?

+",119,,,,,11/15/2019 21:40,,,,3,,,,CC BY-SA 4.0 +8804,1,8805,,11/15/2019 22:39,,4,341,"

I have seen two similar proofs of the no-cloning theorem. They assume (to the contrary) that there exists a unitary operator $U$ such that $U |\psi\rangle |0 \rangle = | \psi \rangle | \psi \rangle$, For any possible $|\psi\rangle$. The proof does not seem to rule out the case that there exists a specific $U$ that can clone only the specific state $| \psi \rangle$. Discussion of the no-cloning theorem implies that there cannot be a specific $U$, which can only clone a certain state, even when the proof only proves that there cannot be a general $U$ which can clone any state. Is there a proof of this specific case somewhere? Or maybe I am missing something from the original proof.

+ +

(I am referencing the one in Nielsen and Chuang which ends with the contradicition that $\langle \psi | \phi \rangle = \langle \psi | \phi \rangle^2$.)

+",9149,,9149,,11/20/2019 4:48,11/20/2019 4:48,Premise of the proof of the No-Cloning Theorem,,2,0,,,,CC BY-SA 4.0 +8805,2,,8804,11/15/2019 22:47,,8,,"
+

The proof does not seem to rule out the case that there exists a specific U that can clone only the specific state |ψ⟩.

+
+ +

That's because you can clone specific states. Cloning is only impossible if the set of possible input states includes a pair of states that are not orthogonal.

+ +

For example, here is a circuit that performs $|\psi⟩ \to |\psi⟩|\psi⟩$ as long as $|\psi\rangle$ is promised to be exactly $|0\rangle$ or exactly $|1\rangle$ and never anything else:

+ +

+",119,,26,,11/16/2019 14:44,11/16/2019 14:44,,,,4,,,,CC BY-SA 4.0 +8806,2,,8799,11/16/2019 9:13,,0,,"

Yes. It is outdated, however, to explain something without sounding too abstract the old stationary orbiting solutions come handy.

+",9070,,,,,11/16/2019 9:13,,,,1,,,,CC BY-SA 4.0 +8807,2,,8804,11/16/2019 9:20,,1,,"

The real missing keyword in the stating the theorem is ""arbitrary unknown state""! If you have some information about $|\psi\rangle$, i.e. specific state, then perhaps you can reconstruct that state!

+",9070,,26,,11/16/2019 14:45,11/16/2019 14:45,,,,0,,,,CC BY-SA 4.0 +8808,1,,,11/16/2019 10:06,,3,656,"

Given two sets of $N$ uniformly random binary bitstrings of size $m$, such as $$(x_0,x_1,...,x_m) \space \forall x_i \in \{0,1\}.$$

+ +

One generated from a quantum device and the other generated by random uniform in Python. Knowing that quantum is really random and classical is pseudo-random, is there any statistical test to distinguish which one is classical and which one quantum?

+",9070,,26,,11/16/2019 14:41,11/19/2019 9:35,How to distinguish quantum random from classical random?,,3,2,,,,CC BY-SA 4.0 +8809,2,,8808,11/16/2019 11:40,,2,,"

Depends on what pseudorandom generator Python is using; if the pseudorandom generator is cryptographically secure, then it is computationally impossible to distinguish whether a bit string is generated by the pseudorandom generator or is truly random.

+ +

On the other hand, ""truly random"" quantum generator may fail classical randomness tests, because real-world quantum random number generation does not automatically guaranty uniformity (and requires some randomness extractor, quantum or classical, to make the output bit string computationally indistinguishable from uniform).

+",2105,,,,,11/16/2019 11:40,,,,0,,,,CC BY-SA 4.0 +8810,1,,,11/16/2019 17:08,,2,64,"

I have to test a simulator with a high number of random stabilizer circuits. +One way to create random stabilizer circuits is to generate random graph states and convert those to circuits, this, however, will always yield optimized circuits (in particular the entanglement gates will be optimized).

+ +

Is there a systematical way to generate randomized unoptimized stabilizer circuits? Can this algorithm take the starting state into account i.e. if the simulation will always start from $$|+\rangle = \left(\bigotimes\limits_{i=0}^{n-1} H_i \right)|0\rangle \ ?$$

+",9157,,26,,11/16/2019 17:25,11/16/2019 17:25,How to randomly generate unoptimized stabilizer circuits?,,0,3,,,,CC BY-SA 4.0 +8811,1,,,11/16/2019 17:09,,2,97,"

I've been meaning to implement Grover's Algorithm for the 3-bit case, wherein I need to implement a CCCNOT gate. How can this be done efficiently (i.e. as few Toffoli and/or CNOT as possible)?

+",9156,,,,,11/16/2019 17:09,How would one implement a 4-qubit CCCNOT gate (equivalent to controlled-Toffoli)?,,0,0,,11/19/2019 20:47,,CC BY-SA 4.0 +8812,2,,8808,11/16/2019 18:34,,3,,"

The idea behind pseudo-random number generators is to generate random numbers using the software, which is convenient and cost-effective. The pseudo-random number generators are one-way functions so if you know the seed you can predict their subsequent values but you cannot determine the sequence of values if you do not know the seed. Quantum randomness is physical randomness or the so-called true randomness. Mathematically, they both have the same statistical properties; provided large number of values are sampled from both of them. Thus, a well designed pseudo-random number generator would be as random as Physical (True) Quantum random number generators, so if you do not know the seed, you will not be able to distinguish them. The advantage of Physical (True) Quantum random number generators is that you cannot guess their values in any case.

+ +

If the pseudo-random number generator is not well designed then you can identify patterns in it like the infamous RANDU routine (https://en.wikipedia.org/wiki/Randomness_tests), which fails randomness tests.

+ +

In practice, physical source of randomness is often XORed with pseudo-random numbers to pass the randomness test. You may refer to https://en.wikipedia.org/wiki/Random_number_generation

+",8120,,,,,11/16/2019 18:34,,,,0,,,,CC BY-SA 4.0 +8814,1,8815,,11/17/2019 0:10,,6,451,"

In Nielsen and Chuang Quantum Computation and Quantum Information book section 2.2.6, a POVM of three elements are used to measure a single qubit in order to know for sure whether the state is $|0\rangle$ or $|+\rangle$ if the first two measurement results are obtained, and do not infer the state when the third result is obtained.

+ +

My question is: is it physically realizable to measure three possible results from a single qubit? I thought you can only get n bit of information measuring n qubits. Three outcomes is more than one bit.

+",8321,,55,,3/12/2021 19:45,3/12/2021 19:45,Are three POVM measurements on a single qubit physically realizable?,,2,0,,,,CC BY-SA 4.0 +8815,2,,8814,11/17/2019 2:31,,9,,"

Three outcomes amounts to more than one bit if the outcomes are all deterministic, and give you information about the original qubit.

+ +

But suppose I have a coin (that is either heads or tails). I roll a dice, and if it comes 1 through 5, I tell you ""H"" or ""T"", depending on what the coin is. If it comes up 6, I tell you ""6"".

+ +

There are three outcomes, but on average, you're only getting $\frac{5}{6}$ of a bit of information about the coin with each trial.

+ +

You're indeed getting more than one bit of information about the symbol I tell you, but if you get a ""6"", it doesn't tell you anything about my coin.

+ +

This is the way that Nielsen and Chuang's POVM works. You either learn $|0\rangle$, $|+\rangle$, or a third outcome (call it ""6"") that doesn't tell you anything about the qubit.

+",1765,,,,,11/17/2019 2:31,,,,2,,,,CC BY-SA 4.0 +8816,1,8826,,11/17/2019 11:33,,1,181,"

What does the notation $|\psi\rangle$ mean and how does it relate to the notation $|0\rangle$ and $|1\rangle$? Does $\psi$ have some connection to the one found in Shroedinger's equation?

+",9118,,9118,,11/17/2019 23:05,11/17/2019 23:05,What does $\lvert \psi \rangle$ mean?,,1,2,,,,CC BY-SA 4.0 +8817,1,8819,,11/17/2019 12:01,,2,73,"

If

+ +
    +
  1. quantum physics is a refinement of classical physics, and
  2. +
  3. quantum computing is a refinement of classical computing, and
  4. +
  5. classical computers use bits (binary digits) whereas quantum computers use qubits
  6. +
+ +

then are binary states (0,1) a significant and pervasive construct underpinning the theory of classical physics as opposed to quantum physics?

+",9118,,26,,11/18/2019 7:44,11/19/2019 9:44,Are binary states (bits) pervasive in classical physics?,,2,1,,,,CC BY-SA 4.0 +8818,1,8842,,11/17/2019 12:51,,5,92,"

Ewin Tang says to not expect exponential speed-ups from quantum machine learning using low-dimensional data because, in such cases, quantum analogues of classical algorithms will not provide outperformance.

+ +

What then is the definition of low-dimensional data exactly in classical machine learning for an array with $N$ rows and $K$ columns? Can such an array even be considered high-dimensional, and if so, in which direction ($N\gg K$ or $K\gg N$)? Or does high-dimensionality require that the array possess a third dimension ($N$, $K$ and $M$)?

+",9118,,9118,,11/17/2019 18:42,11/18/2019 23:59,Low-dimensional data and quantum machine learning,,1,0,,,,CC BY-SA 4.0 +8819,2,,8817,11/17/2019 13:57,,2,,"
    +
  1. Quantum computing is not a refinement of classical computing; it's simply a different paradigm of computing aimed at solving specific categories of problems more efficiently.

  2. +
  3. Quantum computing doesn't necessarily require qubits (cf. qudit); that's just a theoretical and experimental convenience. In fact, continuous-variable quantum computing seems to be a hot research area these days.

  4. +
  5. As for the broader question of whether the universe is 'discrete' or 'quantizable', you might find the concepts of digital physics and bit string physics interesting.

  6. +
+",26,,26,,11/17/2019 14:09,11/17/2019 14:09,,,,0,,,,CC BY-SA 4.0 +8820,1,,,11/17/2019 13:59,,10,646,"

Consider an arbitrary $n$-qubit state $\lvert \psi \rangle$. How much do we understand about the probability distribution of the fidelity of $\lvert \psi \rangle$ with a tensor product $\lvert \alpha \rangle = \lvert \alpha_1 \rangle \lvert \alpha_2 \rangle \cdots \lvert \alpha_n \rangle$ of Haar-random pure states $\lvert \alpha_j \rangle$?

+ +

It seems to me that the mean fidelity will be $1/2^n$ (taking fidelity to be measured in units of probability, i.e.$F(\lvert\alpha\rangle,\lvert\psi\rangle) = \lvert \langle \alpha \vert \psi \rangle \rvert^2$). For instance, we can consider the fidelity instead of $\lvert \psi \rangle$, subject to a tensor product of Haar-random single-qubit unitaries, with the state $\lvert 00\cdots0 \rangle$. It seems to me that, up to phases, the Haar-random unitaries on $\lvert \psi \rangle$ will in effect randomise the weights of the components of $\lvert \psi \rangle$ over the standard basis. The expected fidelity with any particular standard basis state would then be the same over all standard basis states, i.e. $1/2^n$.

+ +

Question.

+ +

What bounds we can describe on the probability, that the fidelity will will differ much from $1/2^n$ (either in absolute or relative error) — without making any assumptions about the amount of entanglement or any other features of $\lvert \psi \rangle$?

+",124,,55,,7/21/2022 9:45,7/21/2022 9:45,On the distribution of the fidelity of a random product state with an arbitrary many-qubit state,,2,4,,,,CC BY-SA 4.0 +8825,1,8828,,11/17/2019 16:25,,0,81,"

Is it $\theta$ or $\varphi$ as usually depicted on the Bloch sphere? In other words, is it the angle projected on the $xy$-plane or is it the one on a plane that intersects the $z$-axis of the Bloch sphere? How could I have answered this myself?

+ +

+",9165,,,,,11/17/2019 19:43,Which angle is estimated by the phase estimation algorithm?,,1,0,,,,CC BY-SA 4.0 +8826,2,,8816,11/17/2019 17:12,,8,,"

The notation $\lvert \alpha \rangle$, $\lvert \psi \rangle$, etc. just indicates that the thing in question is a vector. Furthermore, it is extremely common that the following things are also intended (in that one really should say if any of these things do not hold):

+ +
    +
  • $\lvert \psi \rangle$ is a column vector.
  • +
  • $\lvert \psi \rangle$ is not the zero vector.
  • +
  • $\lvert \psi \rangle$ has complex coefficients (and in particular its not necessarily restricted to real coefficients).
  • +
  • $\lvert \psi \rangle$ has unit Euclidean norm.
  • +
+ +

Such a vector is usually called a state-vector, or sometimes a (pure) state.

+ +

The symbol $\lvert \psi \rangle$ in particular, like a bold-face $\mathbf v$ in the context of vector algebra, is often used just as a generic choice of symbol or variable. It does relate to the wave function $\psi$ in Schrödinger's equation, in that the wave function $\psi$ can be interpreted as a state vector in a very large vector space.

+ +

The notation of putting $\psi$ in asymmetrical brackets (technically, a ""ket"": one reads $\lvert \psi \rangle$ either as ""psi"" or ""ket-psi"" by convention) is a part of Dirac notation. There is a corresponding dual object $\langle \psi \rvert = \lvert \psi \rangle^\dagger$ called a ""bra"" (we read $\langle \psi \rvert$ as ""bra-psi""), and when you multiply a bra and a ket, you evaluate an inner product (or a ""bracket""): +$$ \bigl( \langle \alpha \rvert \bigr) \bigl( \lvert \psi \rangle \bigr) = \langle \alpha \vert \psi \rangle = \langle \alpha, \psi \rangle.$$ +Thus, you'd often see the normalisation condition on state vectors written as $\langle \psi \vert \psi \rangle = 1$. You will often see people talk about some state vectors $\lvert \alpha \rangle$ and $\lvert \beta \rangle$ being orthogonal: this can be denoted by $\langle \alpha \vert \beta \rangle = 0$.

+ +

The symbols $\lvert 0 \rangle$ and $\lvert 1 \rangle$ are a (very frequently occurring) special case. They indicate standard basis vectors, usually of $\mathbb C^2$, which have a 1 in one position and 0 everywhere else, and which are orthogonal to one another: +$$ \lvert 0 \rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix}, \qquad\lvert 1 \rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix}. $$ +Elsewhere in mathematics, these might be written instead as $\mathbf e_0$ and $\mathbf e_1$.

+ +
    +
  • It's reasonably common to consider such vectors indexed by other integers, e.g. $\lvert 2 \rangle$, $\lvert 3 \rangle$, etc.: these are then standard basis vectors $\mathbf e_2$, $\mathbf e_3$, etc. in a vector space of dimension greater than 2.

  • +
  • It is also common to see vectors indexed by binary strings, e.g. $\lvert 001 \rangle$: this is a standard basis state of a system consisting of multiple qubits, in this case identified with the Kronecker product $\lvert 0 \rangle \otimes \lvert 0 \rangle \otimes \lvert 1 \rangle = \mathbf e_0 \otimes \mathbf e_0 \otimes \mathbf e_1 =: \mathbf e_{001}$.

  • +
  • It is also common to see vectors indexed by elements of an arbitrary (though usually finite) set, e.g. $\lvert v \rangle$ for a vertex $v$ of some graph $G$. This is just a standard basis vector in some vector space, indexed by (the elements of) the set in question.

  • +
  • More generally, it is very very common to write $\lvert \text{(expression)} \rangle$, where $\text{(expression)}$ is some variable or formula on variables ranging over some set. This just represents a standard basis vector which is being indexed by that expression. For instance, to take an arbitrary example, for $x,y, z\in \mathbb Z_8$, we may write $\lvert z{+} xy \rangle =: \mathbf e_{z{+}xy} $ (a standard basis state of a vector space of dimension eight, indexed by elements of $\mathbb Z_8$), in which case we should understand from context that ""$+$"" is the addition operation in the ring of the integers modulo 8, and ""$xy$"" is the product of $x$ and $y$ in that same number system.

  • +
+ +

There are more special cases in Dirac notation, which might not be the most sensible notation from a general point of view (they are the equivalent of ""irregular verbs"") but which are in heavy use and which are useful shorthand:

+ +
    +
  • $\lvert + \rangle$ represents the specific state $\tfrac1{\sqrt 2}(\lvert 0 \rangle + \lvert 1 \rangle)$.

  • +
  • $\lvert - \rangle$ represents the specific state $\tfrac1{\sqrt 2}(\lvert 0 \rangle - \lvert 1 \rangle)$.

  • +
  • Generalising the correspondence above with the symbols $+$ or $-$ in the kets, and the idea that you can have expressions in your kets, the symbol $\lvert \pm \rangle$ represents either one (or the set of both) of the two state vectors $\tfrac1{\sqrt 2}(\lvert 0 \rangle \pm \lvert 1 \rangle)$.

  • +
  • Physicists often put arrows in their kets: for example, $\lvert \uparrow \rangle$, $\lvert \downarrow \rangle$, $\lvert \rightarrow \rangle$, +$\lvert \nearrow \rangle$, and others generally refer to spin states or polarisations in physical systems, where the arrow literally refers to some spacial orientation.

  • +
+ +

In general, you can put pretty much any symbol in a bra or a ket that you like, and it will be immediately understood to refer to some state or functional. Because of the conventions above, this can allow you to quickly import some meaning which the symbols might have in a closely related context. (Though you should choose your notation carefully and explain it if it is not in very common usage.)

+ +

Hopefully this clarifies some of what's going on with the notation.

+",124,,124,,11/17/2019 18:33,11/17/2019 18:33,,,,0,,,,CC BY-SA 4.0 +8827,1,,,11/17/2019 19:06,,1,34,"

In classical optimization problems, some objective function's surface serves as a landscape for finding its minimum through minimization algorithms.

+ +

Instead of your typical U-shaped objective surface (e.g. the squared loss function), consider instead a W-shaped surface, implying two pockets where one pocket must contain the global minimum, while the other only holds a local minimum.

+ +

Quantum annealing, in contrast to classical simulated annealing, has an additional ability to evaluate both pockets of the W-shape concurrently, from what I understand based on 'parallel universes' or quantum parallel computation that classical, sequential optimization can't. How much of this ability is due to superposition, entanglement and teleportation?

+ +

(It seems to me like superposition and entanglement both contribute to overall parallelizing behavior, but with one being an option reserved for certain applications, outside of, or such as, quantum annealing.)

+ +

Could someone also go into detail about the maths/circuitry behind this process, of how quantum annealing is designed to jump between or parallelize the optimizer in two or more different locations of the objective surface at once?

+ +

A referral to a Python package that demonstrates quantum annealing would be good too.

+",9118,,26,,11/17/2019 21:23,11/17/2019 21:23,Entanglement and teleportation in quantum annealing and parallel computation,,0,0,,,,CC BY-SA 4.0 +8828,2,,8825,11/17/2019 19:43,,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:

+ +

$$U|\psi\rangle = e^{2i\pi\alpha}|\psi\rangle$$

+ +

Wikipedia article on phase estimation has more details on the algorithm.

+",2879,,,,,11/17/2019 19:43,,,,0,,,,CC BY-SA 4.0 +8829,2,,8814,11/17/2019 20:13,,1,,"

Thanks Peter for the clarification about information vs. outcomes. I accept his answer to acknowledge that, and want to add the possible construction of such measurement.

+ +

In the same book section 2.2.8, a general method is described. In this case, one can add two qubits prepared as $|00\rangle$, apply a unitary on the three qubits and measure the two ancillary ones to get classic value 0, 1, or 3. Clearly to get 3 outcomes upon measurements, we do need at least two qubits to be measured. However, we already know the two ancillary ones, the measurements do not give new information about the ancillary ones.

+",8321,,,,,11/17/2019 20:13,,,,0,,,,CC BY-SA 4.0 +8830,1,8831,,11/17/2019 20:53,,6,988,"

Superdense encoding allows us to transmit the information of two classical bits using a single qubit with a pre-shared Bell state qubit pair. We can duplicate the construct to transmit $2n$ classical bits using $n$ qubits. My question is: can we do better by using fewer qubits by leveraging multiqubit entanglement?

+ +

Superdense coding applies $I, X, Z, XZ$ operator on a single qubit to get $4$ different outcomes. For $n$ qubits, if we can only apply these four operators on individual qubits, then $4^n$ combinations are possible. Given $4^n=2^{2n}$, one can only get information of $2n$ classical bits. I know it's a big ""if"". Is that assumption correct since Pauli group forms a basis for all operators?

+ +

Sorry I am a beginner in this subject and am not clear about many concepts yet. Also apologize if the answer is already embedded in some earlier thread. Thanks.

+",8321,,55,,11/18/2019 10:16,11/18/2019 10:16,Can superdense coding be made more efficient?,,1,1,,,,CC BY-SA 4.0 +8831,2,,8830,11/17/2019 22:14,,6,,"

No, you can't send more than 2 bits per transmitted qubit. Ultradense Coding would allow FTL Signalling.

+ +

The basic problem is that, if either teleportation or superdense coding was slightly more efficient, iteratively nesting them inside of each other would allow you to send more encoded qubits than the number of physical qubits you sent. Suppose you could ultradense code 3 bits into 1 sent qubit. Send 2 ultradense qubits, equivalent to 6 bits, but use those 6 bits to power teleportation of 3 qubits, which are actually ultradense coding 9 bits, which are teleporting 4 qubits, which are coding 12 bits, which are teleporting 6 qubits, which are coding 18 bits, teleporting 9 qubits, coding 27 bits, teleporting 13 qubits, coding 39 bits, ... you get the idea.

+ +

Throw an error detecting code on top, and the receiver can just guess at the initial teleportation bits and see if it worked. This would presumably allow them to receive the message before you even send it, which is clearly a problem.

+",119,,,,,11/17/2019 22:14,,,,1,,,,CC BY-SA 4.0 +8832,1,8835,,11/18/2019 1:01,,8,419,"

This is a follow-up question to a previous question I had, where the correct answer was to use the Kronecker product.

+

Given, for example, a vector representing two qubits $$\begin{bmatrix}0 \\ 1 \\ 0 \\ 0\end{bmatrix}$$ is there an algorithm to decompose it into two vectors $$\begin{bmatrix}1 \\ 0\end{bmatrix}$$ and $$\begin{bmatrix} 0 \\ 1\end{bmatrix}$$

+

If so, does this generalize to N qubits? I suspect the procedure doesn't scale well computationally (hence the entire point of quantum computing) but I'm still curious to know whether and what form the algorithm may take.

+",5289,,2927,,11/3/2021 1:25,11/3/2021 1:25,How to efficiently calculate the inverse of a Kronecker product?,,3,1,,,,CC BY-SA 4.0 +8833,1,8834,,11/18/2019 3:04,,2,304,"

Say I have some qubit $|q\rangle = \alpha |0\rangle + \beta |1\rangle$. If I apply some unitary $U$, I get $U |q\rangle$; great. I can also think of $U$ as a change-of-basis matrix that maps the $|0\rangle, |1\rangle$ basis to the $U|0\rangle, U|1\rangle$ basis. If I just decide to measure the original $|q\rangle$ in that new basis, then all of my very limited knowledge about all of this would lead me to believe I get $U|q\rangle$. So is there any actual difference between the two situations? This seems like a well-known or obvious thing but I really don't know.

+",9168,,,,,11/18/2019 5:54,Difference between unitary transformations and measurement,,1,1,,,,CC BY-SA 4.0 +8834,2,,8833,11/18/2019 5:54,,3,,"

Application of a unitary transformation $U$ on a state $|q\rangle$ really leads to a new state $U|q\rangle$. What you get after a measurement is a one particular outcome of $U|q\rangle$ state because the measurement leads to colapse of the state wave function.

+ +

If you repeat measurement many times you will get probability distribution of possible outcomes of the quantum state.

+ +

Another difference is a reversability. While transformation of the quantum state is always reversible because the unitary matrix can be always inverted, the measurement is irreversible because of the wave function colapse. To reconstruct the quantum state you need to do many measurements of same state in different basis and employ so-called quantum tomography.

+",9006,,,,,11/18/2019 5:54,,,,3,,,,CC BY-SA 4.0 +8835,2,,8832,11/18/2019 7:22,,7,,"

You specifically ask about qubits, so I'll keep it to that. Imagine you have a state +$$ +|\psi\rangle=\sum_{x\in\{0,1\}^n}a_x|x\rangle. +$$ +You can choose to look at each qubit. I'll take the first qubit for the sake of simplicity. We have that +$$ +|\psi\rangle=|0\rangle\sum_{y\in\{0,1\}^{n-1}}a_{0y}|y\rangle+|1\rangle\sum_{y\in\{0,1\}^{n-1}}a_{1y}|y\rangle +$$ +which we can equally well think of as +$$ +|\psi\rangle=c_0|0\rangle|\phi_0\rangle+c_1|1\rangle|\phi_1\rangle, +$$ +where $\langle\phi_0|\phi_0\rangle=\langle\phi_1|\phi_1\rangle=1$. If it happens that $\langle\phi_0|\phi_1\rangle=e^{i\gamma}$, then this is the same as +$$ +|\psi\rangle=(c_0|0\rangle+c_1e^{i\gamma}|1\rangle)|\phi_0\rangle, +$$ +which is now in its separable form, as desired. You keep repeating this qubit-by-qubit. Of course, as the number of qubits, $N$, increases, you're dealing with exponentially many coefficients, so the calculation is not efficient, although it is procedurally straightforward.

+ +

In terms of actually performing the computation, it may be easier to rely on the partial trace, which is built in to many packages. You'd calculate, for example, +$$ +\rho_1=\text{Tr}_{2,3,\ldots N}|\psi\rangle\langle\psi|, +$$ +the reduced density matrix on the first qubit. If $\text{Tr}\rho_1^2=1$, then this state is separable. Moreover, $\rho_1$ is a rank 1 projector, and the state that it projects onto is the separable decomposition of that qubit.

+",1837,,1837,,11/19/2019 17:06,11/19/2019 17:06,,,,1,,,,CC BY-SA 4.0 +8836,1,8838,,11/18/2019 11:37,,1,214,"

I have the following code, which runs properly.

+ +
from qiskit import *
+from qiskit.converters import *
+
+ghz2 = QuantumCircuit(5, 5)
+ghz2.h(2)
+ghz2.cx(2, 1)
+ghz2.cx(1, 0)
+ghz2.cx(2, 3)
+ghz2.cx(3, 4)
+
+
+ghz_dag = circuit_to_dag(ghz2)
+
+ +

How do I access properties of this dag? For instance, I would like to get all the 2-qubit gates using the collect 2qubit gates method (the output is supposed to be a dictionary) or simply draw the DAG but again, dag_drawer(ghz_dag) throws up an error ('MultiDiGraph' object has no attribute 'number_of_selfloops') even though, that's done in an example here.

+ +

Maybe this is just a Python usage question but how does one access the properties of the DAG?

+",4831,,26,,11/18/2019 12:17,11/18/2019 14:23,How does one get the attributes of a circuit from its DAG in qiskit?,,1,4,,,,CC BY-SA 4.0 +8837,1,8915,,11/18/2019 13:14,,0,98,"

I am new to quantum computing and I wanted to do a project for one of my classes where I study a specific algorithm from the field and then insert parallelism in it so it can be executed more efficiently on a cluster i.e., high-performance computing (HPC) system.

+ +

I would appreciate any suggestions which algorithm should I pursue to implement, as well as any resources available to study its background. Thanks in advance!

+",9174,,26,,11/18/2019 15:11,11/25/2019 7:10,Which algorithm in quantum computing can be implemented for a HPC system?,,1,1,,,,CC BY-SA 4.0 +8838,2,,8836,11/18/2019 14:23,,3,,"

Properties of the DAG are simply accessed using dot notation. For example, if you would like to get all the two qubit gates you would do dag.twoQ_gates() which returns a list of the two qubit gates present in the dag.

+ +

The code you have linked to is a transpiler pass. This is a method that looks over the dag to identify some property or to perform some optimization. It stores variables to the property set, self.property_set. There is more information about using the transpiler here.

+",5955,,,,,11/18/2019 14:23,,,,4,,,,CC BY-SA 4.0 +8839,1,,,11/18/2019 15:19,,1,87,"

I'm a Politecnico di Torino student currently enrolled - and close to graduate - in Electronics and Communications engineering. As such, I know the basics of analog electronics, digital electronics, signal processing and of course anything that has to do with communications, especially TCP/IP on all levels, even physical. I like the theory of information and signal modulation, and I also like higher levels in TCP/IP, knowing some basic algorithms and protocols; I'm not new to this. Furthermore, I hate analyzing analog circuits, but I love digital electronics and LTI systems theory (including discrete analysis like Z-transform of signals, FFT, etc). Along with this, I have a strong personal background on operating systems and programming (mainly C/C++; but I also have a big experience in higher-level languages). My initial thought was to engage with embedded systems as my MSc, in order to strengthen my knowledge in OSes (since I'm not used to real-time ones) and find a mix between my hobby, programming, and something that has to do with telecommunications, signal analysis, or anyways low-level computer stuff (for example, I love memory management and CPU arch, and I'd love to learn more about them). So, why not, this sounds like a good mix.

+ +

However, I've recently discovered that one of our free-choice exams includes, weirdly, an introduction to Quantum Information, Quantum Computing, and Teleportation at the Bachelor's level. I was selected for this and I will start the lectures next semester. I still have no idea how the whole thing works, but the concept of quantum computing seems extremely interesting to me, right now. In case I end up loving this course, I think I'd be wanting to do something about quantum computing in my future Ph.D. program if I ever get to get into one. +At this point, I got some choices:

+ +
    +
  • MSc in Computer/Electronic Engineering with Embedded Systems path - I think this would be good especially for getting to know into details how these systems work on a low level, how classical architectures work before heading to a hypothetical quantum computing background

  • +
  • MSc in Physics of Complex Systems - this one is very interesting because it provides a lot of statistical inference, statistical quantum mechanics, and some quantum information theory backgrounds

  • +
  • MSc in Computer Engineering, Cyber Security path - this one could be interesting if I want to operate with the security of quantum systems - I saw that, in telecommunications, there is something called a ""quantum key sharing""; I'm not sure what it is, but sounds cool.

  • +
  • MSc in Computer Engineering, Software Engineering path - interesting, but I'm not sure how good this could be.
  • +
  • MSc in Data Science and Engineering - could be pretty cool, but I'm not sure how this could help with QC.
  • +
+ +

Do these courses make sense? In case they do, which one could be the best? I'm very interested in computer architecture and in telecommunications, and also in reverse engineering memory management, and data structures. One thing I absolutely love is working with bits, especially when it's about manipulating memory or also bitmasks, and I also am amazed and very interested in probability when it's applied to signals (power spectral densities and that stuff), and in general statistical inference. I hate purely analog circuits analysis because, to me, they have lots of inconsistencies and I'm not good at re-modeling circuits from different points of view, let alone all the awful approximations that are often taken for granted in these courses. I also love physics, especially electromagnetism, and stochastic processes-based physical theories, so Physics of Complex Systems could be interesting.

+ +

What do you think? Do any of these make sense? +I could also switch university, but quantum computing courses at MSc level are extremely rare and they're usually found in mostly Physics and Technology courses, and furthermore, it would be a great problem with funding, but I suppose I could make some more sacrifices.

+ +

I am really sorry for my long post and I hope this is the right subsite, and I hope this wasn't already asked (couldn't really think anything about it, especially with these courses). For any suggestions, thank you in advance! I would really appreciate any tips. Have a good day!

+",8999,,26,,11/18/2019 15:50,11/18/2019 15:50,Could any of these university courses be a good MSc for a quantum computing future job/research?,,0,7,,11/19/2019 22:33,,CC BY-SA 4.0 +8841,2,,8794,11/18/2019 18:10,,3,,"

$\newcommand{\on}[1]{{\operatorname{#1}}}$The basic answer is to just write, for a given bipartite state $X$, $\Phi(X)\equiv\operatorname{Tr}_B(X)$. This defines a quantum channel which acts on the input as a partial trace. You can check that this does indeed qualify as a quantum channel etc.

+

A misconception that might have led you to ask this question can be found in your saying that "I have no idea how to define a quantum channel with the partial trace because partial trace depends on an index $i$ (i.e. $i$ of $\operatorname{Tr}_i(\rho)$). Intuitively, the index $i$ is random, but then I don't know how to define a map that represents the partial trace. This is wrong. The index used to denote the partial trace represents which space is being traced out. It is not "random", but rather is something that has to be decided when the operation is defined. For example, for a bipartite system, you can always define the partial trace with respect to either of the two subspace, thus getting two different, if related, maps.

+

Another way to interpret the question is: "What does the partial trace map look like in one of the common quantum channel representations?".

+

A note on notation: I'll use here Einstein's summation notation (though using only lower indices) for repeated indices, as well as numbers instead of letters to represent indices. This is because I believe it makes it easier to see the structure of some expressions. Furthermore, I will sometimes use primed indices when an index represents an element in a dual vector space (i.e. it corresponds to a bra). For example, I'll write the matrix elements of a density matrix $\rho$ as $\rho_{11'}$. For a bipartite state $\sigma$, I will write $\sigma=\sigma_{12,1'2'}|1\rangle\!\langle 1'|\otimes|2\rangle\!\langle2'|$, where "$1$" and "$2$" correspond to kets in first and second space, while "$1',2'$" correspond to bras in the same spaces. +Whenever suitable, I will include both the expression in operatorial form and the explicit base-dependent one with indices. +

+

Natural representation

+

(Natural representation in general) Given an arbitrary channel $\Phi$, denote with $K(\Phi)$ its natural representation. You can think of this as the linear map that acts on states via their vectorisations. Fixing a canonical basis, we can write $K(\Phi)$ explicitly through its matrix components as +$$K(\Phi)\on{vec}(X) = \on{vec}(\Phi(X)), \qquad +[\Phi(X)]_{11'}=K(\Phi)_{11',22'}X_{22'}.$$ +One thing to notice at this point is that what the "$1$" and "$2$" indices represent does not really matter at this point. If $X$ is bipartite, then "$2$" is an index denoting an element of a bipartite space, and so it might be written as something like $2=(2_1 2_2)$, or directly $2\sim 23$, as I will do in the following. However, the natural representation is still possible, regardless of what the input and output spaces actually are.

+

(Natural representation of partial trace) In the case of $\Phi=\on{Tr}_B$ (where $B$ denotes here the second space), the input $X$ has a bipartite structure, and so we can write its matrix elements as $X_{12,1'2'}$, while the output does not have a tensor product structure (or at least we are not considering this structure here). +We can then write the action of the partial trace in the natural representation as +$$[\operatorname{Tr}_B(X)]_{11'}=K(\operatorname{Tr}_B)_{11',232'3'}X_{232'3'}.$$ +From the definition of partial trace, we know that +$[\operatorname{Tr}_B(X)]_{11'}= +\sum_\alpha X_{1\alpha1' \alpha}\equiv X_{1\alpha 1'\alpha}.$ +For the two expressions to be consistent, you then need the partial trace to have the following natural representation: +$$ + K(\on{Tr}_B)_{11',232'3'} = \delta_{12}\delta_{1'2'}\delta_{33'}. \tag A +$$

+

(Alternative expression) +We can get an expression with less floating indices by reasoning directly in terms of the operatorial relations: as pointed out before, we must have +$K(\on{Tr}_B)\on{vec}(X) = \on{vec}(\on{Tr}_B(X))$. But we can also observe that +$$\on{vec}(\on{Tr}_B(X)) += \sum_{i,j,\alpha} |i,j\rangle X_{i\alpha,j\alpha} += \left(\sum_\alpha I\otimes\langle \alpha|\otimes I\otimes\langle \alpha|\right)\on{vec}(X),$$ +and thus +$$K(\on{Tr}_B) = \sum_\alpha (I\otimes\langle \alpha|\otimes I\otimes\langle \alpha|)$$

+

Kraus representation

+

(Natural vs Kraus representation) Write the Kraus decomposition of $\Phi$ as +$\Phi(X)=\sum_a A_a X A_a^\dagger \equiv A_a X A_a^\dagger.$ +I will use "$a$" to index the Kraus operators, to distinguish the associated "auxiliary space" from indices denoting Hilbert space components. I will also not give any meaning to whether an index is raised or not (i.e. $A_a\equiv A^a$), as the meaning of the indices will be obvious from the context. +The relation between this and the natural representation (again using non-bipartite notation for now) is +$$ +K(\Phi) = \sum_a A_a\otimes \bar A_a, \qquad +K(\Phi)_{11',22'}=A^a_{12} \bar A^a_{1'2'}.$$ +In the case of the partial trace, the input space (the index "$2$" here) has a bipartite structure while the output one doesn't, so the components of the $A_a$ operators are written as $A^a_{1,23}$ etc.

+

(Kraus repr of partial trace) Using the previous result about the natural representation of the partial trace, we can write +$$\delta_{12}\delta_{1'2'}\delta_{33'}=A^a_{1,23}\bar A^a_{1',2'3'},$$ +which means that $A^a_{1,23}=\delta_{12}B^a_3$ for some object $B$ such that +$$B^a_3 \bar B^a_{3'}=\delta_{33'}.\tag{Y}$$ +There are many equivalent choices for such an object. What we can observe is that (Y) can be understood as the orthonormality relation between a set of vectors, where "$3$" indexes the vectors and "$a$" is used for the components. This means that for (Y) to be possible, the auxiliary space in which the "$a$" indices live must have dimension greater than or equal to the dimension of the space of the index "$3$" (because you cannot have $n$ orthogonal vectors in a space of dimension $< n$). +We can then take the dimensions to be equal, which makes $B$ a unitary operator with respect to its two indices. Because unitary matrices are all and only those whose rows (columns) form an orthonormal system for the space, and can freely choose which basis to use, the easier choice is to use the computational basis, which means that $B^a_3=\delta_{a3}$. +It is trivial to check that this choice satisfies (Y), and therefore produces the correct Kraus operators. +We conclude that the most natural (or a natural choice) for the Kraus operators of the partial trace is +$$ +A_a = I\otimes\langle a|, + \qquad +A^a_{1,23} = \delta_{12}\delta_{a3}.$$

+

Choi representation

+

This is straightforward from our analysis of the natural representation. +Indeed, the Choi operator $J(\Phi)$ as the same matrix components as the natural representation $K(\Phi)$, up to some rearrangement. More specifically, +$$J(\Phi)_{12,1'2'} = K(\Phi)_{11',22'}.$$ +It then follows from (A) that +$$J(\Phi)_{123,1'2'3'} = \delta_{12}\delta_{1'2'}\delta_{33'}.$$ +Equivalently, as an operator, this reads +$$J(\Phi) = |m\rangle\!\langle m|\otimes I,$$ +where $|m\rangle\equiv \sum_i|i,i\rangle\!\langle i,i|$ is the maximally entangled state (modulo normalisation).

+

If you want to then represent this operator as a matrix, in the simplest case of all spaces being two-dimensional, you find a matrix that is the same as the density matrix of the Bell state $|00\rangle+|11\rangle$, upon replacing $1$ with the two-dimensional identity, and $0$ with the $2\times2$ zero matrix. More explicitly: +$$ +\left( +\begin{array}{cccccccc} + 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ + 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 1 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ + 0 & 1 & 0 & 0 & 0 & 0 & 0 & 1 \\ +\end{array} +\right). +$$

+

The fact that the $J(\Phi)$ is a square matrix while $K(\Phi)$ isn't is not a coincidence. The Choi is a square matrix for any map $\Phi$, while the natural representation is only square when input and output spaces have the same dimensions.

+

The Mathematica code to generate the above matrix is the following:

+
SparseArray[{{i_, j_} :> 1 /; With[
+       {iList = IntegerDigits[i - 1, 2, 3], 
+        jList = IntegerDigits[j - 1, 2, 3]},
+       And[
+        iList[[1]] == iList[[2]],
+        jList[[1]] == jList[[2]],
+        iList[[3]] == jList[[3]]
+        ]]}, {8, 8}] // Normal // TeXForm
+
+",55,,55,,5/17/2021 9:08,5/17/2021 9:08,,,,0,,,,CC BY-SA 4.0 +8842,2,,8818,11/18/2019 20:46,,3,,"

The Context

+ +

The algorithm Ewin Tang originally examined and dequantized was the quantum recommendation system algorithm by Kerenidis & Prakash.

+ +

Many QML algorithms, including the quantum recommendation system algorithm, exploit the quantum linear systems algorithm (QLSA), which was posted on arXiv in 2008 by Harrow, Hassidim, and Lloyd (that's why it's also sometimes known as the HHL algorithm). The QLSA algorithm solves a quantum linear system of equations (i.e. the input is quantum information) via matrix inversion. Formally, given a matrix $\mathbf{A} \in \mathbb{R}^{N \times N}$ and a vector $\vec{b} \in \mathbb{R}^N$, the task is to solve for $\vec{x} \in \mathbb{R}^N$ in the system $\mathbf{A} \vec{x}=\vec{b}$. Note that the original QLSA didn't include a data loading or measurement procedure (important when considering its complexity).

+ +

About Speed

+ +

The QLSA outputs a solution with complexity $O(d^4\kappa^2\log N/\epsilon)$, where $d$ is the density of $\mathbf{A}$, $\kappa$ is the magnitude of the ratio of the largest to smallest eigenvalues of the matrix (i.e. $\kappa = \vert\lambda_{\max}/\lambda_{\min}\vert$), and $\epsilon$ is the precision.

+ +

Focusing on $d$ and $\kappa$, we can define them in layman's terms as:

+ +
    +
  • $d$ is the maximum number of non-zero entries among the rows of $\mathbf{A}$
  • +
  • $\kappa$ is the magnitude of the ratio between the largest and smallest eigenvalues of the matrix $\mathbf{A}$
  • +
+ +

Over the years, several improvements have been made to the QLSA – so this complexity can be considered higher than what is theoretically possible.

+ +

And on Dimensionality...

+ +

First off, we typically talk about the dimensionality of a data matrix in terms of its columns – that is, an $m\times n$ matrix would be high dimensional $n \gg m$, where $m$ is the number of rows (samples) and $n$ is the number of columns (features). You could think of this in the context of the QLSA where $\mathbf{A}$ is the data matrix for a linear regression.

+ +

I'd argue that Tang is making a general statement about algorithmic complexity. Specifically, that you need a large input (matrix) to get a meaningful speedup up, just given the complexity of the algorithm and a comparable classical approach like Gaussian elimination (which is $O(N^3)$) or one of Tang's dequantized (classical) algorithms, which (as I understand them) end up having polynomial complexity, though the polynomials are of quite high order(s) on some term(s).

+ +

That said, another point is that given the polynomial terms $d$ and $\kappa$ and the $\log N / \epsilon$, if $N$ is relatively small and $d$ and $\kappa$ are large, the latter are going to have a greater influence on the complexity.

+",1937,,1937,,11/18/2019 23:59,11/18/2019 23:59,,,,2,,,,CC BY-SA 4.0 +8843,1,,,11/19/2019 0:28,,3,513,"

I’m trying to get a Quantum Fourier Transform working with the rest of a compiled version of Shor’s algorithm, attempting to factor $N=21$. +In the following image, there’s an initialization phase (before the first vertical line), then a compiled version of modular exponentiation with base 4 up to the second vertical line (based on 1, figure 5), followed by QFT. The output of modular exponentiation seems correct (the output of that module matches the truth table in 1 (table V), which gives $f(4, 21, x) = 4^x \bmod 21)$.

+ +

However, the output of QFT gives a pretty much flat distribution over [q3…q7]. This is slightly involved, but I’d appreciate any tips over where I may be going wrong. Happy to provide my code, etc. + +

+ +

1 Simplified Factoring Algorithms for Validating Small-Scale Quantum Information Processing Technologies, Gamel & James, 2013, https://arxiv.org/abs/1310.6446v2 (edited)

+",9180,,26,,11/19/2019 13:20,8/19/2021 17:45,Implementing QFT for Shor's Algorithm,,1,2,,,,CC BY-SA 4.0 +8844,1,8845,,11/19/2019 6:53,,2,223,"
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
+from qiskit.tools.visualization import matplotlib_circuit_drawer as drawer
+from qiskit import Aer
+from qiskit import execute
+import numpy as np
+%matplotlib inline
+
+ +

This is the code cell that I am trying to implement. The error is in the second line.

+ +
Error--> ImportError: cannot import name 'matplotlib_circuit_drawer'
+
+ +

I'm using Google Colab to execute the code. How to solve this?

+",8330,,26,,11/19/2019 13:18,11/19/2019 13:18,ImportError: cannot import name 'matplotlib_circuit_drawer',,1,0,,,,CC BY-SA 4.0 +8845,2,,8844,11/19/2019 7:23,,2,,"

qiskit.tools.visualization has been moved to qiskit.visualization and matplotlib_circuit_drawer has been removed. Instead of using it, try using qiskit.visualization.circuit_drawer() with the appropriate arguments.

+ +

So in this case it should be qiskit.visualization.circuit_drawer(my_circuit, output='mpl', filename='my_circuit.png')

+",5771,,5955,,11/19/2019 8:38,11/19/2019 8:38,,,,0,,,,CC BY-SA 4.0 +8846,2,,8832,11/19/2019 8:52,,3,,"

Consider an arbitrary vector $\boldsymbol v\equiv(v_i)_{i=1}^N\in\mathbb C^{nm}$ of length $n m$ (if you care only about qubits, just fix $n=m=2$).

+ +

For $\boldsymbol v$ to have an $(n,m)$ partition means that we can write it as $\boldsymbol v=\boldsymbol u\otimes \boldsymbol w$ for some $\boldsymbol u\in\mathbb C^n$ and $\boldsymbol w\in\mathbb C^m$. +If this is the case, then the components of $\boldsymbol v$ must be related to those of $\boldsymbol u,\boldsymbol w$ via +$$v_{ij}=u_i w_j. \tag A$$ +The first thing to notice is that the tensor product operation $(\boldsymbol u,\boldsymbol w)\mapsto\boldsymbol v$ is not injective. In particular, for any $\lambda\in\mathbb C$ we have $(\lambda \boldsymbol u)\otimes \boldsymbol w=\boldsymbol u\otimes(\lambda \boldsymbol w)$, and thus given a separable $\boldsymbol v$ we can only recover its ""reduced vectors"" up to their individual norms and phase factors. + +Because we are interested in quantum states, this means that we don't need to worry about neither the normalisation nor the phase of the vectors $\boldsymbol u,\boldsymbol w$.

+ +

A remarkable property of (A) is that, for any pair of indices $j\neq j'$ and $i$, we have $v_{ij}/v_{ij'}=w_j/w_{j'}$, where, you might notice, the $i$ index does not appear on the right-hand side.

+ +

This property characterises separable vectors: check that $v_{ij}/v_{ij'}$ does not depend on $i$ for all $j,j'$, and if so, define $w_i\equiv v_{i1}/v_{ij}$, where we are using the fact that $\boldsymbol w$ is defined up to normalisation to assume $w_1=1$ (when some of the elements $v_{ij}$ we might not be able to assume this, but those cases are usually trivial to handle separately). +Once you have $\boldsymbol w$, you can find $u_i$ by simply computing $v_{ij}/w_j$.

+ +

For example, if $\boldsymbol v=(1,1,2,2)^T$, then +$$v_{11}=v_{12}=1, \qquad v_{21}=v_{22}=2,$$ +and thus $v_{12}/v_{11}=v_{22}/v_{21}=1$. You can thus define $\boldsymbol w=(1,1)$. You then compute $u_1=v_{11}/w_1=1$ and $u_2=v_{21}/w_1=2$, which tells you that $\boldsymbol u=(1,2)$.

+ +

For example, if $\boldsymbol v=(0,1,0,0)^T$ and $n=m=2$, then by definition +$$v_{11}=v_{21}=v_{22}=0 \qquad\text{and}\qquad v_{12}=1.$$ +Because $v_{11}=0$, we cannot use directly the procedure above, but the fact that $v_{2j}=0$ for all $j$ tells you immediately that $\boldsymbol u=(1,0)$, and then finding $\boldsymbol v$ is easy.

+ +

As for how numerically efficient this particular method is, I'm not so sure. The main problem is that all these divisions will be prone to numerical instability for small values of the amplitudes. Methods that are based on computing entropies might work better, but I'm not sure.

+",55,,,,,11/19/2019 8:52,,,,0,,,,CC BY-SA 4.0 +8847,2,,8808,11/19/2019 9:35,,1,,"

In general, you cannot distinguish between the two. Both classical and quantum mechanics can produce arbitrary probability distributions, so there simply isn't enough information to distinguish between the two if that's all you have access to.

+ +

A setting in which observable differences can be observed is when locality is taken into account. If the probability distribution is obtained by spatially separated parties interacting with two parts of an entangled system, then the produced correlations in the observed statistics can be measurably incompatible with classical mechanics (see Bell's inequalities and such).

+",55,,,,,11/19/2019 9:35,,,,3,,,,CC BY-SA 4.0 +8848,2,,8817,11/19/2019 9:44,,1,,"

Qubits are the quantum states that carry the smallest amount of ""quantum information"": the simplest possible quantum states you can imagine. They are pervasive for this reason, just like bits in classical physics are pervasive because they are the basic unit of information. We use bits all the times simply because we find it convenient to build things (e.g. coputers) in such a way that we can model their behaviour in terms of bits. Underlying the simplified models, physical reality is much more complex than that though: inside your computers that are transistors carrying ""continuous"" amounts of currents and voltages, and describing the whole thing in terms of bits is only an extremely useful way to simplify how the whole thing works.

+ +

One caveat is that there is a sense in which ""qubits"" are more natural in quantum mechanics than ""bits"" are in classical physics. Indeed, elementary particles often have intrinsic degrees of freedom that seem to be genuine two-dimensional systems (qubits). There isn't anything like this in classical physics that I know of. But then again, one could argue that even talking about elementary particles in quantum mechanics is only a ""simplified model useful for descriptions"".

+",55,,,,,11/19/2019 9:44,,,,0,,,,CC BY-SA 4.0 +8849,1,8851,,11/19/2019 9:51,,16,3595,"

When explaining a quantum algorithm, many revert to 'circuit-speak' by drawing a diagram of how qubits split off into transformations and measurements, however, rarely if not never would someone explaining a classical math algorithm revert to its representation in binary circuits. I would understand that this is because transforms and such don't exist in the binary world, but:

+ +

Doesn't this unnecessary focus on the computational details relating to computing-computing, rather than the mathematical/statistical/optimization problem that the circuitry merely only underlies, detract from the main problem/application at hand? Is the classical mindset just that intuitive and aligned to general human thought, that quantum circuits, on the other hand, will remain to be a standard explanation strategy?

+",9118,,26,,11/19/2019 12:33,2/11/2022 8:43,"Quantum circuits explain algorithms, why didn't classical circuits?",,4,1,,,,CC BY-SA 4.0 +8850,1,,,11/19/2019 10:23,,4,1021,"

I found some examples of implementing the oracle when the marked state is $|000\rangle$. +But how can we know what gate we should use inside of the oracle?

+ +

+ +

Besides, for the part implementation, the example shows like this:

+ +

+ +

Mathematically, it should be $2|0\rangle\langle 0|-I$, but how can it be realized by X gates and controlled-Z gate?

+",9105,,26,,11/19/2019 13:17,1/12/2023 2:08,"In Grover, how to implement oracle and amplification using Qiskit?",,2,0,,,,CC BY-SA 4.0 +8851,2,,8849,11/19/2019 13:10,,19,,"

You might find this analogy helpful: the development of quantum algorithms is still in the Booth's multiplication algorithm stage; we haven't quite reached dynamic programming or backtracking. You'll find that most textbooks explain the Booth's algorithm using the following circuit.

+ +

+ +

That is in fact, the method in which the multiplication logic is implemented in most modern processors (with some minor modifications depending on the version). However, this kind of representation quickly becomes tedious when you move to on algorithmic techniques like looping and recursion which may involve multiple multiplication and division steps, among others. It would be crazy for textbooks to explain more advanced algorithms using hardware-level implementations like this. Not to mention that the basic hardware circuitries vary with the processor. If you've ever done assembly language programming this should resonate.

+ +

Classical algorithm textbooks like the CLRS evade this problem by framing the algorithms without any particular processor in mind. The basic algorithmic procedures like addition, multiplication, looping, etc. are all considered as black boxes. If you're interested to see the processor-specific implementation of a CLRS algorithm you could certainly write it up in some high-level language like C and then convert it to assembly. Fortunately, compilers do that tedious conversion on our behalf!

+ +

Now the interesting part is that the basic building blocks of quantum algorithms are not addition or multiplication as such, but rather operations like Fourier transform and amplitude amplification. Quantum algorithms are largely framed in terms of these basic transformations that are very easy to visualize using quantum circuits (at least, if we're using the gate model). It's really much more about convenience and much less about intuition.

+ +

Rest assured that if a textbook ever states a generalized quantum equivalent of the Dijkstra's algorithm it wouldn't be showing you all the gates required to implement it, but rather in terms of the elementary quantum operations whose hardware implementations would largely vary depending on the quantum processor you're using. The bottom line is that we're still in the assembly language stage of quantum computing.

+",26,,9399,,12/7/2019 14:59,12/7/2019 14:59,,,,7,,,,CC BY-SA 4.0 +8852,2,,8849,11/19/2019 14:15,,8,,"

The state of quantum computing technology is still in its infancy, so implementation details are generally important when considering quantum algorithms. Number of gates, number of operations, types of gates (e.g. Clifford vs. non-Clifford) are often necessary information to evaluate the feasibility and value of a quantum algorithm.

+ +

In many cases quantum algorithms are still being optimized, and there are often competing approaches with different trade-offs being considered and iterated. As a result, even publications describing very complex algorithms often include circuit diagrams implementing novel functions to improve efficiency (e.g. Fig. 1: controlled SELECT).

+ +

The quantum circuit model is also one of the more intuitive ways to depict quantum computations. Quantum circuits are a restricted form of tensor networks (see e.g. here), which are often used more broadly in both physics and classical computing (particularly in machine learning).

+ +

Microsoft seems to be one of the leaders in terms of developing the level of abstraction of quantum computation that you seem to be referring to, embodied in Q#. However, effective abstraction is not always straightforward or necessarily more intuitive (see e.g. here).

+",8623,,8623,,11/19/2019 14:52,11/19/2019 14:52,,,,0,,,,CC BY-SA 4.0 +8853,2,,8715,11/19/2019 15:35,,1,,"

This is my attempt. Let's say the list looks like:

+ +

$\lambda_1$, $\lambda_2$, $\lambda_1$, $\lambda_3$, $\dots$, $\lambda_n$

+ +

where $\lambda_i$ are numbers. The variables (unknowns) are the Hamiltonian and the energy eigenvectors

+ +

We start with the following tricks:

+ +
    +
  1. We assume $M$ (number of measurements) is a large number. This enables us to say the distribution observed $\{ M \}$ is the most probable distribution*.
  2. +
  3. By *most probable we mean the expectation empirically is the most probable expectation value to be measured. For example the expectation is: $$ \langle H \rangle = \frac{m_1 \lambda_1 + m_2 \lambda_2 + \dots + m_n \lambda_n}{M}$$
  4. +
  5. Where we count the frequency of the of a particular eigenvalues with +$ \lambda_k$ with $m_i$. Hence, for a particular eigenvalue +$m_i$.
  6. +
  7. Obviously intermediary measurements are being done otherwise the same energy eigenvalue would be on the list. We will assume the observable used (to change the state) was $\hat O$ with kets $|o_i \rangle$. Then the probability of the eigenvalue $\lambda_k$ arriving through that particular state (with no degeneracy)$| \lambda_k \rangle$ is $$ P_i( \lambda_k ) = | \langle o_i | \lambda_k \rangle |^2 = \frac{m_k}{M}$$ Do note: the eigenvector is essentially not known.
  8. +
  9. We use the following trick (from statistical mechanics) of multinomial theorem: $$ (a_1+a_2 +a_3 + \dots +a_M )^M = \sum \frac{M!}{b_1!b_2! \dots b_M!} {a_1}^{b_1}{a_2}^{b_2} \dots {a_n}^{b_n}$$
  10. +
  11. Now choosing $b_j \to m_j$ and $a_j \to P(\lambda_j)$. We should get a coefficient of the probability of obtaining our particular distribution which is: $$ P_i(\{M \}) = \frac{M!}{m_1!m_2! \dots m_M!} $$
  12. +
  13. Using point ($1$) the probability obtained is the most probable distribution. Hence, by varying the eigenkets claim the correct eigenkets would maximize the below: $$ P_i(\{ M \}) = \max P_i(\{ M' \}) \implies \frac{M!}{m_1!m_2! \dots m_M!} = \max \prod_k \frac{M!}{(M | \langle o_i | \lambda_k \rangle |^2)!} $$ +Taking log and maximising will work as well.
  14. +
  15. It should be possible to talk about a mix of eigenkets such as $| o_k \rangle$, $| o_i \rangle$, etc (using density matrices). It should also be possible consider variations of degenerate eigenvalues (in a similar style shown in the question). Again one would have to consider which outcome maximizes the probability.
  16. +
  17. Once, one has the eigenkets one can use the spectral theorem to write the Hamiltonian.
  18. +
+",5045,,5045,,11/24/2019 9:35,11/24/2019 9:35,,,,0,,,,CC BY-SA 4.0 +8854,1,,,11/19/2019 18:36,,0,124,"

The qubit is able to take on multiple states at once, unlike the bit. This property I know is superposition, but is this property perpetual (always on) or optional (controlled to be on or off only when needed by an algorithm, such that when not needed, the qubit reverts to, or takes on the disguise of, a bit)?

+ +

and how does perpetual/optional superposition play into the notion of quantum parallelism: Does the qubit always execute parallel computations and incapable of a uni-sequential workflow, or can it be controlled to execute tasks in parallel only when the algorithm deems it necessary?

+ +

Essentially, what is the difference or connection between superposition and quantum parallelism and are these properties always active in a quantum algorithm?

+ +

(optional: Circuit diagrams that demonstrate example comparisons of ""superposition/parallelism on"" and ""superposition/parallelism off"" can be included as long as each item (line, gate and symbol) is annotated as a bullet point list.)

+",9118,,9118,,11/19/2019 18:46,11/19/2019 22:57,Can quantum parallelism be turned on and off?,,1,4,,,,CC BY-SA 4.0 +8855,2,,8849,11/19/2019 19:14,,7,,"

In classical computing, both circuit diagrams and pseudo-code are used to explain algorithms. The choice between circuits and pseudo-code depends on the context. If the goal is to explain a highly optimized implementation of an algorithm on FPGA, a circuit diagram is probably more suitable. For example, see this paper on AES implementation on FPGA. Pedagogical explanation of AES uses pseudo-code.

+ +

Similarly in quantum computing, if one wants to explain a highly optimized implementation of a modular adder, they resort to showing circuit diagrams. Papers focused on more high-level quantum algorithms frequently contain no quantum circuit diagrams and use pseudo-code instead. A good example of such a paper is Quantum algorithm for linear systems of equations. If you look through papers referenced at Quantum Algorithm Zoo, you will find many that have no circuit diagrams in them.

+ +

It seems that many people get the impression that 'circuit-speak' is so common because quantum computing is taught from the ground up. Quantum circuits are one of the first concepts many get exposed to when learning quantum computing.

+",5445,,,,,11/19/2019 19:14,,,,0,,,,CC BY-SA 4.0 +8856,2,,8854,11/19/2019 19:49,,2,,"

'Quantum parallelism' is a common misconception - sure, the quantum computer does compute in a 'parallel' fashion, but really the power of quantum computing emerges from constructive / destructive interference.

+ +

If you wanted, you could absolutely make a quantum computer behave in a classical format: constantly measure the qubits and correct if necessary. For example, if you had a qubit in $\frac{1}{\sqrt{2}} (|0\rangle + | 1 \rangle) $ and desired a classical bit of $|0\rangle$, you can measure, and apply $X$ if the qubit measured resolves to a $|1 \rangle$.

+",8343,,9006,,11/19/2019 22:57,11/19/2019 22:57,,,,2,,,,CC BY-SA 4.0 +8857,2,,5073,11/19/2019 22:11,,4,,"

This feature is now available using the snapshot function of Qiskit Aer. Snapshots can be added to the circuit and the values are then returned in the results object.

+ +

This is an example of how you can create a circuit, add a snapshot to it and then get the result:

+ + + +
from qiskit import *
+
+qc = QuantumCircuit(2)
+qc.h(0)
+qc.snapshot('1')             # add a snapshot with the key '1'
+qc.h(0)                      # add more gates after the snapshot
+
+backend = Aer.get_backend('statevector_simulator')
+result = execute(qc, backend).result()
+snapshots = result.data()['snapshots']['statevector']
+
+ +

snapshots now contains a dictionary where the keys are the names given to the snapshots, and the values are an array of state vectors associated with that key.

+ +

In this example it is{'1': [[[0.7071067811865476, 0.0], [0.7071067811865475, 0.0], [0.0, 0.0], [0.0, 0.0]]]}.

+",5955,,,,,11/19/2019 22:11,,,,0,,,,CC BY-SA 4.0 +8858,1,8861,,11/20/2019 5:44,,0,119,"

This is going to look like homework because it is from a self-inflected Coursera course. I have already found the answer by trial and error but I want to clear my logic. (Coz I'm not getting sleep otherwise and I can't ask the question in Coursera without revealing too much and ruining the quiz for others.)

+ +

+ +

Instead of doing the long math here I used the online calculator: here’s a link:

+ +

+ +

Once again online calculator to help : Link:

+ +

The result comes out as 3/4 but the expected answer is set as 1/2. +Can anyone help? I might be missing something very simple.

+ +

Edit

+ +

The complete solution:

+ +

$$\begin{aligned}|\phi| = {(1+ \sqrt{3}i) \over 4\sqrt{2}}(|+\rangle +|-\rangle)|0\rangle+{(1- \sqrt{3}i)\over 4\sqrt{2}}(|+\rangle + |-\rangle)|1\rangle \\ + {(1- \sqrt{3}i) \over 4\sqrt{2}}(|+\rangle-|-\rangle)|0\rangle+{(1+ \sqrt{3}i) \over 4\sqrt{2}}(|+\rangle - |-\rangle)|1\rangle\end{aligned}$$

+ +

By dropping the $|+\rangle$ combinations we are left with

+ +

$$\begin{aligned}|\phi| = {(1+ \sqrt{3}i) \over 4\sqrt{2}}|-\rangle|0\rangle-{(1- \sqrt{3}i) \over 4\sqrt{2}}\rangle|1\rangle+{(1- \sqrt{3}i) \over 4\sqrt{2}}|-\rangle|0\rangle-{(1+ \sqrt{3}i) \over 4\sqrt{2}}|-\rangle|1\rangle\end{aligned}$$

+ +

This is where I was wrong to not solve it even further.

+ +

$$|\phi| = ({(1+ \sqrt{3}i) \over 4\sqrt{2}}-{(1- \sqrt{3}i) \over 4\sqrt{2}})|-\rangle|0\rangle+({(1- \sqrt{3}i) \over 4\sqrt{2}}-{(1+ \sqrt{3}i) \over 4\sqrt{2}})|-\rangle|1\rangle$$

+ +

$$|\phi| = {\sqrt{3}i \over 2\sqrt{2}}|-\rangle|0\rangle-{\sqrt{3}i \over 2\sqrt{2}}|-\rangle|1\rangle$$

+ +

Next, we normalize this.

+ +

$$|\phi| = {({\sqrt{3}i \over 2\sqrt{2}}|-\rangle|0\rangle-{\sqrt{3}i \over 2\sqrt{2}}|-\rangle|1\rangle) \over \sqrt {{\left|\sqrt{3}i \over 2\sqrt{2}\right|^2}+{\left|\sqrt{3}i \over 2\sqrt{2}\right|^2}}}$$

+ +

$$|\phi| = {2\sqrt{3} \over 3} . {\sqrt{3}i \over 2\sqrt{2}}|-\rangle|0\rangle-{2\sqrt{3} \over 3}.{\sqrt{3}i \over 2\sqrt{2}}|-\rangle|1\rangle)$$

+ +

$$|\phi| = {1 \over \sqrt{2}}|-\rangle|0\rangle-{1 \over \sqrt{2}}|-\rangle|1\rangle)$$

+ +

Hence the probably of second qubit: $P(|0\rangle)$ when the first qubit is $|-\rangle$ is :

+ +

$$|\phi| = {\left ({1 \over \sqrt{2}}\right )}^2 = \frac{1}{2}$$

+",9193,,26,,11/27/2019 13:20,11/27/2019 13:20,Beginners doubt: calculating probability of one qubit based on other in a 2 qubit system,,2,2,0,,,CC BY-SA 4.0 +8859,1,,,11/20/2019 5:48,,3,84,"

What areas of research in NISQ algorithms have heavy focus? I'm interested in quantum chemistry algorithms because of previous work (e.g. VQEs), and I'd love to learn more about other near-term algorithms that are being explored.

+",8343,,8343,,11/20/2019 15:53,11/21/2019 11:56,Active areas of research for NISQ algorithms,,0,1,,,,CC BY-SA 4.0 +8860,2,,8858,11/20/2019 6:16,,1,,"

There is no long math, and you need not online calculators. When you simply omit $|+\rangle$ state of the first qubit after the measurement, the resulting 2-qubit state $|\Phi\rangle$ is unnormalized. You just need to factor out the state $|-\rangle$ of the first qubit and normalize the remaining state of the second qubit before obtaining the final answer.

+",2105,,2105,,11/20/2019 6:21,11/20/2019 6:21,,,,0,,,,CC BY-SA 4.0 +8861,2,,8858,11/20/2019 6:16,,2,,"

In the line immediately before Step 2, you have like terms that can be combined. Combine these, then renormalize the vector.

+ +

Recognize that your misstep lies in the properties of the amplitude. Generally, for some $a, b$ components and $x, y$ separation:

+ +

$$ +|a + bi|^2 \neq |x + yi|^2 + |(a - x) + (b - y)i|^2 +$$

+ +

In this case, the like terms aren't combined, so we're combining the probabilities of the individual terms, which doesn't hold.

+",8343,,,,,11/20/2019 6:16,,,,1,,,,CC BY-SA 4.0 +8862,1,8863,,11/20/2019 6:32,,4,1971,"

I have read some of the other decomposition questions here however still don't understand how to do it manually. The matrix I wish to decompose is the following for 2 qubits:

+ +

$M=\frac{1}{\sqrt2}\begin{bmatrix} +1 & 0 & 0& i\\ +0 & 1& i & 0\\ +0 & i & 1 & 0\\ +i & 0& 0 & 1 +\end{bmatrix}$

+ +

I have used the Qiskit circuit decompose to find that it corresponds to the following image, but I don't understand how that was done.

+ +

Also Qiskit is only able to decompose for up to 2 qubits. My application for the matrix expands beyond 2 qubits and I would also like to know how to decompose for more.

+ +

Any help on the step by step process of decomposition would be appreciated as well as any insight on multiple qubit decomposition :)

+",8405,,55,,11/26/2019 10:40,11/26/2019 10:40,How to decompose this two-qubit unitary matrix to the standard gate set?,,2,0,,,,CC BY-SA 4.0 +8863,2,,8862,11/20/2019 7:36,,7,,"

I found paper Quantum Circuits for Isometries to be a useful reference on the topic. It describes several methods for decomposing multi-qubit unitaries into CNOT gates and qubit unitaries and also gives several references to earlier related works.

+ +

There is also a Mathematica package that implements algorithms described in the mentioned paper. If you don't have Mathematica you can still probably run it using Wolfram Engine and Wolfram Language for Jupyter.

+ +

For decomposition of two-qubit unitaries with minimal CNOT count quant-ph/0308033 is a good reference.

+",5445,,,,,11/20/2019 7:36,,,,0,,,,CC BY-SA 4.0 +8864,1,,,11/20/2019 8:18,,1,322,"

What will happen if the two qubits in Bell state for a 2-qubit system, $\frac{1}{\sqrt2}(\left|00\right\rangle+\left|11\right\rangle)$ are simultaneously measured at the same instant? Two scenarios: Qubits are measured in the same states or different states. Has anyone tried to measure the qubits experimentally in IBM-Q? What is the answer from Quantum Mechanics?

+",8120,,26,,11/20/2019 16:22,9/12/2021 21:29,Bell state: simultaneous measurement of two entangled qubits,,3,0,0,,,CC BY-SA 4.0 +8865,2,,8864,11/20/2019 8:24,,3,,"

In theory, there is no difference between this and measuring one qubit and then the other. One way of thinking about this is from the perspective of inertial frames of reference in special relativity - for two separated parties, there is no global definition of simultaneous. Different observers can observe different orderings of space-like separated events. While this is not strictly built in to quantum mechanics, it does respect that structure.

+",1837,,,,,11/20/2019 8:24,,,,3,,,,CC BY-SA 4.0 +8866,2,,8864,11/20/2019 12:26,,2,,"

I tried to prepare and measure this Bell state on IBM Q. There is a low probablity, around few percent, that you measure states $|01\rangle$ or $|10\rangle$. But this is caused by a thermal noise and spontaneous break of the entangled state.

+",9006,,,,,11/20/2019 12:26,,,,2,,,,CC BY-SA 4.0 +8867,1,,,11/20/2019 12:40,,1,124,"

Recently, I used the transpile() function with the level 3 preset pass manager to compile a very long and complex circuit on a real device coupling map. I was curious to see how much the depth of the circuit would increase due to the inevitable swaps. The result was quite strange, the depth of the transpiled circuit was an order of magnitude lower than the original circuit.

+

When I drew the transpiled circuit I found that it was composed of some strange multi-qubit gates labeled as 'unitary' (see picture below), while most of the two-qubits gates from the original circuit were gone.

+

+

I was wondering what these unitaries could mean.

+",9200,,-1,,6/18/2020 8:31,11/20/2019 15:54,Strange circuit with multi-qubit 'unitary' gates after transpiler with optimization level 3,,1,0,,,,CC BY-SA 4.0 +8868,1,8870,,11/20/2019 13:11,,4,560,"

In IBM Q-Experience how can I upload a data file that I intend to read from the python code?

+",9201,,,,,11/20/2019 13:30,Data file read/write from within IBM Q-Experience Jupyter notebook,,1,0,,,,CC BY-SA 4.0 +8869,2,,8849,11/20/2019 13:21,,2,,"

There are no classical registers nor a clock in quantum computing

+

In classical computers you can have a well defined "current state at a given time" (stored notably in CPU registers and DRAM memory in modern systems), and this state changes with time (each CPU clock) in a controlled way.

+

Therefore, it is easier to map sequential description of an algorithm back to classical real hardware. For example, a classical algorithm might be described sequentially as:

+
a = b + c
+d = 2 * a
+
+

and in a classical computer this might actually be implemented in two separate steps:

+
    +
  • a CPU clock happens
  • +
  • one ADD instruction that stores the intermediate result to a register that represent a
  • +
  • a CPU clock happens
  • +
  • one MUL instruction which stores the final result to a register that represnts d
  • +
  • a CPU clock happens
  • +
  • ...
  • +
+

In quantum computing however, you cannot save the "intermediate state of a computation" and operate on it in a later step: you set up the inputs and the circuit, and information flows in a single indivisible step to the sensor device at the end of the circuit which makes a probabilistic reading.

+

Therefore, unless we are treating quantum circuits as black boxes between classical registers, sequential algorithm descriptions don't make much sense.

+

It is this fact that makes quantum computers much harder to program.

+

So a more likely useful description of quantum computing looks more like the combinatorial logic blocks (i.e. blocks with no registers and therefore no state) in hardware description languages such as Verilog and VHDL, which are just textual descriptions of a graph of circuits. This is exactly the case of IBM's OpenQASM quantum circuit description for example.

+

For example, in a Verilog combinatorial block, when you say:

+
a = b + c
+
+

it doesn't mean "on the next clock cycle of the algorithm, the register a will be worth b + c" like in say C or Python.

+

It rather means:

+
    +
  • a is a wire,
  • +
  • b is a wire
  • +
  • c is a wire
  • +
  • + is an adding circuit with b and c as inputs and a as output
  • +
+

Therefore, as soon as b or c change, a also "immediately" changes. With "immediately" in quotes because in practice electrons do take some time to move, and so we can't take the clock smaller than this propagation time.

+

A "propagation time" analogue is also present in quantum computers, where each experiment takes some time to finish, and the faster that time, the faster you can rerun the experiment to reduce uncertitude of the result.

+

Of course, for any maximum input size, you could make one huge combinatorial circuit that implements that algorithm. But in classical computing we don't do that because silicon is expensive to design and produce, so it is much more economical to design a circuit that solves a wider range of problems than a huge specialized circuit, even if each problem is solved a bit less fast.

+

In quantum computers, you don't have a choice. Unless you can use a divide and conquer style algorithm to generate smaller subproblems (which generally implies a P problem which might not be so interesting to a quantum computer), you just need a minimum number of qubits and gates for each given algorithm.

+",4243,,4243,,2/11/2022 8:43,2/11/2022 8:43,,,,7,,,,CC BY-SA 4.0 +8870,2,,8868,11/20/2019 13:30,,4,,"

If you go to the Qiskit Notebooks section, you will see this button

+ +

If you click import you can chose to upload the file from your computer into IQX.

+",5955,,,,,11/20/2019 13:30,,,,5,,,,CC BY-SA 4.0 +8871,2,,8867,11/20/2019 13:41,,1,,"

The point of the transplier is not only to map circuits to backends, but also to optimize the circuit to reduce the number of gates it contains so that the results you receive will (hopefully) be better. This is done through a series of optimizations, provided by things called transpiler passes. There is more information about them here.

+ +

A unitary in this case is quantum gate which can be represented by a matrix. You could try calling to_matrix() on this gate so you can see what action it is performing. It may have been formed by combining several gates into one. The 0 and 1 labels show which qubits it is acting on.

+",5955,,,,,11/20/2019 13:41,,,,2,,,,CC BY-SA 4.0 +8872,1,,,11/20/2019 14:14,,0,86,"

I recently attended a seminar where a professor of quantum cryptography told the audience that one quantum qubit can theoretically store ""infinite information"". I was very intrigued by this statement, and me being an absolute novice in this domain, do not have the means of verifying the validity of his statement. My questions are as follows:

+ +
+
    +
  1. Can we really compute the distance $|x - y| < \epsilon$ using a quantum qubit? If so, can anyone throw light on how this is done?
  2. +
  3. Also, if not, how far along are we in actually computing this quantity?
  4. +
  5. Can we measure if quantum computers approximate this quantity better (or worse?) than classical computers?
  6. +
+
+ +

Thanks a lot in advance!

+",8989,,55,,11/24/2020 14:22,11/24/2020 14:22,How close are we in achieving computation over reals using quantum qubits?,,0,3,,11/21/2019 13:05,,CC BY-SA 4.0 +8873,1,8874,,11/20/2019 14:38,,1,49,"

If an individual or commercial enterprise resorts to renting quantum computing power on the cloud, wouldn't the company who owns and hosts the quantum computer be able to see/monitor/eavesdrop on the electronic transmissions that their customers make, causing privacy concerns? And about adoption, first of all, how has the business and usage statistics of renting cloud services been for supercomputers anyway?

+ +

About error correction, How would the user be able to verify the reliability of the estimates and solutions returned by the superconductor they are renting, given how the current state of the technology is widely known to lack error correction mechanisms, or is that just a misconception?

+",9118,,26,,11/20/2019 15:52,11/20/2019 16:33,"Renting quantum on the cloud: data privacy, adoption and error correction",,1,0,,,,CC BY-SA 4.0 +8874,2,,8873,11/20/2019 15:20,,1,,"

These are two separate questions, so I will (try to) answer them separately as well.

+ +

Concerning the (reduction of) privacy in remote or cloud computing.

+ +

Without any alterations, the instructions for a quantum computation that is to be run on a remote computer can be seen by that remote computer. That is to say, if you want to conceal the computations that you want to perform (be it the type of computations or the input to said operation), this is not possible using this approach.

+ +

There is a parallel to be made to classical remote computation: there exist methods to hide/encrypt the input parameters to some remote computation, which is known as Homomorphic encryption. This can be used to hide the input parameters of the quantum computation as well, in principle.$^{1}$.

+ +

To conceal the type of computation that you want to perform, is a much more challenging task. There is no way of doing this in classical computation that I know of, but there is a method that can be used in quantum computing. +For this to work, you need to have a quantum channel to the remote machine (i.e. an internet-type link over which you can send qubits). This method is known as blind quantum computing, and is very much in an active area of research.

+ +

Concerning error correction, or the lack thereof

+ +

You are right in saying that current quantum computers have too few qubits to perform active reliable error correction. This is true for both local and remote quantum computers. However, the answers of most computations that quantum computers perform are relatively easy to test: they are hard to compute, but easy to assert. This means that one just tests the answer returned by the remote machine and through that determines the reliability of the remote machine.

+ +

Furthermore, there exist types of computations that are less affected by the current noise levels of qubits; see for instance VQE's. These types of algorithms are more readily implemented on current hardware.

+ +

$^{1}$ I believe that this is the case, I am not an expert on the matter.

+",8141,,8141,,11/20/2019 16:33,11/20/2019 16:33,,,,0,,,,CC BY-SA 4.0 +8876,2,,8843,11/20/2019 18:52,,4,,"

The comment made by arriopolis is correct. The output registers of these compiled circuits are important for synthesizing the circuit, but not particularly interesting to measure. As you saw already, those measurements just match the truth tables they were designed to match.

+ +

The QFT and measurements intended for this circuit are

+ +

+ +

which gives the probability distributions

+ +

+ +

(If the code implementing any of this would be helpful to anyone, just let me know in the comments.)

+ +

The significance of these probability distributions is that they match the expectations of theory for analogous registers of a general implementation of Shor's algorithm. The authors show how this works in detail in Section V, along with proposed uses including quantifying entanglement capacity and noise.

+ +

The punchline is that these distributions match the diagonal elements of a reduced density matrix, tracing over the output register to get

+ +

$$\rho_p \equiv \text{tr}_o(\vert \phi_p \rangle \langle \phi_p \vert).$$

+ +

These are tabulated for this particular case in Table XI (it's clear a priori that $p=3$). Note that the authors' intent to represent binary numbers in the registers by integers was made clear earlier in the section.

+ +

However, the circuit above is only an intermediate step towards the authors' aim of substantial simplification of a complex circuit. For example, the composite density matrix for this circuit, which is a necessary step in getting to Table XI, has dimension $2^8 \times 2^8$.

+ +

Noting that 5 qubits are used to represent three values (1, 4, and 16) on the output register, the authors use a $\text{log}_4$ map to synthesize the much improved circuit

+ +

+ +

which remarkably has the same probability distribution on the input register (i.e. matches the same row in Table XI) and maintains the $\text{log}_4$ map between output registers.

+",8623,,8623,,11/20/2019 19:10,11/20/2019 19:10,,,,0,,,,CC BY-SA 4.0 +8877,1,,,11/20/2019 20:42,,1,42,"

OpenQasmReader was added in https://github.com/microsoft/Quantum/pull/58. I can't find this code on the latest clone of the aforementioned repository. Going through the commits, I found that it had been de-referenced in the README.

+",362,,,,,11/20/2019 20:42,Where is OpenQasmReader in Q#?,,1,0,,,,CC BY-SA 4.0 +8878,2,,8877,11/20/2019 20:42,,1,,"

OpenQasmReader was moved to another repository.

+",362,,,,,11/20/2019 20:42,,,,0,,,,CC BY-SA 4.0 +8879,2,,1631,11/20/2019 21:51,,2,,"

Entanglement is a quantum physical phenomenon, demonstrated in practical experiments, mathematically modeled in quantum mechanics. We can come up with several creative speculations of what it is (philosophically), but at the end of the day we just have to accept it and trust the math.

+ +

From a statistics point of view we can think of it as a complete correlation (1 or -1) between two random variables (the qubits). We may not know any these variables outcome beforehand, but once we measure one of them, due to the correlation, the other will be previsible. +I recently wrote an article on how quantum entanglement is handled by a quantum computing simulator, wich you may find helpful as well.

+",9207,,,,,11/20/2019 21:51,,,,3,,,,CC BY-SA 4.0 +8881,2,,2151,11/21/2019 0:25,,5,,"

The most recent quantum machine learning textbook is

+ +

Schuld and Petruccione (2018). Supervised Learning with Quantum Computers

+ +

while a nice companion to Nielsen and Chuang for introductory quantum maths is

+ +

Marinescu and Marinescu (2011). Classical and Quantum Information, +Chapter 1: Preliminaries

+",9118,,9118,,11/21/2019 0:41,11/21/2019 0:41,,,,0,,,,CC BY-SA 4.0 +8882,1,8884,,11/21/2019 9:13,,1,736,"

I have the really odd problem when it comes to plotting Bloch spheres using QuTip. Plotting state vectors works perfectly fine e.g.

+ +
from qutip import *
+import numpy as np
+import matplotlib.pyplot as plt
+
+b = Bloch()
+s = Qobj([[1],[0]])
+b.add_states(s)
+b.show()    
+
+ +

But when I try to plot points on the Bloch sphere using QuTiP

+ +
from qutip import *
+import numpy as np
+import matplotlib.pyplot as plt
+
+b = Bloch()
+pnt = [1,1,1]
+b.add_points(pnt)
+b.show()
+
+ +

I get the following error message

+ +
Traceback (most recent call last):
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/matplotlib/backends/backend_macosx.py"", line 80, in _draw
+    self.figure.draw(renderer)
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/matplotlib/artist.py"", line 38, in draw_wrapper
+    return draw(artist, renderer, *args, **kwargs)
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/matplotlib/figure.py"", line 1709, in draw
+    renderer, self, artists, self.suppressComposite)
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/matplotlib/image.py"", line 135, in _draw_list_compositing_images
+    a.draw(renderer)
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/matplotlib/artist.py"", line 38, in draw_wrapper
+    return draw(artist, renderer, *args, **kwargs)
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/mpl_toolkits/mplot3d/axes3d.py"", line 292, in draw
+    reverse=True)):
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/mpl_toolkits/mplot3d/axes3d.py"", line 291, in <lambda>
+    key=lambda col: col.do_3d_projection(renderer),
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/mpl_toolkits/mplot3d/art3d.py"", line 545, in do_3d_projection
+    ecs = (_zalpha(self._edgecolor3d, vzs) if self._depthshade else
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/mpl_toolkits/mplot3d/art3d.py"", line 847, in _zalpha
+    rgba = np.broadcast_to(mcolors.to_rgba_array(colors), (len(zs), 4))
+  File ""<__array_function__ internals>"", line 6, in broadcast_to
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/numpy/lib/stride_tricks.py"", line 182, in broadcast_to
+    return _broadcast_to(array, shape, subok=subok, readonly=True)
+  File ""/Users/turbotanten/anaconda3/lib/python3.7/site-packages/numpy/lib/stride_tricks.py"", line 127, in _broadcast_to
+    op_flags=['readonly'], itershape=shape, order='C')
+ValueError: operands could not be broadcast together with remapped shapes [original->remapped]: (0,4) and requested shape (2,4)
+
+ +

I have tried using different matplotlib backends like TkAgg without any success. I don't know how to fix this problem.

+",2136,,26,,11/21/2019 16:27,11/21/2019 16:27,Can't plot points on the Bloch sphere (QuTip),,1,0,,,,CC BY-SA 4.0 +8883,1,8891,,11/21/2019 10:09,,4,360,"

In Cirq, quantum circuit consists of moments, which in turn consists of operations. This is different from Qiskit/OpenQASM, which doesn’t have the concept of moments. What is the design philosophy behind the moment-based quantum circuit? What are the advantages and disadvantages of it?

+ +

As a result of moments, one can insert operations in different moments using different insert strategies. It seems to me the earliest insert strategy is always preferred, which is the same as Qiskit/OpenQASM. What are the use cases for different insert strategies?

+",7474,,26,,11/21/2019 16:27,11/21/2019 19:36,Moments-based quantum circuit in Cirq,,1,1,,,,CC BY-SA 4.0 +8884,2,,8882,11/21/2019 10:56,,1,,"

I found a solution to my problem here https://github.com/qutip/qutip/issues/1027

+ +

Apparently plotting points on the Bloch sphere does not work with Matplotlib v3.1.0. +So I had to downgrade to v.3.0.3 for it to work!

+",2136,,,,,11/21/2019 10:56,,,,0,,,,CC BY-SA 4.0 +8886,1,,,11/21/2019 15:03,,0,97,"

I'm looking for an entrypoint to learning about quantum computing to which I'm exposed only by popular science articles and some qiskit materials so far. I understand that it's entirely possible that I'm insulated from the underlying math and implementation details, but I'm not interested in that. Considering my background is in classical programming, mostly imperative languages, what's a good book or set of other materials to get me started but with a view to eventually go deep?

+",9215,,26,,11/21/2019 16:25,11/21/2019 16:25,Intro to quantum computing for programmers,,1,1,,11/25/2019 21:31,,CC BY-SA 4.0 +8887,2,,8886,11/21/2019 15:22,,6,,"

I don't think I agree - you really do need a grasp of quantum computing mechanics (including the math) in order to do any programming

+ +

TLDR: Quantum computers are so specialized and the software is so close to the physical realization that you need an understanding of the math of quantum algorithms.

+ +

Here's my logic

+ +

With classical computers, we have a large workforce of programmers who don't understand the physical implementation of bits, the semiconducting gates, etc. But, that's because the physical realization has been heavily abstracted away - we think in data structures that are far removed from bit realizations. So, they don't need to think of primitive logic gates when programming, as compilers already bring it to the bit level.

+ +

For quantum computers, we don't have these far off abstractions yet - we barely can achieve 50+ qubits (with so-so error correction), so an understanding of the underlying mechanics of qubits is critical. Programming a quantum computer is modifying individual qubits with gates, so you need to understand how the gates affect qubits. Also, quantum computers aren't meant for general computing - they're meant for tough, math heavy problems (like machine learning, molecular simulation, cryptography).

+",8343,,,,,11/21/2019 15:22,,,,0,,,,CC BY-SA 4.0 +8888,1,8890,,11/21/2019 16:02,,1,159,"

Could someone guide me on how to create my own qiskit.result.models.ExperimentResultData object? I would simply like to create an object with some self-created dict of counts.

+ +

Creating qiskit.result.models.ExperimentalResults object is somehow easy, since by calling it from qiskit.result.models.ExperimentResults, I simply pass the required attributes. But somehow I was not able to figure out how to do the same with qiskit.result.models.ExperimentResultData, which should be passed as ""data"" attribute to qiskit.result.models.ExperimentalResults object.

+",9216,,5955,,11/21/2019 17:04,11/21/2019 17:04,qiskit - Creating your own ExperimentResultData object,,1,0,,,,CC BY-SA 4.0 +8889,1,,,11/21/2019 16:31,,2,814,"

If I consider $a|00\rangle + b|01\rangle +c|10\rangle +d|11\rangle$ as a valid two-qubit system, what is the probability of measuring the first qubit in state $\frac{1}{\sqrt 2}(|0⟩+|1⟩)$?

+ +

I know that the probability of measuring the first qubit in state $|0\rangle$ is $|a|^2 + |b|^2$, but I couldn't figure out how it works here. Thanks in advance.

+",9218,,55,,11/22/2019 14:50,11/22/2019 14:50,Probability of measuring the first qubit in the state $\frac{1}{\sqrt 2}(|0⟩+|1⟩)$ in a two-qubit state,,1,1,,,,CC BY-SA 4.0 +8890,2,,8888,11/21/2019 16:59,,2,,"

You should be able to do this by simply creating an instance of the class. This can be done as follows

+ +
from qiskit.validation import base
+raw_counts = {'0x0': 4, '0x2': 10}
+data = models.ExperimentResultData(counts=base.Obj(**raw_counts))
+
+ +

There are lot of examples of how to do this in the testing file for these classes.

+",5955,,,,,11/21/2019 16:59,,,,2,,,,CC BY-SA 4.0 +8891,2,,8883,11/21/2019 19:36,,4,,"
+

What is the design philosophy behind the moment-based quantum circuit? What are the advantages and disadvantages of it?

+
+ +

The basic idea is that we wanted to give users more control over what will actually happen on hardware. Whether or not two gates are run in parallel is really important information when dealing with noise (e.g. it determines total runtime), so it's important for users to be able to determine-whether that's happening and also control-if that's happening.

+ +

The philosophy of giving more control isn't limited to moments. Cirq also requires users to specify specific qubits (no implicit placement), and to use the native gateset of whatever device they are targeting (no implicit decomposition). The important thing is that you should be able to have a clear concrete idea of what will actually happen on the device.

+ +

Cirq also has the concept of a ""schedule"", which has even more control over timing. But ironically we've found that users don't want to use it, and programmers don't like consuming it. So we're actually cutting that next version.

+ +

The list-of-moments structure seems to be a nice sweet spot in terms of flexibility, ease of production, and ease of consumption. You can certainly put the abstraction boundary in other places, but that's where we've found ourselves pulled towards.

+ +
+

It seems to me the earliest insert strategy is always preferred

+
+ +

It's a good rule of thumb, which is why it's the default. But it's not always optimal. For example, hardware may perform best when circuits are stratified into layers of single-qubit gates and layers of two-qubit gates (but never a layer with both single and two qubit gates). So even if you can move a single qubit operation earlier, that may result in it being in the same layer as two qubit operations. Moving it would not be a fatal mistake, the circuit would still run, but it might be slightly noisier. There are lots of ""little things"" like that when dealing with hardware.

+",119,,,,,11/21/2019 19:36,,,,4,,,,CC BY-SA 4.0 +8893,1,8894,,11/21/2019 21:23,,7,838,"

Why is the order reversed on measurement?

+ +
from qiskit import(
+  QuantumCircuit,
+  execute,
+  Aer)
+from qiskit.visualization import plot_histogram
+
+# Use Aer's qasm_simulator
+simulator = Aer.get_backend('qasm_simulator')
+
+# Create a Quantum Circuit acting on the q register
+circuit = QuantumCircuit(3, 3)
+
+# Add a X gate on qubit 0
+circuit.x(0)
+
+# Add a CX (CNOT) gate on control qubit 0 and target qubit 1
+circuit.cx(0, 1)
+
+circuit.barrier()
+# Map the quantum measurement to the classical bits
+circuit.measure([0,1,2], [0,1,2])
+
+# Execute the circuit on the qasm simulator
+job = execute(circuit, simulator, shots=1000)
+
+# Grab results from the job
+result = job.result()
+
+# Returns counts
+counts = result.get_counts(circuit)
+print(""\nTotal count:"",counts)
+
+# Draw the circuit
+circuit.draw()
+
+ +

Got result:

+ +
+

Total count for 00 and 11 are: {'011': 1000}

+
+ +

But I'm expecting '110'.

+",9223,,9223,,11/21/2019 22:40,4/27/2021 19:04,Why is the order reversed on measurement?,,3,0,,,,CC BY-SA 4.0 +8894,2,,8893,11/21/2019 22:39,,6,,"

I still run into this issue too. If you consider $|q0\rangle$ to be the most significant bit (MSB) you have to map it to the most significant classical bit as well, which is in your case a bit no. 2. Or you can flip your quatnum circuit upside down and then $|q0\rangle$ become the least significant bit (LSB) and the measurement will meet your expectation.

+ +

A code

+ +
circuit.measure([0,1,2], [0,1,2])
+
+ +

is valid in case $|q0\rangle$ is LSB and

+ +
circuit.measure([0,1,2], [2,1,0])
+
+ +

in case $|q0\rangle$ is MSB.

+ +

I think that the reason for this arrangement is simply a convention, so you can choose whether $|q0\rangle$ is MSB or LSB and set the measurement procedure accordingly.

+",9006,,,,,11/21/2019 22:39,,,,1,,,,CC BY-SA 4.0 +8895,2,,5215,11/21/2019 23:30,,2,,"

I will try to give an answer from complexity theory's point of view. This question should be asked in cs.stackexchange by the way. The Deutsch-Jozsa problem has an efficient algorithm on quantum computation and on a classical probabilistic Turing machine, so it is in BQP and BPP. There is no result that says: if you show a problem A in BQP and not in P, then P is different from BQP. Thus, in order to prove P $\ne$ BQP, first consider the probabilistic part of P which is BPP [since complexity theorist believe that P $=$ BPP and it is better to compare a a probabilistic version of P with the quantum world of P, which is BQP] then according to complexity's theorist, they say that you need to prove something very hard like: P $\ne$ PSPACE to work on this BBP$ \ne$ BQP, here is a part of the answer by Greg Kuperberg says:

+ +
+

BQP $\ne$ BPP is another thing that people can't prove, because they are both sandwiched between P and PSPACE and no one can prove that P $ \ne $ PSPACE either. (In fact it's worse than that, there are major results on how not to prove that P $\ne$ PSPACE.)

+
+ +

How is it that Deutsch-Jozsa has a probabilistic polynomial running time? Here for this paper, it states the following in page 2:

+ +
+

the Deutsch-Jozsa problem has an efficient solution on a classical probabilistic Turing machine [8, 9]

+
+",1899,,55,,11/22/2019 7:57,11/22/2019 7:57,,,,2,,,,CC BY-SA 4.0 +8896,2,,8889,11/22/2019 0:02,,3,,"

Given an arbitrary state $|\psi\rangle$, if it is expressed in the computational basis as $|\psi\rangle=\sum_k c_k |k\rangle$, then it will give the $k$-th result (when measuring in the computational basis) with probability $|c_k|^2$.

+ +

Note that here by ""computational basis"" I simply mean the measurement basis under consideration.

+ +

If you consider another type of measurement, corresponding to a different basis, say $\{|u_k\rangle\}_k$, then to figure out the outcome probabilities in this new basis you need to express $|\psi\rangle$ in terms of the $|u_k\rangle$. Say that doing this you get something of the form +$$|\psi\rangle = \sum_k d_k |u_k\rangle.$$ +That means that the outcome corresponding to $|u_k\rangle$ is obtained with probability $|d_k|^2$.

+ +

If you start with a description of the state in the $|k\rangle$ basis, and want to switch to a description in terms of the $|u_k\rangle$ one, you simply need to compute the inner products $\langle u_k|\psi\rangle=d_k$.

+ +

More generally, given a state $|\psi\rangle$, the probability of finding it in a state $|\phi\rangle$ is given by $|\langle\phi|\psi\rangle|^2$.

+ +

There is, however, a slightly more general way to do measurements, that doesn't (necessarily) involve a full collapse of the state. You can ask questions of the form ""is the state in a given subspace?"". For example, you can ask whether a state is in one of first $3$ (or any other subset of) computational basis states. You model this situation by using a projector $P$ that projects onto the required basis, and the associated measurement probability is then given by $\|P|\psi\rangle\|^2$.

+ +

Taking as an example your specific case, you have a bipartite state expressed in terms of the computational basis $\{|00\rangle,|01\rangle,|10\rangle,|11\rangle\}$ with coefficients $a,b,c,d$. Let's call this state $|\psi\rangle$. +You are asking about the probability of the state being found in the subspace $\{|+,0\rangle, |+,1\rangle\}$. To compute this probability you therefore write down the projector $P$ defined as +$$P = |+,0\rangle\!\langle +,0| + |+,1\rangle\!\langle +,1| +\equiv |+\rangle\!\langle +| \otimes I_2,$$ +and you compute $\|P|\psi\rangle\|^2$. +Equivalently, you just rewrite $|\psi\rangle$ expressing the first qubit in the $|\pm\rangle$ basis, and then sum the probabilities of finding it in either $|+,u\rangle$ or $|+,v\rangle$, with $\{|u\rangle,|v\rangle\}$ the basis chosen for the second qubit (it doesn't matter which one is used).

+",55,,55,,11/22/2019 14:28,11/22/2019 14:28,,,,2,,,,CC BY-SA 4.0 +8898,1,9300,,11/22/2019 1:27,,4,157,"

Many scientific programmers get by fine without having a computer science background, i.e. they don't need to know the machinery behind the prevailing paradigm of 0's and 1's (bits), let alone basic logic, to code.

+ +

Given this lack of awareness of classical computing's inner workings, what are stand-out concepts from classical computing that every aspiring quantum programmer should know?

+",9118,,1386,,12/3/2019 10:06,12/22/2019 23:55,What concepts from classical computing are vital for quantum programmers?,,1,1,,,,CC BY-SA 4.0 +8900,1,,,11/22/2019 5:32,,10,3059,"

DiVincenzo criteria for quantum communication mentions flying qubits:

+ +

a. The ability to interconvert stationary and flying qubits +b. The ability to faithfully transmit flying qubits between specified locations

+ +

So, what exactly is a flying qubit, and how is it related to and different from a normal qubit? +Please help understand more. +I am undertaking Delft University's course in EdX on Quantum Internet and Quantum Computers.

+",9227,,4501,,2/3/2021 15:36,2/3/2021 15:36,What is a flying qubit?,,1,0,,,,CC BY-SA 4.0 +8901,1,,,11/22/2019 5:49,,3,82,"

Recently there has been interest in understanding the out of time order correlation function (OTOC) $F$, which essentially compares the overlap of two operators $W$ and $V$ acting on a state in two different ways

+
    +
  1. Apply $V$ onto a quantum state, wait a time $t$, then apply $W$
  2. +
  3. Apply $W$ at time $t$, then reverse time to $t=0$ and apply $V$
  4. +
+

This correlation function then takes the form +$$F=\langle W_t^{\dagger} V^{\dagger} W_t V \rangle$$

+

Roughly speaking, $F$ tells you how quickly interactions make the initially commuting $V$ and $W$ stop commuting.

+

Completing step (1) above is straightforward, you just apply the operators one after another. However (2) is more challenging, because one has to reverse the direction of time.

+

The most obvious way to implement (2) is to reverse time through changing the sign of the entire Hamiltonian $H \rightarrow -H$, which effectively reverses the time evolution. Needless to say, this is very tricky in dissipative/open systems, as you can only reverse the sign of a select part of the Hamiltonian, but not all of it.

+

My question is the following: is it meaningful to think about OTOCs in the interaction picture? I ask because it is often the case in experiment (e.g. NMR Hahn echo experiments) that you can reverse the sign of the interaction Hamiltonian but not the full Hamiltonian. What does the OTOC tell you with respect to time evolution in the interaction picture?

+

More concretely, say you have the following spin Hamiltonian

+

$$H = H_0 + g \sum_i \mathbf{S}_i\cdot \mathbf{B}$$

+

Where $H_0$ is some unknown function of the spin operators.

+

Assume that you can change the sign of the magnetic field $\mathbf{B}$ at will, like in NMR. Is there anything interesting about the resulting OTOC in this case? Or does it not have any of the useful properties of "true" OTOCs?

+",2260,,2260,,11/6/2022 15:58,11/6/2022 15:58,Out-of-time-order correlation function in the interaction picture?,,0,1,,,,CC BY-SA 4.0 +8902,2,,8900,11/22/2019 9:18,,11,,"

Preliminary - The DiVincenzo criteria for a 'normal' quantum computer

+

The DiVincenzo criteria, as originally proposed by DiVincenzo, are $5$ criteria that he originally proposed in his seminal 2000 paper. In this paper, he proposed five criteria, which are widely considered to be the five (sufficient and necessary) criteria that any physical quantum computer should meet.

+

As you are doing the TUD quantum crypto course, you are familiar with the concept of a quantum internet. The five DiVincenzo criteria are not sufficient for quantum computer(s) connected over a quantum internet; they come up short in the communication part. For this, two more criteria (nr. $6$ & $7$) have been 'added'. They were also proposed by DiVincenzo in his paper, but in a separate section.

+

I have met people who, by using the term 'The DiVincenzo criteria', refer to only the first five criteria and others who use it to refer to all seven collectively. I tend to view the first five as regarding to stationary qubits, and the latter two as regarding to flying qubits and make the distinction by using this view, but please view that as my personal opinion.

+

The latter two criteria

+

Criteria $6$ & $7$ have to do with communication between different quantum computers or nodes. To exchange (quantum) information between two nodes, one needs to have a carrier of this quantum information. This is exactly what a flying qubit should be: a qubit that can be freely send from one node to the other.

+

The first extra criterium prescribes that the information encoded in a qubit within the quantum computer (often referred to as the stationary qubit in this context) should be reliably transferred to a flying qubit. Additionally, an obtained flying qubit's information needs to be reliably transferred back to a stationary qubit as well.

+

The second extra criterium prescribes that such a flying qubit should be reliably send from one node to another. This is a daunting task if you consider that the nodes might be (geographically) very far apart ($> 50$km). The coherence of the flying qubit needs to be preserved over this scale, possibly (likely) with the use of error correction.

+

Properties of a flying qubit when compared to a stationary qubit

+

A flying qubit should, just as a stationary qubit, be able to reliably store quantum information. However, there are some important distinctions. +First and foremost, flying qubits have a more restricted use case than stationary ones - they are only used to propagate the information between macroscopic distances, whereas stationary qubits are used to not only store information, but also to perform calculations with.

+

So to compare:

+

Stationary qubits need to:

+
    +
  • Be able to store quantum information reliably on a timescale of $\sim ms$.

    +
  • +
  • Perform calculations: various gates/operations need to be reliably performed on them. This includes an operation that moves/converts the information to a flying qubit.

    +
  • +
  • Be able to be measured/read out reliably.

    +
  • +
  • Be able to be highly entangled.

    +
  • +
+

Flying qubits, however, need to:

+
    +
  • Be send over macroscopic distances while keeping their encoded (quantum) information intact.

    +
  • +
  • Be operational on a macroscopic temperature scale (i.e. about room temperature).

    +
  • +
  • Perform only one single operation reliably: converting into stationary qubits.

    +
  • +
  • Be able to be entangled.

    +
  • +
+

Therefore, there are some important distinctions between the two. To summarize in what I believe is their defining distinctions:

+
    +
  • Stationary qubits need to be reliably calculated with.
  • +
  • Flying qubits need to be reliably transmitted over macroscopic distances.
  • +
+

Physical implementation of a flying qubit

+

There exist myriad different implementations of stationary qubits that all have their advantages and disadvantages; it is still an open question what the final 'go to' stationary qubit design (if any) will be. +For flying qubits, there is one clear design which is the most promising: the photon. The photon travels very fast, and has a straightforward two-level system (namely, its polarization). Also, this polarization can be conserved at higher temperatures. Note that other encodings of the qubit into the photon are also possible, for instance the time-bin encoding.

+

Note that it is highly unlikely that stationary and flying qubits will be based on the same physical principle or design. That is to say, stationary qubits will most likely be based on an entirely different physical phenomenon than stationary qubits (e.g. Ion traps, superconducting qubits/transmons, quantum dots, other confined electron systems etc. for stationary qubits.) There are, however, designs for a quantum computer (with stationary qubits) based on the use of photons; only time will tell what actual implementation of stationary and flying qubits will prevail.

+

Current implementations of flying qubits

+

As an interesting sidenote, in the context of quantum key distribution, flying qubits are used in the key distillation. However, for these types of protocols to work, often only a subset of all possible qubit states need to be transferred (often this are the eigenstates of the $Z$ and $X$ operators); this reduces the complexity of the flying qubits. Note that for a general quantum internet this reduction needs to be omitted.

+",8141,,8141,,2/3/2021 9:59,2/3/2021 9:59,,,,4,,,,CC BY-SA 4.0 +8904,1,8906,,11/22/2019 13:59,,2,1236,"

I am trying to understand how CNOT or X gate can be explained by even more basic gates.

+ +

I went through these 2 links that explained the relation, but for my understanding, I am trying to prove it by matrix form. And yes I am clearly disabled in mathematics.

+ +

Link:1 +Link:2

+ +

+ +

So, let's take the case where first Qbit(Q1) is the control and the second Qbit(Q2) is the target.

+ +

As per the articles, CNOT can be explained by $(I\times H)\cdot Z\cdot(I\times H)$. where X is matrix multiplication and (.) refers to dot product.

+ +

So, I went on to first convert all of them to the matrix +Step 1:

+ +

$\left(\begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}\times{1\over\sqrt2}\begin{bmatrix}1 & 1\\1 & -1\end{bmatrix}\right)\cdot\begin{bmatrix}1 & 0\\0 & -1\end{bmatrix}\cdot\left(\begin{bmatrix}1 & 0\\0 & 1\end{bmatrix}\times{1\over\sqrt2}\begin{bmatrix}1 & 1\\1 & -1\end{bmatrix}\right)$

+ +

I have my doubts if this understanding itself is correct but let's continue hoping it is.

+ +

Step 2: +$\left({1\over\sqrt2}\begin{bmatrix}1 & 1 & 0 & 0\\1 & -1 & 0 & 0\\0 & 0 & 1 & 1\\0 & 0 & 1 & -1 \end{bmatrix}\right)\cdot\begin{bmatrix}1 & 0\\0 & -1\end{bmatrix}\cdot\left({1\over\sqrt2}\begin{bmatrix}1 & 1 & 0 & 0\\1 & -1 & 0 & 0\\0 & 0 & 1 & 1\\0 & 0 & 1 & -1 \end{bmatrix}\right)$

+ +

Does this approach look right? if so, how should I approach further? if not what am I missing?

+ +

I even tried to take a smaller bit to solve and tried to solve this:

+ +

$X = H\cdot Z \cdot H$

+ +

Step 1: +$X = {1\over\sqrt2}\begin{bmatrix}1 & 1\\1 & -1\end{bmatrix}\cdot \begin{bmatrix}1 & 0\\0 & -1\end{bmatrix} \cdot {1\over\sqrt2}\begin{bmatrix}1 & 1\\1 & -1\end{bmatrix}$

+ +

Step 2: +$X = {1\over2}\begin{bmatrix} 1*1 & 1*0 \\ 1*0 & -1*-1\end{bmatrix}\cdot \begin{bmatrix}1 & 1 \\ 1 & -1\end{bmatrix}$

+ +

Step 3: +$X = {1\over2}\begin{bmatrix} 1 & 0 \\ 0 & 1\end{bmatrix}\cdot \begin{bmatrix}1 & 1 \\ 1 & -1\end{bmatrix}$

+ +

Step 4: +$X = {1\over2}\begin{bmatrix} 1*1 & 0*1 \\ 0*1 & 1*-1\end{bmatrix}$

+ +

Step 5: +$X = {1\over2}\begin{bmatrix} 1 & 0 \\ 0 & -1\end{bmatrix}$

+ +

once again, this is not Pauli-X gate, so I must be doing something stupid. +Please help and guide me.

+",9193,,26,,11/23/2019 4:40,11/23/2019 4:40,How to translate CNOT gate by Hadamard and Pauli Z gate in matrix form?,,1,5,,,,CC BY-SA 4.0 +8905,1,,,11/22/2019 14:27,,3,58,"

I am reading through the following article: https://arxiv.org/abs/1312.2579 +and I really struggle to understand anything of the section ""D. The standard graph-coloring method"" on page 7 and ""E. The band-coloring method"" on page 8 as well. I've been through plenty of articles that say they use this method, but I am having a hard time understanding anything that is done here. If someone here has any idea, it would be really appreciated if a walkthrough could be provided.

+",5632,,26,,11/23/2019 4:39,11/23/2019 4:39,Graph coloring to reduce the number of qubits in VQE,,0,0,,,,CC BY-SA 4.0 +8906,2,,8904,11/22/2019 16:17,,3,,"

I think you have a slight misunderstanding of what the $Z$ gate in the screenshot you attached is. It is, in fact, not a Z gate, but a (2-qubit) $CZ$ or controlled-$Z$. gate, also referred to as a controlled-phase gate (because the $Z$ operation is a flip of the phase of the $|1\rangle$ state).

+ +

This $CZ$ gate is a lot like the $CX$ gate, however, it performs a $Z$ operation on the second qubit, but only if the state of the first qubit is $|1\rangle$ state. If the first is in the $|0\rangle$ state it performs nothing (i.e. $I$ operation) on the second qubit instead.

+ +

In more technical terms, we can write thus: +\begin{equation} +CZ = |0\rangle \langle0| \otimes I + |1\rangle \langle1| \otimes Z. +\end{equation}

+ +

Then: +\begin{equation} +(I \otimes H) CZ(I\otimes H) = |0\rangle \langle0| \otimes HIH + |1\rangle \langle1| \otimes HZH. +\end{equation}

+ +

We can simplify the $HIH$ term easily: $HIH = HH = I$, from the properties of $I$ and $H$. +The $HZH$ term is actually equal to $X$: +\begin{equation} +\begin{split} +HZH &= \frac{1}{2}\begin{bmatrix}1 & 1 \\ 1 & -1\end{bmatrix}\begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix}\begin{bmatrix}1 & 1 \\ 1 & -1\end{bmatrix}\\ +&= \frac{1}{2}\begin{bmatrix}1 & -1 \\ 1 & 1\end{bmatrix}\begin{bmatrix}1 & 1 \\ 1 & -1\end{bmatrix} \\ +&= \frac{1}{2}\begin{bmatrix}0 & 2 \\ 2 & 0\end{bmatrix}\\ +&= \begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix} = X. +\end{split} +\end{equation} +So we can write: +\begin{equation} +(I \otimes H) CZ(I\otimes H) = |0\rangle \langle0| \otimes HIH + |1\rangle \langle1| \otimes HZH = |0\rangle \langle0| \otimes I + |1\rangle \langle1| \otimes X. +\end{equation} +That is to say, an operation that performs the $X$ operation on the second qubit if the first qubit is in the $|1\rangle$ state (and nothing if the first qubit is in the $|0\rangle$ state). This is, of course, exactly the $CX$ gate which we are looking for.

+",8141,,,,,11/22/2019 16:17,,,,1,,,,CC BY-SA 4.0 +8908,1,,,11/22/2019 18:05,,6,2065,"

I'm interested in quantum computing, specifically in “quantum machine learning” (QML). I'm going to start my masters program in computer science and have previous experience in classical machine learning. I'd like to learn quantum mechanics generally but focus on quantum algorithms.

+ +

I have read about Qiskit and Pennylane, but I'm unsure where to look next. Could you recommend books, courses, and papers to gain background into QML? My goal is to use Qiskit and Pennylane to develop QML algorithms in NISQ systems for data science and big data.

+ +

Another question - can we use quantum computing to develop Bayesian deep learning models (Gaussian processes, bayesian quantum circuits) for data science and big data? Thanks in advance.

+",9226,,1859,,10/8/2022 21:06,10/8/2022 21:06,Pennylane and Qiskit for quantum machine learning,,3,1,,,,CC BY-SA 4.0 +8909,2,,8908,11/22/2019 21:57,,6,,"

Have a look at these for quantum machine learning:

+ + +",9118,,9118,,11/24/2019 18:32,11/24/2019 18:32,,,,0,,,,CC BY-SA 4.0 +8910,2,,8862,11/23/2019 6:16,,2,,"

You can found some interesting approaches to decomposing gates also here: https://arxiv.org/abs/quant-ph/9503016 (Elementary gates for quantum computation).

+",9006,,,,,11/23/2019 6:16,,,,0,,,,CC BY-SA 4.0 +8911,2,,8742,11/23/2019 17:58,,1,,"

We can proceed by applying the parity check matrix $H_2$ for $C_2^\perp$ on the ancilla, which would become $\vert H_2(z'+e_2)\rangle =\vert H_2(z'+u + e_2 -u)\rangle =\vert H_2(e_2-u)\rangle$. Measuring the ancilla gives us $H_2(e_2-u)$. As $u$ is known. we then know $H_2 e_2$, and in turn $e_2$. +After correcting the now bit flip $e_2$, we have: +$$\dfrac{1}{\sqrt{2^n/\vert C_2\vert}}\sum_{z'+u\in C_2^{\perp}}(-1)^{(x+v)z'}|z'\rangle \label{eq:1}\tag{$\star$}$$ +We then re-apply Hadamard gates to each qubit of $\eqref{eq:1}$, which is equivalent to applying Hadamard gates to the state on the final line of the question $$\dfrac{1}{\sqrt{2^n/\vert C_2\vert}}\sum_{z'+u\in C_2^{\perp}}(-1)^{(x+v)z'}|z'+e_2\rangle$$ with $e_2=0$. Hadamard gates are self-inverse, so we get back $$\dfrac{1}{\sqrt{|C_2|}}\sum_{y\in C_2}(-1)^{u\cdot y}(-1)^{(x+y+v)\cdot 0}\vert x+y+v\rangle $$ which is the original encoded state: +$$\dfrac{1}{\sqrt{|C_2|}}\sum_{y\in C_2}(-1)^{u\cdot y}\vert x+y+v\rangle $$

+",7460,,7460,,11/23/2019 18:08,11/23/2019 18:08,,,,0,,,,CC BY-SA 4.0 +8912,1,8934,,11/23/2019 18:36,,8,601,"

I noticed that approaches for finding quantum algorithms the hidden subgroup problem for both Abelian groups ($(\Bbb Z_n\times \Bbb Z_n, +)$, $(\Bbb R, +)$, etc.) and non-Abelian finite groups like the dihedral group and symmetric group often use representation theory.

+ +
    +
  1. Why is this the case? How's it helpful?

  2. +
  3. What are some resources for where I can learn sufficient representation theory to at least get started with understanding such algorithms? (I'm not in a position to read a heavy grad-level math textbook on representation theory.)

  4. +
+",26,,,,,11/25/2019 16:05,Why does representation theory often arise in the context of quantum algorithms for the hidden subgroup problem?,,1,1,,,,CC BY-SA 4.0 +8913,2,,8908,11/23/2019 22:37,,3,,"

Since quantum machine learning with NISQ hardware is such a relatively new field, it is still very highly research driven, and a lot of the potential is still being determined.

+ +

To make these new research implementations more accessible, we've begun building implementations over at https://pennylane.ai/qml. Interesting ones include:

+ + + +

These implementations are executable, and can be downloaded as Python scripts or Jupyter notebooks. Our goal is to keep regularly adding new implementations and demos (the repository behind the website is also open-source at https://github.com/XanaduAI/qml, so anyone can contribute demos).

+",371,,,,,11/23/2019 22:37,,,,0,,,,CC BY-SA 4.0 +8914,1,,,11/24/2019 3:17,,5,331,"

For $q=e^{2 \pi i/3}$, the set of $d^2$ vectors ($d=3$) +\begin{equation} +\left( +\begin{array}{ccc} + 0 & 1 & -1 \\ + 0 & 1 & -q \\ + 0 & 1 & -q^2 \\ + -1 & 0 & 1 \\ + -q & 0 & 1 \\ + -q^2 & 0 & 1 \\ + 1 & -1 & 0 \\ + 1 & -q & 0 \\ + 1 & -q^2 & 0 \\ +\end{array} +\right) +\end{equation}

+ +

forms a SIC-POVM (symmetric, informationally complete, positive operator-valued measure), as noted in eq. (1) of https://arxiv.org/abs/1109.6514 .

+ +

I would similarly like to have a 16-vector counterpart for $d=4$ (to use for entanglement detection--per https://arxiv.org/abs/1805.03955). (There is clearly a huge amount of interesting related literature on such topics, but an attempt of mine to find an explicit d=4 counterpart somewhere within it has so far not been successful.)

+",3089,,55,,8/22/2020 5:57,8/22/2020 5:57,Give an explicit example of a $d = 4$ SIC-POVM,,2,2,,,,CC BY-SA 4.0 +8915,2,,8837,11/24/2019 7:49,,2,,"

If I understand you correctly, your goal is:

+ +
    +
  1. To choose some quantum algorithm (your question is: which algorithm would be good?)

  2. +
  3. Instead of running the quantum algorithm on a real quantum computer, you want to run a simulation of a quantum computer on a classical computer to simulate the execution of the quantum algorithm.

  4. +
  5. You want to optimize your classical simulator to make efficient use of the special capabilities offered by a High Performance Cluster (e.g. parallelism) and demonstrate that the simulation runs faster.

  6. +
+ +

If so, it really does not matter which quantum algorithm you choose, as long as it involves many qubits and many gates.

+ +

You are probably best off choosing some very well-known algorithm that is well described in the literature, e.g. Grover or Shor.

+ +

Your simulation will involve multiplying very large matrices with each other.

+ +

The more qubits, the larger the matrices. The growth is exponential: if you have $N$ qubits, you will be multiplying $2^N$ by $2^N$ matrices.

+ +

The more gates, the more multiplications.

+ +

You will make life easier on yourself if you assume the qubits are perfect (no noise, no errors).

+ +

Since the main point of your exercise is to parallelize some code for an HPC, it probably doesn't matter that the simulation is less realistic.

+",4733,,4733,,11/25/2019 7:10,11/25/2019 7:10,,,,0,,,,CC BY-SA 4.0 +8917,1,8919,,11/24/2019 10:02,,7,463,"

I have already posed the question on Math SE but I hope that people from QC community can help. I am starting studying QC, but first, I want to understand the classical view of algorithms. So in the following my question:

+

Here is the description of Deutsch-Jozsa problem: Let $f:\{0,1\}^n↦\{0,1\}$ be a function promised to be either constant or balanced ('balanced' means that f outputs as many $0$'s as $1$'s). Imagine that you try $k$ inputs (out of the $2^n$ available) and consistently find the same output. What is the probability that the function is actually constant? This link gives an answer as $1-1/2^{k-1}$. I am not able to reproduce this result and I have a prior question: how can the result not depend on $n$? Obtaining 5 equal results has a very different meaning if $n=10$ or $n=100$ isn't it?

+",9243,,2927,,4/27/2021 23:02,4/27/2021 23:02,Probability estimate in classical Deutsch-Jozsa problem,,2,0,,,,CC BY-SA 4.0 +8918,2,,8917,11/24/2019 11:22,,3,,"

Indeed, the formula assumes that $n=\infty$, and is approximately correct if $2^n \gg k$

+",2105,,,,,11/24/2019 11:22,,,,1,,,,CC BY-SA 4.0 +8919,2,,8917,11/24/2019 12:17,,5,,"

Yes, it will depend on $n$ because sampling with replacement is assumed in the proof, which doesn't make sense if $n$ is finite. Intuitively, if a function $f$ really is balanced, and first output corresponding to certain random input is $0$ or $1$, then the probability that the second output corresponding to some other random input will be the same is less than $\frac{1}{2}$ (if $n < \infty$). The formula you state only gives a lower bound which is approached as $n\to\infty$. In general, $k=2^{n-1}+1$ inputs is sufficient to prove whether $f$ is constant or balanced, assuming it's guaranteed to be one of the two. As explained in the linked answer, without assuming replaceability, a tighter lower bound would have been $$\frac{2\binom{2^{n-1}}{k}}{\binom{2^{n}}{k}} = 1-\prod_{i=1}^{k-1} \left(\frac{2^{n-1}-i}{2^n-i}\right).$$ Notice that this becomes equivalent to your formula for $n\to\infty$ i.e., +$$\lim_{n\to\infty} 1-\prod_{i=1}^{k-1} \left(\frac{2^{n-1}-i}{2^n-i}\right) = 1 - \frac{1}{2^{k-1}}.$$

+ +

Perhaps even better bounds can be found depending on the specific nature of $f$; I'll think about it.

+",26,,26,,11/24/2019 13:48,11/24/2019 13:48,,,,0,,,,CC BY-SA 4.0 +8920,2,,8914,11/24/2019 13:35,,3,,"

You can find it here Symmetric Informationally Complete Quantum Measurements or here SIC-POVMs: A new computer study, in the appendix B.

+ +

Update

+ +

Given a single fiducial vector $v = (a_1,a_2,a_3,a_4)^T \in \mathbb{C}^4$ it's pretty easy to write down all SIC-POVM vectors. They are just $C^kS^lv$ for $k,l \in \{0..3\}$, where $C$ and $S$ are clock and shift matrices given by +$$ +C = \begin{pmatrix} +1 & 0 & 0 & 0 \\ +0 & i & 0 & 0 \\ +0 & 0 & -1 & 0 \\ +0 & 0 & 0 & -i \\ +\end{pmatrix}, ~~~ +S = \begin{pmatrix} +0 & 0 & 0 & 1 \\ +1 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 \\ +0 & 0 & 1 & 0 \\ +\end{pmatrix}. +$$

+ +

So $C^kS^lv = (a_{1-l},i^ka_{2-l},(-1)^ka_{3-l},(-i)^ka_{4-l})^T$, where $a_0 = a_4$, $a_{-1} = a_3$, etc.
+Note that a phase of any SIC-POVM vector doesn't matter.

+ +

Update 2

+ +

A simple formula for all 16 vectors can be found here, eq (32)
+The non-normalized fiducial vector is just +$$ +\left( \begin{array}{c} +\sqrt{2+\sqrt{5}} \\ +1 \\ +1 \\ +1 +\end{array} \right) +$$ +but we must change the matrices $C$ and $S$ to correctly generate 16 vectors: +$$ +C = e^{i\pi/4}\begin{pmatrix} +0 & 1 & 0 & 0 \\ +-i & 0 & 0 & 0 \\ +0 & 0 & 0 & -i \\ +0 & 0 & -1 & 0 \\ +\end{pmatrix}, ~~~ +S = e^{i\pi/4}\begin{pmatrix} +0 & 0 & 1 & 0 \\ +0 & 0 & 0 & 1 \\ +-i & 0 & 0 & 0 \\ +0 & i & 0 & 0 \\ +\end{pmatrix}. +$$

+",5870,,5870,,11/25/2019 18:58,11/25/2019 18:58,,,,8,,,,CC BY-SA 4.0 +8921,1,8922,,11/24/2019 14:40,,4,779,"

I know that there are papers (cf. arXiv:quant-ph/0205115) out there which prove that the Toffoli gate by itself is not enough for universal quantum computation, but I haven't had the time to go through the whole proof. Could someone give me the crux of the proof or the intuition for this?

+",26,,,,,11/24/2019 14:57,Why is the Toffoli gate not sufficient for universal quantum computation?,,1,0,,,,CC BY-SA 4.0 +8922,2,,8921,11/24/2019 14:57,,9,,"

The Toffoli gate is just a permutation. If you start in a known basis state, application of a Toffoli just changes it into another basis state, one that you can easily calculate classically (after all, it’s a decision based on looking at 3 bit values). Repeating that doesn’t change anything.

+ +

To make it universal, you need to add something like Hadamard which introduces superposition.

+",1837,,,,,11/24/2019 14:57,,,,0,,,,CC BY-SA 4.0 +8923,1,,,11/25/2019 4:48,,4,143,"

Is it possible to tell Qiskit to execute a parameterized gate where the parameter varies between shots?

+ +

Let's say, for whatever reason, I'd like to speed up the dephasing of a qubit during a run. I can accomplish this by explicating implementing the dephasing Kraus operators by using an $R_x(\phi)$ gate, a controlled $Z$ gate and an ancilla qubit. However, this adds a decent amount of complexity, and thus error, to my circuit.

+ +

A more clever way to do it is to add an $R_z(\theta)$ gate into the circuit, where $\theta$ is drawn from a normal distribution and thus varies shot to shot. This would mean the circuit would need to be reassembled from the parameterized transpilation each shot, which makes me think it's probably not possible. But I wanted to ask just in case.

+ +

I can always do a series of single shot experiments, but I believe the backend (not to mention other users) might have an issue with me submitting thousands of single shot jobs.

+ +

So is there any way to implement a circuit which has a parameter which varies from shot to shot?

+",7701,,,,,9/28/2020 16:39,Vary parameter between shots,,1,2,,,,CC BY-SA 4.0 +8924,1,,,11/25/2019 6:05,,4,122,"

I am going through different types of attacks that eve can perform on the quantum channel. I came across the intercept-resend attack and measure-resend attack. What is the difference between the two?

+ +

According to my view,

+ +
    +
  1. measurement attack - Eve measures the particles going from Alice to Bob as in BB84 protocol
  2. +
  3. intercept-resend - Eve can apply a unitary operation
  4. +
+ +

Am I correct?

+",8620,,26,,11/25/2019 13:45,11/25/2019 13:45,What is the difference between intercept-resend attack and measure-resend attack?,,0,0,,,,CC BY-SA 4.0 +8925,1,8926,,11/25/2019 10:44,,0,54,"

I'm searching for a good quantum algorithm to approximate Chaitin's Constant. Any references/resources will do?

+ +

Note: This number is uncomputable.

+",5045,,26,,11/25/2019 13:25,11/25/2019 13:25,Algorithm to approximate Chaitin's Constant?,,1,0,,,,CC BY-SA 4.0 +8926,2,,8925,11/25/2019 11:03,,3,,"

Any quantum algorithm to approximate Chaitin's constant (or any other number) will also yield a classical algorithm to approximate that same number, just by simulating the quantum computer. (It won't be a great classical algorithm, but it's still an algorithm.)

+ +

As Chaitin's constant provably doesn't admit such a classical algorithm, it also doesn't admit a quantum algorithm either.

+",124,,,,,11/25/2019 11:03,,,,3,,,,CC BY-SA 4.0 +8927,1,8928,,11/25/2019 11:56,,2,65,"

I am a beginner in quantum computing. Please consider the following scenario:

+ +

Suppose Alice wants to send +$\frac{1}{\sqrt{N}}\sum_{j=0,1,2,..N-1} |j\rangle$ to Bob.

+ +

Eve has intercepted the state and want to do the following operation - add his $|0_{\text{Eve}}\rangle$ and get $$\frac{1}{\sqrt{N}}\sum_{j=0,1,2,..N-1} |j\rangle |0_{\text{Eve}}\rangle$$

+ +

Next he wants to apply apply Unitary Transformation $$U|j\rangle|0_{\text{Eve}}\rangle = |j\rangle|j\rangle$$ and convert the state to $|0_{\text{Eve}}\rangle$ and get $$\frac{1}{\sqrt{N}}\sum_{j=0,1,2,..N-1} |j\rangle |j\rangle$$

+ +

Does such unitary operation/transformation exist? if no is it because conflicting no-cloning theorem that you cannot copy a state as it is?

+",8620,,55,,7/26/2020 18:19,7/26/2020 18:19,Can Eve perform this operation?,,2,0,,,,CC BY-SA 4.0 +8928,2,,8927,11/25/2019 12:46,,1,,"

It does exist. It's basically the controlled-not gate generalised to higher dimensional systems.

+ +

The important thing to realise is that means that the bit that Bob ends up with will be highly entangled with what Eve has, and that will have significant observable consequences. As part of a cryptographic protocol, for exampe, Bob could detect that Eve is doing this before sending any sensitive informaiton.

+",1837,,,,,11/25/2019 12:46,,,,0,,,,CC BY-SA 4.0 +8929,2,,8927,11/25/2019 12:58,,1,,"

Please be careful with your notation; don't get confused with the number of qubits that are in $|0_{Eve}\rangle$ (I'm not necessarily saying that you are - just mentioning this as a precaution). Since the state $|\psi\rangle = \frac{1}{\sqrt{N}}\sum_{j \in 0,1,2....N-1}|j\rangle$ that Alice wants to send is a $n$-qubit state with $N=2^{n}$, Alice needs to send $n$ qubits to Bob - possibly via Eve. Therefore, the state $|0_{Eve}\rangle$ that you describe is a $n$-qubit state as well.

+ +

A unitary $U$ that copies the state $|\psi\rangle$:

+ +

The $2n$-qubit unitary that you describe is possible, but on the presumption that Eve knows exactly what Alice will send. Then, a series of $n$ $CX$ gates from the $i$th qubit to the $(i+n)$th qubit will suffice - it will copy any state $|j\rangle$ in the first $n$ qubit to the second $n$ qubits, thereby obtaining the total state $|j\rangle \otimes |j\rangle$. By linearity, it also copies a superposition of different $|j\rangle$-states. So we have: +\begin{equation} +U_{copy} = \sum_{i\in \{1,2...n\}}CX^{(i,i+n)}, +\end{equation}

+ +

where $CX^{(i,i+n)}$ is the CNOT operation with qubit $i$ as the control qubit and qubit $(i+n)$ as the target qubit.

+ +

A unitary that copies any state $|\phi\rangle$:

+ +

However, if Eve does not know what state Alice sends, there is no unitary that will perform the task (of copying a unknown $n$-qubit state $|\phi\rangle$ into the second $n$ qubits). The proof of impossibility is straightforward via the condition that the operation needs to be linear; for a proof see a proof of the no cloning theorem, which applies here.

+",8141,,8141,,11/25/2019 13:46,11/25/2019 13:46,,,,0,,,,CC BY-SA 4.0 +8930,1,8952,,11/25/2019 13:25,,5,850,"

In Quantum Computation and Quantum Information by Nielsen and Chuang, the authors introduce operator sum representation in Section 8.2.3. They denote the evolution of a density matrix, when given an environment, is the following:

+ +

$$\varepsilon (\rho) = \mathrm{tr}_{\text{env}} [U(\rho\otimes \rho_{\text{env}})U^\dagger]$$

+ +

Where you are essentially taking the trace to discard the environment of the unitary evolution of the entire system. What I don't understand is how the operator sum representation is equivalent (Equations 8.9 and 8.11 in N&C)

+ +

$$\varepsilon (\rho) = \sum_k \langle \mathbf{e}_k|U[\rho \otimes |\mathbf{e}_0\rangle \langle \mathbf{e}_0|]U^\dagger|\mathbf{e}_k\rangle = \sum_k E_k\rho E_k^\dagger$$

+ +

In this equation, I take $|\mathbf{e}_k\rangle$ to represent the basis of the system and U to be a 4 x 4 unitary matrix governing the evolution. How is this equivalent to the first equation where you discard the trace? It seems like the second equation (equation 8.9 in N&C) above would yield a scalar quantity. What does this equation mean? I understand the first equation where you take the partial trace, but how does partial trace relate to the 2nd and 3rd equations? I'm a relative beginner in this field.

+",9254,,55,,2/19/2021 18:30,2/19/2021 18:30,How is the partial trace related to the operator sum representation?,,3,1,,2/20/2021 20:27,,CC BY-SA 4.0 +8931,2,,8930,11/25/2019 13:33,,2,,"

$|e_k\rangle$ is the basis of the environment. Taking the sum of projections onto an orthonormal basis of one subsystem is the definition of the partial trace over that subsystem.

+",1837,,,,,11/25/2019 13:33,,,,6,,,,CC BY-SA 4.0 +8934,2,,8912,11/25/2019 16:05,,5,,"

Two classical texts for the representation theory of finite groups are the books of Hamermesh and Serre. These books however lack chapters on Fourier analysis needed for the quantum computation applications.

+ +

For a more modern text for finite group representations which includes a chapter on Fourier analysis, please see the lecture notes by: Steinberg.

+ +

However, for a fast introduction, quite sufficient for the quantum computation applications, there are very concise texts: in Enrique Alvarez lecture notes (Chapter 9, in first reading one can skip the representation theory of $S_N$ and study the 17 pages 79-95 only), and in chapter 2 of the lecture notes by Willwacher.

+ +

Since these concise resources also lack the subject of Fourier analysis, you can read the 5 pages of chapter 3 of Shengyu Zhang quantum computing course giving an introduction to the group theory needed for the hidden subgroup problem.

+ +

In the hidden subgroup problem, we are given a function $f: G \rightarrow S$ ($S$ is a finite set) which is invariant on the cosets of some subgroup $H$ of $G$; i.e., $f(g) = f(gh), \,\, h\in H$; and we want to identify the subgroup $H$.

+ +

Representation theory appears because every function on a finite group $G$ can be written as a linear combination of the matrix elements of its irreducible representations; and we need to identify the representations appearing in the function $f$. We do so by preparing a state: +$$\sum_G |g, f(g)\rangle$$ +(This state is efficiently preparable, when there is an efficient oracle for the computation of $f$). If we measure the second register, we are left with a uniformly weighted combination of group elements belonging to the coset corresponding to the measured values of $f$: +$$\sum_H |ch\rangle$$ +($c$ is any element in this coset).

+ +

Let $\rho$ be an irreducible representation of $G$, then $\rho$ is a matrix function of $G$ of dimension $d_{\rho} \times d_{\rho}$; the quantum Fourier transform, transforms a group vector $|g\rangle$ to:

+ +

$$\sum_{\rho \in \hat{G}} \sum_{i=1}^{d_{\rho}}\sum_{j=1}^{d_{\rho}}\sqrt{\frac{d_{\rho}}{|G|}} \rho(g)_{ij} |i, j, \rho\rangle$$

+ +

Where $\hat{G}$ is the set of irreducible representations, (which is in a one to one correspondence with the conjugacy classes of $G$).

+ +

In order to appreciate the role of the Fourier transform, please consider the case of $\mathbb{Z}_N = \{ z_0, …, z_{N-1}\}$. Since $\mathbb{Z}_N$ is Abelian all its irreducible representations are one dimensional given by:

+ +

$$\rho_m (z_n) = e^{\frac{2 \pi i mn}{N}}$$

+ +

This is the kernel of the usual Fourier transform. $m$ is the representation index and $n$ is the group element index. We know that if we perform a Fourier transform of the function $\rho_m$, we get a peaked function at $m$ by which we identifiy the representation $m$.

+ +

In the general case when we measure the $\rho$ register in $|i, j, \rho\rangle$, we get with a high probability a representation appearing in $f$, thus by repeating the experiment, we get with a high probability all representations having $H$ in their kernel and we can identify $H$ as their mutual kernel.

+ +

Please see the following https://arxiv.org/abs/0812.0380v1 work by Childs and Dam reviewing cases where the above standard method and other improved methods lead to efficient hidden subgroup identification in the non-Abelian cases.

+",4263,,,,,11/25/2019 16:05,,,,0,,,,CC BY-SA 4.0 +8935,1,8938,,11/25/2019 16:43,,6,735,"

Qiskit Aqua has a module that implements the HHL algorithm:

+ +

https://qiskit.org/documentation/_modules/qiskit/aqua/algorithms/single_sample/hhl/hhl.html

+ +

How does one draw the implemented circuit?

+ +

* EDIT * +I'm working with an example from the github. I modified it as follows:

+ +
#
+# Example from 
+# https://github.com/Qiskit/qiskit-iqx-tutorials/blob/master/qiskit/advanced/aqua/linear_systems_of_equations.ipynb
+#
+
+
+from qiskit.aqua import run_algorithm
+from qiskit.aqua.input import LinearSystemInput
+from qiskit.quantum_info import state_fidelity
+from qiskit.aqua.algorithms.classical import ExactLSsolver
+import numpy as np
+
+
+params = {
+    'problem': {
+        'name': 'linear_system'
+    },
+    'algorithm': {
+        'name': 'HHL'
+    },
+    'eigs': {
+        'expansion_mode': 'suzuki',
+        'expansion_order': 2,
+        'name': 'EigsQPE',
+        'num_ancillae': 3,
+        'num_time_slices': 50
+    },
+    'reciprocal': {
+        'name': 'Lookup'
+    },
+    'backend': {
+        'provider': 'qiskit.BasicAer',
+        'name': 'statevector_simulator'
+    }
+}
+
+# The 2 x 2 System to solve 
+#
+
+
+matrix = [[1, 0], [0, 2]]
+vector = [1, 4]
+params['input'] = {
+    'name': 'LinearSystemInput',
+    'matrix': matrix,
+    'vector': vector
+}
+
+
+# Run the HHL Algorithm
+result = run_algorithm(params)
+
+ +

result is the following:

+ +
{'probability_result': 0.024629684664855277,
+ 'output': array([0.46919178+0.00000000e+00j, 0.8830963 -6.70000184e-15j]),
+ 'solution': array([1.05859322-8.03148712e-15j, 1.99244701-3.02331663e-14j]),
+ 'matrix': array([[1, 0],
+        [0, 2]]),
+ 'vector': array([1, 4]),
+ 'circuit_info': {'size': 28870,
+  'depth': 28820,
+  'width': 7,
+  'qubits': 7,
+  'bits': 0,
+  'factors': 1,
+  'operations': {'u3': 6011,
+   'u1': 8021,
+   'cx': 14066,
+   'barrier': 700,
+   'u2': 6,
+   'cu3': 42,
+   'x': 24}
+  }
+}
+
+ +

I tried the following

+ +

HHL.construct_circuit(result.circuit_info).draw()

+ +

but that resulted in

+ +
---------------------------------------------------------------------------
+NameError                                 Traceback (most recent call last)
+<ipython-input-13-4cf1b322ed4c> in <module>
+----> 1 HHL.construct_circuit(result.circuit_info).draw()
+
+NameError: name 'HHL' is not defined
+
+ +

So it may very well be that I didn't import something or that I just don't understand the syntax for the HHL.

+ +

So how should I form the instructions to generate the circuit? (I'm not very good at python so if this question is trivial, I do apologize.) I checked the qiskit documentation but I couldn't understand it well. It didn't give an explicit example so if there's something I need to learn to be able to do this, please let me know. Thank you for your time.

+",9258,,26,,11/26/2019 12:06,10/8/2020 16:37,How to draw Qiskit's HHL algorithm as a circuit?,,2,0,,,,CC BY-SA 4.0 +8936,1,8956,,11/25/2019 17:19,,6,113,"

I want to build a circuit that performs the following operation: +$$ +U_f = \left(\begin{array}{cccccccccc} +1 & 0 & 0 & \dots & \dots & \dots & \dots & \dots & \dots & 0 \\ +0 & 1 & 0 & & & & & & & \vdots\\ +0 & 0 & 1 & & & & & & & \vdots \\ +\vdots & & & \ddots & & & & & & \vdots \\ +\vdots & & & & 0 & 1 & & & & \vdots \\ +\vdots & & & & 1 & 0 & & & & \vdots \\ +\vdots & & & & & & \ddots & & & \vdots \\ +\vdots & & & & & & & 1 & 0 & 0 \\ +\vdots & & & & & & & 0 & 1 & 0 \\ +0 & \dots & \dots & \dots & \dots & \dots & \dots & 0 & 0 & 1 +\end{array}\right) +$$ +but I don't know the equivalent gate combination, and I have never seen such a matrix on any book.

+ +

So I am curious about how one could build this circuit, and generally, given a matrix, if there is any general procedure of decomposing it in gates or deriving the circuit.

+",6245,,26,,11/25/2019 19:07,11/26/2019 19:08,How to construct a circuit to perform this operation? Is there a general way of getting a circuit from a matrix?,,2,1,,,,CC BY-SA 4.0 +8938,2,,8935,11/25/2019 19:12,,6,,"

You can draw the circuit using construct_circuit().draw().

+ +

In the tutorial you are talking about, if you scroll down to the 4x4 randomly generated section that uses params5 you can run print(hhl.construct_circuit()), after the line hhl = HHL.init_params(params5, algo_input).

+ +

This may take a little while to complete but it should eventually print out ASCII art of the circuit. Other drawing options can be configured using .draw().

+ +

NB this isn't to say that you can't draw any of the other circuits, if you follow the way the HHL object is created in this section you can draw any of the configurations specified by the params. For example, you could draw the circuit you are creating using

+ +
from qiskit.aqua.input import LinearSystemInput
+from qiskit.aqua.algorithms.single_sample import HHL
+algo_input = LinearSystemInput(matrix=matrix, vector=vector)
+hhl = HHL.init_params(params, algo_input)
+
+",5955,,5955,,11/25/2019 20:37,11/25/2019 20:37,,,,7,,,,CC BY-SA 4.0 +8940,2,,8914,11/25/2019 20:27,,4,,"

As indicated by Danylo in his anwser, eq. (32) in arXiv: 1103.2030 +presents the sixteen vectors (""ignoring overall phases and normalisation"") +\begin{equation} +\left( +\begin{array}{cccc} + x & 1 & 1 & 1 \\ + x & 1 & -1 & -1 \\ + x & -1 & 1 & -1 \\ + x & -1 & -1 & 1 \\ + i & x & 1 & -i \\ + i & x & -1 & i \\ + -i & x & 1 & i \\ + -i & x & -1 & -i \\ + i & i & x & -1 \\ + i & -i & x & 1 \\ + -i & i & x & 1 \\ + -i & -i & x & -1 \\ + i & 1 & -i & x \\ + i & -1 & i & x \\ + -i & 1 & i & x \\ + -i & -1 & -i & x \\ +\end{array} +\right), +\end{equation} +where +\begin{equation} +x=\sqrt{2+\sqrt{5}}. +\end{equation} +These form ""a set of 16 SIC-vectors covariant under the Heisenberg group"".

+ +

To now normalize the vectors we need to multiply them by $\frac{1}{\sqrt{5+\sqrt{5}}}$. The resultant sixteen vectors $|\psi_i\rangle$ satisfy the desired relation +($d=4$) +\begin{equation} +|\langle\psi_i||\psi_j\rangle|^2 = \frac{d \delta_{ij}+1}{d+1}, i,j=1,2,\ldots, d^2 , +\end{equation} +given in eq. (7) in arXiv: 1805.03955, giving us the explicit set requested in the question.

+",3089,,26,,11/26/2019 12:17,11/26/2019 12:17,,,,0,,,,CC BY-SA 4.0 +8941,1,,,11/25/2019 23:55,,1,121,"

I am currently trying to understand HHL by implementing a very inefficient Qiskit simulation script that performs HHL on an arbitrary hermitian matrix $A$ and a vector $b$.

+ +

Because I am currently only attempting to understand the higher-level workings of the HHL algorithm itself, I am cheating and just using Qiskit simulator features to implement the operators $e^{iAt/T}$ and to 'prepare' $|b>$

+ +

So far, I am trying to get it to work on two examples: the HHL example here and the problem done in this paper. It works as expected on the former, but not on the latter. This makes me wonder if i am correctly implementing the operators $e^{iAt/T}$ used in the QPE section of HHL.

+ +

So my question is whether I am implementing $e^{iAt/T}$ correctly or not. +I have written a function that takes a hermitian matrix, exponentiates it using the scipy function expm, adds a control to this matrix, and then turns it into an operator using the Qiskit Operator function.

+ +

Does this function return the intended unitary operator, $e^{iAt/T}$? If it is ill-conceived, why?

+ +
from qiskit.quantum_info.operators import Operator
+from scipy.linalg import expm
+
+def hermitian_to_controlled_U(hermitian_matrix,T):
+    U_matrix = expm(2j*pi*hermitian_matrix/T)
+
+    # add control
+    M0 = np.asarray([[1,0],\
+                     [0,0]])
+    M1 = np.asarray([[0,0],\
+                     [0,1]])
+    I = np.eye(np.shape(hermop)[0])
+    controlled_U_matrix = np.kron(M0,I)+np.kron(M1,U_matrix)
+
+    controlled_U_gate = Operator(controlled_U_matrix)
+
+    return controlled_U_gate
+
+",4943,,26,,11/26/2019 12:05,11/26/2019 12:05,Exponentiating Hermitian Matrix for use in QPE/HHL,,0,0,,,,CC BY-SA 4.0 +8943,1,,,11/26/2019 0:21,,2,92,"

I am really puzzled when it comes to the construction of a stabilizer code. By that, I mean how to come up with the subgroup $S$ and the matrix generators $M= \{M_1, M_2, \cdots, M_{n-k}\}$? In classical error correcting codes, there is a generator matrix $G$ where each row is linearly independent and from there, you can find the codewords.

+ +

Though stabilizer code deals with operators rather the state itself, what is the process?

+ +

I found this that might be relatable: +Given $n-k$ stabiliser generators, how can we find an additional $k$ commuting generators?

+",7528,,7528,,11/26/2019 20:33,11/26/2019 20:33,The process behind constructing a Stabilizer Code?,,0,1,,,,CC BY-SA 4.0 +8944,2,,8935,11/26/2019 5:07,,2,,"

The credit for this answer goes to met927 in the previous post. So please upvote that answer instead of this one. met927's response answered my question. Not setting up some of the parameters to make system draw faster was my error. So thank you met927 for responding quickly and answering my question!

+ +

Below is a snippet that one can run quite quickly (less than a minute).

+ +
###########################################################
+#
+#
+# met927's response incorporated into the github example
+#
+#
+###########################################################
+
+
+from qiskit.aqua import run_algorithm
+from qiskit.aqua.input import LinearSystemInput
+from qiskit.aqua.algorithms.single_sample import HHL
+
+import numpy as np
+
+# System to solve
+# A  = [[1.5, 0.5], [0.5, 1.5]]
+# b =  [2, 2]
+
+matrix = [[1.5, 0.5], [0.5, 1.5]]
+vector = [2, 2]
+
+params = {
+    'problem': {
+        'name': 'linear_system'
+    },
+    'algorithm': {
+        'name': 'HHL'
+    },
+    'eigs': {
+        'expansion_mode': 'suzuki',
+        'expansion_order': 2,
+        'name': 'EigsQPE',
+        'num_ancillae': 3,
+        'num_time_slices': 50
+    },
+    'reciprocal': {
+        'name': 'Lookup'
+    },
+    'backend': {
+        'provider': 'qiskit.BasicAer',
+        'name': 'statevector_simulator'
+    }
+}
+
+params['input'] = {
+    'name': 'LinearSystemInput',
+    'matrix': matrix,
+    'vector': vector
+}
+
+params['algorithm'] = {
+    'truncate_powerdim': False,
+    'truncate_hermitian': False
+}
+params['reciprocal'] = {
+    'name': 'Lookup',
+    'negative_evals': True
+}
+params['eigs'] = {
+    'expansion_mode': 'suzuki',
+    'expansion_order': 2,
+    'name': 'EigsQPE',
+    'negative_evals': False,
+    'num_ancillae': 1,
+    'num_time_slices': 70
+}
+params['initial_state'] = {
+    'name': 'CUSTOM'
+}
+params['iqft'] = {
+    'name': 'STANDARD'
+}
+params['qft'] = {
+    'name': 'STANDARD'
+}
+
+
+# Prep the input
+algo_input = LinearSystemInput(matrix=matrix, vector=vector)
+
+# Run the HHL algorithm
+hhl = HHL.init_params(params, algo_input)
+
+# Draw the circuit
+print(hhl.construct_circuit())
+
+ +

It draws an ascii circuit. I just wanted to know how to get the routine to draw the circuit. Thanks again met927.

+",9258,,,,,11/26/2019 5:07,,,,0,,,,CC BY-SA 4.0 +8945,1,8946,,11/26/2019 7:32,,3,787,"

Suppose I share two Bell states among two participants Alice and Bob in the following manner : +$$ |\psi\rangle=\left(\dfrac{|0\rangle_1|0\rangle_2+ |1\rangle_1|1\rangle_2}{\sqrt{2}}\right)\left(\dfrac{|0\rangle_3|0\rangle_4+ |1\rangle_3|1\rangle_4}{\sqrt{2}}\right) $$ +Now suppose Alice has qubits $(1,4)$ and Bob has $(2,3)$. I want to find out the density matrices corresponding to Alice, Bob, and combined.

+ +

For the first case should I calculate $|\psi\rangle\langle\psi|$, what should be done, in case there was only one Bell pair shared between Alice and Bob, I would have done $$ \rho_A = \mathrm{Trace}_B(\rho)$$ can this be generalized when there are more than one Bell pair shared in the sense that I have shared? +Can somebody help?

+",6070,,26,,11/26/2019 12:04,11/27/2019 21:59,Density matrix of a product of Bell states,,2,0,,,,CC BY-SA 4.0 +8946,2,,8945,11/26/2019 8:43,,3,,"

Yes, the overall density matrix shared between Alice and Bob is $|\psi\rangle\langle\psi|$. To get the desnity matrix of either Alice or Bob, you should calculate +$$ +\text{Tr}_B|\psi\rangle\langle\psi|\qquad\text{Tr}_A|\psi\rangle\langle\psi| +$$ +respectively.

+ +

However, in this particular case, the calculation is much simply. Let $|\phi\rangle$ be the Bell pair such that +$$ +|\psi\rangle=|\phi_{12}\rangle|\phi_{34}\rangle. +$$ +Because there's a separable partition between (1,2) and (3,4), this is not changed by the partial trace. Thus +$$ +\text{Tr}_B|\psi\rangle\langle\psi|=\left(\text{Tr}_2|\phi\rangle\langle\phi|\right)\otimes \left(\text{Tr}_3|\phi\rangle\langle\phi|\right). +$$

+ +

You imply that you know how to do the partial trace for a single Bell state. The answer is $I/2$. So, we have +$$ +\text{Tr}_B|\psi\rangle\langle\psi|=\frac{1}{4}I\otimes I, +$$ +the maximally mixed state of two qubits. Similarly, +$$ +\text{Tr}_A|\psi\rangle\langle\psi|=\left(\text{Tr}_1|\phi\rangle\langle\phi|\right)\otimes \left(\text{Tr}_4|\phi\rangle\langle\phi|\right)=\frac{1}{4}I\otimes I +$$

+",1837,,,,,11/26/2019 8:43,,,,7,,,,CC BY-SA 4.0 +8947,1,,,11/26/2019 9:35,,-4,126,"

I have composed the gate with IBM Q Experience, but I do not know how to set the answer.
+Please tell me how to set it?

+",9242,,26,,11/30/2019 11:48,11/30/2019 11:48,Bernstein-Vazirani algorithm in IBM Q Experience,,1,1,,12/2/2019 12:06,,CC BY-SA 4.0 +8948,2,,8936,11/26/2019 10:25,,3,,"

I investigated your gate for three different cases:

+ +

1) one q-bit: in this case the $U_f$ is simply $X$

+ +

2) two q-bits: state $|01\rangle$ is mapped to $|10\rangle$ and conversely, otherwise q-bits are unchanged, so the gate implements q-bits swap

+ +

3) three or more q-bits: gate $U_f$ act like this: state $|011...1\rangle$ is mapped to $|100...0\rangle$ and conversely. These states are mutually inverse, i.e. to obtain the second one from the first one, it is sufficient to negate all q-bits. The same is true for obtaining the first state from the second one. In all other cases q-bits are unchanged. Thus it is necessary to introduce an indicator that a quantum register is either in state $|011...1\rangle$ or $|100...0\rangle$. The indicator can be Boolean function $f = \bar{q_0}q_1...q_{n-1} + q_0\bar{q_1}...\bar{q}_{n-1}$. It returns $|1\rangle$ for states $|100...0\rangle$ and $|011...1\rangle$, otherwise it returns $|0\rangle$. Note, that ancilla q-bits are needed. After calculation of the indicator, the result is stored in ancilla bit, other ancillas are uncomputed and CNOT gates controlled by the result of the function $f$ are applied on q-bits $|q_0\rangle$, $|q_1\rangle$...$|q_{n-1}\rangle$.

+ +

Please find here a figure of a circuit implementing case 3) for three q-bits. Its expansion for more q-bits is straighforward. Note that I tested the circuit on IBM Q simulator and it works.

+ +

+",9006,,9006,,11/26/2019 11:20,11/26/2019 11:20,,,,2,,,,CC BY-SA 4.0 +8949,1,8951,,11/26/2019 10:47,,3,990,"

I've recently started reading about quantum computing and I apologize in advance if this is (and I think it probably is) a very simple question.

+ +

I've created the following circuit.

+ +

+ +

I believe I understand this circuit. It sends qubit 1 through the Hadamard gate to give it a 50/50 chance of being 0 or 1. The C-NOT gate means, if q[1] is 0 then q[0] remains 0 and if q[1] is 1 then q[0] has a not gate applied to make it 1. Therefore, the two qubits are entangled. It does the same to entangle q[1] and q[2] and for that reason, when the three are measured it is always 000 or 111 with a 50/50 chance of each. (I may not have understood this part well so if this is wrong, please verify my misunderstanding).

+ +

I've been fiddling with a similar circuit by adding a Hadamard gate to the third qubit at the beginning which is this circuit producing the below result. +

+ +

+ +

I don't quite understand how those are the four possible results so please can someone explain how this circuit works. Many thanks

+",9263,,26,,11/26/2019 12:38,11/26/2019 12:43,Explanation of output produced by the following quantum circuit,,2,2,,,,CC BY-SA 4.0 +8950,2,,8949,11/26/2019 12:18,,3,,"

Yes you are absolutely right with your understanding but here is the game: +All the Qubits are starting with the |0> i.e. value 0 until the Hadamard gate is applied. The Hadamard gates just makes the probability of the Qubit being 0 or 1 to be 50-50 i.e $\frac{1}{\sqrt{2}}|\mathbf{0}> + \frac{1}{\sqrt{2}}|\mathbf{1}>$

+ +
+ +

Now in the second example you applied H gate to q1 and q2 which gave them the probability of being 0 or 1 to be 50-50. So, lets see all the possible initial states of the Qubits and their values as outputs on measurement first:

+ +
+ +
    +
  1. State 1: + +
      +
    • q0 |0> ---OUTPUT : 0--- |
    • +
    • q1 |0> ---OUTPUT : 0--- |
    • +
    • q2 |0> ---OUTPUT : 0--- | + +
      +

      Final Output: 000

      +
    • +
  2. +
  3. State 2: + +
      +
    • q0 |0> ---OUTPUT : 1--- |
    • +
    • q1 |1> ---OUTPUT : 1--- |
    • +
    • q2 |0> ---OUTPUT : 1--- | + +
      +

      Final Output: 111

      +
    • +
  4. +
  5. State 3: + +
      +
    • q0 |0> ---OUTPUT : 0--- |
    • +
    • q1 |0> ---OUTPUT : 0--- |
    • +
    • q2 |1> ---OUTPUT : 1--- | + +
      +

      Final Output: 100

      +
    • +
  6. +
  7. State 4: + +
      +
    • q0 |0> ---OUTPUT : 1--- |
    • +
    • q1 |1> ---OUTPUT : 1--- |
    • +
    • q2 |1> ---OUTPUT : 0--- | + +
      +

      Final Output: 011

      +
    • +
  8. +
+ +
+ +

I hope this helps. Please specify if you are still having trouble in understanding.

+",9183,,9183,,11/26/2019 12:43,11/26/2019 12:43,,,,1,,,,CC BY-SA 4.0 +8951,2,,8949,11/26/2019 12:26,,5,,"

Note that $H | 0 \rangle = | + \rangle = \frac{1}{\sqrt{2}}(| 0 \rangle + | 1 \rangle)$. +So, after the two Hadamard gates the state will be +$$ +| 0 \rangle \otimes H| 0 \rangle \otimes H| 0 \rangle = \frac{1}{2} | 0 \rangle \otimes (| 0 \rangle + | 1 \rangle)\otimes (| 0 \rangle + | 1 \rangle) = +$$ +$$ += \frac{1}{2} (| 000 \rangle + | 001 \rangle + | 010 \rangle + | 011 \rangle) +$$ +Now after the application of those two CNOT gates the state will be +$$ +\frac{1}{2} (| 000 \rangle + | 001 \rangle + | 111 \rangle + | 110 \rangle) +$$ +The last histogram confirms this (in the 00000 representation the state of q[0] is the far right symbol)

+",5870,,,,,11/26/2019 12:26,,,,0,,,,CC BY-SA 4.0 +8952,2,,8930,11/26/2019 12:44,,4,,"

I think it helps here to write things explicitly.

+ +

Suppose $\mathcal E(\rho)=\operatorname{Tr}_E[U(\rho\otimes|\mathbf e_0\rangle\!\langle\mathbf e_0|)U^\dagger]$.

+ +

Pick a basis for the environment in which $|\mathbf e_0\rangle$ is the first element. Note that here $U$ is a unitary matrix in a bipartite system. The operator before taking the partial trace has matrix elements +$$ + [U(\rho\otimes|\mathbf e_0\rangle\!\langle\mathbf e_0|)U^\dagger]_{ij,k\ell} = + \sum_{\alpha,\gamma} U_{ij,\alpha 0} \rho_{\alpha\gamma} (U^\dagger)_{\gamma0,k\ell} = + \sum_{\alpha,\gamma} U_{ij,\alpha0}\bar U_{k\ell,\gamma0} \rho_{\alpha\gamma}. +$$ +Now notice that the partial trace amounts here to make $j=\ell$ and sum over $j$ (because in this notation the indices $i,k$ refer to the system while $j,\ell$ to the environment), so that we get +$$ + [\mathcal E(\rho)]_{ik} = + \sum_j [U(\rho\otimes|\mathbf e_0\rangle\!\langle\mathbf e_0|)U^\dagger]_{ij,kj} = + \sum_{\alpha\gamma j} U_{ij,\alpha0}\bar U_{kj,\gamma0}\rho_{\alpha\gamma}. +$$ +Notice how this is already essentially an operator sum representation: defining $(E_{j})_{i\alpha}\equiv U_{ij,\alpha0}$, we get +$$[\mathcal E(\rho)]_{ik}=\sum_j (E_j)_{i\alpha} (\bar E_j)_{k\gamma}\rho_{\alpha\gamma} = \left[\sum_j E_j \rho E^\dagger_j\right]_{ik}.$$

+",55,,55,,11/26/2019 13:44,11/26/2019 13:44,,,,3,,,,CC BY-SA 4.0 +8953,1,,,11/26/2019 14:04,,2,277,"

Suppose I share three Bell states among two participants Alice and Bob and Charlie in the following manner: +$$ |\psi\rangle=\left(\dfrac{|0\rangle_1|0\rangle_2+ |1\rangle_1|1\rangle_2}{\sqrt{2}}\right)\left(\dfrac{|0\rangle_3|0\rangle_4+ |1\rangle_3|1\rangle_4}{\sqrt{2}}\right)\left(\dfrac{|0\rangle_5|0\rangle_6+ |1\rangle_5|1\rangle_6}{\sqrt{2}}\right) $$ +I want to find out the density matrix for $A$ whos has qubits $(1,4)$ the others have say $(2,3)$ and $(5,6)$. So I first calculate $|\psi\rangle\langle\psi|$ and then take the trace over the particles $(2356)$, Since this is a long computation, we can just notice that the terms whose inner product will be involved are $$\langle0000|\rho|0000\rangle,\langle0100|\rho|0100\rangle, \langle1000|\rho|1000\rangle,\langle1100|\rho|1100\rangle,\langle0011|\rho|0011\rangle,\langle0111|\rho|0111\rangle,\langle1011|\rho|1011\rangle,\langle1111|\rho|1111\rangle,$$ the result I get on calculating this is $$\dfrac{2\left(|0\rangle_1|0\rangle_4\langle0|_1\langle0|_4+|0\rangle_1|1\rangle_4\langle0|_1\langle1|_4+|1\rangle_1|0\rangle_4\langle1|_1\langle0|_4+|1\rangle_1|1\rangle_4\langle1|_1\langle1|_4\right)}{8}=\dfrac{\mathbb{I}\otimes \mathbb{I}}{4} $$ Is this correct? What does this density matrix say about the information that the players have about each others particles?

+",6070,,55,,11/24/2020 14:22,11/24/2020 14:22,Does partial tracing a system with three shared Bell states give the identity?,,2,0,,,,CC BY-SA 4.0 +8954,1,,,11/26/2019 14:40,,3,69,"

In Boson Sampling as first proposed by Aaronson and Arkhipov in arxiv.org/abs/1011.3245, the interferometer is made up of phase shifters and beamsplitters. As these gates are universal, drawing the interferometer at random (just like in Google's random circuit sampling) gives rise to an approximately Haar-random $m \times m$ unitary $U$ acting on the single photon subspace of the $m$-mode Fock states.

+ +

I wonder whether one could also perform BosonSampling with a single beamsplitter. If I understand correctly, a later paper by Aaronson and Bouland arxiv.org/abs/1310.6718 shows that a single non-trivial beamsplitter, say a 50:50 beamsplitter, is universal on the single-photon subspace omitting any extra phaseshifters.

+ +

My question is thus to confirm whether I could equally well just draw a sufficiently long (how long?) sequence of 50:50 beamsplitters and make up the interferometer in BosonSampling just out of these?

+ +

This claim to me seems very suprising, as I would intuitively think that one needs phaseshifters to get all unitaries, thus I would like to confirm this.

+",5322,,,,,11/26/2019 14:40,Boson Sampling with a single beamsplitter,,0,0,,,,CC BY-SA 4.0 +8955,2,,8953,11/26/2019 15:25,,3,,"

The result is correct. You can see it in the other way. You have three two-qubit subsystems $A = \{1,2\}$, $B = \{3,4\}$ and $C = \{5,6\}$. The whole state is the product state on those three subsystems, i.e. the whole density matrix is $\rho_A \otimes \rho_B \otimes \rho_C$. Product state means there are absolutely no correlations between the states on subsystems. Hence you can fully ignore the $C$ subsystem if you are interested only in the state on $D = \{1,4\}$. Also since $\rho_{AB} = \rho_{A} \otimes \rho_{B}$ then it must be $\rho_D = \rho_1 \otimes \rho_4$.

+",5870,,,,,11/26/2019 15:25,,,,1,,,,CC BY-SA 4.0 +8956,2,,8936,11/26/2019 19:08,,3,,"

This operation leaves all computational basis states unchanged, except for the $|0111\dots111\rangle$ and $|1000\dots000\rangle$ states, which it exchanges.

+ +

The first thing to do is to make those two states differ in only one bit position. This can be done by applying CNOT operations controlled by one of the differing bit positions targeting all other differing bit positions. We'll do a CNOT from the leftmost bit to all other bits, resulting in:

+ +

$|0111\dots111\rangle \rightarrow |0111\dots111\rangle$

+ +

$|1000\dots000\rangle \rightarrow |1111\dots111\rangle$

+ +

Now our states differ in only one bit position. The operation that swaps these two states while affecting no others is a CC..CCNOT controlled by all of the bit positions where the bits are the same (with a control type matching that bit) and targeting the differing bit position.

+ +

We then repeat the CNOTs from earlier in order to return to the original basis.

+ +

The final circuit looks like this:

+ +

+ +

Note that this circuit may be upside down, depending on your bit ordering convention.

+ +

We can check it has the right matrix by using Quirk's output display and the state channel duality:

+ +

+",119,,,,,11/26/2019 19:08,,,,0,,,,CC BY-SA 4.0 +8957,1,8959,,11/26/2019 19:25,,2,56,"

I am implementing a simulation of Simon's Algorithm, and am at the part of applying the second n-qbit Hadamard transformation, $H^{\otimes n}$, to the first of the two n-qbit registers, leaving the second unchanged. I am wondering if I can implement this step as applying the operation $H^{\otimes n} \otimes I$ (Kronecker product) to the combined state of the two registers. I want to do this because after the oracle, the two registers are entangled and cannot be represented as a tensor product of the states of each register (is my understanding correct here?).

+ +

So I am wondering if the following is true

+ +

$$(H^{\otimes n} \otimes I)|x⟩|y⟩ = H^{\otimes n}|x⟩ \otimes I|y⟩ = H^{\otimes n}|x⟩ \otimes |y⟩$$

+ +

or more generally is the following true of the kronecker/tensor product?

+ +

$$(A \otimes B) |x⟩|y⟩ = A|x⟩ \otimes B|y⟩$$

+",7960,,26,,11/26/2019 20:00,11/26/2019 20:00,Simon's Algorithm - How to simulate second Hadamard operation on first register?,,1,0,,,,CC BY-SA 4.0 +8958,1,8968,,11/26/2019 19:32,,6,918,"

Is there any paper or article about the performance of the noise model using basic_device_noise_model()? For example, like the noise model in the code below.

+ +
device = IBMQ.get_backend('ibmq_16_melbourne')
+properties = device.properties()
+noise_model = noise.device.basic_device_noise_model(properties)
+
+ +

I used that model to test some short-depth circuits and the results are pretty good actually. But I do not think IBM provide any paper or similar thing in the documentation or tutorial about this part. I wonder how they valid their model.

+",9095,,55,,11/24/2020 14:22,11/24/2020 14:22,How good is basic_device_noise_model() simulating the noise in the quantum computer?,,1,0,,,,CC BY-SA 4.0 +8959,2,,8957,11/26/2019 19:59,,1,,"

Yes.

+ +

The tensor product of two linear maps $S: V \to X$ and $T: W \to Y$ is the linear map

+ +

$$S \otimes T: V \otimes W \to X \otimes Y \ni (v \otimes w) \mapsto S(v) \otimes T(w).$$

+",26,,,,,11/26/2019 19:59,,,,0,,,,CC BY-SA 4.0 +8960,1,,,11/26/2019 21:29,,3,156,"

The question:

+ +

I have a Hilbert space $\mathcal{H}=\mathcal{H}_A\otimes \mathcal{H}_B$, and a codespace $\mathcal{H}_{code}\subset \mathcal{H}$, so that $\mathcal{H}=\mathcal{H}_{code}\oplus\mathcal{H}_\perp$. I know that for all $\psi,\phi\in \mathcal{H}_{code}$, and for all $\mathcal{O}_A=\mathcal{O}_A\otimes \mathcal{I}_B$, we have

+ +

$$\langle\phi|[\mathcal{O}_A,\mathcal{O}]|\psi\rangle =0$$

+ +

I would like to know what I can conclude about the operator $\mathcal{O}$ from this.

+ +

Some thoughts:

+ +

Without the projection into the codespace, we could conclude that $\mathcal{O}=\mathcal{O}_B$. With the projection, the most general thing I can think to write down that satisfies the constraint is

+ +

$$\mathcal{O}=\mathcal{O}_B + \Pi_\perp \mathcal{O}'\Pi_\perp$$

+ +

for any operator $\mathcal{O}'$, where $\Pi_\perp$ projects onto $\mathcal{H}_\perp$. There may be a more general expression, however.

+ +

The most related statements I have found occur in the context of operator algebra quantum error correction. For instance (see for instance Preskill and Pastawski, theorem 1) the condition to correct a noise channel $\mathcal{N}(\cdot)=\sum_k N_k(\cdot )N_k^\dagger$ with respect to an algebra $\mathcal{A}$ is that

+ +

$$[X,\Pi N_k^\dagger N_l \Pi]=0$$

+ +

for all $X\in \mathcal{A}$ and all Kraus operators $N_l,N_k$. This looks like my condition if I took $\mathcal{O}_A$ to be a logical operator. This has lead me to study von Neumann algebras and the theory of operator algebra quantum error correction, but so far this has not been fruitful in answering my original question.

+",8468,,26,,11/27/2019 2:06,12/2/2019 14:22,Implications of commuting within the code space,,1,1,,,,CC BY-SA 4.0 +8961,1,,,11/27/2019 5:10,,4,247,"

Question

+ +

How would a quantum computer calculate a definite integral (without resorting to approximations) of a function?

+ +

Motivation

+ +

According to a post of mine (in the context of classical field theory) seems to make the following premises:

+ +
    +
  1. One can always infer the value of a field at a point.
  2. +
  3. There can exist a Robinson Boundary Condition.
  4. +
  5. This (Klien-Gordon) field obeys Lorentz transformations.
  6. +
+ +

The conclusion seems to be:

+ +
+

Using classical calculations and the Robin boundary condition I show + that one calculate the anti-derivative of a function within time $2X$ + (I can compute an integral below)

+ +

$$\frac{2 \alpha}{\beta} e^{ \frac{\alpha}{\beta}X} \int_0^{X} e^{- + \frac{\alpha}{\beta}\tau} \tilde f_0(\tau) d \tau$$

+ +

where $f_0$ is an arbitrary function whose integral above converges.

+
+ +

Note: It is unclear to me how a quantum computer would stimulate a classical field in a way which would tell you the definite integral?

+",5045,,55,,11/24/2020 14:22,11/24/2020 14:22,Using quantum computers to calculate definite integrals?,,0,7,,,,CC BY-SA 4.0 +8962,1,,,11/27/2019 5:52,,0,69,"

This answer states that:

+ +
+

Once it is submitted, your job will be in queue. You will have to request by GET this job ID to get the answer from the backend. + The GET URL is: https://quantumexperience.ng.bluemix.net/api/Jobs/execution_id. + You will get another JSON answer (put it in a r_json variable). If it has the qasms item, see if r_json['qasms'][0] has a result item and you will get the result of the submission.

+
+ +

But when I download it with python, I got a HTML but not JSON. +When I open this URL in Chrome, I just enter https://quantum-computing.ibm.com/

+ +

The question I meet is there are too many circuit need to run (19200 circuit). But One task can take 64 circuit. (When I try 96 circuit, it fail) So I have to create 300 tasks. Download these result one by one is not easy, so I want a URL. +If someone can tell me how to download 300 results quickly or how to run more circuit in One task. It also really helpful. Thank you very much.

+",8901,,55,,11/27/2019 10:45,11/27/2019 10:45,What is the URL of the result?,,0,4,,,,CC BY-SA 4.0 +8963,1,,,11/27/2019 10:41,,1,60,"

Suppose I prepare a Bell state $|\beta_{00}\rangle$, and distribute the product state $|\beta_{00}\rangle_{12}|\beta_{00}\rangle_{34}|\beta_{00}\rangle_{56}$ without telling them which state I prepared, with $A$ having qubits $1$ and $4$, $B$ having $2,6$, C having $3,5$.

+ +

Now I calculate the individual density matrices for $A, B, C$ which comes out to be $\dfrac{\mathbb{I}\otimes\mathbb{I}}{4}$ for each implying no one has the information about the complete state he/she has since the density matrix is completely mixed. My first question is, is this correct?

+ +

Now, say I want to calculate the entropy of the entire system, and then the entropy for each subsystem $A, B, C$. The entropy of each system can be seen to be $2$ by looking at the eigenvalues of the partial density matrices of $A, B, C$. Suppose I now tell them what state I shared, will the entropy of the entire system and the subsystem change? What if $A$ measures his particles $1,4$, then will the entropy change?

+",6070,,55,,11/24/2020 14:22,11/24/2020 14:22,Entropy of a shared state as measured by the individual parties,,1,3,,,,CC BY-SA 4.0 +8964,2,,8953,11/27/2019 11:10,,2,,"
+

What does this density matrix say about the information that the players have about each others particles?

+
+ +

Nothing, if no further assumptions are made on the initial state. If $A$ and $B$ share a state $\rho$, a reduced state $\rho^A$ doesn't say anything about the information that $A$ has about $B$'s state. +Indeed, $B$ can have any state as far as $A$ knows: any shared state of the form $\rho^A\otimes \sigma$ is compatible with $A$'s knowledge, for any state $\sigma$.

+ +

If on the other hand Alice knows that the initial state is pure, then knowing that their share of the state is $\rho^A$, $A$ can infer the entropy of $B$'s state, because $S(\rho^A)=S(\rho^B)$. Nothing else can be said though, as any local operation applied to $B$ will not change $A$'s outcomes.

+",55,,,,,11/27/2019 11:10,,,,4,,,,CC BY-SA 4.0 +8965,2,,8963,11/27/2019 11:27,,1,,"

The entropy of a system depends on your state of knowledge about it. If you know that a state is pure, then its entropy is zero. If you ""tell $A,B,C$ that the overall shared state is pure"", then they know as much and will, therefore, say that the entropy of the overall state is $0$ (note that this is essentially a tautological statement). However, for them measure that the overall state is indeed pure, they need to be able to do nonlocal measurements. If they can only do local measurements, then as far as they are concerned their state is indistinguishable from $\rho^A\otimes\rho^B\otimes \rho^C$.

+ +

Stated differently, you can think of the entropy of a system as a property of the way it's being measured. If $A$ measures only their state, they will associate to the measured state an entropy $S(\rho^A)$, and this regardless of whatever it's been done by the other parties. Even if you give $A$ full knowledge about the shared state, $A$ still will only be able to measure the entropy $S(\rho^A)$ with only their share of the state.

+",55,,,,,11/27/2019 11:27,,,,2,,,,CC BY-SA 4.0 +8966,1,8967,,11/27/2019 14:17,,0,128,"

I have successfully run bit_flip_error in Qiskit by function pauli_error, but I can not find how to implement a kraus_error.

+ +

pauli_error works as follows:

+ +
pauli_error([('X', p_reset), ('I', 1 - p_reset)])
+
+ +

kraus_error?

+",9275,,26,,11/28/2019 4:34,11/28/2019 4:34,How can I implement a kraus_error in qiskit?,,1,1,,,,CC BY-SA 4.0 +8967,2,,8966,11/27/2019 15:00,,1,,"

I believe you can implement it a similar way you implemented the pauli_error, just with different parameter input. You need to pass in a (list[matrix]): Kraus matrices. The kraus_error method is defined here. You should be able to import it from the same module you import pauli_error from: qiskit.providers.aer.noise.errors.standard_errors

+",6180,,,,,11/27/2019 15:00,,,,2,,,,CC BY-SA 4.0 +8968,2,,8958,11/27/2019 16:52,,14,,"

There is no specific paper for this, though information on the model can be found in the Qiskit Aer API documentation and is based on the research of IBMQ quantum computing group. As examples you can read some of the following papers for more information about errors in IBMQ devices:

+ +
    +
  • arXiv:1410.6419 -- The Methods section at the end has a summary of gate calibration and readout error characterization
  • +
  • arXiv:1603.04821 -- Described types of errors which occur in the way IBMQ devices implement the CNOT gate
  • +
+ +

TL,DR

+ +

This noise model is a greatly simplified approximate error model and you should not expect it to exactly reproduce errors from a real device.

+ +

This is because the model is derived from a very small set of parameters which are obtained from device calibration experiments. For example: For gates errors are derived from a single gate_error parameter along with the gate length and the $T_1$ and $T_2$ relaxation time constants for the qubits involved. General 1 and 2 qubit error maps are described by 4x4 matrix and 16x16 complex matrices (CPTP Choi-matrix), which require a lot more than the given parameters to specify in general.

+ +

More details

+ +

To summarize the documentation the basic noise model consists of:

+ +
    +
  1. Single qubit readout errors
  2. +
  3. Single qubit gate errors on u1, u2, u3 gatese
  4. +
  5. Two-qubit gate errors on cx.
  6. +
+ +

I'll go into more detail below for each case

+ +

Readout Errors

+ +

Readout errors are based on two parameters:

+ +
    +
  1. The probability of recording an outcome as 0 given it was actually 1
  2. +
  3. The probability of recording an outcome as 1 given it was actually 0
  4. +
+ +

This assumes readout error are not correlated between qubits for multi-qubit measurements. It also means that measure errors are purely classical (no back action on qubit state), which is accurate for the case where measurements occur at the end of a circuit (which they must currently for actual devices). In practice these errors are quite a good approximation for the readout errors of IBMQ devices.

+ +

Gate errors

+ +

The 1 and 2-qubit gate errors are derived from following parameters:

+ +
    +
  1. The length of the specific gate
  2. +
  3. The $T_1$, $T_2$ relaxation time values for each qubit in the gate
  4. +
  5. A gate_error parameter obtained from 1 or 2-qubit randomized benchmarking
  6. +
+ +

The gate_error represents the overall error of the gate as is defined as $1 - F$ where $F$ is the average gate fidelity.

+ +

The gate error model assumes this error is described by an error channel $\cal{E} = \cal{E}_{\text{depol}} \circ \cal{E}_{\text{relax}}$ where $\cal{E}_{\text{depol}}$ is a n-qubit depolarizing-error channel and $\cal{E}_{\text{relax}}$ is a tensor product of 1-qubit thermal relaxation error channels on each qubit.

+ +

The main limitations/approximations of this model are:

+ +
    +
  • It approximates all non-relaxation gate errors as depolarizing errors (so there are no coherent errors)
  • +
  • Errors are only applied to gates, so it does not automatically include relaxation errors on idle qubits
  • +
  • It does not include any non-local errors such as cross-talk
  • +
+ +

The thermal relaxation error channel used is very standard and a good model for relaxation errors during gates, so if gate error is completely due to $T_1$ relaxation (we call this $T_1$-limited) the model is very good. If gate error is only partially due to to relaxation then it becomes much more approximate.

+ +

In practice this model is quite good for 1-qubit gate errors where error rates are quite low and close to being $T_1$-limited, but it will not be for CNOT gates which are not $T_1$ limited. CNOT gates also tend to have higher levels of cross-talk errors which are not captured in this model.

+ +

Another limitation is if you circuit has a lot of idle qubits (qubits not participating in a gate during any point in time) it will underestimate $T_1$ relaxation errors unless you add idle (""id"") gates to those qubits. This is partially a limitation of thee quantum circuit format (since it has no notion of gate scheduling) and is something I hope to address in future updates to Qiskit Aer.

+ +

References

+ +

Sources: The Qiskit Aer API documentation and source code, and myself (I wrote the code in question).

+",8650,,,,,11/27/2019 16:52,,,,2,,,,CC BY-SA 4.0 +8969,1,,,11/27/2019 17:15,,3,631,"

I was reading a paper titled ""Using a Recurrent Neural Network to Reconstruct Quantum Dynamics of a Superconducting Qubit from Physical Observations"" and was confused about a stochastic master equation governing the evolution of the single-qubit system. According to the paper, they are denoting the non-unitary evolution of a superconducting qubit. The equation in question is the following: +$$ +d \rho_{t}=\underbrace{\left(i\left[H_{R}, \rho_{t}\right]+\mathcal{L}\left[\sqrt{\frac{\gamma}{2}} \sigma_{Z}\right] \rho_{t}\right)}_{\text {dissipative evolution }} d t+\underbrace{\sqrt{\eta} \mathcal{H}\left[\sqrt{\frac{\gamma}{2}} \sigma_{Z}\right] \rho_{t}}_{\text {backaction }} d w_{t} +$$ +In this case, $H_{\mathrm{R}}=\frac{\hbar \Omega_{R}}{2} \sigma_{X}$, ""describes a microwave drive at the qubit transition frequency which induces unitary evolution of the qubit state characterized by the Rabi frequency $\Omega_R$."" I understand and was able to implement (in MATLAB) the first half of the dissipative evolution, $i[H_R,p_T]$, as this is fairly simple; however, what do the $\mathcal{L}$ and $\mathcal{H}$ mean? The paper describes $\mathcal{L}$ as ""the Lindblad superoperator describing the qubit dephasing induced by the measurement of strength $\gamma$""; however I have little idea as to what this means. What exactly does this mean and, if possible, what are methods of encoding this computationally (in something like MATLAB or python)

+",9254,,13968,,7/13/2021 9:32,7/23/2021 3:39,"What is ""Lindblad Superoperator"" in Stochastic Master Equation",,1,6,,,,CC BY-SA 4.0 +8970,2,,8947,11/27/2019 21:01,,1,,"

I think this should help:

+ +
circuit.measure([0,1,2,3], [0,1,2,3,4,5])
+
+ +

for 4 qubits.

+ +

The secret number = '1001' for the circuit below:

+ +

NOTE the xor gates ""cx"" in qbit 0 and 3 are because it is 1 on the first and last bit of the secret number.

+ +

+ +

And after that simulate (to get the answer):

+ +

+ +

I hope I've helped.

+",9277,,45,,11/29/2019 0:39,11/29/2019 0:39,,,,0,,,,CC BY-SA 4.0 +8971,2,,8945,11/27/2019 21:59,,0,,"

One can perhaps guess the answer without full calculation. Noting that ""tracing"" intuitively means losing information, then, if you A is maximally entangled with B, then you lose information about B (or A) then you end up with no information about A. That is basically how qubits lose information to the environment (here B is like an environment for A).

+",9070,,,,,11/27/2019 21:59,,,,0,,,,CC BY-SA 4.0 +8972,1,,,11/27/2019 22:32,,3,1112,"

I tried to follow the web instructions to load Qiskit, including VC++ 2017 Redistributable, but I get many errors upon installation. The gist seems to be that VC++ 2017 wasn't found. Some results coped below - any suggestions?

+ +
=========================================================
+.
+.
+.
+  Building wheel for qiskit-aer (setup.py) ... error
+  ERROR: Command errored out with exit status 1:
+.
+.
+.
+.
+  --------------------------------------------------------------------------------
+  -- Trying ""Ninja (Visual Studio 15 2017 Win64 v141)"" generator
+  --------------------------------
+  ---------------------------
+  ----------------------
+  -----------------
+  ------------
+  -------
+  --
+  Not searching for unused variables given on the command line.
+  CMake Error: CMake was unable to find a build program corresponding to ""Ninja"".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
+.
+.
+.
+.
+  ----------------------------------------
+  ERROR: Failed building wheel for qiskit-aer
+  Running setup.py clean for qiskit-aer
+  Building wheel for qiskit-terra (setup.py) ... error
+  ERROR: Command errored out with exit status 1:
+.
+.
+.
+.
+    scikit-build could not get a working generator for your system. Aborting build.
+
+Building windows wheels for Python 3.8 requires Microsoft Visual Studio 2017.
+Get it with ""Visual Studio 2017"":
+
+  https://visualstudio.microsoft.com/vs/
+
+",9278,,55,,7/7/2020 12:50,7/7/2020 12:50,Qiskit installation failing: VC++ 2017 not found,,2,9,,,,CC BY-SA 4.0 +8973,1,,,11/28/2019 0:47,,2,76,"

After reading some with regard to the quantum computing gates and the comparison to classic gates it seems that the quantum computer, at least for the time being, is not viewed as a programmable element of a ""hardware circuit"" but more as a hardware device that combines functions, as in what is termed in ""classical computing"" ASSP - application-specific signal processors. Is this view right?

+",9261,,26,,11/28/2019 12:15,11/28/2019 12:15,Are quantum gates analogous to ASSPs in classical computing?,,2,3,,,,CC BY-SA 4.0 +8974,1,,,11/28/2019 2:34,,0,87,"

Just need some clarification: Results derived as the output of ""running"" a ""quantum circuit"" constructed from ""quantum gates"" are distributed in a certain way, based on the design, and the multiple possible outputs have a distribution with the desired one having the highest probability of occurrence. By using more qubits the ""signal to noise"" ratio may be improved (by using the appropriate implementation of the ""quantum circuit"").

+ +

Is my interpretation right or I am missing some key components?

+",9261,,26,,11/28/2019 4:01,11/28/2019 8:36,Is this interpretation of quantum circuits right?,,1,6,,,,CC BY-SA 4.0 +8976,1,8985,,11/28/2019 5:29,,4,116,"

I am trying to prove that the $|S_{n}\rangle$ is $n$-lateral rotationally invariant, where $|S_{n}\rangle$ is defined as

+ +

$$|S_{n}\rangle=\sum_{S \in P_{n}^{n}} (-)^{\tau(S)}|S\rangle\equiv\sum_{S \in P_{n}^{n}} (-)^{\tau(S)}|s_{0}s_{1}.....s_{n-1}\rangle.$$

+ +

A $n$ dimensional qudit state on Hilbert space $H_{n}$ is the superposition of its computational basis $\{|i\rangle\}, i\in\{0,1,2,...,n-1\}$. Here, $|S_n\rangle$ is a state of $n$ such particles on $H_{n}^{\otimes n}$.

+ +

Consider now another basis $|i'\rangle$ connected with the computational +basis by a unitary transformation $U$, where +$$|i\rangle=\sum_{j} U_{ji}|i'\rangle.$$

+ +

Then, in this new basis, the state $|S_{n}\rangle$ takes the same form up to a global phase factor $\phi$. That is,

+ +

$$|S_{n}\rangle=e^{i\phi}\sum_{M \in P_{n}^{n}} (-)^{\tau(M)}|M'\rangle \equiv e^{i\phi}\sum_{M \in P_{n}^{n}} (-)^{\tau(M)}|m_{0}'m_{1}'...m_{n-1}'\rangle.$$

+ +

Here $P_{n}^{n} = \{x_{0}x_{1}x_{2}...x_{n-1}|x_{0},x_{1},x_{2},...,x_{n-1 }\in Z_{n}, \forall j \neq k, x_{j} \neq x_{k}\}$ and the phase factor is given by +$$e^{i\phi} = \det(U).$$

+ +
+ +

Proof

+ +

$$|S_{n}\rangle=\sum_{S \in P_{n}^{n}} (-)^{\tau(S)}\sum_{m_{0}=0}^{n-1}U_{m_{0},s_{0}}|m_{0}'\rangle\otimes...\otimes\sum_{m_{n-1}=0}^{n-1}U_{m_{n-1},s_{n-1}}|m_{n-1}'\rangle$$

+ +

$$=\left[\sum_{M \in P_{n}^{n}} + \sum_{M \not\in P_{n}^{n}}\right]\left[\sum_{S \in P_{n}^{n}} (-)^{\tau(S)}U_{m_{0},s_{0}}U_{m_{1},s_{1}}...U_{m_{n-1},s_{n-1}}\right]|M\rangle$$

+ +

$$=\left[\sum_{M \in P_{n}^{n}} + \sum_{M \not\in P_{n}^{n}}\right]det(U_{m_{j}, s_{i}})|M\rangle$$

+ +

.... continued

+ +

Here how $\left[\sum_{S \in P_{n}^{n}} (-)^{\tau(S)}U_{m_{0},s_{0}}U_{m_{1},s_{1}}...U_{m_{n-1},s_{n-1}}\right]= det(U_{m_{j}, s_{i}})$?

+ +

Please provide a reference if you have any. I have a basic idea about unitary transformations and their matrix representations.

+ +

$\tau(S)$, named inverse number, is defined as the number of transpositions of pairs of elements of $S$ that must be composed to place the elements in canonical order, $012 · · · n − 1$.

+",8620,,55,,11/28/2019 12:10,11/28/2019 17:00,Prove that the state $\sum_{S\in P_n}(-)^{\tau(S)}|S\rangle$ is invariant up to a phase when changing the basis,,2,4,,,,CC BY-SA 4.0 +8977,1,,,11/28/2019 6:14,,11,181,"

We know that solving a hidden subgroup problem over a non-commutative group is a long standing problem in quantum computing even for groups like $D_{2n}$ (alternatively can be written as $\mathbb{Z}_n \rtimes \mathbb{Z}_2$) for general $n$. What are some families $n$ for which this can be done?

+",8132,,8132,,12/3/2019 10:24,12/3/2019 10:24,Status of hidden shift and hidden subgroup problems,,0,4,,,,CC BY-SA 4.0 +8978,1,,,11/28/2019 6:24,,4,873,"

There are many different physical implementations of qubits: NMR, spin qubit, N color center in diamond, superconducting qubit, trapped ions, photonics quantum computing, topological qubit, etc. However, superconducting qubits is currently the most popular approach, adopted by IBM, Google, Rigetti, Intel, etc.

+ +

What are the advantages of superconducting qubits over other implementations, such as trapped ions? As far as I know, trapped ions qubits have higher gate fidelity and it doesn't require low temperature. Is scalability the main advantage of superconducting qubits over other implementations?

+",7474,,55,,11/28/2019 12:23,12/2/2019 10:07,Why are superconducting qubits the most popular approach to build a quantum computer?,,1,6,,,,CC BY-SA 4.0 +8979,1,,,11/28/2019 7:11,,3,166,"

What are the infrastructures needed to build a cloud quantum computing service like IBM Q Experience?

+ +

It seems this is not a trivial task. IQX has been running for more than 3 years and yet it is taking ages for Google to come up with one.

+",7474,,,,,11/28/2019 16:31,How to put a quantum computer on the cloud?,,1,1,,,,CC BY-SA 4.0 +8980,2,,8974,11/28/2019 8:36,,2,,"

Yes, when you run an algorithm, often specified as a sequence of gates, you get different results according to some probability distribution.

+ +

Assuming we are talking about an error-free computation (this is where, in this field, we use the terminology ""noise"" which is distinct from the ""noise"" of ""signal to noise ratio""), then most algorithms that you will currently find are designed in such a way that as the size of the input increases (and you therefore use more qubits), the success probability tends to 1 (increasing signal to noise ratio, to use your terminology). However, for a fixed input, you cannot always just throw more qubits at the problem and somehow magically expect to improve the probability of the correct outcome. (That said, some algorithms such as phase estimation do work like that.)

+ +

Instead, what you can do is exactly what you'd do with probabilistic classical computation: repeat the computation many times and perform a majority vote for the answer. You could do this in parallel, using more qubits, but you can also do it sequentially, and not use any extra qubits at all.

+",1837,,,,,11/28/2019 8:36,,,,1,,,,CC BY-SA 4.0 +8981,2,,8973,11/28/2019 8:36,,1,,"
+

(...) depending on what you attempt to compute you ""design"" your circuit - this is what is called ASSP (Application Specific Signal Processor) where the input is Signal which are processed by the Circuit (processor) to create the processed output - the measure gate. [Source]

+
+ +

Reading the question more carefully and after your clarification in the comments, I think it has some merit. It is indeed the case that quantum gates are not fully programmable in most architectures; the gate array (quantum circuit) has to be designed according to the specific algorithm and specific problem we're trying to solve (what you call ASSP), which certainly is a nuisance.

+ +

However, note that in Google's latest architectures like the Sycamore, the gates are indeed fully programmable (at least, that's their claim), as is expected of a general-purpose quantum computer. I'm not sure what your impression of ""programming"" quantum gates is, but it's like manipulating a sequence of laser or microwave pulses on qubits in ion-trap and superconducting architectures respectively. See Peter Shor's answer for a nice explanation.

+",26,,26,,11/28/2019 12:12,11/28/2019 12:12,,,,0,,,,CC BY-SA 4.0 +8982,2,,8973,11/28/2019 9:21,,1,,"

Today many people believe that programming means coding on some language like python; this is not true. The early classical computers were programmed by inserting junctions which connect logical elements of an electronic scheme, and this is also programming.

+ +

I believe modern programmable quantum computers are programmed like that: a programmer is given a certain number of gates, and allowed ways to connect the gates; his task is to connect the gates to implement some algorithm.

+",2105,,,,,11/28/2019 9:21,,,,2,,,,CC BY-SA 4.0 +8983,2,,8976,11/28/2019 14:55,,2,,"

Let unitary operator $U$ acts as a permutation $\boldsymbol{\sigma} = (\sigma_1, \sigma_2,..,\sigma_n) $ on the standard basis. That is +$$ +U |i \rangle = | \sigma_i \rangle +$$ +for every $i \in \{0,1,..,n-1\}$.
+Now if ${\boldsymbol{\rho}} = (\rho_1, \rho_2,..,\rho_n)$ is some permutation, then +$$ +U^{\otimes n} | \boldsymbol{\rho}\rangle = U^{\otimes n} | \rho_1 \rho_2..\rho_n\rangle = | \sigma_{\rho_1} \sigma_{\rho_2}..\sigma_{\rho_n}\rangle = | (\sigma\rho)_1 (\sigma\rho)_2 ..(\sigma\rho)_n \rangle = | \boldsymbol{\sigma\rho}\rangle +$$ +Here $\boldsymbol{\sigma\rho}$ is the composition of permutations $\boldsymbol{\sigma}$ and $\boldsymbol{\rho}$.
+Now note that +$$(-1)^{\tau(\boldsymbol{\sigma\rho})} = (-1)^{\tau(\boldsymbol{\sigma})}(-1)^{\tau(\boldsymbol{\rho})} +$$ +Finally +$$ +U^{\otimes n} | S_n \rangle += U^{\otimes n} \sum_{\rho \in Sym_n}(-1)^{\tau(\boldsymbol{\rho})}| \boldsymbol{\rho}\rangle += \sum_{\rho \in Sym_n}(-1)^{\tau(\boldsymbol{\rho})}| \boldsymbol{\sigma\rho} \rangle += +$$ +$$ +=(-1)^{\tau(\boldsymbol{\sigma})} \sum_{\rho \in Sym_n}(-1)^{\tau(\boldsymbol{\sigma\rho})}| \boldsymbol{\sigma\rho} \rangle += (-1)^{\tau(\boldsymbol{\sigma})} | S_n \rangle = \text{det}(U)| S_n \rangle +$$

+ +

For the proof for every unitary $U$ see the DaftWullie's answer.

+",5870,,5870,,11/28/2019 17:00,11/28/2019 17:00,,,,0,,,,CC BY-SA 4.0 +8984,2,,8979,11/28/2019 15:14,,2,,"

To have a cloud computing quantum service you need to automate all layers and communication between layers in the quantum system stack: +

+ +

Source: ""The engineering challenges in quantum computing"" by Almudever et al.

+ +

I am sure Google would be able to do this, but for now they are not focusing on this. This gives them the advantage to put all their efforts into proof of concept experiments such as the quantum supremacy demo.

+",9282,,26,,11/28/2019 16:31,11/28/2019 16:31,,,,4,,,,CC BY-SA 4.0 +8985,2,,8976,11/28/2019 16:17,,3,,"

Let $\rho$ and $\sigma$ be two permutations, i.e. lists of length $d$ containing some ordering of the elements 0 to $d-1$.

+ +

What we want to calculate is $\langle \rho|U^{\otimes d}|S\rangle$. If we can show that this is $(-1)^{\tau(\rho)}$ up to a global phase, then we know not only that those elements come through the calculation correctly, but by normalisation, it must be that all states not of the form $|\rho\rangle$ have 0 amplitude.

+ +

Now, +$$\langle \rho|U^{\otimes d}|S\rangle=\sum_{\sigma}(-1)^{\tau(\sigma)}\prod_{i=0}^{d-1}U_{\rho_i,\sigma_i}$$ +Let us change the order that we do the product, so the first element we take as $\rho_i=0$, then $\rho_i=1$ etc. So, this expression becomes +$$ +\sum_{\sigma}(-1)^{\tau(\sigma)}\prod_{i=0}^{d-1}U_{i,(\rho^{-1}\sigma)_i}. +$$ +Next, we change the order that we take the sum over permutations (since the set of objects we're summing over is unchanged by the permutation $\rho^{-1}$). +$$ +\sum_{\sigma}(-1)^{\tau(\rho\sigma)}\prod_{i=0}^{d-1}U_{i,\sigma_i}. +$$ +Next, we use $\tau(\rho\sigma)=\tau(\rho)\tau(\sigma)$, so we have +$$ +(-1)^{\tau(\rho)}\left(\sum_{\sigma}(-1)^{\tau(\sigma)}\prod_{i=0}^{d-1}U_{i,\sigma_i}\right). +$$ +The term in brackets is a standard way of writing $\text{det}(U)$. See, for example, Wikipedia. Just to complete the argument in terms of what we had to prove, $U$ is unitary, so its determinant has modulus 1, i.e. $\text{det}(U)$ just contributes a global phase.

+",1837,,,,,11/28/2019 16:17,,,,0,,,,CC BY-SA 4.0 +8986,1,,,11/28/2019 16:57,,1,55,"

I saw a video in which a guy from IBM was explaining (very generally) quantum computing, it's difference with classical computing etc. +The talk was not technical at all, it was intended for a broad audience.

+ +

At some point he told that, if we need to represent our position on the planet with only one bit, we could only tell for example if we are on the North or South hemisphere, but with a qubit we could tell exactly where we where.

+ +

He did this example to explain the difference in how much information can a bit and a qubit contain and to give a little idea of what a superposition is (I think).

+ +

Now, my question:

+ +

From what I know a qubit has more than one state, but when I read it I can only have one or zero, so why this example was made? From what I can understand a qubit can hold more information but I can't read it, so basically it's useless.

+",9285,,55,,11/24/2020 14:22,11/24/2020 14:22,Clarification on the information content of a qubit,,0,2,,11/28/2019 17:31,,CC BY-SA 4.0 +8987,1,,,11/28/2019 21:06,,2,247,"

When I access IBM Q backend with qiskit code, an error occurs.

+ +
from qiskit import IBMQ 
+
+qt = 'xxxxxxxxx'
+
+IBMQ.save_account(qt)
+IBMQ.load_accounts()
+
+ +

The error message is as follows:

+ +
---------------------------------------------------------------------------
+JSONDecodeError                           Traceback (most recent call last)
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/api/utils.py in obtain_token(self, config)
+    135             response.raise_for_status()
+--> 136             self.data_credentials = response.json()
+    137         except (requests.HTTPError, ValueError) as ex:
+
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/requests/models.py in json(self, **kwargs)
+    896                     pass
+--> 897         return complexjson.loads(self.text, **kwargs)
+    898 
+
+/usr/local/oss/anaconda3/lib/python3.6/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
+    353             parse_constant is None and object_pairs_hook is None and not kw):
+--> 354         return _default_decoder.decode(s)
+    355     if cls is None:
+
+/usr/local/oss/anaconda3/lib/python3.6/json/decoder.py in decode(self, s, _w)
+    338         """"""
+--> 339         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
+    340         end = _w(s, end).end()
+
+/usr/local/oss/anaconda3/lib/python3.6/json/decoder.py in raw_decode(self, s, idx)
+    356         except StopIteration as err:
+--> 357             raise JSONDecodeError(""Expecting value"", s, err.value) from None
+    358         return obj, end
+
+JSONDecodeError: Expecting value: line 1 column 1 (char 0)
+
+During handling of the above exception, another exception occurred:
+
+ApiError                                  Traceback (most recent call last)
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/ibmqsingleprovider.py in _authenticate(cls, credentials)
+     94 
+---> 95     def _discover_remote_backends(self):
+     96         """"""Return the remote backends available.
+
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/api/ibmqconnector.py in __init__(self, token, config, verify)
+    103         self.req = Request(token, config=config, verify=verify)
+--> 104 
+    105     def _check_backend(self, backend_name):
+
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/api/utils.py in __init__(self, token, config, verify, retries, timeout_interval)
+    216                                       proxy_urls=self.proxy_urls,
+--> 217                                       ntlm_credentials=self.ntlm_credentials)
+    218 
+
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/api/utils.py in __init__(self, token, config, verify, proxy_urls, ntlm_credentials)
+     67         if token:
+---> 68             self.obtain_token(config=self.config)
+     69         else:
+
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/api/utils.py in obtain_token(self, config)
+    137         except (requests.HTTPError, ValueError) as ex:
+--> 138             raise ApiError('error during login: %s' % str(ex))
+    139 
+
+ApiError: error during login: Expecting value: line 1 column 1 (char 0)
+
+The above exception was the direct cause of the following exception:
+
+ConnectionError                           Traceback (most recent call last)
+<ipython-input-9-2e30fdf423aa> in <module>
+     11 IBMQ.stored_accounts()
+     12 
+---> 13 IBMQ.load_accounts()
+     14 #IBMQ.enable_account(qt)
+
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/ibmqprovider.py in load_accounts(self, **kwargs)
+    197 
+    198     def disable_accounts(self, **kwargs):
+--> 199         """"""Disable accounts in the current session, subject to optional filtering.
+    200 
+    201         The filter kwargs can be `token`, `url`, `hub`, `group`, `project`.
+
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/ibmqprovider.py in _append_account(self, credentials)
+    277         """"""
+    278         return all(getattr(credentials, key_, None) == value_ for
+--> 279                    key_, value_ in filter_dict.items())
+
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/ibmqsingleprovider.py in __init__(self, credentials, ibmq_provider)
+     50         self.credentials = credentials
+     51         self._api = self._authenticate(self.credentials)
+---> 52         self._ibm_provider = ibmq_provider
+     53 
+     54         # Populate the list of remote backends.
+
+/usr/local/oss/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/ibmqsingleprovider.py in _authenticate(cls, credentials)
+    101         """"""
+    102         ret = OrderedDict()
+--> 103         configs_list = self._api.available_backends()
+    104         for raw_config in configs_list:
+    105             try:
+
+ConnectionError: Couldn't connect to IBMQ server: error during login: Expecting value: line 1 column 1 (char 0)
+
+ +

How can I solve this problem ?

+",9288,,26,,11/29/2019 13:57,7/10/2020 6:22,Couldn't connect to IBMQ server,,1,0,,,,CC BY-SA 4.0 +8988,2,,8987,11/29/2019 0:47,,2,,"

You added an ""s"" in the final.

+ +

IBMQ.load_accounts()

+ +

The right way is:

+ +

IBMQ.load_account()

+ +

I hope I could have helped.

+",9277,,9277,,11/29/2019 1:14,11/29/2019 1:14,,,,0,,,,CC BY-SA 4.0 +8989,1,,,11/29/2019 4:49,,1,103,"

I don't understand this ""trapped ion (qubit implemented by the internal state of trapped ions)""

+ +

One qubit implemented by the internal state of trapped ions (plural)?

+ +

""Consider an ion trap. The ions represent qubits by using one electronic state as a |0⟩ and another as a |1⟩""

+ +

What are these ions states physically?

+",8491,,26,,11/29/2019 13:53,11/29/2019 13:53,How can one trapped ion physically represent quantum states?,,1,1,,,,CC BY-SA 4.0 +8990,2,,8989,11/29/2019 10:29,,2,,"

The ion states are the different energy states of the ion. These different energy states can be denoted with the total +spin of the ion and the phonon levels of the ion.

+ +

If we look at a Helium atom which has two electrons the total spin can be S = 0 if the electrons are in the following spin state: +$$ +\frac{1}{\sqrt{2}}(\uparrow \downarrow-\downarrow \uparrow) +$$ +or the total spin can be S=1 if the electrons are in one of the following three states +$$ +\downarrow \downarrow +$$ +$$ +\frac{1}{\sqrt{2}}(\uparrow \downarrow+\downarrow \uparrow) +$$ +$$ +\uparrow \uparrow +$$ +The phonon levels represent motional states of the atom.

+ +

Often two ion energy states with a different total spin and 0 phonons are chosen as the qubit $|0\rangle$ and $|1\rangle$ state.

+",9282,,,,,11/29/2019 10:29,,,,0,,,,CC BY-SA 4.0 +8993,1,,,11/29/2019 19:45,,2,84,"

I'm picturing the control equipment on the inside of an ISS wall with the part that needs being cold being on the outer side.

+ +

I imagine this has been considered and if so, was the idea rejected for some particular reason?

+ +

Note: It this is off topic please let me know and I'll delete it and post it on a hardware forum.

+",9298,,,,,4/29/2020 3:06,Mightn't the cost of a quantum computer be lowered by building it on earth sans cooler and then using it in the frigid vacuum of space?,,1,5,0,,,CC BY-SA 4.0 +8994,1,,,11/29/2019 20:01,,4,105,"

Where does QEC fit in the larger picture of the execution of a fault tolerant quantum algorithm?

+ +

For QEC, there is an initial preparation of the qubit state and the ancillary qubits; then a ""noisy channel""; then a check and error correcting. It seems the algorithm would be the noisy channel, but then the final checking and correcting stage would project the state back to its original state negating any the algorithm did. I'm missing something essential here.

+",8420,,26,,11/30/2019 11:30,12/7/2019 7:04,Where does error correction go in a quantum algorithm?,,2,0,,,,CC BY-SA 4.0 +8995,2,,2203,11/30/2019 4:56,,3,,"

Content wise very similar course but different name Quantum Information Science I (three parts - part 1, 2, and 3) and Quantum Information Science II were $49 per course as verified certified learning outcome - a series of 3 courses + 1 more extra course on edX. Now the course has been taken down; at least no more new enrollments, and MITx Pro is offering it for \$2250 + \$2250 = \$4500. This is 20 times higher for the same course.

+ +

I see there would be a number of other MOOCs coming soon. One such is from St Petersberg State University - Introduction to Quantum Computing, but the English version is very poor in quality of content compared to the Russian version on Coursera. However, there is a course from TU Delft on edX, and also one from Keio University at FutureLearn. These options could be looked at; same content but at lower price.

+ +

PS: I am coming up with a course on Udemy and also maybe on Coursera with IBM Qiskit open network free version. Stay tuned for it.

+ +

Edit-2: Adding edX course links cited above.

+ +
    +
  1. Quantum Information Science I

    + +
  2. +
  3. Quantum Information Science II: Advanced quantum algorithms and information theory +https://www.edx.org/course/quantum-information-science-ii-advanced-quantum-al
  4. +
+",9302,,9302,,1/3/2020 4:07,1/3/2020 4:07,,,,1,,,,CC BY-SA 4.0 +8996,1,9032,,11/30/2019 5:15,,1,151,"

Has anyone used or considered color-space and color superposition for Qutrit work?

+ +

A classical color-sphere has black and white at its poles, a grey scale as its axis, pure spectral colors as a color-wheel around its equator, and every possible mixed color inside or on the surface of this color space. This is a qutrit-like space analogous to a Bloch Sphere as a qubit space.

+ +

+ +

Research validating superposition of colors as a Qubit (if not a Qutrit) Computing basis-

+ +

https://physics.aps.org/articles/v9/135

+",9301,,9301,,12/2/2019 0:30,12/2/2019 14:59,Color-Space as Effective and Intuitive Qutrit Physical Realization?,,1,2,,12/6/2019 23:49,,CC BY-SA 4.0 +8998,1,,,11/30/2019 7:19,,-1,104,"

Suppose Alice needs to transmit a bit of information about something which happened just before $t = 0$ to Bob who is light years away from Alice. Entangled pairs of qubits, $\left|00\right> + \left|11\right>$ (after normalising) is being created at the midpoint of Alice and Bob and shared. There exists a time $t = -T$ such that the half entangled pair created at $t = -T$ reaches Alice and Bob at $t = 0$. Assume that there is a setup with Bob which creates some sort of interference of the qubits he receives. Now, if the required bit to transmit is 0, Alice does nothing. However, if the required bit to transmit is 1, Alice does a measurement of the qubits (half the entangled pairs) which she receives from time $t = 0$. It means that if Alice gets a 0, the corresponding qubit which Bob has is 0 (similarly with 1). Now, this means that Alice has information of Bob's qubit and the interference stops at $t = 0$. If Bob keeps seeing interference after $t = 0$, it means that the bit was 0. If Bob sees that the interference stops at $t = 0$, the bit was 1. It looks like information got transmitted faster that the speed of light. Can someone please explain why this is wrong?

+",8602,,55,,11/24/2020 14:22,11/24/2020 14:22,Does this setup violate relativity?,,2,0,,,,CC BY-SA 4.0 +8999,2,,8998,11/30/2019 7:43,,2,,"

Bob does not ""see"" the interference in the sense you assume. To ""see"" the interference (actually the states of his qubits) Bob needs to measure the qubits, and the measurement gives Bob no information whether Alice measured her qubits or not.

+",2105,,,,,11/30/2019 7:43,,,,0,,,,CC BY-SA 4.0 +9000,2,,8998,11/30/2019 15:18,,2,,"

""Assume that there is a setup with Bob which creates some sort of interference of the qubits he receives.""

+ +

I think you need to be more specific on this point. From Bob's perspective his qubit is simply a mixed state in the computational basis +$$\rho_B=\frac{1}{2}|0\rangle\langle 0|+\frac{1}{2}|1\rangle\langle1|$$ +so he will not be able to perceive any interference effects.

+",5238,,26,,11/30/2019 16:20,11/30/2019 16:20,,,,0,,,,CC BY-SA 4.0 +9001,1,,,11/30/2019 16:29,,4,120,"

Could you please give a direction/reference towards realising the following using any set of realisable quantum gates

+ +

$$\boxed{|S_{n}\rangle = \frac{1} {\sqrt{n!}} \sum_{S\in P_n^{n}} ( \,-1) \,^{\Gamma(S)}|s_{0}\rangle |s_{1}\rangle ....|s_{n-1}\rangle}$$

+ +

Here $P_n^{n}$ is the set of all permutations of $Z_n := \{0,1,··· ,n−1\}$, $S$ is a permutation (or sequence) in the form $S = s_0 s_1 ···s_{n−1}$. $\Gamma(S)$, named inverse number, is defined as the number of transpositions of pairs of elements of $S$ that must be composed to place the elements in canonical order, $012 · · · n−1$.

+",9304,,,,,4/27/2020 13:04,How to generate the following $n$-level $n$-particle singlet state?,,0,5,,,,CC BY-SA 4.0 +9002,1,,,11/30/2019 17:47,,-2,185,"

Please, be patient with my question

+ +

I already read that there is a heuristic that makes superposition a fact of reality. In addition, this superposition, when observed, it has a state of 0 or 1. Furthermore, quantum programming is done on our workstation and executed on remote quantum hardware. Finally, the use of Hadamard gates was able to create a superposition. Therefore, I'm curious to know if the superposition really is real or is it an assumption?

+ +

Edit note: I started this question with Toffoli. However, my question is about Hadamard gate.

+",5986,,5986,,12/1/2019 15:45,12/1/2019 15:45,Is quantum superposition state a truth or an assumption?,,2,2,,,,CC BY-SA 4.0 +9003,2,,8960,11/30/2019 18:09,,2,,"

I have some ideas

+ +

1) Since $[\mathcal{O}^\dagger_A, \mathcal{O}] = - [\mathcal{O}_A, \mathcal{O}^\dagger]^\dagger$ and $\mathcal{O} = (\mathcal{O}+\mathcal{O}^\dagger)/2 + (\mathcal{O}-\mathcal{O}^\dagger)/2$ you can solve it only for self-adjoint operators $\mathcal{O}=\mathcal{O}^\dagger$. And even more, you can consider only real self-adjoint operators $\mathcal{O} = \mathcal{O}^\dagger = \mathcal{O}^T$.

+ +

2) You can rewrite your equation as +$$ +\text{Tr}\big( \mathcal{O} \cdot [E_{\psi\phi}, \mathcal{O}_A]\big) = 0,~~ E_{\psi\phi} = |\psi\rangle\langle \phi| +$$ +hence it must be +$$ +\text{Tr}\big( \mathcal{O} \cdot [\Pi X \Pi, \mathcal{O}_A]\big) = 0 +$$ +for every operator $X$ on $\mathcal{H}$.
+Also the last equation means that $\mathcal{O}^\dagger$ is orthogonal to the subspace $\mathrm{span}\{[\Pi X \Pi, \mathcal{O}_A]\}$ in the operator space with the Hilbert-Schmidt inner product on it.

+ +

Update

+ +

Using the last characterization it's not hard to show that there is a counterexample to your guess of a general formula. Let $|\phi\rangle = |v\rangle_A|w\rangle_B$ and $\mathcal{H}_{code} = \{\lambda |\phi\rangle, \lambda \in \mathbb{C}\}$, i.e. it's 1-dimensional and generated by a product state. In this case +$$ +\Pi X \Pi = \chi |\phi\rangle\langle\phi| = \chi |v\rangle\langle v| \otimes |w\rangle\langle w| +$$ +So +$$ +[\Pi X \Pi, \mathcal{O}_A \otimes I_B] = [\chi |v\rangle\langle v|, \mathcal{O}_A ] \otimes |w\rangle\langle w| +$$ +The last expression is not equal to zero only if $[\chi |v\rangle\langle v|, \mathcal{O}_A ] \neq 0$.

+ +

It's easy to see that if $[M,E_{11}]=0$, where $M$ is some $n \times n$ matrix and $E_{11}$ is a matrix with a single non-zero element in the $(1,1)$ position, then it must be $m_{12}=m_{13}=...=m_{1n}=0, m_{21}=m_{31}=...=m_{n1}=0$ (and vice versa). So dimension of the subspace $\text{span}\{[M,E_{11}]\}$ equals to $2(n-1)$.

+ +

Let $d_A = \text{dim}\mathcal{H}_A$, $d_B = \text{dim}\mathcal{H}_B$. We have that +$$ +\text{dim} \big( \text{span} \{ [\Pi X \Pi, \mathcal{O}_A \otimes I_B] \} \big) = 2(d_A-1) +$$ +So dimension of the subspace of solutions $\mathcal{O}$ must be $d_A^2d_B^2 - 2(d_A-1)$
+But your general formula gives no more than $d_B^2 + (d_Ad_B-1)^2$ dimensional subspace. If $d_B=2$ and $d_A>2$ it's just not enough.

+",5870,,5870,,12/2/2019 14:22,12/2/2019 14:22,,,,0,,,,CC BY-SA 4.0 +9004,2,,9002,11/30/2019 18:37,,4,,"

Whether or not quantum superposition is a ""truth"", is a philosophical question. Quantum theory is simply an axiomatic mathematical model of the universe that happens to give correct experimental predictions (at least, for a fairly broad range) for several physical phenomena. It certainly might be possible to come up with a different mathematical model of the universe (though, the prospects look bleak) that would not require quantum superposition to explain such physical phenomena. In that sense, you can definitely call it an assumption. Every axiomatic system begins with assumptions (i.e., the axioms) after all!

+ +

If you're wondering which basic axiom of quantum mechanics implies quantum superposition, it's this:

+ +
+

Each physical system is associated with a (topologically) separable complex Hilbert space $H$ with inner product $\langle \phi|\psi\rangle$. Rays (that is, subspaces of complex dimension 1) in $H$ are associated with quantum states of the system.

+
+ +

If you've taken some introductory courses in linear algebra you should be aware that the Hilbert space is a vector space whose elements can be written as a linear superposition of its basis elements. Quantum superposition is just that; a quantum state can be written in terms of linear superpositions of the other (basis) quantum states.

+",26,,26,,11/30/2019 22:16,11/30/2019 22:16,,,,5,,,,CC BY-SA 4.0 +9006,2,,8993,12/1/2019 3:00,,1,,"

Space-based cryogenic cost must become cheaper than Earth-based cryogenic cost and cheaper than classical computation emulating quantum computation. Earth application IO datalink and general space operations cost must fall as well. Mass space colonization will help.

+",9301,,,,,12/1/2019 3:00,,,,1,,,,CC BY-SA 4.0 +9007,2,,9002,12/1/2019 3:02,,3,,"

[Can't comment and so, writing an answer]

+ +

As @Sanchayan aptly pointed the theoretical/mathematical arguments which could indicate that superposition is not just an assumption.

+ +

A couple more thoughts:

+ +
    +
  1. You're right in observing that the superposition collapses to 0 or 1 when observed and that's expected due to the collapse of the wave function. A quick way to check if superposition exists could be to see if it's symptoms are observable - interference (destructive/constructive) as an example. You could verify this by running Grover's search algorithm. You'd see how select amplitudes are amplified while others are diminished. We could make a case here that this extends support for superposition being real.

  2. +
  3. It's unclear what you mean by ""quantum programming is done on our workstation and executed on remote quantum hardware"". When we write a quantum program on our workstation, it's just a blueprint of an ""experiment"" that we would like the quantum hardware to perform. Once that information is received by the hardware, it sets up the experiment (initializing qubits), manipulates the qubits (using gates - which might result in superposition, entanglement and/or interference in due course) and finally measures the outcome (collapse of the superposition) and then reports it to our workstation.

  4. +
  5. When you mention, ""the use of Toffoli gates was able to create a superposition"", is that a question? Technically, any state which is not a pure basis state (|0> and |1>) could be termed as a superposition since then it would be a free point on the bloch sphere apart from the poles.

  6. +
+",8852,,,,,12/1/2019 3:02,,,,1,,,,CC BY-SA 4.0 +9009,1,9010,,12/1/2019 9:25,,4,66,"

I am a beginner at QC. I was going through the basics of multi-qubits I encountered a state $|2\rangle|3\rangle$.

+ +

I want clarification on the following points:

+ +
    +
  1. Can I write $|2\rangle$ as $|10\rangle = |1\rangle|0\rangle$ always?
  2. +
  3. If $|2\rangle = |10\rangle = |1\rangle|0\rangle$, Can I write $|2\rangle|3\rangle = |10\rangle|11\rangle = |1011\rangle$?
  4. +
+ +

Assume $|0\rangle$, $|1\rangle$ in computational basis. +$|0\rangle = \begin{bmatrix} + 1 \\ +0 +\end{bmatrix}$, +$|1\rangle = \begin{bmatrix} + 0 \\ +1 +\end{bmatrix}$

+",8620,,8620,,12/1/2019 9:51,12/1/2019 9:53,How should I interpret $|2\rangle|3\rangle$?,,1,2,,,,CC BY-SA 4.0 +9010,2,,9009,12/1/2019 9:53,,3,,"

Your interpretation is right.

+ +

1) $|2\rangle$ is $|10\rangle$, or vector $\begin{bmatrix}0\\0\\1\\0\end{bmatrix}$ in Hilbert space representing two q-bits system.

+ +

2)Yes, it is possible as well. The first two q-bits in in state $|10\rangle$ and last two q-bits in state $|11\rangle$, hence the state of all four q-bits is $|1011\rangle$, or $|11\rangle$ (eleven!) in decimal but I would recommend to avoid writing decimal numbers in this case as they can be confused with binary numbers easily.

+",9006,,,,,12/1/2019 9:53,,,,0,,,,CC BY-SA 4.0 +9011,1,9016,,12/1/2019 12:57,,2,803,"

How do I measure the first qubit of an entangled vector, say
+\begin{pmatrix} + 1 \\ + -1 \\ + 0 \\ + 0 \\ + \end{pmatrix} +is what I get on the end of Deutsch's algorithm. If I get it right, I should now measure the first qubit in this 2-qubit register. How can I do it?

+",9292,,55,,12/3/2019 12:07,12/6/2019 14:47,How to measure one of the qubits in a two-qubit register?,,1,2,,,,CC BY-SA 4.0 +9012,1,,,12/1/2019 13:35,,3,514,"

Consider the modified version of the Traveling Salesman Problem where you are searching for a path of length less than some $k$. We can solve this problem using Grover's search where we encode each one of the possible paths as a quantum state and then search for the ones that have length less than $k$.

+

The oracle for this problem is supposed to add the weights of the edges in the given path, check if the total weight is less than $k$ and output 1 if it is the case. How can one construct an oracle for this problem? Is there a practical implementation? How and where to encode the weights of the edges?

+",7986,,8757,,8/4/2020 7:03,8/4/2020 7:03,Grover's search for solving TSP,,0,3,,,,CC BY-SA 4.0 +9013,2,,8820,12/1/2019 14:10,,2,,"

The required fidelity $F$ is a function of the Cartesian product of the single $n$-qubit state space: $CP^{2^n-1}$ and $n$ copies of a single qubit state space: $CP^{1} \cong S^2$. The statistics of $F$ is computed for a sample space drawn uniformly from the state space regarded as a probability space with respect to its Fubini-Study measure.

+ +

An explicit expression of $F$ is given in coordinates, and the assumption of the average: $<F> = \frac{1}{2^n}$ is validated by a direct integration.

+ +

Next, the probability density function of $F$ is computed again by a direct integration (and found to be a beta distribution with parameters $\alpha = 1$, $\beta = 2^n-1$).

+ +

The computation results are compared to a numerical experiment with $n=4$.

+ +

Finally, the required probability is explicitly computed from the density function.

+ +

We can parametrize the complex projective space $CP^{N-1}$, almost everywhere with the coordinates $ \mathbb{C}^{N-1} \ni \mathbf{\zeta} = \{[\zeta_1, . . ., \zeta_{N-1}]^t\}$. A random $N$-dimensional normalized vector corresponding to the point $\mathbf{\zeta}$ is given by (as a column vector): +$$|\psi(\mathbf{\zeta}, \mathbf{\bar{\zeta}})\rangle = \frac{[1, \zeta _1,.,.,., \zeta _{N-1}]^t}{\sqrt{1+\mathbf{\zeta}^{\dagger} \mathbf{\zeta} }}$$

+ +

(We will eventually take $N=2^n$ or $N=2$). The Fubini-Study volume element is given by: +$$d{\mu}_{CP^{N-1}}(\mathbf{\zeta}, \mathbf{\bar{\zeta}}) = \frac{(N-1)!}{\pi^{N-1}}\frac{\prod_{k=1}^{N-1} d\zeta_k d\bar{\zeta}_k}{(1+\mathbf{\zeta}^{\dagger} \mathbf{\zeta})^N}$$ +(The prefactor serves for normalizing the volume to a unit mass).

+ +

The following integral identities are valid: +$$\int_{CP^{N-1}} \frac{\zeta_k } {(1+\mathbf{\zeta}^{\dagger} \mathbf{\zeta})^N} d{\mu}_{CP^{N-1}}(\mathbf{\zeta}, \mathbf{\bar{\zeta})} = 0$$ +$$\int_{CP^{N-1}} \frac{\bar{\zeta}_k } {(1+\mathbf{\zeta}^{\dagger} \mathbf{\zeta})^N} d{\mu}_{CP^{N-1}}(\mathbf{\zeta}, \mathbf{\bar{\zeta})} = 0$$ +$$\int_{CP^{N-1}} \frac{1} {(1+\mathbf{\zeta}^{\dagger} \mathbf{\zeta})^N} d{\mu}_{CP^{N-1}}(\mathbf{\zeta}, \mathbf{\bar{\zeta})} = \frac{1}{N}$$ +$$\int_{CP^{N-1}} \frac{\zeta_k\bar{\zeta}_l } {(1+\mathbf{\zeta}^{\dagger} \mathbf{\zeta})^N} d{\mu}_{CP^{N-1}}(\mathbf{\zeta}, \mathbf{\bar{\zeta})} = \frac{1}{N}\delta_{kl}$$

+ +

The Fubini-Study volume element is invariant with respect to the following unitary transformation realized non-linearly on the coordinates: +Let $U \in U(N)$ be given in the following block form: +$$U = \begin{bmatrix} +a & \mathbf{b}^t\\ +\mathbf{c} & D +\end{bmatrix}$$ +($a$ is a scalar, $b$ and $c$ are $N-1$ dimensional column vectors and $D$ is an $N-1\times N-1$ matrix). +$$\begin{bmatrix} 1\\ \mathbf{\zeta} \end{bmatrix} \rightarrow \begin{bmatrix} 1\\ \mathbf{\zeta}' \end{bmatrix} = (a + \mathbf{b}^t \zeta)\, U \begin{bmatrix} 1\\ \mathbf{\zeta} \end{bmatrix}$$ +The first factor is a multiplier (cocycle).

+ +

Similarly, the $k$-th single qubit complex projective line can be parametrized almost everywhere by: +$$|\alpha_k(z_k, \bar{z}_k)\rangle = \frac{[1, z_k]^t}{\sqrt{1+\bar{z_k} z_k }}$$ +And the corresponding volume element: +$$d{\mu}_{CP^{1}}(z_k, \bar{z}_k) = \frac{1}{\pi}\frac{dz_k d\bar{z_k}}{(1+\bar{z_k} z_k)^2}$$ +Denoting by $f$ the natural mapping from the power set of $\mathbb{Z}_{n} = \{0, .,.,., n-1\}$ to $\mathbb{Z}_{2^n}$: +$$f(x) = \sum_{k \in x} 2^k$$ +and using the shorthand notation: +$$z^{ f(x) } = \prod_{ k\in x } z_k$$ +(with the convention $\zeta_0 = z_0 = 1$) +Tensoring the single qubit vectors and performing the inner product, we get: +$$F(\mathbf{\zeta}, z_0, ., ., . z_{n-1}, \mathbf{\bar{\zeta}}, \bar{z}_0, ., ., . \bar{z}_{n-1})= \frac{|\sum_{x \in \mathcal{P}(\mathbb{Z}_{n})} \zeta_{f(x)} \bar{z}^{f(x)} |^2}{(1+\mathbf{\zeta}^{\dagger} \mathbf{\zeta}) \prod_{k \in \mathbb{Z}_{n}} (1+\bar{z_k} z_k)}$$ +The average of $F$ is computed by means of the following integral: +$$<F> = \int_{CP^{2^n-1}} d{\mu}_{CP^{N-1}}(\mathbf{\zeta}, \mathbf{\bar{\zeta}}) \prod_{k=0}^{N-1} d{\mu}_{CP^{1}}(z_k, \bar{z}_k) F(\mathbf{\zeta}, z_0, ., ., . z_{n-1}, \mathbf{\bar{\zeta}}, \bar{z}_0, ., ., . \bar{z}_{n-1})$$ +Expanding the numerator of $F$, we get a quadratic polynomial in $\mathbf{\zeta}, \mathbf{\bar{\zeta}}$. Using the integration formulas, only $2^n$ terms survive, each contributing $\frac{1}{2^n}$. Thus, we are left with: +$$<F> = \frac{1}{2^n} \prod_{k=0}^{N-1} d{\mu}_{CP^{1}}(z_k, \bar{z}_k) \frac{\sum_{x \in \mathcal{P}(\mathbb{Z}_{n})} z^{f(x)} \bar{z}^{f(x)} }{ \prod_{k \in \mathbb{Z}_{n}} (1+\bar{z_k} z_k)}$$ +The numerator factors to the denominator, and we are left with a product of $2^n$ normalized volumes of $CP^1$, i.e. $1$, +Thus + $$<F> = \frac{1}{2^n}$$ +Given the explicit expression of the function $F$ on a probability space; its probability density function can be written as: +$$p_F(y) = \int_{CP^{2^n-1}} d{\mu}_{CP^{N-1}}(\mathbf{\zeta}, \mathbf{\bar{\zeta}}) \prod_{k=0}^{N-1} d{\mu}_{CP^{1}}(z_k, \bar{z}_k) \delta(F(\mathbf{\zeta}, z_0, ., ., . z_{n-1}, \mathbf{\bar{\zeta}}, \bar{z}_0, ., ., . \bar{z}_{n-1}) – y)$$ +We observe that the numerator of $F$ can be written as: +$$\begin{bmatrix}1 & \bar{\mathbf{\zeta}}\end{bmatrix} +\begin{bmatrix}1 \\ \mathbf{z}\end{bmatrix} +\begin{bmatrix}1 & \bar{\mathbf{z}}\end{bmatrix} +\begin{bmatrix}1 \\ \mathbf{\zeta}\end{bmatrix}$$ +The interior matrix (depending on $\mathbf{z}$ only) is of unit rank; thus it can be diagonalized by a unitary transformation to a matrix of the form:

+ +

$$ \mathrm{diag }\begin{bmatrix} 1+ \mathbf{z}^{\dagger} \mathbf{z}, & 0, & 0, & ... \end{bmatrix}$$ +(Please notice that the scalar cocycles cancel between the numerator and the denominator and the Fubini-Study measure is invariant under the transformation).

+ +

As mentioned above, the nonvanishing first element just factors out to the denominator depending on $z$. Thus, we are left with $n$ integrations on the normalized volumes of $CP^1$ giving an overall result of $1$ with respect to the $z$ integration. As for the $\zeta$ dependent terms, we are left with only one term of $\begin{bmatrix}1 & \bar{\mathbf{\zeta}}\end{bmatrix} \begin{bmatrix}1 \\ \mathbf{\zeta}\end{bmatrix}$, which can be taken the first, i.e., $1$, thus the delta function term becomes: +$$\delta(\frac{1}{(1+\mathbf{\zeta}^{\dagger} \mathbf{\zeta})}-y)$$ +Performing the standard manipulations on the delta function, we obtain: +$$\frac{1}{2y^{\frac{3}{2}}(1-y)^{\frac{1}{2}}}\delta(\sqrt{\mathbf{\zeta}^{\dagger} \mathbf{\zeta}}-\sqrt{\frac{1-y}{y}})$$ +The constraint is a spherical surface of dimension $2N-3$ inside $CP^{N-1}$ and radius $\sqrt{\frac{1-y}{y}}$ +Using the surface area formula for a $n-1$ sphere of unit radius: +$$S_{n-1} = \frac{n \pi^{\frac{n}{2}}}{\Gamma(\frac{n}{2}+1)}$$ +We arrive at: +$$ p_F(y) = \frac{1}{2y^{\frac{3}{2}}(1-y)^{\frac{1}{2}}} \frac{(2N-2) \pi^{N-1}}{\Gamma(N)} \left(\sqrt{\frac{1-y}{y}}\right)^{2N-3} \frac{(N-1)!}{\pi^{N-1}} y^N = (N-1)(1-y)^{N-2}$$ +Which is just the beta distribution, with the parameters $\alpha = 1$, $\beta = 2^n-1$).

+ +

Thus, for the $n$ qubit case, we have: +$$ p_F(y) = = (2^n-1)(1-y)^{2^n-2}$$ +A numerical experiment was performed with $n=4$ with $10^6$ draws. The following figure compares the computed probability density function to the experiment's histogram:

+ +

+ +

From the probability density function, we get asymptotically for n>>1 and $\epsilon>>\frac{1}{2^n}$: +$$\mathrm{Pr}(y>\frac{1}{2^n}+\epsilon) = e^{-2^n\epsilon}$$

+",4263,,4263,,12/1/2019 15:36,12/1/2019 15:36,,,,2,,,,CC BY-SA 4.0 +9014,1,9026,,12/1/2019 15:08,,8,1566,"

I would like to do a quantum tomography on two qubit states.

+

Recently, I successfully did so for one qubit based on Nielsen-Chuang. They advise to use this formula for one qubit density operator estimation:

+

\begin{equation} +\rho = \frac{\text{tr}(\rho)I+\text{tr}(X\rho)X+\text{tr}(Y\rho)Y+\text{tr}(Z\rho)Z}{2}, +\end{equation}

+

where for example $\text{tr}(X\rho)$ can be estimated as a sum of eigenvalues corresponding to eigenvectors of an observable $X$ divided by the total number of observations. Or in other words, a quantum state is measured in the $X$ basis, and the eigenvalues $\pm1$ are assigned to the respective outcomes of the measurement. Similarly, this is done for observables $Y$ and $Z$. Clearly $\text{tr}(\rho)=1$.

+

After that, Nielsen and Chuang proposed the generalization of quantum state tomography for more qubits. The density operator is estimated by this formula: +\begin{equation} +\rho=\sum_{\vec{v}}\frac{\text{tr}(\sigma_{v_1}\otimes\sigma_{v_2}...\otimes\sigma_{v_n}\rho)\sigma_{v_1}\otimes\sigma_{v_2}...\otimes\sigma_{v_n}}{2^n} +\end{equation}

+

where sigmas are Pauli matrices $X$, $Y$, $Z$ and identity matrix $I$. Vector $\vec{v}; v_{i}\in \{0,1,2,3\}$; specifies which Pauli matrices are combined in Kronecker product.

+

In the case of two qubits, observables in the estimator above are Kronecker products of two Pauli matrices. I realized that their eigenvector as very often Bell states. For example, observable $Z \otimes Z$ is an exception as it has eigenvectors corresponding to the basis of $\mathbb{C}^2$.

+

My questions are:

+
    +
  1. In case eigenvectors of a observable coresponds to Bell states, I would measure a quantum state in Bell basis. Am I right?

    +
  2. +
  3. How to measure in case an observable is in shape $I\otimes \sigma$ or $\sigma\otimes I$, where $\sigma$ is some Pauli matrix? Does it mean that I should measure only one q-bit?

    +
  4. +
+",9006,,55,,6/17/2021 8:52,11/3/2021 12:20,How to perform quantum state tomography on two qubits?,,1,0,,,,CC BY-SA 4.0 +9015,1,,,12/1/2019 15:13,,8,281,"

Just like other classical and quantum key distribution protocols, BB84 is vulnerable to "man"-in-the-middle attacks, where Eve pretends to be Bob to Alice, and Eve pretends to be Alice to Bob. The countermeasure against this potential "man"-in-the-middle attack is to implement authentication and data integrity checks on the Alice-Bob classical channel. [1] [2] [4] [5]

+

My question is: what authentication protocol should we use for BB84 and other QKD protocols?

+

I can think of the following candidates:

+
    +
  1. We could use pre-shared keys as suggested in [1]. But that feels problematic to me for two reasons.

    +

    1.1. The whole point of having a key distribution protocol is to avoid the need for pre-shared keys. If the pre-shared key is ever leaked, authentication and hence the QKD protocol itself is compromised.

    +

    1.2. A client can only connect to a server if the client and server already have agreed on a pre-shared key. In many use cases (e.g. web browser connecting to a web server) this is a very unreasonable requirement.

    +
  2. +
  3. Start with a pre-shared key for the first key agreement. But during that first key agreement, generate some extra key bits that are used for authentication during the next key agreement, etc. This is suggested in [3] and [6]. However, if one of the devices loses its state (e.g. due to a power cycle or field replacement after a failure) we have to revert back to the first pre-shared key. Thus, the first pre-shared key will always be a vector of attack.

    +
  4. +
  5. In classical key distribution protocols problem, both 1.1 and 1.2 are solved by using authentication protocols such as RSA or DSA that rely on PKI and on the use of certificates and trusted CAs. However, we cannot use RSA or DSA for QKD authentication because both RSA and DSA are quantum-unsafe (they assume discrete logs are hard).

    +
  6. +
  7. Use post quantum crypto (PQC) algorithms to authenticate the QKD session. But if you trust PQC, then why not use it for everything instead of using QKD; PQC is easier to deploy since it not require any quantum photon sources or quantum photon detectors.

    +
  8. +
+

So, to reiterate my question in another way, is there an authentication protocol that achieves both of the following goals?

+

A. It allows a client to authenticate any server without assuming that the client and server have a pre-shared key.

+

B. It is quantum-safe.

+
+

+ +References: + +

+ +[1] [Is quantum key distribution safe against MITM attacks too?](https://crypto.stackexchange.com/questions/2719/is-quantum-key-distribution-safe-against-mitm-attacks-too#2721) + +

+ +[2] Van Meter, Rodney. Quantum Networking (Networks and Telecommunications). Wiley. Kindle Edition. Section 5.2: ""A true man-in-the-middle attack is foiled by (and explains the need for) authentication and data integrity checks on the classical channel."" + +

+ +[3] Reis, André. Quantum Key Distribution Post Processing - A study on the Information Reconciliation Cascade Protocol. Section 1.1 footnote: ""Specially important, those [extra key] bits can be used to generate Message Authentication Codes for future QKD executions to extend the length of the shared key"" + +

+ +[4] Reis, André. Quantum Key Distribution Post Processing - A study on the Information Reconciliation Cascade Protocol. Section 2.2: ""the classical phase uses a public classical authenticated channel (using Digital Signatures or Message Authentication Codes)"" + +

+ +[5] ETSI GS QKD 002 V1.1.1 ""Quantum Key Distribution; Use Cases"". Section 4.1.2: ""Quantum key distribution, too, requires authentication of the parties to rule out man-in-the-middle attacks. This is done by public discussion on the classical channel which uses a message authentication primitive to guarantee message integrity."" + +

+ +[6] ETSI GS QKD 002 V1.1.1 ""Quantum Key Distribution; Use Cases"". Section 4.1.3: ""In QKD, a small fraction of the continuously generated key can be used for information theoretically secure message +authentication, but when a link is taken into operation, a pre-distributed initial secret is necessary to authenticate the +public channel before the first quantum keys become available. This is comparable to digital signature schemes, where +the public key (mostly in the form of identity certificates) of the sender, or the public key of a trusted third party, when +transitive trust relations are applied, must be pre-distributed (e.g. with the web browser). Insofar the necessity of a +pre-distributed secret constitutes no principal disadvantage of information theoretically secure authentication schemes, +as opposed to signature based or MAC based authentication systems, as this is claimed e.g. in [i.21]."" + +",4733,,4733,,11/25/2021 12:59,12/30/2021 9:15,What authentication protocol to use for BB84 and other QKD protocols?,,0,0,,,,CC BY-SA 4.0 +9016,2,,9011,12/1/2019 15:53,,4,,"

To measure, observe that you are simply projecting a quantum state onto some basis set of vectors. First, I will note that this state is not normalized. Let us first define the following quantum state.

+ +

$$|\psi_i\rangle = \begin{pmatrix}1\\-1\\0\\0\end{pmatrix}.$$

+ +

Then, calculating the corresponding probability yields: +$$|\langle \psi_i|\psi_i\rangle|^2 = (1)(1) + (-1)(-1) = 2.$$

+ +

So to normalize this state, we will simply divide by $\sqrt{2}$. Thus, we obtain the state: +$$|\psi\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix}1\\-1\\0\\0\end{pmatrix}.$$ +We now wish to measure this state in the standard basis, and so we wish to project the state onto the set of basis vectors: +$$|00\rangle = \begin{pmatrix}1\\0\\0\\0\end{pmatrix}, |01\rangle = \begin{pmatrix}0\\1\\0\\0\end{pmatrix},|10\rangle = \begin{pmatrix}0\\0\\1\\0\end{pmatrix},|11\rangle = \begin{pmatrix}0\\0\\0\\1\end{pmatrix}$$.

+ +

We will now calculate the probability amplitude of the state collapsing to each of those states. That is, we wish to calculate: +$$\langle00|\psi\rangle\\=\frac{1}{\sqrt{2}}\begin{pmatrix}1&0&0&0\end{pmatrix}\begin{pmatrix}1\\-1\\0\\0\end{pmatrix}\\=\frac{1}{\sqrt{2}}.$$

+ +

$$\langle01|\psi\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix}0&1&0&0\end{pmatrix}\begin{pmatrix}1\\-1\\0\\0\end{pmatrix}\\=-\frac{1}{\sqrt{2}}.$$

+ +

And although it is trivial to see that the amplitudes of the two remaining states will be zero, I will include the calculations for completeness: +$$\langle10|\psi\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix}0&0&1&0\end{pmatrix}\begin{pmatrix}1\\-1\\0\\0\end{pmatrix}\\=0.$$

+ +

$$\langle11|\psi\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix}0&0&0&1\end{pmatrix}\begin{pmatrix}1\\-1\\0\\0\end{pmatrix}\\=0.$$

+ +

And so we see that the probability of obtaining the $|00\rangle$ and $|01\rangle$ states are 0.5 each, and so measurement of the first qubit must yield the $|0\rangle$ state. To see what would happen if you measured the second qubit, simply sample the $|00\rangle$ and $|01\rangle$ states once according to the aforementioned probabilities.

+ +

Edit: In response to a comment left on this answer, I have added the following note. +If you have the state:

+ +

$$|\psi\rangle = \alpha_0|0\rangle + ... + \alpha_N|N\rangle,$$

+ +

then the probability amplitude of obtaining a component of the state, $|\psi_i\rangle$, is given by $\langle \psi_i|\psi\rangle$. Consequently, the probability of measuring a value associated with $|\psi_i\rangle$ is given by $|\langle \psi_i|\psi\rangle|^2$.

+",5157,,5157,,12/6/2019 14:47,12/6/2019 14:47,,,,4,,,,CC BY-SA 4.0 +9017,1,,,12/1/2019 17:45,,0,52,"

I came across a ""new"" type of quantum computer - photonic quantum computing. Is this type of technology of interest here? You may read about an example here. I wonder how many types of quantum computers are now researched? Any good summary of these technologies?

+",9261,,26,,12/1/2019 17:54,12/1/2019 17:54,How many types of quantum computers are currently being researched?,,0,7,,12/2/2019 1:22,,CC BY-SA 4.0 +9018,1,9019,,12/1/2019 18:06,,1,315,"

I am struggling with the density matrix for diagonally polarized photons. Can I think of diagonally polarized photons as a mixture of vertically and horizontally polarized photons?

+",9314,,26,,12/1/2019 18:18,12/1/2019 18:18,Density matrix for a diagonally polarized photon,,1,1,,,,CC BY-SA 4.0 +9019,2,,9018,12/1/2019 18:17,,2,,"

Yes, you can write a diagonally polarized state as a linear superposition of horizontally and vertically polarized states (""mixture"" isn't the right term though; it's still a pure state). For instance, the $45^{\circ}$ diagonally polarized state $\lvert \nearrow \rangle$ may be expressed as +$$\lvert \nearrow \rangle = \frac{1}{\sqrt 2} \lvert \rightarrow \rangle + \frac{1}{\sqrt 2}\lvert \uparrow \rangle.$$

+ +

The density matrix $\rho$ of this state can be written as $\lvert\nearrow\rangle\langle \nearrow\rvert$ (cf. this); try calculating the matrix notation by yourself.

+",26,,,,,12/1/2019 18:17,,,,1,,,,CC BY-SA 4.0 +9021,1,,,12/2/2019 0:36,,2,1005,"

When I type this: IBMQ.load_account(), I am getting this error. What does this mean, and how can I rectify it?

+ +
NameError                                 Traceback (most recent call last)
+<ipython-input-2-beb09c0bf764> in <module>
+----> 1 IBMQ.load_account()
+
+NameError: name 'IBMQ' is not defined
+
+",9320,,26,,12/2/2019 10:19,11/3/2020 15:01,Can't access IBMQ (NameError: name 'IBMQ' is not defined),,1,3,,,,CC BY-SA 4.0 +9022,1,,,12/2/2019 5:55,,3,65,"

I am a beginner at QC, currently going through a paper on Quantum Anonymous Voting. Please clarify the orthogonal property described in the following scenario.

+ +

Consider $n$ voters $V_{0}, V_{1}, V_{2}, ..., V_{n-1}$. $V_{0}$ is preparing the following state and distributes $n-1$ particles to other $n-1$ players keeping 1st particle with itself.

+ +
+

$$\boxed{|S_{n}\rangle = \frac{1} {\sqrt{n!}} \sum_{S\in P_n^{n}} ( \,-1) \,^{\Gamma(S)}|s_{0}\rangle |s_{1}\rangle ....|s_{n-1}\rangle}$$

+
+ +

Here $P_n^{n}$ is the set of all permutations of $Z_n := \{0,1,··· ,n−1\}$, $S$ is a permutation (or sequence) in the form $S = s_0 s_1 ···s_{n−1}$. $\Gamma(S)$, named inverse number, is defined as the number of transpositions of pairs of elements of $S$ that must be composed to place the elements in canonical order, $012 · · · n−1$.

+ +
+ +

Consider the following security attack

+ +

Assume there are $l$ dishonest voters, $V_{i_{0}}, V_{i_{1}, V_{i_{2}}},...,V_{i_{l-1}}$. They first intercept some transmitted particles, entangle them with an auxiliary system prepared in advance and then return the operated particles to honest voters. The state of the whole composite system is denoted by $|\psi\rangle$. To elude the detection, it is required that all measurements outcomes should be distinct when measuring each particle held by honest voter in the Fourier basis, and thus $|\psi\rangle$ should be in the form

+ +

$$\boxed{|\psi\rangle = \sum_{S\in P_n^{n-l}} \frac{( \,-1) \,^{\Gamma(S)} F^{\otimes(n-l)} |S\rangle}{\sqrt{|P_n^{n-l}|}}\otimes |u_{S}\rangle}$$

+ +

where $S=s_{0}s_{j_{0}}...s_{j_{n-l-2}}$, $|u_{S}\rangle$ are the states of composite system of $l$ particles and auxiliary system, $P_{n}^{n-l}=\{x_{0}x_{1}...x_{n-l-1}| x_{0},x_{1},...,x_{n-l-1} \in Z_{n} \}$ and $|P_n^{n-l}| = \frac{n!}{l!}$ is its size. $P_n^{n-l}$ can be divided into $\frac{n!}{(n-1)!l!}$ subsets, each one corresponding to the set of all the +(n-1)! permutations of a $n-l$ combination of $Z_{n}$.

+ +

Any two states $|u_{S_{0}}\rangle$ and $|u_{S_{1}}\rangle$ such that $S_{0} \in P_{n}^{n-l,w_{0}}$, $S_{1} \in P_{n}^{n-l,w_{1}}$, and $w_{0} \neq w_{1}$ should be orthogonal to each other, ie., $\langle$ $u_{S_{0}} | u_{S_{1}}$$\rangle$ = 0. if not the honest voters cannot deterministically know subset $P_{n}^{n-l,w}$ in which the honest voters announce the correct measurement outcomes to avoid being detected.

+ +

I want clarification on above highlighted sentence about orthogonality. If possible please help me with an example.

+",9304,,26,,12/3/2019 16:53,12/3/2019 16:53,Please clarify the following orthogonal property (quantum anonymous voting),,0,0,,,,CC BY-SA 4.0 +9023,2,,9021,12/2/2019 9:38,,1,,"

Please check you have qiskit-ibmq-provider installed. You can do this by running pip show qiskit-ibmq-provider in a terminal. If this returns a warning that it isn't installed, you can then install it using the command pip install qiskit-ibmq-provider.

+ +

Then go back to your code and make sure you have the statement from qiskit import IBMQ before this line of code.

+ +

That should take care of things.

+",5955,,9322,,12/3/2019 7:50,12/3/2019 7:50,,,,0,,,,CC BY-SA 4.0 +9024,2,,8978,12/2/2019 10:07,,3,,"

By coincidence, this article just came out on Ars Technica which might answer some of your questions. (This is not an endorsement of everything written in that article. But the author basically asked, and researched, the same question that you're asking.)

+ +

The TL;DR answer is that superconducting qubits are manufactured and allow for better control over other technologies.

+",1790,,,,,12/2/2019 10:07,,,,0,,,,CC BY-SA 4.0 +9025,1,9028,,12/2/2019 11:16,,5,640,"

I am very new to quantum computing and I have recently started to experiment with qiskit module in python, by following tutorials and implementing simple algorithms.

+ +

I constructed the quantum circuit described on this page: Qiskit teleportation And got same results that were expected:

+ +

my circuit:

+ +

+ +

my results:

+ +

+ +

Which are apparently expected results, since

+ +
+

""we will always measure 0 from Bob's qubit because we started off with + |0⟩""

+
+ +

However, if I apply NOT Gate at the start of q0, I still get the exact same results. Is my understanding of algorithm wrong? Shouldnt I be getting q2 as 1 after applying the NOT gate at start?

+ +

code:

+ +
import qiskit as q
+from qiskit.visualization import plot_histogram
+
+circuit = q.QuantumCircuit(3, 3)
+
+# entangle cubit 1 & 2
+
+circuit.h(1)
+
+circuit.cx(1, 2)
+
+# apply CNOT to qubit we want to send
+circuit.cx(0, 1)
+
+circuit.h(0)
+
+circuit.measure([0,1], [0,1])
+
+circuit.cx(1, 2)
+
+circuit.cz(0, 2)
+
+print(circuit)
+
+backend = q.Aer.get_backend('qasm_simulator')
+job = q.execute(circuit, backend, shots=1024)
+result = job.result()
+
+counts = result.get_counts(circuit)
+plot_histogram(counts)
+
+ +

Outcomes when NOT gate is inserted at the start of q0:

+ +

+",9325,,26,,12/3/2019 15:59,12/3/2019 15:59,Understanding quantum teleportation algorithm from qiskit tutorials,,1,12,,,,CC BY-SA 4.0 +9026,2,,9014,12/2/2019 11:38,,12,,"

Preliminary

+

I would like to rewrite the equation that you have in a slightly different manner. Since a density matrix can be written as a matrix, we can also write it down as a linear combination of elements from a basis for the space of density matrices. We can use essentially any basis to do this, but some are preferred: most notably, the Pauli basis. For a $2$-qubit system, we use the $2$-qubit Pauli group $$^{1} \mathcal{P}^{2} = \big(\frac{1}{\sqrt{2}}\{I,X,Y,Z\}\big)^{\otimes 2};$$ the two-fold tensor product of the four Pauli matrices.

+

Then, we can simply expand any density matrix $\rho$ as: +\begin{equation} +\rho = \sum_{P_{i} \in \mathcal{P}^{2}}p_{i}P_{i}, +\end{equation} +with $p_{i} = \mathrm{tr}\big[P_{i}\rho\big]$ the 'coefficent' of $\rho$ along $P_{i}$.

+

The goal of quantum state tomography is then to determine the coefficients $\{p_{i}\}$, thereby characterizing $\rho$ fully. Note that we can also try to expand $\rho$ in any other basis for the space of density matrices, we then get different coefficient $\{p_{i}\}$.

+

Determining the coefficients $\{p_{i}\}$

+

The coefficients $\{p_{i}\}$ are readily determined by the fact that a measurement of an observable $A$ on the state $\rho$ has an expectation value $\langle A,\rho \rangle = \mathrm{tr}\big[A\rho\big]$. Therefore, multiple measurements of the same observable will give information to calculate these expectation values.

+

The first question

+

The Bell states are four states that together span the $2$-qubit Hilbert space. However, the $2$-qubit density matrix space is spanned by $4^{2}$ elements; so to be able to perform the expansion of $\rho$ we need $16$ linearly independent observables. You can think of this mathematically like this:

+

The four Bell states $\{|\Psi_{+}\rangle,|\Psi_{-}\rangle, |\Phi_{+}\rangle, |\Phi_{-}\rangle\}$ allow us to determine the expectation values for the four observables $|\Psi_{+}\rangle\langle\Psi_{+}|,|\Psi_{-}\rangle\langle\Psi_{-}|,|\Phi_{+}\rangle\langle\Phi_{+}|$ & $|\Phi_{-}\rangle\langle\Phi_{-}|$. However, you are 'missing' the $12$ cross-products that together with these four observables span the entire density matrix space. Essentially, you are only determining the diagonal elements of the density matrix expressed in the Bell basis. To determine the off-diagonal elements you need to estimate the eigenvalues of the other observables somehow, which requires some less-than straightforward operations.

+

The second question

+

To determine the expectation values for an observable $I \otimes P$ with $P \not = I$, one can indeed 'just' measure the second qubit in the corresponding eigenbasis to $P$, and leave the other qubit unaffected (essentially tracing out this qubit). Note that if $P$ is also $I$, the expectation value (of $I \otimes I$) will be equal to $1$ by definition.

+

However, there is a method that can be used to infer the expectation values of these observables from other measurement outcomes. As an example, note that the observable $ZZ = Z \otimes Z$ has four eigenstates, two of which are a $+1$ eigenstate ($|00\rangle \& |11\rangle$) and two of which are a $-1$ eigenstate ($|01\rangle \& |01\rangle$). This gives the spectral decomposition for $Z \otimes Z$: +$$ +Z \otimes Z = (+1)|00\rangle\langle 00| + (+1)|11\rangle\langle 11| + (-1)|01\rangle\langle 01| + (-1)|10\rangle\langle 10| +$$ +Measuring the $ZZ$ observable $N_{\text{tot}}$ times will give counts$^{2}$ $N_{00}, N_{01}, N_{10}$ and $N_{11}$ which together should add up to $N_{tot}$. The expectation value for observable $ZZ$ can now be estimated:

+

\begin{equation} +\begin{split} +\mathrm{tr}\big[(ZZ)\rho\big] =& (+1)\mathrm{tr}\big[|00\rangle\langle00|\rho\big] + (+1)\mathrm{tr}\big[|11\rangle\langle11|\rho\big] + \\ +& (-1)\mathrm{tr}\big[|01\rangle\langle01|\rho\big] + (-1)\mathrm{tr}\big[|10\rangle\langle10|\rho\big] \\ +\simeq& +\frac{N_{00}}{N_{\text{tot}}} +\frac{N_{11}}{N_{\text{tot}}} - \frac{N_{01}}{N_{\text{tot}}} - \frac{N_{10}}{N_{\text{tot}}}. +\end{split} +\end{equation}

+

Now, the observable $I\otimes Z = IZ$ can too be expanded into its eigenspaces. The thing is, the $+1$ and $-1$ eigenstates of $Z$ (i.e. $|0\rangle$ and $|1\rangle$) are both $+1$ eigenstates of $I$. Therefore, the previously 'measured' eigenstates for $ZZ$ can be used to determine the expectation value for $IZ$ as well. The states $|00\rangle$ and $|10\rangle$ are now the $+1$ eigenstates, whereas $|01\rangle$ and $|11\rangle$ are now the $-1$ eigenstates; we can thus approximate the expectation value for $IZ$ as:

+

\begin{equation} +\mathrm{tr}\big[IZ\rho\big] \simeq +\frac{N_{00}}{N_{\text{tot}}} +\frac{N_{10}}{N_{\text{tot}}} - \frac{N_{01}}{N_{\text{tot}}} - \frac{N_{11}}{N_{\text{tot}}}. +\end{equation}

+

The expectation value for $ZI$ can be determined in a similar manner from the same measurement outcomes, keeping track of the new eigenvalues for all states.

+

Since all states are $+1$ eigenstates of $I$, and therefore also those of the $X$ and $Y$ operators, we can use a similar technique to determine $IX, XI, IY \ \& \ YI$. This means that instead of performing $4^{2}$ different measurements $N_{\mathrm{tot}}$ times, we only need to perform $3^{n}$ different measurements. This technique also works for a higher number of qubits, which brings down the cost of QST somewhat.

+

Final notes

+

$^{1}$ Please note that I have omitted the term $\frac{1}{2^{n}}$ from the expansion of $\rho$. This means that I have implicitly assumed the Pauli basis to be the normalized Pauli basis: $\mathrm{tr}\big[P_{i}P_{j}\big] = \delta_{ij}$ (with $\delta_{ij}$ the Kronecker delta), instead of $2^{n}\delta_{ij}$. If you wish to use the normal Pauli basis, you have to include the factor of $\frac{1}{2^{n}}$ in the expansion.

+

Note that using a normalized basis does help in some occasions (for instance, here it clears up the notation a bit.) However, you also lose some important properties, most notably that these normalized matrices do not form a group under multiplication anymore.

+

$^{2}$ This is a subtle point. How is the measurement according to this observable actually implemented? If you have some magical measurement device that actually only tells you if the measured state was (projected to) a $+1$ or $-1$ eigenstate of $Z\otimes Z$, you do not learn those individual counts ($N_{00}$ etc.); but these results would still be enough to approximate $\mathrm{tr}\big[(Z\otimes Z)\rho\big]$ though! However, in practice, this measurement is emulated by measuring $Z$ on both qubits separately, which would give you counts for all four outcomes.

+",8141,,8141,,11/3/2021 12:20,11/3/2021 12:20,,,,0,,,,CC BY-SA 4.0 +9027,1,,,12/2/2019 12:38,,1,117,"

I have the following problem: I want to create a q# operation for generating a random integer from 1 to max and return the generated number. What algorithm do I need? What does the q# code look like? I am very new to quantum computing so sorry if this is a simple question!

+",9326,,26,,12/3/2019 16:00,12/5/2019 1:53,How to create a q# operation to generate a random number from 1 to max?,,1,1,,,,CC BY-SA 4.0 +9028,2,,9025,12/2/2019 12:44,,5,,"

Your circuit does not measure $q_2$ qubit after teleportation; I guess that is why teleportation of $|1\rangle$ qubit is shown incorrectly.

+",2105,,2105,,12/2/2019 13:02,12/2/2019 13:02,,,,0,,,,CC BY-SA 4.0 +9029,1,,,12/2/2019 13:34,,5,246,"

After reading about quantum computers, for a high school research paper, a few questions arose concerning quantum logic gates.

+ +
    +
  • At first, it seems that quantum logic gates are in essence various forms of electromagnetic radiation that can change the energies of quantum particles, such as electrons, so that the pertaining quantum states change accordingly, although is this assertion correct?
  • +
  • Moreover, if quantum gates are fundamentally described as EM-waves, then why are multiple steps of quantum gates in a quantum circuit required to manipulate the qubits; wouldn't it be easier to send a few EM-wave to the selected qubits so the desired quantum states are directly acquired, without using intermediate steps?
  • +
  • Or would this be possible, but is it more effective to break up a certain problem into smaller steps through utilizing quantum gates?
  • +
  • Lastly, if one wants to apply a quantum gate to four exemplary qubits, does this imply that each of those four qubits requires to be individually manipulated by the same quantum gate? In other words, send four identical EM-waves to each of the four qubits.
  • +
+ +

Hopefully, these questions are clearly formulated and do not cause any ambiguities. By the way, even though mathematics is a profound component of understanding quantum computing, I would rather prefer a more intuitive or casual explanation instead of mathematical expressions, since I simply do not possess the required mathematical abilities.

+ +

PS: Fortunately I am acquainted with the Dirac notation of quantum states, such as $$\frac{1}{4^{0.5}} (|00\rangle + |01\rangle + |10\rangle + |11\rangle).$$

+",9313,,26,,12/3/2019 16:23,12/3/2019 16:23,"Why are multiple quantum gates, in a quantum circuit, used?",,1,0,,,,CC BY-SA 4.0 +9031,2,,9029,12/2/2019 14:50,,4,,"

I think you would benefit from realizing that quantum gates are an abstraction of the actual operations that we perform on qubits. Just as a qubit is an abstraction (a mathematical model to describe the state of a two-level quantum mechanical system) a quantum (logical) gate is a mathematical construct that we use in the study of quantum algorithms & quantum information science.

+ +

The way we implement these mathematical constructs varies. As you may be aware, there are multiple physical systems on which we implement the mathematical abstraction that is the qubit. +This can be an electron's spin (which is either up or down, i.e. restricted to two levels), but there are myriad other physical implementations of qubits. If you are not familiar with the concept of spin, just think of it as an intrinsic rotation of the electron along an axis through its north- and south-pole. This can either be anti-clockwise (up) or clockwise (down).

+ +
+

At first it seems that quantum logic gates are in essence various forms of electromagnetic radiation that can change the energies of quantum particles, such as electrons, so that the pertaining quantum states change accordingly, although is this assertion correct?

+
+ +

The physical implementation of a quantum logic gate strongly depends on the physical implementation of the qubit which we are concerning. For qubits based on an electron's spin this implementation might indeed be by using electromagnetic waves, but other systems definitely do not always use EM waves. Moreover, electron-spin-qubits are also often operated on by applying a voltage to a conducting material very close to the electron.

+ +

The currently most used implementation of a qubit, the transmon qubit, is addressed by applying EM radiation (in the X-ray-regime). A transmon is essentially an altered LC-circuit, (a circuit with a capacitor (dutch: condensator) and an inductor (dutch: spoel).) The LC circuit is altered so that it only has two available quantum states, which are the $|0\rangle$ and $|1\rangle$ states.

+ +
+

Moreover, if quantum gates are fundamentally described as EM-waves, then why are multiple steps of quantum gates in a quantum circuit required to manipulate the qubits, wouldn't it be easier to send a few EM-wave to the selected qubits so the desired quantum states are directly acquired, without using intermediate steps?

+
+ +

There exist literally uncountable many operations that one can perform on a qubit, so it is virtually impossible to be able to implement all of them explicitly. However, if you restrict yourself to a (relatively small) subset of all operation, you can approach every possible gate very, very well. (Such a subset, by the way, is called an universal gate set). It is much, much easier to engineer only an implementation of a subset of all the quantum gates.

+ +
+

Or would this be possible, but is it more effective to break up a certain problem into smaller steps through utilizing quantum gates? + Essentially, yes. In both engineering and study of algorithms it helps tremendously to limit to a subset. This is not to say that this is without problems though. The subset that you use might be different than for instance I - so to implement your hypothetical algorithm on my hypothetical quantum computer we might need to translate your 'code' or 'instructions' to something that my quantum computer can read. Since you're familiar with computer programming, you might see this as the usage of different, non-compatible assembly languages. In quantum computing, we often call these translation steps 'transpilation'.

+
+ +

Sometimes it is indeed more useful to think of some very elaborate quantum operation as something on its own, instead of a series of smaller, easier gates. A clear example is the quantum Fourier transform, which uses many smaller gates 'under the hood', but still has a clear defined action. A high-level quantum programmer might want to use the quantum Fourier transform as-is in his or her code, whereas the an implementation on actual hardware will need to be 'dumbed down' to all its smaller parts - this process is known as 'compilation'.

+ +
+

Lastly, if one wants to apply a quantum gate to four exemplary qubits, does this imply that each of those four qubits requires to be individually manipulated by the same quantum gate? In other words, send four identical EM-waves to each of the four qubits.

+
+ +

In a quantum computer, we want to be able to control separate qubits separately. That is to say, maybe we want to flip one qubit, without affecting the other. For this individual control, different qubits are addressed by different operations. For instance, two electron-spin qubits are addressed by applying a voltage to two different physical 'things' - that way, you know that you apply the gate to only the qubit you want. When gates are implemented using EM radiation, different qubits are addressed by EM radiation of different wavelength - the qubits only couple to the EM radiation with the 'correct' wavelength. So to apply the same gate to different qubits means to physically doing separate things.

+ +

Note that in our mathematical abstraction (not considering the implementations) the order of application of gates do not matter if they are on separate qubits. For instance, if we have four qubits and we want to perform a bit-flip on all of them, this is represented by the operation $XXXX$ - the bit-flip or $X$ operation on all four separate qubits. However, this does need to be performed in parallel. Performing nothing on a qubit is denoted by the Identity or $I$ operation. So flipping only the first qubit is the operation $XIII$. Then flipping only the second is denoted by the operation $IXII$, etc. +So the succession of operations $XIII$, $IXII$, $IIXI$ and $IIIX$ will indeed give the operation $XXXX$.

+",8141,,8141,,12/2/2019 15:02,12/2/2019 15:02,,,,4,,,,CC BY-SA 4.0 +9032,2,,8996,12/2/2019 14:59,,2,,"

Let me for starters address your last comment:

+ +
+

Research validating superposition of colors as a Qubit (if not a Qutrit) Computing basis- + https://physics.aps.org/articles/v9/135

+
+ +

This has absolutely nothing to do with the problem at hand. That paper talks about how to generate photons with two frequencies, it has nothing to do with how states can be represented with colour encoding.

+ +
+ +

You can use RGB encoding to map elements of $\mathbb R^3$ to a single color. This can be useful if for example you are dealing with a state in which you have a two-dimensional system (a qubit) interacting with an high-dimensional one. An example of such a system are vector vortex beams, which are states of light in which the polarization is entangled with the orbital angular momentum, and therefore the polarization state depends on the position in the transverse propagation plane (unfortunately, the only example of this kind of RGB encoding actually being used that I know of is as of yet unpublished).

+ +

Regarding using this kind of thing to represent the state of a qutrit, I guess you can do it, but I don't know how useful it would be. +The idea is that given a qutrit state of the form +$$|\psi\rangle=\alpha|0\rangle+\beta|1\rangle+\gamma|2\rangle$$ +you can represent it as a Bloch sphere attached to each element of another Bloch sphere. One way to do this (other choices are possible) is to have the first Bloch sphere represent the state of the qubit in the space spanned by $|0\rangle$ and the projector onto the two remaining modes, and the second Bloch sphere represent the state you get after post-selecting on the $|2\rangle,|3\rangle$ modes.

+ +

In other words, this means that you are rewriting the state as +$$|\psi\rangle = + \alpha |0\rangle + \left(\sqrt{|\beta|^2+|\gamma|^2}\right) e^{i\arg\beta} + \left[ + \underbrace{\frac{|\beta|}{\sqrt{|\beta|^2+|\gamma|^2}}}_{\equiv \beta'}|1\rangle + + \underbrace{\frac{\gamma e^{-i\arg \beta}}{\sqrt{|\beta|^2+|\gamma|^2}}}_{\equiv \gamma'}|2\rangle + \right]. +$$ +We then use $c_0\equiv \alpha$ and $c_1\equiv\sqrt{|\beta|^2+|\gamma|^2}e^{i\arg\beta}$ as amplitudes of our ""first qubit"", and $\beta',\gamma'$ as amplitudes of the ""second qubit"". +It should be noticed that there are some caveat in doing this. For example, when $\alpha=1$, the amplitudes in the second sphere are undefined (although this is not that much of a problem, as it's quite common to have this sort of situation when using nonlinear coordinates). +Intuitively, the first Bloch sphere encodes the probability of the state being found in the $|0\rangle$ state and the relative phase between $|0\rangle$ and $|1\rangle$, while the second Bloch sphere encodes the relative probability of finding $|1\rangle$ and $|2\rangle$ and their relative phase.

+ +

Once you do this, you can represent the state as a pair of Bloch spheres, one attached to the point on the first one. If you represent the point on the second Bloch sphere with an RGB encoding, this amounts to representing the state of the qutrit as a coloured point on a sphere. +Just for fun, I implemented this in Mathematica to see what would come out. If you evaluate the following code (which requires MaTeX to be installed on your system, but if you don't the only thing you lose are the labels on the Bloch sphere):

+ +
fromSphericalCoordinates[{rr_, \[Theta]\[Theta]_, \[Phi]\[Phi]_}] := 
+  With[{r = Abs@rr, \[Theta] = Abs@\[Theta]\[Theta], \[Phi] = 
+     Abs@\[Phi]\[Phi]}, Which[
+    \[Theta] == 0, {0, 0, 1},
+    \[Theta] == Pi, {0, 0, -1},
+    Not[0 < \[Theta] < \[Pi]], 
+    fromSphericalCoordinates[{r, Mod[\[Theta], Pi], \[Phi]}],
+    True, FromSphericalCoordinates[{r, \[Theta], \[Phi]}]
+    ]];
+colorizePointOnSphere[pt_] := RGBColor[(pt + 1)/2];
+
+stateToBlochCoordinates[ket_List] := {
+   2 Re[Conjugate@ket[[1]]*ket[[2]]],
+   2 Im[Conjugate@ket[[1]]*ket[[2]]],
+   Abs[ket[[1]]]^2 - Abs[ket[[2]]]^2
+   };
+
+qutritStateToDoubleSpherePoints[ket_List] := 
+  With[{normalizedState = 
+     Chop[# E^(-I Arg@First@#)] &@Normalize@ket},
+   With[{
+     firstQubit = {normalizedState[[1]], 
+       Sqrt[1 - normalizedState[[1]]^2] E^(
+        I Arg@normalizedState[[2]])},
+     secondQubit = # E^(-I Arg@First@#) &@
+        Normalize@normalizedState[[{2, 3}]] // Chop
+     },
+    {stateToBlochCoordinates@firstQubit, 
+     stateToBlochCoordinates@secondQubit}
+    ]];
+
+
+qutritStateToColouredSphere[ket_List] := 
+  With[{pts = qutritStateToDoubleSpherePoints@ket},
+   Graphics3D[{PointSize@0.05,
+     colorizePointOnSphere@Last@pts,
+     Point@First@pts
+     }]
+   ];
+
+Get[""https://raw.githubusercontent.com/lucainnocenti/QM/master/\
+BlochSphere.m""]
+Manipulate[
+ Column@{qutritStateToDoubleSpherePoints@{Cos[\[Theta]1], 
+       Sin[\[Theta]1] Cos[\[Theta]2] E^(I \[Phi]1), 
+       Sin[\[Theta]1] Sin[\[Theta]2] E^(
+        I (\[Phi]1 + \[Phi]2))}, #} &@
+  Show[{
+    Graphics3D[{QBlochSphere[]}, ImageSize -> 600],
+    qutritStateToColouredSphere@{Cos[\[Theta]1], 
+      Sin[\[Theta]1] Cos[\[Theta]2] E^(I \[Phi]1), 
+      Sin[\[Theta]1] Sin[\[Theta]2] E^(I (\[Phi]1 + \[Phi]2))}
+    }, Axes -> True, AxesLabel -> {x, y, z}, Boxed -> False],
+ {{\[Theta]1, 0}, 0, Pi/2.001, 0.001, Appearance -> ""Labeled""},
+ {{\[Theta]2, 0}, 0, Pi/2.001, 0.001, Appearance -> ""Labeled""},
+ {{\[Phi]1, 0}, -Pi, Pi, 0.001, Appearance -> ""Labeled""},
+ {{\[Phi]2, 0}, -Pi, Pi, 0.001, Appearance -> ""Labeled""}, 
+ ControlPlacement -> Right
+ ]
+
+ +

This will give you the following interactive interface to explore how different qutrits would be represented:

+ +

+ +

I don't think that this would be a particularly useful way to represent states. Directly showing a small Bloch sphere at every point of the big Bloch sphere would probably be a better idea.

+",55,,,,,12/2/2019 14:59,,,,3,,,,CC BY-SA 4.0 +9033,1,,,12/2/2019 15:10,,1,224,"

I have been trying to implement a ripple carry adder using qsikit in IBM Q Experience. I was able to implement full carry adder but I am having trouble with ripple carry adder. I am able to add 100 + 001 or 100 + 010 etc fine however when i try to perform 100+100 i get rubbish output. Here's my implementation in qsikit

+ + + +
def storeValues(x, y):
+    circuit = QuantumCircuit((len(x)*3)+1,len(x)+1)
+    for i in range(0, len(x)):
+        if x[i] == ""1"":
+            circuit.x(i)
+    for j in range(0, len(y)):
+        if y[j] == ""1"":
+            circuit.x(len(x)+j)
+    return circuit
+
+def fullAdder(input1, input2, carryin, carryout, circuit):
+    circuit.ccx(input1, input2, carryout)
+    circuit.cx(input1, input2)
+    circuit.ccx(input2, carryin, carryout)
+    circuit.cx(input2, carryin)
+    circuit.cx(input1, input2)
+
+x = '10'
+y = '10'
+circuit = storeValues(x, y)
+for i in range(len(x)):
+    fullAdder(i, len(x)+i, len(x)+len(y)+i, len(x)+len(y)+i+1, circuit)
+    circuit.barrier()
+
+for i in range(len(x)+1):
+    circuit.measure([(len(x)*2)+i], [i])
+#circuit.draw()
+simulator = Aer.get_backend(""qasm_simulator"")
+result = execute(circuit, backend=simulator, shots=1).result()
+print(list(result.get_counts().keys())[0])
+
+ +

Here's a circuit diagram

+ +

I do not understand why using Cout as Cin for another full adder is causing problems!

+",9329,,26,,12/3/2019 16:00,12/3/2019 16:00,Ripple Adder using Full Adder,,0,5,,12/5/2019 9:25,,CC BY-SA 4.0 +9034,1,,,12/2/2019 16:48,,4,164,"

I've playing around with a binary classification problem with a dataset of size 1000 examples and 5 features. I'm using the VQC algorithm from the Qiskit package the that uses a feature map and a parametrized variational circuit. The algorithm has a .train() ( most examples use run() as well) method that implements the optimization loop to find the optimal parameters of the variational form and accepts as argument a minibatch size parameter. I'm using the SPSA optimizer, how does batching work in this environment? Does it use a batch of examples to estimate the cost and update the parameters after the batch has been processed like in mini-batch stochastic gradient?

+ +

I've also wanted to execute the learning phase of the VQC on the IBMQ experience platform. Taking into account that most real backend on the IBMQ accept a number of 75 experiments, i.e number of circuits to execute within a submitted job, I've thought that setting mini-batch size to the number of maximum experiments would be reasonable, although I know Aqua handles and manages jobs (splitting, waiting for results) at higher level, so you could set it to any number.

+",5166,,26,,12/3/2019 16:01,12/3/2019 16:01,How does batching work in the optimizer loop of the VQC algorithm in Qiskit Aqua?,,0,0,,,,CC BY-SA 4.0 +9035,1,,,12/2/2019 17:18,,9,1686,"

I have a computer science background, and I'm interested in studying 'quantum algorithms' and anything that is related like 'quantum complexity'.

+ +

I would like to have all important resources that is needed to study quantum algorithms. For example, textbooks, papers, surveys.

+ +

If there are any resources for algorithms like Shor's algorithm, then please could you also share these. There are multiple of textbooks and papers, so can you specify the good one for computer science background.

+ +

This video by John Watrous is really good for an introduction to quantum algorithms.

+",9016,,55,,12/3/2019 15:14,11/8/2020 22:48,Resources to study quantum algorithms and quantum complexity,,6,2,,,,CC BY-SA 4.0 +9036,2,,9035,12/2/2019 17:30,,2,,"

There is a textbook that starts from scratch and teaches you all the fundamental concepts of quantum computing, including quantum algorithms. I would also recommend the tutorials as these are written in python so should accessible to Computer Scientists. There are also further tutorials on things such as Shor's.

+ +

When learning I also found there were lots of useful videos about specific topics on YouTube.

+",5955,,,,,12/2/2019 17:30,,,,0,,,,CC BY-SA 4.0 +9037,2,,9035,12/2/2019 18:06,,6,,"

For complexity theory, Watrous' CSSQI 2012 lectures are the best resource I found so far. Here's the corresponding review paper. He approaches the subject in a fairly rigorous manner which is a great thing if you like clarity.

+ +

You could also follow Scott Aaronson's undergraduate lectures and his 2013 book Quantum Computing Since Democritus in parallel for a more intuitive although slightly hand-wavy approach.

+",26,,26,,12/21/2019 15:03,12/21/2019 15:03,,,,0,,,,CC BY-SA 4.0 +9038,1,,,12/2/2019 18:19,,4,177,"

Consider the function $f:\{0, 1\}^3\to\{0, 1\}^2$ with $f(x, y, z) = (x \oplus y, y \oplus z)$. How would you construct its standard unitary representation?

+",9332,,26,,12/3/2019 16:32,12/3/2019 16:32,"How to construct the unitary representation of the function $f(x, y, z) = (x \oplus y, y \oplus z)$?",,2,2,,,,CC BY-SA 4.0 +9039,2,,9038,12/2/2019 18:38,,6,,"

There’s not exactly a standard way of doing it. The first thing you have to do is make the transformation unitary. The way that’s guaranteed to work is to introduce 2 extra qubits. However that’s not necessary in this case. Instead, the circuit is very simple: controlled not controlled from y targeting z, followed by controlled not controlled from x and targeting y.

+ +

This is for the function $g : \{ 0,1 \}^3 \to \{0,1\}^3$ +$$ +g(x,y,z)=(x,x\oplus y , y \oplus z) +$$

+",1837,,434,,12/2/2019 22:21,12/2/2019 22:21,,,,1,,,,CC BY-SA 4.0 +9040,1,,,12/2/2019 19:14,,2,224,"

Over the years I encountered different explanations of quantum computing advantage over classical computers. But I am not sure which explanations are in fact valid and which are not.

+ +
    +
  1. Quantum computer utilizes parallelism. It tries to arrive to the solution by multiple ways in parallel, which saves the time needed to find the right way.

  2. +
  3. Quantum computer can leap to the correct solution. It can tunnel through potential barriers on the solution landscape to a global maximum or minimum.

  4. +
  5. Quantum computer can go back and forward in time, repeating the calculation with different data. It is claimed that if the result is wrong, the quantum computer in a sense ""reverts time"", discarding the result and repeats the calculation with different options using the same time interval.

  6. +
  7. Quantum computer can manipulate quantities of information below 1 bit independently. For instance, if you have 100 variables 1/100 of a bit each, on classical computer you still need 100 bits to store them all, while on quantum computer you can store all these variables in 1 bit.

  8. +
  9. Quantum computer utilizes faster-than-light speed to transfer quantum information during calculation. It is claimed that quantum information can be transferred faster than light unlike classical information.

  10. +
+ +

Please tell me, which of these interpretations are correct and which are not.

+",9334,,,,,12/5/2019 5:21,Interpretations of quantum computing power,,1,5,,12/5/2019 9:25,,CC BY-SA 4.0 +9041,2,,9040,12/2/2019 19:54,,6,,"

1 and 2 have elements of truth, but are only partially correct, with big caveats.

+ +

3 and 5 are complete nonsense.

+ +

You can choose to read 4 the right way to make some sense out of it, but it doesn’t contribute to the computational speed of any algorithms.

+",1837,,,,,12/2/2019 19:54,,,,3,,,,CC BY-SA 4.0 +9042,2,,9035,12/2/2019 22:29,,3,,"

I would like to add some more sources:

+ +

Perhaps the most well-known source is the book ""Quantum Computation and Quantum Information"" by Nielsen & Chuang. Even though the scope of the book is broader than just quantum algorithms, it is well-structured so there is no need to dig through unrelated topics.

+ +

Another source is Ronald de Wolf's lecture notes, which you can find here. As these are updated every year, they are a bit more up-to-date than Nielsen & Chuang's book.

+",24,,,,,12/2/2019 22:29,,,,0,,,,CC BY-SA 4.0 +9043,2,,9035,12/2/2019 23:04,,3,,"

I found this overview of quantum algorithms and their implementation (for majority of them) on IBM Q Experience quite useful: https://arxiv.org/abs/1804.03719.

+",9006,,,,,12/2/2019 23:04,,,,0,,,,CC BY-SA 4.0 +9044,1,9045,,12/2/2019 23:44,,4,1179,"

I can't seem to find anything, but this seems like something that should be possible.

+",9338,,26,,12/3/2019 16:25,10/25/2020 5:41,Is there a way to output a circuit from Qiskit to the IBM Q Experience circuit composer?,,2,0,,,,CC BY-SA 4.0 +9045,2,,9044,12/3/2019 4:50,,5,,"

You can convert a qiskit circuit to QASM using circuit.qasm(). You can copy this and then there's an ""Import OpenQASM"" button on the initial circuit composer page:

+ +

+ +

and you can paste the QASM into a tab of the composer itself:

+ +

+",119,,5955,,12/3/2019 7:49,12/3/2019 7:49,,,,3,,,,CC BY-SA 4.0 +9046,1,,,12/3/2019 7:30,,6,205,"

Self reducibility is when search version of the problems in a language reduce to decision versions of the same problems. NP-complete problems are self reducible. Are QCMA complete problems self reducible?

+",1351,,2927,,12/4/2019 19:34,1/20/2020 14:34,Self reducibility of QCMA problems,,1,2,,,,CC BY-SA 4.0 +9047,1,9048,,12/3/2019 9:03,,3,698,"

If I act a CNOT gate on quantum circuit:

+ + + +
from qiskit import QuantumCircuit
+qc = QuantumCircuit(2, 2)
+qc.cx(0, 1)
+
+ +

it means that qubit_0 is the control qubit, and qubit_1 is the target qubit. +And if I switch 0 and 1, it means that qubit_1 is the control qubit, and qubit_0 is the target qubit.

+ +

But I remember that the CNOT gate is a one-direction gate, which means that one of the case would be the same as the other one but with some hadamard gates acting before and after it on the real device.

+ +

So, what I would like to ask is that:
+""How can I specify which is the one that would not act other gates when executing on the real device.""

+ +

I had also checked for the coupling_map:

+ + + +
backend.configuration().coupling_map
+
+ +

and it returns both [0, 1] and [1, 0]

+ +

I'm not sure which is the one that won't act other hadamard gates, or is the real devices of IBMQ now support both kinds of CNOT operation?

+ +

Or, (I'm guessing) the smaller index would be the control qubit?

+",8083,,26,,12/3/2019 16:24,11/8/2022 8:00,How to specify the CNOT gate direction (control qubit to target qubit) in Qiskit?,,1,3,,,,CC BY-SA 4.0 +9048,2,,9047,12/3/2019 10:13,,3,,"

What you are asking here is a valid question, but it does depend on what backend you are using. The CNOT gate, when implemented on real hardware, is generally only implementable in one direction betweem any two pair of qubits, especially for transmon qubits (i.e. the types of qubits IBM uses).

+

However, simulators and emulators generally do not hold this constraint. Moreover, general quantum computing on a higher abstraction level also benefits from being able to apply these entangling gates in both directions.

+

To this end, one can indeed reverse the direction of a CNOT gate by changing both qubits to the Hadamard basis before application of the CNOT gate, and back from the Hadamard basis to the computational basis after the application of the CNOT gate. It is a good exercise to assert this for yourself; a straightforward way to check this is by writing out the matrix multiplications that form this operation.

+

The coupling map that you have obtained does indicate that you have either used a simulator backend, or that you have used a physical backend where these bi-directional CNOT gates are possible. After checking the updated IBM Q website, I just realized that there are now indeed physical backends that do posses these gates. They are indicated by bi-directional arrows between the qubits (i.e. circles) if you click on the backends to show the diagrams.

+",8141,,8141,,11/8/2022 8:00,11/8/2022 8:00,,,,1,,,,CC BY-SA 4.0 +9049,1,9054,,12/3/2019 10:28,,7,673,"

I have read the following paper by Dumitrescu et al.

+ +

To make a Unitary Coupled Cluster (UCC) ansatz, one prepares with the following equation. +$$ +| \psi_{\rm{UCC}} \rangle = U(\theta)|\mathrm{HF}\rangle +$$ +Here, $U(\theta) = \exp[ T(\theta) - T^{\dagger}(\theta) ]$ and $|\mathrm{HF}\rangle$ is the Hartree-Fock state.

+ +

Let me consider a simple system where $T(\theta) = \theta a_0^{\dagger}a_1$. Then one obtains +$$\begin{align} +U(\theta) &= \exp[ \theta(a_0^{\dagger}a_1 - a_1^{\dagger}a_0) ] \;. \\ +&= \exp[ i(\theta/2) (X_0Y_1 - X_1Y_0) ] +\end{align} +$$

+ +

Here, one applies Jordan-Wigner transformation.

+ +

So far, I can understand but hereafter how can I make a circuit? +Should I expand and calculate $U(\theta)|\mathrm{HF}\rangle$ with Baler-Campbell-Hausdorff formula or something?

+",8673,,26,,12/3/2019 17:15,12/3/2019 19:59,How to prepare Unitary Coupled Cluster ansatz for VQE in a circuit?,,1,0,,,,CC BY-SA 4.0 +9050,2,,9038,12/3/2019 11:19,,1,,"

A good way to start is to have a look at the truth table of the function:

+ +

+ +

$$\begin{array}{ccccc} + x & y & z & \text{out1} & \text{out2} \\\hline + 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 1 & 0 & 1 \\ + 0 & 1 & 0 & 1 & 1 \\ + 0 & 1 & 1 & 1 & 0 \\ + 1 & 0 & 0 & 1 & 0 \\ + 1 & 0 & 1 & 1 & 1 \\ + 1 & 1 & 0 & 0 & 1 \\ + 1 & 1 & 1 & 0 & 0 \\ +\end{array}$$

+ +

An interesting feature you might notice from this is that each output $(o_1,o_2)$ occurs exactly twice. This tells you that a single ancilla is enough to make this into a unitary mapping.

+ +

To build this mapping, you simply need to add a third output to each input $(x,y,z)$, taking care to assign different outcomes whenever two triples $(x,y,z)$ and $(x',y',z')$ are assigned the same value by $f$. +Clearly, there are multiple ways to do this (more precisely, there are $2^4$ ways to do it). Once this assignment is done, the unitary transformation you are looking for is the corresponding permutation matrix.

+ +

An example would be the following:

+ +

+$$\begin{pmatrix} + 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ + 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ + 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ +\end{pmatrix}.$$

+ +

See also this other answer to a similar problem.

+",55,,,,,12/3/2019 11:19,,,,0,,,,CC BY-SA 4.0 +9051,1,,,12/3/2019 13:16,,1,184,"

Evidently the Bloch Sphere is used as a graphical representation for any single qubit system, although what does it mean at an intuitive level? Moreover, the manipulation of qubits still seems unclear, regarding certain aspects. Hence I've attempted to concretely list my questions and preferably non-mathematical answers are desired. Thanks in advance and I look forward to hearing from you soon.

+ +

Bloch Sphere related

+ +
    +
  • Since quantum states always contain two possible states: $|1\rangle$ and $|0\rangle$, then why does the Bloch Sphere depict three separate axes, namely Z, X, and, Y. What is the meaning of each axis?
  • +
  • Why would it be relevant to represent a quantum state via the three-axis if the quantum state possesses merely twee possible states?
  • +
+ +

Quantum operations related

+ +
    +
  • Apparently an infinite number of quantum operations are possible on a qubit, even though it seems only a few quantum logic gates exist to manipulate a qubit in a fixed and predetermined way. What is meant by an infinite amount of quantum operations and what is a quantum operation (perhaps to merely alter the complex coefficients or change the phase of a qubit)?

  • +
  • If it's true that quantum algorithms can use destructive and constructive interference for destroying states en amplifying certain states, then how are the specific quantum states selected to for example destructively interfere, and others to constructively interfere. In passing, I do comprehend the concept of interference, however which parts of qubits interfere with one another to amplify and eliminate particular quantum states?

  • +
  • Is the phase of a qubit only of importance for inducing destructive and constructive interference, if so, which gates are used for modifying the phase of one or more qubits?

  • +
+ +

Entanglement

+ +
    +
  • A quantum register could implement, for instance, 12 qubits, would it be possible to create different groups of entangled qubits, e.g. 6 - 4 - 2 (three separate entangled qubit pairs). Furthermore, does measuring one qubit of an entangled group of qubits result in a total collapse of all the qubits' superpositions or could still a few quantum states remain in superpositions while certain other states have collapsed?
  • +
  • Are entanglement and interference always used together during quantum computations?
  • +
+ +

Unfortunately, I am not fully acquainted with the required mathematics of quantum computing, apart from the Dirac notation.

+",9313,,26,,12/3/2019 16:21,12/3/2019 16:21,Bloch sphere and quantum operations,,1,5,,12/3/2019 17:45,,CC BY-SA 4.0 +9052,2,,9051,12/3/2019 15:28,,1,,"

I hinted in the comments of your previous question that the answers to the above questions have a shared basis for an answer, and since you're already asking about that too I guess you have found that: the Bloch sphere. The Bloch sphere is a method of visualizing the state of a qubit. However, to really understand this visualization, you really need to use some mathematics.

+ +

The state of a qubit

+ +

The state $|\psi\rangle$ of a qubit, in its most general form, can be written in ket notation as:

+ +

\begin{equation} +|\psi\rangle = \alpha |0\rangle + \beta |1\rangle +\end{equation} +with $\alpha$ and $\beta$ complex numbers.

+ +

If you are not familiar with complex number, I strongly advise you to get acquainted with them (for instance by watching this amazing video on youtube), but for now you can think of them as a kind of 'two-dimensional number'. The best way to conceptualize that is to think of them as some point in the $xy$-plane. They have two separate defining parameters:

+ +
    +
  • The distance to the origin, commonly referred to as their magnitude or modulus or absolute value. We write the magnitude of a complex number $z$ as $|z|$.
  • +
  • The angle they make with the $x$-axis, commonly referred to as their phase. We write the phase of a complex number $z$ as $arg(z)$, and we often denote it with the letter $\phi$.
  • +
+ +

The important thing to realize is that these two parameters are independent of each other.

+ +

For reasons that I wont go into here, there is another constraint on $\alpha$ and $\beta$: their moduli squared together should add up to unity: $|\alpha|^{2} + |\beta|^{2} = 1$. Moreover, we only care about the phase difference between $\alpha$ and $\beta$, which we call the relative phase.

+ +

This culminates in us writing the state of a qubit as:

+ +

\begin{equation} +|\psi\rangle = \cos(\theta)|0\rangle + e^{i\phi}\sin(\theta)|1\rangle. +\end{equation}

+ +

where $\theta \in [0,\pi)$ and $\phi \in [0, 2\pi)$. This can be mapped to a sphere with radius $1$, where $\theta$ is the angle between the point on the sphere and the north pole (e.g. the latitude of a point on earth), and $\phi$ is the angle of the point in the $xy$-plane (e.g. the longitude of a point on earth).

+ +

We map all possible states of the qubit on a sphere, which is a surface (mind you, the state of the qubit is on the sphere, not in!). This surface is a $2D$ structure so can be parametrized by $2$ parameters (in our case, $\theta$ and $\phi$).

+ +

Operation on qubits

+ +
+

Apparently an infinite number of quantum operations are possible on a qubit, even though it seems only a few quantum logic gates exist to manipulate a qubit in a fixed and predetermined way. What is meant by an infinite amount of quantum operations and what is a quantum operation (perhaps to merely alter the complex coefficients or change the phase of a qubit)?

+
+ +

An operation or gate on a qubit is the tranformation of the state $|\psi_{1}\rangle$ of a qubit to some other state $|\psi_{2}\rangle$. Since these states are defined by continuous parameters, there are an infinite number of different mappings or operations. Thus, there are an infinite number of gates possible. Luckily, we don't need all of them for sensible quantum computing.

+ +
+

If it's true that quantum algorithms can use destructive and constructive interference for destroying states en amplifying certain states, then how are the specific quantum states selected to for example destructively interfere, and others to constructively interfere. In passing, I do comprehend the concept of interference, however which parts of qubits interfere with one another to amplify and eliminate particular quantum states?

+
+ +

This is a though question, and can only be really answered by very precise mathematical description. In principle, it is the task of the quantum algorithm to invoke this interference in such a manner that certain states get more likely to be measured.

+ +
+

Is the phase of a qubit only of importance for inducing destructive and constructive interference, if so, which gates are used for modifying the phase of one or more qubits?

+
+ +

Again, this is a though question. you need a very thorough understanding of the role of the phase in a qubit's state description. In essence, the fact that the qubit has a phase makes it a quantum bit instead of a classical (statistical) bit. In one sense all the phase does is help in the interference, but in the same sense one could say that quantum computing is all about said interference.

+ +
+

A quantum register could implement, for instance, 12 qubits, would it be possible to create different groups of entangled qubits, e.g. 6 - 4 - 2 (three separate entangled qubit pairs). Furthermore, does measuring one qubit of an entangled group of qubits result in a total collapse of all the qubits' superpositions or could still a few quantum states remain in superpositions while certain other states have collapsed?

+
+ +

Yes, there can exist such subgroups of underlying entangled pairs. Moreover, the measurement of a qubit that is entangled with other qubits will always collapse some entanglement, but not necessarily all 'entanglement'. So the remaining qubits might still be entangled with each other. The measured qubit, however, will be completely disentangled from all other qubits; we say the qubit to be in a separable state.

+ +
+

Are entanglement and interference always used together during quantum computations?

+
+ +

Without elaborating very much, I would say that they are not on the 'same level' within the concepts of quantum computation, and I would therefore say that they are not strictly 'used together'. However, entanglement and interference both play a necessary role in quantum computations.

+ +

Final sidenote

+ +

This many subquestions in one post is generally unfavourable. Please try to ask them separate posts next time.

+",8141,,,,,12/3/2019 15:28,,,,1,,,,CC BY-SA 4.0 +9053,2,,9035,12/3/2019 16:14,,3,,"

Related threads:

+ +",26,,1859,,11/8/2020 0:23,11/8/2020 0:23,,,,0,,,12/3/2019 16:14,CC BY-SA 4.0 +9054,2,,9049,12/3/2019 19:59,,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$ basis, and $R_{x}(\frac{\pi}{2})$ changes $Y$ basis to $Z$ basis. +For example for operator $U(\theta)=e^{-i\frac{\theta}{2}X_{0}X{1}}$ you have the following cirquit:

+ +

+",6071,,,,,12/3/2019 19:59,,,,1,,,,CC BY-SA 4.0 +9055,1,,,12/4/2019 1:31,,3,516,"

Given the GHZ state wrt n = 3: $\frac{|000⟩ + |111⟩}{\sqrt{2}}$, I'm trying to understand how the principle of monogamy of entanglement manifests here. I came across this explanation.

+ +
+

Let’s say that Alice, Bob, and Charlie hold random bits, which are either all 0 or all 1 + (so, they’re classically correlated). If all three of them get together, they can see that their bits are + correlated, and the same is true if only two of them are together.

+ +

But now suppose the three players share a GHZ state. With all three of them, they can + see that the state is entangled, but what if Charlie is gone? Can Alice and Bob see that they’re entangled + with each other? + No. To see this, observe that by the No-Communication Theorem, Charlie could’ve measured + without Alice and Bob knowing. But if he did, then Alice and Bob would clearly have classical + correlation only: either both 0’s (if Charlie got the measurement outcome 0) or both 1 (if Charlie got 1). From this it follows that Alice and Bob have only classical correlation regardless of whether Charlie + measured or not.

+
+ +

I've been trying to make sense of this for a while now and I'm at my wit's end. ANY help is appreciated, thanks!

+",9360,,55,,11/24/2020 14:22,11/24/2020 14:22,Understanding the monogamy of entanglement with respect to GHZ States,,1,2,,,,CC BY-SA 4.0 +9056,2,,9055,12/4/2019 3:31,,3,,"
+

Let’s say that Alice, Bob, and Charlie hold random bits, which are either all or all (so, they’re classically correlated). If all three of them get together, they can see that their bits are correlated, and the same is true if only two of them are together.

+
+ +

If Alice, Bob, and Charlie all have either the bits $\{1_A, 1_B, 1_C\}$ or the bits $\{0_A, 0_B, 0_C\}$, upon multiple measurements, Bob and Charlie will notice that their bits are always the same as Alice's bits. This is the classical ""correlation"" Aaronson mentions.

+ +
+

But now suppose the three players share a GHZ state. With all three of them, they can see that the state is entangled (...)

+
+ +

A GHZ state allows for non-classical (or quantum) correlations. If Alice, Bob, and Charlie are together, then with some measurements they can detect some non-trivial correlations; this concept is well explained here.

+ +
+

but what if Charlie is gone? Can Alice and Bob see that they’re entangled with each other? No. To see this, observe that by the No-Communication Theorem, Charlie could’ve measured without Alice and Bob knowing.

+
+ +

If Charlie measured his qubit then depending on whether he gets $|0\rangle_C$ or $|1\rangle_C$, the remaining composite state of Alice and Bob's qubits would be either $|00\rangle_{AB}$ or $|11\rangle_{AB}$ respectively. This is clear from the definition of the GHZ state i.e.,

+ +

$$|\mathrm{GHZ}_3\rangle = \frac{|00\rangle_{AB} |0\rangle_C + |11\rangle_{AB}|1\rangle_C}{\sqrt 2}.$$

+ +
+

But if he did, then Alice and Bob would clearly have classical correlation only: either both ’s (if Charlie got the measurement outcome) or both (if Charlie got). From this it follows that Alice and Bob have only classical correlation regardless of whether Charlie measured or not

+
+ +

As the post-measurement composite state of Alice and Bob's qubits would be either $|0\rangle_A|0\rangle_B$ or $|1\rangle_A|1\rangle_B$, the resulting correlation becomes trivial. If Alice's qubit is measured to be $|0\rangle_A$ or $|1\rangle_A$ then Bob's qubit would be $|0\rangle_B$ or $|1\rangle_B$ respectively and vice-versa.

+ +

Moreover, even if say Charlie didn't measure his qubit, if Alice measures her qubit to be $|0\rangle_A$ (or $|1\rangle_A$), Bob's qubit will also be $|0\rangle_B$ (or $|1\rangle_B$). This is again a trivial classical correlation between Alice and Bob. The fact of the matter is that to observe some non-trivial correlations you need to determine the joint statistics of Alice, Bob and Charlie. Pairwise statistics will only show you trivial classical correlations. The magic of entanglement only manifests in the three-body measurement statistics for the GHZ state!

+ +
+ +

In the GHZ case, we noticed that the effects of entanglement are only observable in the three-qubit statistics and not in the pairwise statistics. Mathematically, it can be shown that in the GHZ state there is no pairwise entanglement at all (from the reduced density matrix $\rho_{AB}$). The ""Monogamy of Entanglement"" part is a bit of a non-sequitur, indeed. Aaronson states the example of the $|W_3\rangle$ where no two qubits are pairwise ""maximally entangled"" but are entangled to some degree.

+ +

                                   

+ +

The point is that, in a three-qubit state, it is theoretically impossible for more than one pair of qubits to be maximally entangled. The $|\mathrm{GHZ}_3\rangle$ and $|W_3\rangle$ states are simply examples of this; the interesting fact being that the $|\mathrm{GHZ}_3\rangle$ state as a whole is maximally entangled although no two qubits are pairwise maximally entangled. Thus, it is analogous to Borromean rings which consist of three topological circles which are linked but where removing any one ring leaves the other two unconnected.

+",26,,2927,,12/4/2019 19:33,12/4/2019 19:33,,,,7,,,,CC BY-SA 4.0 +9057,1,,,12/4/2019 3:49,,3,200,"

While writing this answer I was wondering whether the analogy of the nature of entanglement in the GHZ state with Borromean rings is more than a mere analogy (cf. Aaronson's lecture).

+ +

The question in my mind basically is: can quantum entanglement, at least for the finite-dimensional cases, be expressed in terms of knot theory? Has there been any approach in this direction? If yes, then I suppose it would be a nice way to visualize qubit entanglements in various scenarios.

+",26,,,,,12/28/2019 7:55,Can quantum entanglement be expressed in terms of knot theory?,,1,3,,,,CC BY-SA 4.0 +9058,1,9062,,12/4/2019 4:01,,4,223,"

I have an amplitude damping channel, denoted as a superoperator $\mathcal{E}$ with operator elements

+ +

\begin{matrix} + E_1=\begin{pmatrix} + 1 & 0 \\ + 0 & \sqrt{1-r} + \end{pmatrix},\quad + E_2=\begin{pmatrix} + 0 & \sqrt{r} \\ + 0 & 0 + \end{pmatrix} + \end{matrix} +I am confused that how to explicitly obtain the $\mathcal{E}^{\otimes 2}$ in matrix form?

+ +

Also, I am trying to understand what is $\mathcal{E}^{\otimes 2}(\rho)$, where $\rho=1/2|00\rangle\langle 00|+1/2|11\rangle\langle 11|$?

+",9275,,26,,12/5/2019 13:32,12/5/2019 13:32,How to obtain the tensor-product of two quantum operations (superoperators) explicitly?,,1,0,,,,CC BY-SA 4.0 +9059,1,9060,,12/4/2019 9:24,,1,115,"

As a developer myself, I still do not understand what can be done so far with services like AWS BRAKET or IBM CLOUD QUANTUM COMPUTING. +Can someone explain me the practical purpose of it in the present? Or is it mostly a PR move to create hype? +Thank you

+",9363,,5955,,12/4/2019 10:00,12/4/2019 10:01,What can be done so far with cloud quantum computing?,,1,0,,,,CC BY-SA 4.0 +9060,2,,9059,12/4/2019 10:01,,2,,"

They are resources to help people get started with learning about quantum computing. They are also useful to help further research as services such as IBM Q Experience provide access to real quantum computers, and so people can conduct research using them.

+",5955,,,,,12/4/2019 10:01,,,,1,,,,CC BY-SA 4.0 +9061,1,,,12/4/2019 13:52,,5,96,"

Gil Kalai often speaks of the apparent connection between symplectic geometry, geometric quantization, and quantum noise. He is known to describe one of his focus areas as:

+ +
+

(...) properties and models of quantum noise which do not enable quantum fault tolerance believed to be crucial for building quantum computers.

+
+ +

I'm somewhat aware of the basic notions of symplectic geometry and geometric quantization, but could someone give me a basic outline of how this relates to quantum noise and fault tolerance?

+",26,,,,,12/4/2019 13:52,How's quantum noise and fault-tolerance related to symplectic geometry and geometric quantization?,,0,0,,,,CC BY-SA 4.0 +9062,2,,9058,12/4/2019 14:44,,3,,"

I guess that what you're after is +$ +\mathcal{E}^{\otimes 2} +$ +is defined by the 4 operator elements +$$ +E_1\otimes E_1,E_1\otimes E_2,E_2\otimes E_1,E_2\otimes E_2. +$$

+ +

If you apply this to $\rho$, you get +$$ +\frac{1+r^2}{2}|00\rangle\langle 00|+\frac{(1-r)^2}{2}|11\rangle\langle 11|+\frac{r(1-r)}{2}(|01\rangle\langle|01|+|10\rangle\langle 10|). +$$ +An important check is that this still has trace 1.

+",1837,,,,,12/4/2019 14:44,,,,5,,,,CC BY-SA 4.0 +9063,1,,,12/4/2019 17:53,,3,299,"

How many iterations are needed in Grover’s quantum search for finding one out of M marked items in a database containing N items (for 1 < M < N/2)?

+ +

I would have thought we just reduce the size of the search space to M and then calculate the probability? But then does that mean the size of the overall database does not matter here?

+",9332,,55,,12/5/2019 9:33,12/7/2019 4:41,How many iterations does Grover’s search need to find one out of $M$ marked items?,,2,1,,,,CC BY-SA 4.0 +9064,1,9065,,12/4/2019 18:22,,5,826,"

I'm trying to use Qiskit's built in transpiler passes to do the following. I would like to take a quantum circuit and allocate the logical qubits to physical qubits.

+ +

The tutorial doesn't really explain how to do this. I would like to use one of the preset passes (TrivialLayout, DenseLayout, etc) to get this allocation.

+ +
from qiskit import QuantumCircuit
+from qiskit.compiler import transpile
+from qiskit.transpiler import PassManager, passes 
+from qiskit.test.mock import FakeMelbourne # NB will need to install dev requirements
+
+"""""" This is the circuit we are going to look at""""""
+qc = QuantumCircuit(13, 13)
+qc.h(3)
+qc.cx(0,6)
+qc.h(1)
+qc.cx(6,0)
+qc.cx(0,1)
+qc.cx(3,1)
+qc.h(3)
+qc.cx(3,0)
+qc.measure_all()
+
+backend = FakeMelbourne() 
+properties = backend.properties() 
+coupling_map = backend.configuration().coupling_map
+
+ +

The output of the program should be a dictionary or something that gives tells me which physical qubit each logical qubit is mapped to. How can I do this?

+",4831,,4831,,12/4/2019 18:30,2/28/2020 7:17,Getting a layout for qubits in Qiskit,,1,1,,,,CC BY-SA 4.0 +9065,2,,9064,12/4/2019 20:06,,6,,"

Try replacing the last three lines of the code you posted with

+ +
IBMQ.load_account()
+backend = IBMQ.get_provider(hub='ibm-q').get_backend('ibmq_16_melbourne')
+new_circ_lv0 = transpile(qc, backend=backend, optimization_level=0)
+plot_circuit_layout(new_circ_lv0, backend)
+
+ +

and add the necessary import statements (plot_circuit_layout is in qiskit.visualization). This should give you the mapping from your logical qubits to physical qubits on ibmq_16_melbourne, with optimization level 0:

+ +

+ +

For more information, this tutorial will probably be more helpful for this task than the one you linked.

+",8623,,8623,,12/4/2019 20:15,12/4/2019 20:15,,,,2,,,,CC BY-SA 4.0 +9066,2,,9063,12/4/2019 20:08,,4,,"

R iterations where $(2R+1)\theta\approx\pi/2$ and $\sin\theta=\sqrt{M/N}$

+ +

Regarding your question, how do you “just reduce the size of the search space”?

+",1837,,,,,12/4/2019 20:08,,,,0,,,,CC BY-SA 4.0 +9067,1,,,12/4/2019 22:42,,2,2619,"

After lightly reading into quantum algorithms and the hardware of quantum computers, I subsequently started wondering how a quantum computer is programmed so it executes the desired quantum algorithm correctly.

+ +

Cornering preliminary knowledge, this is what I know currently:

+ +
    +
  • A quantum computer is at the highest level of abstraction controlled +by a classical computer.
  • +
  • The classical computer processes input data from a user and passes this on to Qubit control- and measuring devices.
  • +
  • Next, the qubit control- and measuring devices are able to manipulate and measure the desired qubits.
  • +
  • Lastly, the quantum plane which is a partially isolated quantum register that contains all the required qubits.
  • +
+ +

Questions:

+ +
    +
  • Would the hardware structure of a quantum computer, that I asserted +above, be correct?
  • +
  • And how is a classically written quantum code, such as Qiskit, able to instruct the quantum computer to run a certain quantum algorithm (where the algorithm is simply comprised of quantum logic 'gates' that cleverly manipulate the qubits)?
  • +
+ +

PS: I've tried to limit the number of questions and keep the questions coherent.

+",9313,,26,,12/5/2019 15:15,12/5/2019 18:29,How is a quantum computer programmed?,,1,0,,,,CC BY-SA 4.0 +9068,1,,,12/4/2019 23:31,,2,85,"

Is backend.defaults().cmd_def and backend.defaults().pulse_library kept updated regularly? Is this the correct place to pull the best calibrated pulses for the standard gates? I am working on a project now and find I get substantially different results running on OpenQASM vs. OpenPulse as well as running the same pulse schedule a week apart. Thanks!

+",7701,,,,,12/4/2019 23:31,OpenPulse: Where to get current pulse definitions for standard gates?,,0,0,,,,CC BY-SA 4.0 +9069,2,,9027,12/5/2019 1:31,,1,,"

With Q# you can generate random numbers in two ways:

+ +
    +
  1. Using a classical pseudorandom number generator, which is exactly the same that a classical language like Python does when you use the library random. As Mariia Mykhailova says in the comments, Q# has a built-in operation RandomInt that does exactly this: RandomInt

  2. +
  3. Using a quantum operation that uses measurements on qubits to extract random bits to build a random number. Unfortunately, right now Q# is not yet compatible with any real quantum hardware, so to implement this method you will need to use a classical simulator of a quantum computer that ultimately will implement a classical pseudorandom function like in (1).

  4. +
+ +

However, since you're new in quantum computing and you want to learn, choosing (2), even if at the end is just a convoluted version of (1), makes sense for pedagogical purposes. So let's see how to implement (2) using Q# and Python.

+ +
    +
  • a) First we need to create a Q# file (Operation.qs) to obtain random bits from measuring qubits. To see how you have a nice tutorial here. Your Q# code should look like this:
  • +
+ +
+

namespace Quantum { + open Microsoft.Quantum.Intrinsic; + operation QuantumRandomNumberGenerator() : Result { + using(q = Qubit()) { + H(q);
+ let r = M(q); + Reset(q); + return r; + } + } + }

+
+ +
    +
  • b) Secondly we need to create a Python file (in the same folder than the .qs file) that is going to build an integer by calling the quantum operation defined above several times. The code is the following (comments inside the code):
  • +
+ +
+ +

+ +

Text code:

+ +
import qsharp 
+from Quantum import QuantumRandomNumberGenerator
+bit_string = []
+max = 50
+for i in range(0, max.bit_length()):
+    bit_string.append(QuantumRandomNumberGenerator.simulate()) 
+number = int("""".join(str(x) for x in bit_string), 2)
+print(number)
+
+ +

Now if you execute this Python code in the terminal (supposing you have all the dependencies correctly installed) the following message should appear in the command promt:

+ +
Preparing Q# environment...
+33
+
+ +

My random number was 33.

+ +
+",9366,,9366,,12/5/2019 1:53,12/5/2019 1:53,,,,0,,,,CC BY-SA 4.0 +9070,1,9072,,12/5/2019 3:58,,3,955,"

Can we generate quantum random numbers through Qiskit? +I want to try the random number generator without using optics or noise.

+",9367,,26,,12/5/2019 13:34,12/5/2019 13:34,Quantum random number generator,,1,2,,,,CC BY-SA 4.0 +9072,2,,9070,12/5/2019 7:57,,4,,"

Hadamard Gates together with Quantum Bloom Filters and a Verifiable Random Functions can prove to be a simple but elegant implementation of Quantum Algorithmic Randomness.

+ +

This technique can be seen as a way to reduce the dimensionality of high-dimensional data; high-dimensional input items can be reduced to low-dimensional versions while preserving relative distances between items. While we reduce the dimensionality from a high dimensional data the elements of order are replaced by entropies of randomness.

+ +

We can generate Quantum Random Numbers in IBM QIS Kit by implementing a Hadamard Gate. The Hadamard gate is the simplest method for generating a random bit in a qubit. It generates a quantum state which is a superposition of a 0 and a 1, with equal probability. If you then attempt to measure that qubit the quantum state collapses into either a 0 or a 1 with equal probability, generating a single random bit.

+ +

Execute n Hadamard (H) gates, either on the same or distinct qubits, measure the qubit state after executing each H gate, and you have n-bits of random number. Please find a sample code from IBM QIS Kit for executing a Hadamard gate through a register with a specific backend.

+ +
from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit
+from qiskit import execute
+from qiskit import IBMQ
+from qiskit.tools.jupyter import *
+from qiskit.providers.ibmq import least_busy
+IBMQ.load_accounts()
+IBMQ.backends()
+backend = least_busy(IBMQ.backends(simulator=False))
+%%qiskit_job_status
+q = QuantumRegister(2)
+c = ClassicalRegister(2)
+qc = QuantumCircuit(q, c)
+qc.h(q[0])
+qc.cx(q[0], q[1])
+qc.measure(q, c)
+job_exp = execute(qc, backend=backend, shots=1024, max_credits=3)
+
+",4501,,,,,12/5/2019 7:57,,,,1,,,,CC BY-SA 4.0 +9073,1,9084,,12/5/2019 8:54,,6,1437,"

+ +

+ +

How is the error rate pointed by the arrow defined? How did you get it? +thanks!

+",8901,,,,,12/5/2019 21:26,What does the error rate on the IBMQ website mean?,,1,0,,,,CC BY-SA 4.0 +9074,1,,,12/5/2019 10:14,,0,67,"

Where I can find the previous Quantum-Experiment tutorial for beginners? +(the one that was under https://quantumexperience.ng.bluemix.net/qstage/#/account)

+",9371,,26,,12/5/2019 13:33,12/5/2019 16:57,Find the Q-Experiment tutorial for beginner,,1,0,,,,CC BY-SA 4.0 +9075,2,,8994,12/5/2019 11:21,,1,,"

Based on what I've understood from your question, I think the interpretation of the noisy channel as the quantum algorithm may be causing unnecessary confusion. QEC should be present in the fault tolerant computing paradigm as a background operation capable of guaranteeing that qubits retain coherence of their quantum states for practical amounts of time. As such, in terms of how you lay out the notion, the quantum algorithm that is being executed can't exactly be associated to the quantum channel. The channel is essentially the conglomerate of error mechanisms (decoherence etc.) by which quantum states are corrupted. Thus, what QEC does is ensure that the qubits the algorithm is working with are in the correct quantum states. You can think of it as a background process or black box that is always running to ensure that the quantum algorithm will not fail due to the incorrectness of its basic information units (the qubits themselves).

+ +

Naturally, the follow up to this question is how can QEC correct these quantum states when the implementation of quantum codes is based on quantum gates, which suffer from the aforementioned mechanisms themselves. This leads to a debate over which QECC family (turbo, LDPC, polar...) is better suited for this purpose, but this begins to deviate from the topic of the question.

+",7855,,,,,12/5/2019 11:21,,,,0,,,,CC BY-SA 4.0 +9076,1,9077,,12/5/2019 12:14,,1,227,"

I have been running a variational circuit optimizing the parameters on the ""melbourne"" device. The system launches multiple jobs in parallel, and only gets the jobs accepted that my credit allows. The remainder get queued with the following message:

+ +
""FAILURE: Can not get job id, Resubmit the qobj to get job id.Error: 403 
+Client Error: Forbidden for url: https://api.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs?
+access_token=.... Your credits to run jobs are not enough, Error code: 3458."" 
+
+ +

This is normal, and it continues till the program runs till completion.

+ +

Unfortunately, I have encountered a new error that actually halts the program and throws the error shown below (520 Server Error).

+ +

My questions:

+ +
    +
  • Why is this happening?
  • +
  • What can I do against it?
  • +
+ +

Thanks

+ +
FAILURE: Can not get job id, Resubmit the qobj to get job id.Error: 403 Client Error: Forbidden for url: https://api.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/Jobs?access_token=.... Your credits to run jobs are not enough, Error code: 3458.
+Traceback (most recent call last):
+  File ""file.py"", line 307, in <module>
+QSVMsetup(featuremap)
+  File ""file.py"", line 284, in QSVMsetup
+training_result = svm.train(df_train_test_x_Q, df_train_test_y_Q, quantum_instance)
+  File ""vqc.py"", line 437, in train
+gradient_fn=grad_fn  # func for computing gradient
+  File ""/home/user/.local/lib/python3.6/site-packages/qiskit/aqua/algorithms/adaptive/vq_algorithm.py"", line 118, in find_minimum
+gradient_function=gradient_fn)
+  File ""/home/user/.local/lib/python3.6/site-packages/qiskit/aqua/components/optimizers/spsa.py"", line 131, in optimize
+max_trials=self._max_trials, **self._options)
+  File ""/home/user/.local/lib/python3.6/site-packages/qiskit/aqua/components/optimizers/spsa.py"", line 182, in _optimization
+cost_minus = obj_fun(theta_minus)
+  File ""/home/user/ibm/vqc_mod_v10.py"", line 476, in _cost_function_wrapper
+predicted_probs, predicted_labels = self._get_prediction(self._batches[batch_index], theta)
+  File ""/home/user/ibm/vqc_mod_v10.py"", line 348, in _get_prediction
+results = self._quantum_instance.execute(list(circuits.values()))
+  File ""/home/user/.local/lib/python3.6/site-packages/qiskit/aqua/quantum_instance.py"", line 312, in execute
+self._skip_qobj_validation, self._job_callback)
+  File ""/home/user/.local/lib/python3.6/site-packages/qiskit/aqua/utils/run_circuits.py"", line 343, in run_qobj
+logger.info(""Backend status: {}"".format(backend.status()))
+  File ""/home/user/.local/lib/python3.6/site-packages/qiskit/providers/ibmq/ibmqbackend.py"", line 112, in status
+api_status = self._api.backend_status(self.name())
+  File ""/home/user/.local/lib/python3.6/site-packages/qiskit/providers/ibmq/api_v2/clients/account.py"", line 64, in backend_status
+return self.client_api.backend(backend_name).status()
+  File ""/home/user/.local/lib/python3.6/site-packages/qiskit/providers/ibmq/api_v2/rest/backend.py"", line 58, in status
+response = self.session.get(url).json()
+  File ""/home/user/.local/lib/python3.6/site-packages/requests/sessions.py"", line 546, in get
+return self.request('GET', url, **kwargs)
+  File ""/home/user/.local/lib/python3.6/site-packages/qiskit/providers/ibmq/api_v2/session.py"", line 166, in request
+raise RequestsApiError(ex, message) from None
+qiskit.providers.ibmq.api_v2.exceptions.RequestsApiError: 520 Server Error: Origin Error for url: https://api.quantum-computing.ibm.com/api/Network/ibm-q/Groups/open/Projects/main/devices/ibmq_16_melbourne/queue/status?access_token=...
+
+",2794,,5955,,12/5/2019 12:49,12/5/2019 12:49,IBM Q experience - error code 520,,1,0,,,,CC BY-SA 4.0 +9077,2,,9076,12/5/2019 12:48,,2,,"

This is likely because the Melbourne device is currently offline for upgrades, it should be back up in around 2 weeks. If you join the Slack workspace, linked from the qiskit website and then join the #ibm-q-systems channel you can get updates about all the devices and when they will be taken offline.

+",5955,,,,,12/5/2019 12:48,,,,2,,,,CC BY-SA 4.0 +9080,2,,9074,12/5/2019 16:57,,1,,"

All the tutorials are now on the IBM Q Experience website. They are in the form of Jupyter Notebooks to help you learn about programming with Qiskit. There are also some additional materials if you click the ? button, such as links to documentation about how to get started using the composer.

+",5955,,,,,12/5/2019 16:57,,,,0,,,,CC BY-SA 4.0 +9081,2,,9067,12/5/2019 18:29,,6,,"

Let us look at each observation and question in perspective. Before delving deep into the questions, please let me share a few reference architecture diagrams on the components of a quantum computer.

+ +

+ +

We need to review the mentioned observations and understandings from a practical implementation vantage point. When we consider the quantum realm in its entirety, there is a finite and fundamental thermodynamic limit between the forces and fields of quantum physics and classical physics.

+ +

We cannot say that a quantum computer is at the highest level of abstraction controlled by a classical computer. A quantum computer is a physical realisation of a quantum Turing machine supported by quantum mechanical processes which are modelled as physical qubits and abstracted as logical qubits.

+ +

There is an interface between quantum mechanical processes and classical computer processes. Through this interface, input data from a a classical computing device can be fed into a quantum circuit. This quantum circuit can help us to realise a set of quantum gates which helps us to create a quantum register necessary for quantum circuitry.

+ +

Quantum Circuits are constructed from Quantum Registers which are devised from various types of universal, special purpose and custom built qubits. The logical quibits can create different permutations and combinations of physical qubit manifestations.

+ +

Quantum register is a type of circuit construction from logical qubits. Perhaps we will devise more diverse forms of circuits such as quantum stack machines, quantum memories etc. in the near future. The following diagram depicts how quantum circuits function in the physical circuitry.

+ +

+ +

Questions:

+ +

Would the hardware structure of a quantum computer, that I asserted above, be correct?

+ +

There are various hardware models and architectures for quantum computers. One of the early model is based on Nuclear Magnetic Resonance. Adiabatic Optimisation process based Quantum Annealing Computer is built by DWave. Superconducting Qubit based Universal Quantum Computer is the model implemented by IBM. Intel is implementing Silicon based Quantum Computers. China is building Photonics based Quantum Computers. Microsoft is pioneering a topological quantum computing model.

+ +

We cannot say all of them follows the same exact hardware components and models for a quantum computer. However IBM has put forward an interesting model for the super conducting chip based quantum computing model. Please find it below.

+ +

+ +

And how is a classically written quantum code, such as Qiskit, able to instruct the quantum computer to run a certain quantum algorithm (where the algorithm is simply comprised of quantum logic 'gates' that cleverly manipulate the qubits)?

+ +

I believe you must have got a clear idea of how a Quantum Algorithm can be implemented in a Quantum Programming Paradigm like QIS Kit from IBM and PyQuil like a language by Rigetti or Q# by Microsoft by seeing the first architecture diagram. Every general purpose Quantum Computer has been implemented wit a Quantum Compiler + Quantum Runtime and a Quantum Arithmetic Unit and a Quantum Memory in the conventions of classical Von Neuman Computer Architecture. They will be supported by Quantum Processor with specific instruction sets and Quantum error correcting codes as part of the instrumentation layer. They will be supported by the Quantum Processors and Quantum Chips. If you connect to IBM Q on IBM Bluemix you can see the topology of quantum processors for various quantum computers.

+ +

Hope I could address some of your questions. Looking forward to further discussions.

+",4501,,,,,12/5/2019 18:29,,,,0,,,,CC BY-SA 4.0 +9082,1,9085,,12/5/2019 18:52,,2,193,"

Background

+ +

The counterpart of a NOT gate is the CNOT gate. They make use of ancilla qubits to achieve this.

+ +

Question

+ +

Given an arbitrary non-unitary transformation what are the minimum number of ancilla qubits required to make a transformation unitary? (Any bounds will do as well)

+",5045,,55,,11/24/2020 14:21,11/24/2020 14:21,Minimum number of ancilla qubits required to make a transformation unitary?,,2,3,,,,CC BY-SA 4.0 +9083,2,,9082,12/5/2019 20:09,,4,,"

For a classical function $f:\{0,1\}^n\rightarrow\{0,1\}^m$, there is always a reversibile implementation (and hence corresponding unitary implementation) on $n+m$ bits. There could be one on as few as $n$ bits depending on the function. For example, when you say that controlled not is the reversible implementation of not (it corresponds to the upper bound), not is itself reversible and hence unitary, corresponding to the lower bound.

+ +

Your question asks more generally about a non-unitary transformation. You may be interested in the following questions/answers:

+ + + +

Essentially, if it can be extended, yo only need one qubit.

+",1837,,1837,,12/6/2019 7:10,12/6/2019 7:10,,,,2,,,,CC BY-SA 4.0 +9084,2,,9073,12/5/2019 21:26,,11,,"

Readout error: do a bunch (1000's) of experiments preparing the qubit in either the 0 state or the 1 state and then immediately measuring the qubit state after each preparation. Two types of readout errors can occur: prepared 1 --> measured 0, and prepared 0 --> measured 1. The reported readout error is the average of the rate of those two errors (e.g. if the first occurred on 2% of trials and the second occurred on 1% of trials, then the total error rate would be 1.5% or 0.015.

+ +

Single-qubit U2 error rate: this is measured using randomized benchmarking (see https://arxiv.org/abs/1109.6887), in which sequences of gates (specifically Clifford gates) are applied with the goal of taking the qubit on a random walk among certain points on the Bloch sphere and returning it to the 0 state it started in. As the number of gates in the sequence is increased, the chance of returning to zero drops exponentially and eventually saturates near 50%. The gate error rate is extracted from the fit to this exponential decay.

+ +

CNOT error rate: two-qubit randomized benchmarking; same idea as for single-qubit errors, but now the gates are two-qubit Clifford gates.

+",535,,,,,12/5/2019 21:26,,,,0,,,,CC BY-SA 4.0 +9085,2,,9082,12/6/2019 10:22,,2,,"

The procedure I use e.g. in this answer works in the general case as well.

+ +

The minimum number of ancillae that you need depends on how much ""non-injective"" the function is. +By this I mean that, given a function $f$, the property that matters is the number of elements in the preimages of $f$: $|f^{-1}(y)|$, where $f^{-1}(y)\equiv\{x : f(x)=y\}$. +More specifically, you need to look at the greatest such number: +$$I\equiv \max_{y\in\operatorname{im} f} |f^{-1}(y)|,$$ +where the maximum is taken over all elements in the image of $f$. +Then, the necessary and sufficient number of ancillary qubits required to make the operation unitary (i.e. to make $f$ bijective) is $\lceil\log_2 I\rceil$, where $\lceil x\rceil$ denotes the smallest integer greater than $x$.

+ +

The reason is simple: you are looking for a function $\tilde f$ which extends $f$ and is injective. For this to be the case you need the set of inputs that all go to the same output to now ""become distinguishable"". This means that given any $y\in\operatorname{im}(f)$ for which there are $\ell$ elements in $f^{-1}(y)$, +call them $x_1,...,x_\ell$, the extension $\tilde f$ must instead give $\ell$ different outputs $y_1,...,y_\ell$.

+ +

This is just a generic way to build an injective function out of a generic function, but now we need something more: we want $\tilde f$ to also be such that partial tracing the ancillary qubits gives back the original function. This means that all the additional outputs must be in the form of ancillary qubits, which converts the question into: ""what is the smallest number of ancillary qubits I need to get an injective function?"" To answer this you need only focus on the ""least injective output"", as if there are enough ancillary modes to separate $\max_y f^{-1}(y)$ then they are also enough to make the whole function injective. The number of qubits required to have $I$ distinct modes is the smallest $n$ such that $2^n\ge I$, hence the result $n=\lceil\log_2 I\rceil$.

+ +

I should note that there is nothing quantum about this: it is just a result about the number of ancillary bits required to make a classical operation reversible.

+",55,,,,,12/6/2019 10:22,,,,0,,,,CC BY-SA 4.0 +9086,1,9088,,12/6/2019 11:17,,1,62,"

Let's say I have a ket which is a momentum eigenket $| p \rangle$ and then I measure the position and obtain $|x' \rangle$.

+ +

$$ | p \rangle = \int | x \rangle \langle x | p \rangle dx \to | x' \rangle $$

+ +

My question is what is the minimum number of ancilla qubits required to simulate this transformation unitarily?

+ +

Note: Since the cardinality of kets involved here is $\aleph_1$ I am unaware how to implement this

+",5045,,55,,11/24/2020 14:21,11/24/2020 14:21,Minimum number of ancilla qubits to unitarily simulate a measurement?,,1,6,,,,CC BY-SA 4.0 +9088,2,,9086,12/6/2019 12:17,,4,,"

While talking about knowing the position exactly is a nice theoretical ideal, in practice, you cannot do that. You'll really be asking: ""In which 'bin' of width $\delta x$ where $x$ spans from $x_{\min}$ to $x_{\max}$ is the particle confined to?"". This means that there's $(x_{\max}-x_{\min})/\delta x$ bins, and so you basically need +$$ +\log_2\left((x_{\max}-x_{\min})/\delta x\right) +$$ +qubits to represent that information. Hence, this is the number of ancillas you would need.

+",1837,,,,,12/6/2019 12:17,,,,5,,,,CC BY-SA 4.0 +9089,1,,,12/6/2019 15:06,,5,846,"

A density matrix is defined as: +$$\sum p_i |\psi_i \rangle \langle \psi_i|$$

+ +

If the dimensionality of each $|\psi_i \rangle$ is $d$, why does it take $d^2$ dimensions to represent a density matrix? (In both cases ignore the reduction in the number of dimensions due to normalization.)

+ +

I guess once you write to declare that a density matrix is written in terms of the outer product of pure states with themselves, you just look at the number of dimensions used to represent those, but my question is more in the flavor of:

+ +

Why does it take (around) $d^2$ dimensions to represent all possible convex combinations of $d$ dimensional systems?

+",2832,,55,,11/24/2020 14:21,4/12/2021 12:29,Why are $d^2$ dimensions required to describe a density matrix?,,2,1,,,,CC BY-SA 4.0 +9090,2,,9089,12/6/2019 19:17,,8,,"

It appears that you have some confusion regarding the basic notions of density operators and ""dimension"". Why $d^2$ dimensions ""are required to describe"" a density matrix isn't the right question to ask; density matrices are $d^2$ dimensional objects in the same sense that vectors in $\Bbb R^3$ are 3-dimensional (i.e., the cardinality of any basis set of $\Bbb R^3$ is 3). By convention, the dimensionality of a vector refers to the space of which the vector is a member. Or did you mean the minimum number of parameters needed specify a density matrix uniquely? More on that later.

+ +

One of the axioms of quantum mechanics is that to every quantum system there is associated a separable complex Hilbert space $(\mathcal{H}, +, \cdot, \langle \cdot|\cdot\rangle)$. The states of the system are all positive trace-class linear maps $\rho:\mathcal{H}\to \mathcal{H}$ for which $\mathrm{Tr}(\rho) = 1$. A quantum state$^\dagger$ $\rho$ is called a pure state if

+ +

$$\exists \psi\in \mathcal{H}: \forall \alpha \in \mathcal{H}: \rho(\alpha) = \frac{\langle \psi|\alpha \rangle}{\langle \psi|\psi\rangle}\psi.$$

+ +

To each pure state $\rho$ you can assign an element $\psi \in \mathcal{H}$ but the correspondence isn't one-to-one even if you restrict to pure states and impose the normalization condition (for instance, elements of the Hilbert varying by a global phase factor have essentially the same pure state). The take-home point is that it's wrong to refer to $\psi$ as the pure state itself; a correction perhaps would be that a pure state can be given by an element $\psi$ of the Hilbert space, only up to arbitrary rescaling.

+ +

Note that $\rho(\cdot)_\psi : \mathcal{H}\to\mathcal{H}$ is in fact the following linear operator

+ +

$$\rho(\cdot)_\psi = \frac{\langle \psi|\cdot\rangle}{\langle \psi|\psi\rangle}\psi = \frac{|\psi\rangle\langle\psi|}{\langle \psi|\psi\rangle}$$

+ +

which follows from the fact that $\mathcal H\otimes \mathcal H\simeq \mathcal H\otimes \mathcal H^*$ (cf. this answer). Once you choose an ordered basis, it can written down as a matrix as well.

+ +

Now this $\rho$ is what introductory textbooks call the ""density operator"" for a pure state, which is an endomorphism on $\mathcal{H}$ (a linear map from $\mathcal{H}$ to $\mathcal{H}$ and not merely an element of $\mathcal{H}$; this I believe was the root of your confusion). As you should know from your linear algebra classes: the dimension of space of linear maps between two vector spaces (say $V$ and $W$) is $\dim(V)\times \dim(W)$ (cf. proof), it is clear that the dimension of $\rho$ (w.r.t the space of such linear maps $\mathcal{H}\to\mathcal{H}$) is $\dim(H)\times \dim(H) = d \times d = d^2$. In infinite-dimensional cases things get a bit murkier but we leave that to the field of functional analysis.

+ +

Coming to mixed states, they're simply classical ensembles of pure states (encoding the lack of knowledge of the experimenter) and it can be shown from the spectral theorem that every mixed state can be represented as a non-unique countable convex combination of pure states $^{\dagger\dagger}$ i.e.,

+ +

$$\rho_{\text{mixed}} = \sum_i p_i\rho_{\psi_i}.$$

+ +

Introductory physics and quantum computing texts tend to write this as

+ +

$$\rho_{\text{mixed}} = \sum_i p_i|\psi_i\rangle\langle\psi_i|$$

+ +

with suitable normalization, but I do not find that notation particularly elegant.

+ +

Nevertheless, to answer your main question, linear operators $\mathcal{H}\to\mathcal{H}$ form a vector space structure $\mathcal{L}(\mathcal{H})$ and there exists a natural addition and scalar multiplication on that space. Clearly, the dimension is preserved upon a linear combination of $\dim^2(\mathcal{H})$ dimensional linear operators $\rho_{\psi_i}$ by the closure property of vector spaces (vector spaces are are closed under addition and scalar multiplication).

+ +

We need to be careful about the terminology here: when you say that the dimension of $\rho$ is $d^2$, it's actually referring to the dimension of $\mathcal{L}(\mathcal{H})$ i.e. the vector space of all linear maps from $\mathcal{\mathcal{H}}$ to $\mathcal{H}$ without any additional constraints. However, when you only allow convex combinations, the set of such $\rho$ s no longer has a vector space structure (cf. Moretti's answer); it's merely a convex set embedded in a vector space.

+ +

Furthermore, when you impose the conditions of positivity (self-adjointness, which is a basis-independent concept) and unit trace, the dimension (number of complex parameters) needed to specify $\rho$ then reduces to $$\underbrace{\frac{d^2-d}{2}}_{\text{off-diagonal terms}} + \underbrace{(d-1)}_{\text{diagonal terms}}.$$ That is, $(d^2-d)/2$ complex numbers are needed to specify the off-diagonal terms (the elements of a self-adjoint matrix are anti-symmetric about the diagonal) and only $(d-1)$ complex numbers are needed to specify the real diagonal terms (as the trace is constant). In this sense, the dimension of the ""space"" of density operators is $d(d+1)/2-1$ and not $d^2$. In colloquial language, it still makes sense to call it $d^2$ after all, because we usually call any $m\times n$ matrix as $mn$-dimensional, and you'll represent density operators as $d\times d$ matrices anyway, but it's useful to know the subtleties.

+ +
+ +

+$^\dagger$: Not every quantum state can be represented by a density operator (cf. Chiral Anomaly's answer on Physics SE). +

+ +

$^{\dagger\dagger}$: From Krein-Milman and Carathéodory's theorems it can be further shown that any state is a convex combination of at most $(\dim \mathcal H)^2$ pure states. Spectral theorem gives an even stronger result, namely that any state is a convex combination of at most $\dim \mathcal H$ pure states $|\psi_i\rangle\langle \psi_i|$ where $\psi_i$ are pairwise orthogonal unit vectors. For an elaborate discussion check the recent monograph titled Alice and Bob Meet Banach: The Interface of Asymptotic Geometric Analysis and Quantum Information Theory by Guillaume Aubrun and Stanisław J. Szarek (chapters 1-2).

+",26,,26,,12/8/2019 7:57,12/8/2019 7:57,,,,7,,,,CC BY-SA 4.0 +9091,1,9092,,12/6/2019 19:41,,2,167,"

I try to solve problems from Problems in Quantum Computing.

+ +

I stuck with problem #3:

+ +

+ +

I do the following:

+ +

Because: +$$ \sigma_2 = \begin{pmatrix} +0 & -i\\ +i & 0 +\end{pmatrix}$$ +Then: +$$ -i \frac{\phi}{2}\sigma_2 = \begin{pmatrix} +0 & -\frac{\phi}{2}\\ +\frac{\phi}{2} & 0 +\end{pmatrix} +$$

+ +

$$\exp\begin{pmatrix} +0 & -\frac{\phi}{2}\\ +\frac{\phi}{2} & 0 +\end{pmatrix} = \begin{pmatrix} +1 & \exp(-\frac{\phi}{2})\\ +\exp(\frac{\phi}{2}) & 1 +\end{pmatrix}$$

+ +

If I multiply the result of the last calculation with $\begin{pmatrix} +1 \\ +0 +\end{pmatrix}$ or $\begin{pmatrix} +0 \\ +1 +\end{pmatrix}$ I can't get $\psi_1(\phi)$ or $\psi_2(\phi)$. I get some unnormalised state like:

+ +

$$ +\begin{pmatrix} +1 \\ +\exp(\frac{\phi}{2}) +\end{pmatrix} +$$

+ +

Does it mean that the definition of the problem is not correct?

+",6134,,55,,12/16/2019 10:39,1/16/2020 9:25,How to get specific state applying $e^{-i\phi \sigma_2/2}$ to $|0\rangle$ or $|1\rangle$?,,2,0,,,,CC BY-SA 4.0 +9092,2,,9091,12/6/2019 20:16,,4,,"

Your mistake is computing exponent of matrix; use the formula

+ +

$$\exp(i\theta\sigma_2)=\cos(\theta)\cdot I+i\cdot \sin(\theta)\cdot\sigma_2$$

+",2105,,26,,12/6/2019 20:18,12/6/2019 20:18,,,,3,,,,CC BY-SA 4.0 +9093,2,,9091,12/6/2019 23:42,,6,,"

A matrix function $f(A)$ for normal matrix $A$ is defined as follows +\begin{equation} +f(A)=\sum_{i=1}^{n}f(\lambda_i)v_iv_i^T +\end{equation} +where $\lambda_{i}$ is an eigenvalue and $v_{i}$ is coresponding eigenvector (note: transposed vector $v_{i}$ is a row vector).

+ +

In your case: $f(A) = \mathrm{e}^A$ and $A = -i\frac{\phi}{2}\sigma_{2}$.

+",9006,,9006,,1/9/2020 16:55,1/9/2020 16:55,,,,5,,,,CC BY-SA 4.0 +9094,1,,,12/7/2019 1:40,,2,175,"

If $2$ qubits together provide the states 00, 01, 11 or 10 simultaneously which represent $4$ probabilities in total, how many probabilities do $N$ qubits represent? Does the formula for this somehow express quadratic/exponential speed-up?

+",9118,,,,,12/7/2019 8:51,How many probabilities does the number of qubits represent?,,3,1,,,,CC BY-SA 4.0 +9095,2,,9094,12/7/2019 2:17,,3,,"

$N$ qubits have $2^N$ basis states, and $2^N$ probabilities (to be in each of basis states).

+ +

The question ""does the number of probabilities express the exponential speed-up ?"" does not make sense to me.

+",2105,,,,,12/7/2019 2:17,,,,1,,,,CC BY-SA 4.0 +9096,1,9097,,12/7/2019 3:33,,3,167,"

I'm trying to make a quantum computing mod for a game, (apologies if the notation is wrong I'm new to QM).

+ +

Let's say I have 2 qubits that are both +$\frac{1}{\sqrt{2}}(|0⟩ + |1⟩)$ and I put them through a CNOT gate. The result would be

+ +

$$A \otimes B = \begin{pmatrix} +\frac{1}{\sqrt{2}}\\ +\frac{1}{\sqrt{2}} +\end{pmatrix} +\otimes +\begin{pmatrix} +\frac{1}{\sqrt{2}}\\ +\frac{1}{\sqrt{2}} +\end{pmatrix} += \begin{pmatrix} +\frac{1}{2}\\ +\frac{1}{2}\\ +\frac{1}{2}\\ +\frac{1}{2} +\end{pmatrix}$$

+ +

$$\mathrm{CNOT}_{\text{matrix}} (A \otimes B) = +\begin{pmatrix} +1 & 0 & 0 & 0\\ +0 & 1 & 0 & 0\\ +0 & 0 & 0 & 1\\ +0 & 0 & 1 & 0 +\end{pmatrix} +\begin{pmatrix} +\frac{1}{2}\\ +\frac{1}{2}\\ +\frac{1}{2}\\ +\frac{1}{2} +\end{pmatrix}= +\begin{pmatrix} +\frac{1}{2}\\ +\frac{1}{2}\\ +\frac{1}{2}\\ +\frac{1}{2} +\end{pmatrix}$$

+ +

Which I don't believe is an entangled system. Thus, would it in theory be possible to get something in terms of the |0⟩ and |1⟩ for each individual particle? For example, express the individual states +of qubit 1 and 2 in the form:

+ +

$$\alpha|0⟩ + \beta|1⟩$$

+ +

(And if so, how would I determine this?)

+",9390,,26,,12/7/2019 9:46,12/7/2019 21:01,Non-entangled two qubit system get information about the individual particle states after CNOT,,3,1,,,,CC BY-SA 4.0 +9097,2,,9096,12/7/2019 4:17,,1,,"

Correct, the final state is not an entangled state.

+ +
1/2(|00> + |01> + |10> + |11>)
+
+ +

Therefore it represents a tensor product of two qubits' state.

+ +
1/sqrt(2)(|0> + |1>) <tensorproduct_symbol> 1/sqrt(2)(|0> + |1>)
+
+ +

For both qubits,

+ +
alpha = beta = 1/sqrt(2)
+
+ +

This wouldn't have been possible if the qubits were entangled.

+",8852,,,,,12/7/2019 4:17,,,,4,,,,CC BY-SA 4.0 +9098,2,,9063,12/7/2019 4:41,,0,,"

At the cost of over-simplifying:

+ +

For the second part of your question, Grover's search helps in marking the M items in the whole database. You're still searching a whole database of N items.

+ +

The beauty in this implementation is that when we measure, the probability of finding these M items is higher than all the other non-marked items in the database.

+",8852,,,,,12/7/2019 4:41,,,,0,,,,CC BY-SA 4.0 +9099,2,,9096,12/7/2019 5:36,,2,,"

The fastest way I know to check if a given qubit is not entangled is to check if all its conditioned-on-others states are parallel. A conditioned-on-others state is a subset of your state vector where the other qubits are equal to some specific value.

+ +

For example, the first two entries in your column vector are the state of one qubit conditioned on the other being 0. The last two entries are the state of that same qubit conditioned on the other being 1. Notice that the first two entries (as a vector) are parallel to the second two entries (as a vector). Their dot product's magnitude is equal to the product of their magnitudes. (In this case it's easy to see they're parallel because they're literally identical.) Therefore that qubit is separable. Its state is equal to the first two entries (or the second two entries; doesn't matter) after normalization up to some irrelevant global phase factor.

+ +

Quirk's amplitude displays perform this extraction when applied to a subset of the wires:

+ +

+ +

You can see the python code in Cirq that performs this subwavefunction extraction.

+",119,,,,,12/7/2019 5:36,,,,0,,,,CC BY-SA 4.0 +9100,2,,8994,12/7/2019 7:04,,0,,"

In an algorithm, there is no noisy channel per se. There are faulty gates causing errors each time they are applied.

+ +

However, it's not completely disconnected, as you could model each faulty gate followed by an error on the output qubit(s) of the gate. This error model is the equivalent of a noisy channel. It would act on single qubits for single qubit gates, while actin on 2 qubits for 2 qubit gates (possibly showing correlated errors).

+ +

The job of QECC in a faul tolerant design is to correct for errors on qubit gates while keeping in mind that doing so requires some more possibly faulty gates.

+",9393,,,,,12/7/2019 7:04,,,,0,,,,CC BY-SA 4.0 +9101,2,,9094,12/7/2019 7:22,,2,,"

The speed up is not expressed by the exponentially many basis states that a quantum system can be in.

+ +

The speedup comes from being able to recombine the probability amplitudes associated to the these basis states so that a measurement can output the correct result of the computation with sufficiently high probability.

+ +

If the exponentially many basis states accessible alone would make up for the speedup then any algorithm would be speedup by a quantum computer. And that's not the case.

+",9393,,,,,12/7/2019 7:22,,,,1,,,,CC BY-SA 4.0 +9102,2,,9094,12/7/2019 7:54,,3,,"

Sometimes, mainly in popular articles and books, it is stated that $n$ qubits can be in all $2^n$ possible zero-one combinations simultaneously (the superposition of these combinations) and any calculation on this register is done with all these combinations. This is used as an explanation for speed-up brings by a quantum computer. However, this is misunderstanding. If you want to use this explanation, you have to add that it is necessary to repeat an algorithm run many times and as a result you lose some of the speed-up. But this is still not precise explanation. You have to use laws of a quantum mechanics to explain this preciselly. Unfortunately there is no precise and at the same time ""popular"" explanation.

+ +

Additionlly, the reason behind the speed-up is different for different algorithms. The scale of the speed-up is also different. It is for example quadratic for Monte Carlo simulation or database search (Grover algorithm) and exponential for solving linear equations (HHL algorithm) or integer factorization (Shor algorithm). Moreover, there are algorithms bringing no speed-up in comparison with a classical computer (e.g. binary function parity evaluation).

+ +

Note: to be precise about HHL algorithm, it brings exponential speed-up only in case we are looking for value $x^TMx$ for some operator $M$ and $x$ is a solution of $Ax=b$.

+",9006,,9006,,12/7/2019 8:51,12/7/2019 8:51,,,,0,,,,CC BY-SA 4.0 +9103,2,,2597,12/7/2019 10:35,,1,,"

Quantum Walk may not perform in optimal ways over a conventional and determinisitc binary tree data structure. In a quantum walk experimental setup, the coin will not follow a binomial distribution. Construction of a quantum superposition based index for a tree data structure would be a better model. In one of the most popular implementations, a quantum walk involves a coin flip followed by a bit shift operator. The quantum walk involves a rotation of the coin space followed by the conditional shift operator. The quantum walk begins to differ from the classical walk from the initial epochs onwards. This asymmetry arises because the Hadamard coin treats the two directions |left⟩ and |right⟩ differently.

+ +

+ +

The quantum walk propagates quadratically faster than the classical walk. the quantum walk spreads faster, at a rate proportional to the number of steps, instead of the square root of the number of steps as in the classical case, a quadratic speed up. An interesting addition to this model is to consider quantum logical states for the coin flipping experiment. The solution is to make the coin quantum too, and give it a unitary twist instead of a random toss. The quantum coin keeps track of which way you arrived at your location, allowing you to retrace your steps.

+ +

Shenvi showed that a quantum walk could search an unsorted database with a quadratic speed up. The first quantum algorithm for this problem is due to Grover, using a different method to obtain the same quadratic speed up. A classical search of an unsorted database potentially has to check all N entries in the database, and on average has to check at least half. A quantum search only needs to make √N queries, though the queries ask for many answers in superposition. The quantum walk search algorithm sort of works backwards, starting in a uniform superposition over the whole database, and converging on the answer as the quantum walk proceeds. Quantum walks are reversible: a quantum walk running backwards is also a quantum walk. A quantum walk travels through all the paths in superposition, and the quantum interference between different paths allows the quantum walker to figure out which way is forward right up to the exit, which it finds in time proportional to the width of the network.

+ +

Hence a better and scalable quantum walk implementation would be to using the combination of a Quantum Grover Search, Quantum Bloom Filter and a Quantum Superposition based Merkel Tree or a graph isomorphism based data structure.

+ +

References

+ +

Search Over a Quantum Walk, Equivalence of Szegedy’s and Coined Quantum Walks, Grover Search with Lackadaisical Quantum Walks, Quantum Walks and their applications, A Quantum Walk Search Algorithm

+",4501,,4501,,12/7/2019 10:43,12/7/2019 10:43,,,,0,,,,CC BY-SA 4.0 +9104,2,,9046,12/7/2019 11:49,,6,,"

self-reducible is a term regarding function class, such as $\mathsf{FNP}$, which is slightly different from what I am going to talk about, namely a witness-finding procedure for some quantum complexity classes.

+ +

For the question regarding whether we have a procedure of finding a witness of a $\mathsf{QCMA}$ instance or not. +The short answer is not known. +However, we did know that $\mathsf{PreciseQCMA}$ has such a witness-finding procedure! +$\mathsf{PreciseQCMA}$ ($=\mathsf{NP^{PP}}$, see [MN17] and [GSSSY18]) is a variant of $\mathsf{QCMA}$ such that the gap between the acceptance probability of YES case and NO case is at least inverse-exponential.

+ +
+ +

Recall the witness-finding procedure for $\mathsf{NP}$, i.e. Claim 1.

+ +
+

Claim 1. There exists a $\sf P^{NP}$ protocol to find a witness of an + instance in a $\sf NP$ language.

+
+ +

This $\mathsf{P^{NP}}$ protocol is as below:

+ +
    +
  1. Given an instance $x$ in a language $\cal L\in \mathsf{NP}$, we can ask whether it is in YES case or not.
  2. +
  3. If $x$ is indeed in YES case, then we can fix the first bit of the witness to be $w_1=0$, and write it as an instance $x\circ w_1$ in a new language $\cal L'$. Again, we can ask whether $x\circ w_1$ is in YES case or not.
  4. +
  5. If $x\circ w_1$ is in YES case, then we know there exists a witness starting from $0$; otherwise, we know there exists a witness starting from $1$.
  6. +
  7. Repeat Step 1 and Step 2 inductively, we can find a witness of an instance in $\cal L$ using $\mathrm{poly}(n)$ queries where $|x|=n$.
  8. +
+ +

The language $\cal L'$ consists of all $x\circ w'$ where $w'$ is the prefix of a correct witness. Hence, if $\cal L' \subseteq \mathsf{C}$, then the procedure above is a $\mathsf{P^C}$ protocol. +It is easy to see that $\cal L' \subseteq \mathsf{NP}$ since a $\mathsf{NP}$ verifier is powerful enough to reject a $x\circ w'$ instance if $x\circ w'\notin\cal L'$. +We complete proof for the existence of a witness-finding procedure for $\sf NP$ with an explicit construction.

+ +
+ +

Now let us do the same thing for $\mathsf{QCMA}$. Note that there is a gap of acceptance probability between YES case and NO case, namely for a promise problem $(\cal L_{yes},\cal L_{no}) \in \sf QCMA$, we have $\cal L_{yes} \cup \cal L_{no} \subsetneq \{0,1\}^*$. +Back to the witness-finding procedure of $\sf QCMA$, we obtain $(\cal L',\{0,1\}^* \setminus \cal L') \not\in \sf QCMA$ due to the gap issue just mentioned. Further details can be found in Remark 3.7 in [GSSSY18].

+ +

What about $\sf PreciseQCMA$? Fortunately, we can show Claim 2 below which is a lemma (proven in my paper with collaborators, see [GLK19]).

+ +
+

Claim 2. There exists a $\sf P^{PreciseQCMA}$ protocol to find a witness of an + instance in a $\sf PreciseQCMA$ language.

+
+ +

Notice the acceptance probability of an instance in a language $\cal L$ in a $\sf QCMA$-type complexity class, such as $\sf QCMA$ and $\sf PreciseQCMA$, requires only inverse-exponential accuracy. +The reason is that the total number of gates for preparing a witness and the verification circuit is at most ${\rm poly}(n)$. +Also, the gap of acceptance probability between YES case and NO case is inverse-exponentially small, so it is not hard to conclude that $(\cal L', \{0,1\}^* \setminus \cal L') \in \sf PreciseQCMA$. It completes the proof of Claim 2.

+ +
+ +

Could we say anything more about complexity classes with a quantum witness? +By the Solovay-Kitaev theorem, preparing any $n$-qubit quantum state with inverse-polynomial accuracy requires an exponentially long local gates sequence. Hence, a polynomial-time classical algorithm with the help of a $\sf QMA$-type class oracle cannot find a quantum witness naively.

+ +

Furthermore, the gap $c-s$ between YES case and NO case of such a $\sf QMA$-type class is also crucial. Otherwise, the oracle might not be able to decide whether $x\circ w'$ is in ${\sf QMA}(c,s)$ or not. With the help of quantum queries (such as superpositions) to an oracle, we might have a ${\sf BQP}^{{\sf QMA}(c,s)}$ protocol for finding a witness, but it requires non-trivial new ideas.

+ +

However, we still can say something now about ${\sf QMA}(c,s)$ with a very tiny $c-s$ gap. Let $\sf ExactQMA$ be a variant of ${\sf QMA}(c,s)$ with an inverse-doubly-exponential gap $c-s \geq 2^{-2^{{\rm poly}(n)}}$, also $\sf ExactQMA_1$ if $c=1$. +Then by the same reasoning used in Claim 2, we obtain Claim 3:

+ +
+

Claim 3. There exists a $\sf ExactQMA_1$ protocol to find a witness of an + instance in a $\sf ExactQMA_1$ language.

+
+ +

The protocol that we obtain essentially is a $\sf BQPSPACE^{ExactQMA_1}$ protocol, since an exponential-length local gates sequence (i.e. an exponential-length bit string) that acts on $n$ qubits is even enough to prepare any quantum state within inverse-doubly-exponential accuracy. +Note that ${\sf ExactQMA_1} = {\sf PSPACE}$ [IKW10, FL16], ${\sf BQPSPACE} = {\sf PSPACE}$ [Wat99] and $\mathsf{PSPACE}^{\mathsf{PSPACE}}=\mathsf{PSPACE}$, we obtain ${\sf BQPSPACE^{ExactQMA_1}} \subseteq {\sf ExactQMA_1}$.

+",1777,,1777,,1/20/2020 14:34,1/20/2020 14:34,,,,3,,,,CC BY-SA 4.0 +9106,1,,,12/7/2019 16:49,,2,234,"

+ +

So I am wondering why this ""Quantum Teleportation Algorithm"" from Qiskit - Programming on Quantum Computers Ep 5 is represented differently when I draw it (on the left in the image above) compared to when they draw it (on the right in the image above), i.e. my result has only one $c$ line and the result from the video has separate lines for $c_0$, $c_1$, and $c_2$.

+ +

I would assume that this is something that was simply changed in development of Qiskit, but then I am wondering why they would make this change.
+Again, my assumption would be that there are no controlled gates on classical bits but only links from the quantum register to the classical register, hence, it is not needed to display separate lines.

+",9399,,,,,12/7/2019 17:10,Why is there only one line for the classical register?,,1,3,,,,CC BY-SA 4.0 +9107,2,,9106,12/7/2019 17:10,,4,,"

This can be done by passing a style to the drawer, setting the cregbundle to be False as the default is True. For example, given the circuit qc we can draw all the classical registers as follows :

+ +

qc.draw(output='mpl', filename='no_bundle.png', style={'cregbundle': False})

+ +

However, it is worth noting that only the mpl drawer supports setting things using a style dictionary like this.

+",5955,,,,,12/7/2019 17:10,,,,2,,,,CC BY-SA 4.0 +9108,1,9109,,12/7/2019 19:14,,5,418,"

Suppose I have the following circuit where q0 and q1 are measured one after the other.

+ +

+ +

The simulation results state that the state 00 occurs 75% of the time, and the state 11 occurs 25% of the time. But if you measure both at the same time, you get 00 and 11 50% of the time each.

+ +

Here are my calculations:

+ +

$\begin{bmatrix} + \frac{1}{\sqrt{2}} \\ + \frac{1}{\sqrt{2}} \\ + \end{bmatrix} \otimes +\begin{bmatrix} + 1 \\ + 0 \\ + \end{bmatrix} = +\begin{bmatrix} + \frac{1}{\sqrt{2}} \\ + 0 \\ +\frac{1}{\sqrt{2}}\\ +0 + \end{bmatrix}$

+ +

$ +\begin{bmatrix} + 1, 0, 0, 0 \\ +0, 1, 0, 0 \\ +0, 0, 0, 1 \\ +0, 0, 1, 0 \\ + \end{bmatrix} +\begin{bmatrix} + \frac{1}{\sqrt{2}} \\ + 0 \\ +\frac{1}{\sqrt{2}}\\ +0 + \end{bmatrix} += +\begin{bmatrix} + \frac{1}{\sqrt{2}} \\ + 0 \\ +0 \\ +\frac{1}{\sqrt{2}}\\ + \end{bmatrix} +$

+ +

We now have an entangled state. First H gate:

+ +

$(H \otimes I) \begin{bmatrix} + \frac{1}{\sqrt{2}} \\ + 0 \\ +0 \\ +\frac{1}{\sqrt{2}} + \end{bmatrix} = $ +$ +\begin{bmatrix} +\frac{1}{2} \\ +\frac{1}{2} \\ +\frac{1}{2} \\ +-\frac{1}{2} + \end{bmatrix}$

+ +

2nd H gate:

+ +

$(H \otimes I) +\begin{bmatrix} +\frac{1}{2} \\ +\frac{1}{2} \\ +\frac{1}{2} \\ +-\frac{1}{2} + \end{bmatrix} = +\begin{bmatrix} +\frac{1}{\sqrt{2}} \\ +0 \\ +0 \\ +\frac{1}{\sqrt{2}} + \end{bmatrix}$

+ +

Thus there should be a 50-50 chance of the final state either being 00 or 11, but how come measuring the results one after the other changes it?

+",9390,,55,,12/11/2019 14:42,12/11/2019 14:42,Why does measuring one qubit after the other in this entangled system alter the result?,,2,1,,,,CC BY-SA 4.0 +9109,2,,9108,12/7/2019 19:56,,9,,"

If the simulator is saying that state 00 occurs 75% of the time then the simulator has a bug. Reordering measurements can't make certain outcomes more likely in that way. It would violate the no communication theorem.

+ +

+",119,,,,,12/7/2019 19:56,,,,0,,,,CC BY-SA 4.0 +9110,2,,9096,12/7/2019 21:01,,0,,"

Your end state is not entangled. As you have written, the state vector after the gate is the same as the one before the gate. And your starting state is obviously not entangled.

+ +

As for the rest of your question, what would be the 'something' you are looking for in terms of 0's and 1's?

+",9393,,,,,12/7/2019 21:01,,,,0,,,,CC BY-SA 4.0 +9111,2,,9108,12/7/2019 23:27,,3,,"

Just some notes:

+ +

1) A symbol for tensor product is $\otimes$, so I edited your answer so.

+ +

2) After CNOT, you do not have to calculate firstly tensor product $H \otimes I$ and then $I \otimes H$ (by the way, you calculated $H \otimes I$ instead of $I \otimes H$ in step you denoted 2nd H) and simply use $H \otimes H$

+ +

3) Regarding your comment ""two Hadamards gate do nothing"". They in fact change basis you measure in from z-basis to x-basis. However, if you measure your state proudced by Hadamard and CNOT (this is called Bell $\beta_{00}$ state) in both bases then you get same results. But please bear in mind that in case of another measured states, the result with and without $H$s could be different.

+",9006,,,,,12/7/2019 23:27,,,,0,,,,CC BY-SA 4.0 +9112,1,,,12/8/2019 8:47,,1,123,"

Say Alice wants to transmit a 10-bit key.

+ +

For the BB84 protocol, if we assume that Alice and Bob use the same basis to encode and decode 6 qubits (and different ones for the other 4), then what would be the maximum and minimum bits they might agree on?

+ +

Would the minimum number be 6 because they use the same basis 6 times and the maximum be 10? (in case Bob measures the same value even when using a different basis)

+ +

Also, since they disagree on the basis 4 times, are there $2^4$ possible runs of this protocol possible?

+ +

Extension: How would one go about doing the above analysis for B92?

+",9332,,9332,,12/8/2019 8:54,5/7/2020 7:05,BB84 and B92 protocols: what is maximum and minimum bits that Alice and Bob might agree on?,,1,0,,,,CC BY-SA 4.0 +9113,1,9114,,12/8/2019 13:24,,3,1258,"

I have some difficulty with understanding no-cloning theorem. Simply speaking, according to the theorem, it is not possible to copy a quantum state.

+ +

On the other hand, CNOT gate can be used as so-called fan-out gate which purpose is to copy one qubit to another one, previously in state $|0\rangle$.

+ +

It seems that these two facts negate each other.

+ +

My question: How is no-cloning theorem compatible with the fact that fan-out gate works?

+",9006,,55,,5/2/2021 9:22,10/31/2022 9:33,How is the no-cloning theorem compatible with the fact that fan-out gates work?,,2,1,,,,CC BY-SA 4.0 +9114,2,,9113,12/8/2019 14:49,,11,,"

By ""copying a quantum state"", we mean that we cannot take +$$|\psi⟩|0⟩=\alpha|00⟩+\beta|10⟩$$ +into +$$|\psi⟩|\psi⟩=(\alpha|0⟩+\beta|1⟩)(\alpha|0⟩+\beta|1⟩)=\alpha^2|00⟩+\alpha\beta|01⟩+\beta\alpha|10⟩+\beta^2|11⟩$$ +for arbitrary single qubit state $|\psi⟩=\alpha|0⟩+\beta|1⟩$. Notice that this resulting two-qubit state $|\psi⟩|\psi⟩$ is still separable.

+But in the case of CNOT gate, it takes $|\psi⟩|0⟩$ to +$$CNOT|\psi⟩|0⟩=CNOT(\alpha|00⟩+\beta|10⟩)=\alpha|00⟩+\beta|11⟩.$$ +As you can see, the results are different. The resulting two-qubit state from CNOT is now entangled (not separable).

+CNOT gate does not copy qubit states; rather it creates entanglement between them.

+",9405,,,,,12/8/2019 14:49,,,,1,,,,CC BY-SA 4.0 +9115,1,9125,,12/8/2019 16:45,,4,1115,"

I'm new to quantum computing, so apologize if my question seems obvious.

+

Say we have a state $|\Psi\rangle$ and we want to measure it in the computational basis. From what I've been able to understand so far is that, when we make a measure in the computational basis, we obtain a classical bit with a certain probability. For instance if: $$|\Psi\rangle\phantom{} = \alpha|0\rangle+\beta|1\rangle$$ then, once we measure, we obtain $0$ with probability $|\alpha|^2$ and obtain $1$ with probability $|\beta|^2$

+

Where I truly get lost is when I am asked to measure a state in another basis. For instance, let's say that I am asked to measure $|\Psi\rangle$ in the following basis: $$\{|\alpha\rangle, |\alpha_{\bot}\rangle\}$$ where $\alpha = \frac{\pi}{4}$. I am totally lost here, as I don't know what $|\alpha>$ is. It's a vector of 2 components, I guess. Intuitively, I would have said that $|\alpha\rangle = \alpha|0\rangle$, but I am honestly not sure. Even if that is true, I have no idea what $|\alpha_{\bot}\rangle$ would be like. Could you help me out to clarify this, please?

+

PS: I don't have a background in physics. I have one in Computer Science. I'm discovering quantum computing on my free time

+",9407,,1859,,11/21/2020 18:24,11/21/2020 18:24,Measuring in an arbitrary basis,,3,0,,,,CC BY-SA 4.0 +9116,1,9117,,12/8/2019 17:13,,0,349,"

How does a controlled R gate look like (matrixwise)? +And how to generate CCR, CCCR and so on?

+",9292,,,,,6/9/2022 8:41,Controlled phase shift gate,,2,0,,,,CC BY-SA 4.0 +9117,2,,9116,12/8/2019 17:28,,3,,"

I found the answer and it seems like for a gate

+ +

$$ +U = \begin{bmatrix} +x_{00} & x_{10}\\ +x_{00} & x_{11} +\end{bmatrix} +$$

+ +

its controlled variant would be: +$$ +CU=\begin{bmatrix} +1 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 \\ +0 & 0 & x_{00} & x_{01} \\ +0 & 0 & x_{10} & x_{11} +\end{bmatrix} +$$

+ +

Hence for R, which is +$$ +R(\theta) = \begin{bmatrix} +1 & 0\\ +0 & e^{i \theta} \end{bmatrix} +$$

+ +

CR would be: +$$ +CR(\theta)=\begin{bmatrix} +1 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 \\ +0 & 0 & 1 & 0 \\ +0 & 0 & 0 & e^{i \theta} +\end{bmatrix} +$$

+ +

P.S.: Please, correct me if I'm wrong.

+",9292,,,,,12/8/2019 17:28,,,,1,,,,CC BY-SA 4.0 +9118,2,,9115,12/8/2019 18:03,,1,,"

$\newcommand{\ket}[1]{|#1⟩}$ +Let's assume the state $\ket{\Psi}$ is written in an arbitrary basis, say $(\ket{a},\ket{b})$, as:

+ +

$\ket{\Psi} = \alpha \ket{a} + \beta \ket{b}$, where $\alpha$ and $\beta$ are complex coefficients

+ +

Denoting the eigenvalues of the basis as $A$ and $B$ respectively, according to Born's rule of measurement, there is a probability $|a|^2$ of measuring $A$ and $|b|^2$ of measuring B.

+ +

Given a state $\ket{\alpha}$, $\ket{\alpha_{\perp}}$ is its orthogonal state. Writing the states as vectors, the two vectors are orthogonal. It is true that in a Euclidean vector space of dimension $n \geq 3$ (3D space, if you will), a vector has infinitely many orthogonal vectors. In the case of a 1-qubit state, however, we're actually in the $n = 2$ case! In geometric terms, we're in 2D space. This means that we actually have only two vectors that are orthogonal to the vector in question.

+ +

To know which one to choose, we have to refer to the Bloch sphere representation of 1-qubit bases.

+ +

+ +

On the Bloch sphere, two orthogonal vectors are colinear. To find an orthogonal vector of another vector in order to form a basis, we just take the vector obtained by central symmetry. For instance, in the above figure, if we take $\ket{\psi}$ defined by the angles $\theta$ and $\phi$ as the vector, the other vector $\ket{\psi_{\perp}}$ will be defined by the angles $\theta + \pi$ and $\phi + \pi$.

+ +

Now as to what $\ket{\alpha}$ with $\alpha = \frac{\pi}{4}$, I believe it means a vector with $\theta = \frac{\pi}{4}$, as the $\phi$ angle is just responsible for a phase constant and does not affect measurement. In short, pick any vector with $\theta = \frac{\pi}{4}$, then find its orthogonal vector by central symmetry.

+ +

I've only very rarely encountered this notation however and find it very confusing, especially for an introductory text in quantum computing.

+ +

The section below is meant to prepare you for the same notation you just encountered in a different context, so as to prevent you from confusing the two.

+ +

Usually, quantum circuits have registers of width not bound to 1 qubit. While there is no ambiguity in the case of 1 qubit, the following notations can be used in the case of multi-qubit registers (in order of decreasing explicitness), where we choose the binary representation of the number $5$ as the state of a 3-qubit register.

+ +
    +
  1. $\ket{1} \otimes \ket{0} \otimes \ket{1}$
  2. +
  3. $\ket{101}_3$, the subscript denoting the width of the register
  4. +
  5. $\ket{5}_3$, where we switch to decimal base
  6. +
  7. $\ket{5}$, where we forego the width of the register
  8. +
+ +

The $5$ which we chose arbitrarily before, can actually be any positive (unsigned) integer representable with 3 qubits.

+ +

For 1-qubit numbers, a basis has 2 elements (in the computational basis, $\ket{0}$ and $\ket{1}$). +For 2-qubit numbers, the basis has 4 elements (in the computational basis, $\ket{00}$, $\ket{01}$, $\ket{10}$ and $\ket{11}$). +For $n$-qubit numbers, the basis has $2^n$ elements.

+ +

Notice that the aforementioned bases can also be written with the notation conventions as:

+ +
    +
  • $\ket{0}$, $\ket{1}$, $\ket{2}$, $\ket{3}$, in the case of $n = 2$
  • +
  • $\ket{0}$, $\ket{1}$, $\ldots$, $\ket{2^n - 1}$, in the general case
  • +
+",9408,,,,,12/8/2019 18:03,,,,0,,,,CC BY-SA 4.0 +9119,1,9131,,12/8/2019 19:50,,3,84,"

I'm writing a Q# program and I'm calling an operation defined in the program that outputs a Result (One or Zero).

+ +

For example something like this:

+ +
output = QuantumOperation.Run(sim).Result;
+
+ +

I want to convert now output to a bool within C#, but I don't know how.

+ +

One way to go around this is to change the output of QuantumOperation to be a bool and transforming the result at the end of the operation with ResultAsBool(result). However, I want to maintain the output of the operation to be a Result. So ideally the conversion should happen within the C# host code.

+",9366,,,,,12/9/2019 17:56,How can I transform a Result into a Bool in Q# + C# environment?,,1,0,,,,CC BY-SA 4.0 +9120,1,,,12/8/2019 20:41,,4,90,"

As far as I know after minimization I have to obtain a value $E_{0}\le \frac{\langle \psi (\theta)|H|\psi (\theta)\rangle}{\langle \psi (\theta)|\psi (\theta)\rangle}$, where $E_{0}$ - eigenvalue of ground state for hamiltonian $H$. Sometimes the algorithm give the value close to $E_{0}$, but far more often I get values lower than that.

+ +

I use hardwave efficient ansatz for initial state generation.

+ +

Hamiltonian consists of Pauli-strings $H=\sum_{ijkl}\sigma_i\sigma_j\sigma_k\sigma_l$.

+ +

For parameters optimization I use ""COBYLA"" and ""Nelder-Mead"" methods.

+ +

Could it be that the ansatz produce a state space which is not large enough?

+",6071,,6071,,12/9/2019 6:50,12/9/2019 23:29,How to explain that I get a value lower than the smallest possible through minimization procedure in VQE?,,1,4,,,,CC BY-SA 4.0 +9121,2,,9115,12/8/2019 22:18,,2,,"

In simple words, measuring in another basis than computational one means that you express a quantum state $|\psi\rangle$ like a linear combination of two vectors different from $|0\rangle$ and $|1\rangle$.

+

An example of another basis is x-basis (or Hadamard basis). In this case, base vectors are $|+\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix}1\\1\end{pmatrix}$ and $|-\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix}1\\-1\end{pmatrix}$. To measure in this basis, you firstly have put Hadamard gate $H$ before a measurement in a quantum circuit. Your result will be again vectors $|0\rangle$ and $|1\rangle$ but $|0\rangle$ corresponds to $|+\rangle$ and $|1\rangle$ to $|-\rangle$. As a result, you are able to express $|\psi\rangle$ like a combination of $|+\rangle$ and $|-\rangle$.

+

Similarly, it is possible to measure in many different basis, however, firstly you have to find a circuit transforming the basis to a computational one and to apply it before measuring.

+",9006,,7706,,9/6/2020 6:07,9/6/2020 6:07,,,,0,,,,CC BY-SA 4.0 +9122,1,9142,,12/9/2019 2:28,,3,87,"

I'm working on the following exercise:

+ +
+

""Show how a classical probabilistic transition on an M -state system can be simulated + by a quantum algorithm by adding an additional M -state ‘ancilla’ system, applying a + unitary operation to the joint system, and then measuring and discarding the ancilla + system."" + - ""An Introduction to Quantum Computing"" by Phillip Kaye.

+
+ +

I am wondering if my attempt below is correct, and if not, if I could have a hint how to go about correcting it.

+ +

My interpretation of the exercise is that I only need to show an example of a super-operator that represents a classical probabilistic transition and not showing this is true in general (although, I am curious how to go about showing this in general). In addition, the classical system needs to be represented by a stochastic matrix that cannot be represented by any unitary (e.g. for stochastic matrix $S$, $\nexists U$ (unitary) s.t. $S_{(i,j)} = |U_{(i,j)}|^2$), else we wouldn't need to use a ""super-operator"".

+ +

Where a super-operator is: $\rho \mapsto Tr_B(\rho \otimes |0...0\rangle\langle0...0|)$, where $B$ is the ancillary system.

+ +

Consider a 2-state classical probabilistic system (to make the math simple) represented as qubits: $|0\rangle, |1\rangle$, represented as a vector w.r.t. the standard basis as $[1, 0]^t, [0, 1]^t$ respectively. Then add an ancilla, $|0\rangle$ to construct two elements of a 4-state system : $|00\rangle, |2\rangle = |10\rangle$ represented as tensors w.r.t. the standard basis as $[1, 0, 0, 0]^t, [0,0,1,0]^t$.

+ +

Define the unitary operator on the joint-system: +$$U = \begin{pmatrix} +\lambda_{11} & \lambda_{12} & \lambda_{13} & \lambda_{14}\\ +\lambda_{21} & \lambda_{22} & \lambda_{23} & \lambda_{24}\\ +\lambda_{31} & \lambda_{32} & \lambda_{33} & \lambda_{34}\\ +\lambda_{41} & \lambda_{42} & \lambda_{43} & \lambda_{44}\\ +\end{pmatrix},$$

+ +

assuming the classical system starts in the state $|00\rangle$.

+ +

Call the initial 2-state system $A$, and the ancilla as $B$. Applying the super-operator:

+ +

$$\operatorname{Tr}_B(U|00\rangle\langle 00|U^\dagger) = \begin{pmatrix} +|\lambda_{11}|^2 + |\lambda_{21}|^2 & \lambda_{11}\lambda_{31}^* + \lambda_{21}\lambda_{41}^* \\ + \lambda_{31}\lambda_{11}^* + \lambda_{41}\lambda_{21}^*& |\lambda_{31}|^2 + |\lambda_{41}|^2 \\ +\end{pmatrix} = \rho_0.$$

+ +

Similarly, for $|10\rangle$,

+ +

$$\operatorname{Tr}_B(U|10\rangle\langle 10|U^\dagger) = \begin{pmatrix} +|\lambda_{13}|^2 + |\lambda_{23}|^2 & \lambda_{13}\lambda_{33}^* + \lambda_{23}\lambda_{43}^* \\ + \lambda_{33}\lambda_{13}^* + \lambda_{43}\lambda_{23}^*& |\lambda_{33}|^2 + |\lambda_{43}|^2 \\ +\end{pmatrix} = \rho_1.$$

+ +

This is the part I am dubious about:

+ +

The transition: $|0\rangle \mapsto |1\rangle$ is represented by the (0,1) entry of the density matrix $\rho_0$ (or the component $|0\rangle\langle 1|)$ and the transition: $|0\rangle \mapsto |0\rangle$ is represented by the (0,0) entry of $\rho_0$ (or the component $|0\rangle\langle 0|)$

+ +

If the system started in $|1\rangle$: + $|1\rangle \mapsto |0\rangle$ is represented by the (1,0) entry of the density matrix $\rho_1$ and the transition: $|1\rangle \mapsto |1\rangle$ is represented by the (1,1) entry of $\rho_1$

+ +

Since the system being simulated is classical super-positions aren't considered as inputs.

+ +

Thus this super operator w.r.t. the unitary operator above, represents the 2 x 2 stochastic matrix (as long as the entries in each column sum to 1)

+ +

$$\begin{pmatrix} +|\lambda_{11}|^2 + |\lambda_{21}|^2 & \lambda_{33}\lambda_{13}^* + \lambda_{43}\lambda_{23}^* \\ + \lambda_{13}\lambda_{33}^* + \lambda_{23}\lambda_{43}^*& |\lambda_{33}|^2 + |\lambda_{43}|^2 \\ +\end{pmatrix} = S$$

+ +

Thus to represent the trivial transition matrix: +$$S = \begin{pmatrix} +1 & 1 \\ +0 & 0 \\ +\end{pmatrix}$$ +where entry (i,j) represents the probability of transitioning from j to i (so the columns need to sum to 1), which can't be represented by any 2 x 2 unitary

+ +

We can make $U = \begin{pmatrix} +0 & 0 & 1 & 0\\ +1 & 0 & 0 & 0\\ +0 & 1 & 0 & 0\\ +0 & 0 & 0 & 1\\ +\end{pmatrix}$

+ +

Update (all parts of the exercise) part (c) is the question asked above +

+",8765,,8765,,12/10/2019 18:49,12/12/2019 9:04,Simulating Classical Probabilistic Transitions with superoperators,,2,4,,,,CC BY-SA 4.0 +9123,1,,,12/9/2019 3:54,,2,55,"

I use HPC hardware and AI software to forecast stock market prices in real time. My system is running into hardware and operating system limitations so I am wondering if it would be productive to experiment with a quantum computer. If anyone has any experience or expertise using a quantum computer for finance, please share your ideas and expertise. Thanks. Daro

+",9414,,,,,12/10/2019 22:05,Are there realistic applications to predictive analysis of complex systems now handled by AI?,,1,0,,,,CC BY-SA 4.0 +9124,2,,9112,12/9/2019 6:35,,1,,"

I’m not exactly sure what is meant by “the bits they agree on”, but I would interpret it slightly differently to you. If Alice and Bob don’t agree on the same basis, they discard those bits, so they have a maximum of 6. If everything works perfectly, all 6 bits should be equal. Of course, in the real world, there are experimental imperfections and it could be that as few as 0 agree.

+ +

I’m also unsure why you’re counting the number of “possible runs” of the protocol. But I suppose I would count the number of possible basis choices. I forget if we’re talking about a 4-state or 6-state protocol here (2 bases or 3 bases) so let k be the number of bases. Each of the agreeing rounds has k different ways it could have occurred. The non-agreeing rounds have k(k-1) different ways the bases could have been chosen. This means that overall there are +$$\binom{10}{6}k^6(k(k-1))^4$$ +different ways that result in the described situation. That’s out of the $k^{20}$ different choices overall.

+",1837,,,,,12/9/2019 6:35,,,,0,,,,CC BY-SA 4.0 +9125,2,,9115,12/9/2019 7:36,,4,,"

You're happy with the concept of measuring in the computational basis, so stick with that for now. Measuring in another basis simply means applying a unitary before the measurement. Unitaries are basis transformations, meaning they change some basis, say $|\alpha\rangle,|\alpha^\perp\rangle$ into another basis such as $|0\rangle,|1\rangle$. Indeed, we can deliberately construct unitaries in this way: +$$ +U=|0\rangle\langle\alpha|+|1\rangle\langle\alpha^\perp| +$$ +For example, if we started with an initial state $|\alpha\rangle$, then applying $U$ converts if to $|0\rangle$ and so when you measure it, you definitely get answer $|0\rangle$, corresponding the the original state having definitely been in the state $|\alpha\rangle$.

+ +

As for the notation of what $|\alpha\rangle$ means: remember that the text inside the ket, in this case $\alpha$, is an arbitrary label that doesn't mean anything unless you ascribe a meaning to it. So it's just there to denote ""some state"", presumably a one-qubit state from this context. So, that implicitly means an arbitrary normalised vector such as $\alpha|0\rangle+\beta|1\rangle$ where $|\alpha|^2+|\beta|^2=1$. It could be a bit confusing to have $\alpha$ appear in both the label and one of the amplitudes but that's why, personally, I wouldn't ever make the label $\alpha$. Now it might be that whatever source you're using has ascribed a particular meaning to the concept $|\alpha\rangle$. Since you're talking about it being an angle, I'm guessing it means $\cos\alpha|0\rangle+\sin\alpha|1\rangle$, but that would be highly source dependent because I could just as easily imagine a source using $\cos\frac{\alpha}{2}|0\rangle+\sin\frac{\alpha}{2}|1\rangle$ or even $(|0\rangle+e^{i\alpha}|1\rangle)/\sqrt{2}$.

+ +

On the other hand, the meaning of $|\alpha^\perp\rangle$ is pretty clear: a state that or orthogonal to $|\alpha\rangle$. For a qubit that means it has to be (up to a global phase) $\beta^\star|0\rangle-\alpha^\star|1\rangle$

+",1837,,,,,12/9/2019 7:36,,,,0,,,,CC BY-SA 4.0 +9126,1,,,12/9/2019 13:30,,3,72,"

Consider a classical channel $N_{X\rightarrow Y}$ which takes every input alphabet $x\in X$ to output alphabet $y\in Y$ with probability $P(y|x)_{Y|X}$. It is stated in many papers that even if the sender and receiver share entangled quantum states (or even no-signalling resources like a Popescu-Rohrlich box), they cannot increase the asymptotic capacity.

+ +

What is the proof of this statement?

+ +

Notes

+ +

A half-answer to this question is in this work, where the authors comment

+ +
+

By itself, prior entanglement between sender and receiver confers no + ability to transmit classical information, nor can it increase the + capacity of a classical channel above what it would have been without + the entanglement. This follows from the fact that local manipulation + of one of two entangled subsystems cannot influence the expectation of + any local observable of the other subsystem

+
+ +

However, this is a little mysterious to me since it is known (see here) that in other regimes (one shot, zero error, etc.), entanglement between the sender and receiver can be used to boost the capacity of a classical channel. However, all these advantages die away in the case where one uses the channel $n$ times and $n\rightarrow\infty$. Why is this so?

+",4831,,,,,12/9/2019 13:30,Proof that quantum entanglement does not increase the asymptotic capacity of classical channel,,0,0,,,,CC BY-SA 4.0 +9127,1,9128,,12/9/2019 13:32,,2,141,"

Say, I have a specific scheme, +

+ +

where I need to specify inputs for controlled R logical gate, which here is +$$ +R(\theta)=\begin{bmatrix} +1 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 \\ +0 & 0 & 1 & 0 \\ +0 & 0 & 0 & e^{\frac{2 \pi i}{2\theta}} +\end{bmatrix} +$$

+ +

But that is for the case when the first qbit is the control and the second is the operand.

+ +

I don't understand, how I can do it matrixwise, that is, making a matrix that'd use certain qbit of a register as control line and another as the resulting one, leaving everything else as is. +I mean, it's okay, if I have a 2 lines where I just put the qregister in the gate and it works. But this is somewhat harder. How should I change the matrix represenation to specify the gate's inputs and outputs?

+",9292,,,,,12/9/2019 15:53,How do I apply a controlled gate to specific qbits in the register?,,1,0,,,,CC BY-SA 4.0 +9128,2,,9127,12/9/2019 14:18,,1,,"

The action of any controlled gate is to do nothing (i.e. apply the identity operation) if the control qubit is in $\vert 0\rangle$ and apply an operation $U$ on the target when the control is in $\vert 1\rangle$. All other qubits in the system are also left untouched (i.e. apply the identity operation).

+ +

Use the subscripts $c$ and $t$ for the control qubit and target qubit. The gate looks like this

+ +

$$ I_1\otimes I_2\otimes... \otimes\vert 0\rangle\langle 0\vert_c \otimes... \otimes\ I_t\ \otimes...\otimes I_n \ \ +\ \ I_1\otimes I_2\otimes... \otimes\vert 1\rangle\langle 1\vert_c \otimes... \otimes\ U_t\ \otimes...\otimes I_n$$

+ +

In matrix form, this is just

+ +

$$\begin{pmatrix}1&0\\ 0&1\end{pmatrix}_1\otimes \begin{pmatrix}1 & 0\\ 0&1 \end{pmatrix}_2 \otimes ... \otimes\begin{pmatrix}1 & 0\\ 0&0 \end{pmatrix}_c \otimes ... \otimes\begin{pmatrix}1 & 0\\ 0&1 \end{pmatrix}_t\otimes... \otimes \begin{pmatrix}1 & 0\\ 0&1 \end{pmatrix}_n \\ ++ \begin{pmatrix}1&0\\ 0&1\end{pmatrix}_1\otimes \begin{pmatrix}1 & 0\\ 0&1 \end{pmatrix}_2 \otimes ... \otimes\begin{pmatrix}0 & 0\\ 0 & 1 \end{pmatrix}_c \otimes ... \otimes\begin{pmatrix}u_{11} & u_{12}\\ u_{21}& u_{22} \end{pmatrix}_t\otimes... \otimes \begin{pmatrix}1 & 0\\ 0&1 \end{pmatrix}_n $$

+ +

A simple example to help is when you only have two qubits, $t$ corresponds to the first qubit and $c$ corresponds to the second qubit. Then you have

+ +

$$ I\otimes \vert 0\rangle\langle 0\vert + U\otimes \vert 1\rangle\langle 1\vert.$$

+ +

The matrix form is

+ +

$$\begin{pmatrix} +1 & 0 & 0 & 0\\ +0 & u_{11} & 0 & u_{12}\\ +0& 0& 1 & 0\\ +0 & u_{21} & 0 & u_{22} +\end{pmatrix}$$

+",5669,,5669,,12/9/2019 15:53,12/9/2019 15:53,,,,4,,,,CC BY-SA 4.0 +9129,1,,,12/9/2019 15:00,,2,148,"

I find looking at physical processes through the lens of quantum information science rather interesting. I know of a few applications of it:

+ +
    +
  • quantum computation;
  • +
  • solid state (tensor network approach);
  • +
  • cosmology (information exchange with black holes).
  • +
+ +

Can you provide any other examples? Maybe in high energy physics or even other sciences?

+",9424,,55,,8/20/2020 8:05,8/20/2020 8:05,What are some examples of applications of quantum information to other sciences?,,1,0,,,,CC BY-SA 4.0 +9130,1,,,12/9/2019 17:50,,1,101,"

I am trying to wrap my head around Simon's algorithm and I am trying to solve a question.

+ +

+ +

This is the solution that I have come up with. Please correct me if I am wrong. +

+",9425,,,,,12/9/2019 17:50,Simon's algorithm example,,0,3,,12/15/2019 3:10,,CC BY-SA 4.0 +9131,2,,9119,12/9/2019 17:56,,4,,"

Q# type Result is represented by C# class Microsoft.Quantum.Simulation.Core.Result; in particular, it has constants Result.Zero and Result.One that you can compare the return of your operation to.

+ +
using Microsoft.Quantum.Simulation.Core;
+
+boolOutput = (QuantumOperation.Run(sim).Result == Result.One);
+
+",2879,,,,,12/9/2019 17:56,,,,0,,,,CC BY-SA 4.0 +9132,1,9136,,12/9/2019 18:21,,0,103,"

Ok, I understand the difference between quantum bits and classical bits. But, unfortunately, all explanations on the Internet stop at this point.

+ +

This is what I understand that happens:

+ +
    +
  1. A particle is rotating randomly;
  2. +
  3. A measurement is made to know the probability of being a 1 or a 0;
  4. +
  5. Using a quantum gate one will know if it is 1 or 0;
  6. +
+ +

But how is this different from a classical calculation? How do they use the ""superposition"" to make many trials instead of just some?

+ +

I do not get the point were it gets faster than classical computers, once in the end the spin is converted to 1 or 0.

+",9426,,55,,11/24/2020 14:21,11/24/2020 14:21,"How do qubits use the ""superposition"" to make many trials instead of just some?",,2,1,,,,CC BY-SA 4.0 +9133,1,,,12/9/2019 20:53,,0,125,"

I ve beeen trying to use the qiskit package from spyder IDE inisde anaconda (Python version 3.7) but when i try to acces my account I get the following error:

+ +
 runfile('H:/Python Projects/QComputing/account_save.py', wdir='H:/Python Projects/QComputing')
+[{'token': 'MYTOKEN', 'url': 'https://quantumexperience.ng.bluemix.net/api'}]
+
+runfile('H:/Python Projects/QComputing/account_save.py', wdir='H:/Python Projects/QComputing')
+[{'token': 'MYTOKEN', 'url': 'https://quantumexperience.ng.bluemix.net/api'}]
+Traceback (most recent call last):
+
+  File ""<ipython-input-5-c4b9a517fa2c>"", line 1, in <module>
+    runfile('H:/Python Projects/QComputing/account_save.py', wdir='H:/Python Projects/QComputing')
+
+  File ""C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\spyder_kernels\customize\spydercustomize.py"", line 827, in runfile
+    execfile(filename, namespace)
+
+  File ""C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\spyder_kernels\customize\spydercustomize.py"", line 110, in execfile
+    exec(compile(f.read(), filename, 'exec'), namespace)
+
+  File ""H:/Python Projects/QComputing/account_save.py"", line 14, in <module>
+    qsk.IBMQ.load_accounts()
+
+  File ""C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\qiskit\providers\ibmq\ibmqprovider.py"", line 199, in load_accounts
+    self._append_account(credentials)
+
+  File ""C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\qiskit\providers\ibmq\ibmqprovider.py"", line 279, in _append_account
+    single_provider = IBMQSingleProvider(credentials, self)
+
+  File ""C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\qiskit\providers\ibmq\ibmqsingleprovider.py"", line 52, in __init__
+    self._api = self._authenticate(self.credentials)
+
+  File ""C:\Users\Admin\Anaconda3\envs\QComputing\lib\site-packages\qiskit\providers\ibmq\ibmqsingleprovider.py"", line 103, in _authenticate
+    .format(ex)) from root_exception
+
+ConnectionError: Couldn't connect to IBMQ server: error during login: Expecting value: line 1 column 1 (char 0)
+
+ +

I run only the following commands:

+ +
import qiskit as qsk
+print(qsk.IBMQ.stored_accounts())
+qsk.IBMQ.load_accounts()
+
+ +

and i have already created an account(with account save command). I have tried closing the antivirus software. Any ideas? Thanks.

+",9428,,26,,12/16/2019 18:43,12/16/2019 18:43,QISKit Connection,,1,1,,,,CC BY-SA 4.0 +9134,2,,9133,12/9/2019 21:46,,1,,"

Try to run this code:

+ +
from qiskit import IBMQ
+
+IBMQ.save_account('your_api_token')
+
+ +

And for access:

+ +
IBMQ.load_account()# without the 's'
+
+ +

Hope this helps.

+",9277,,9277,,12/9/2019 21:52,12/9/2019 21:52,,,,0,,,,CC BY-SA 4.0 +9135,1,9141,,12/9/2019 21:51,,1,450,"

I know that SWAP2 (swaps 2 qubits) gate looks like:

+ +

$$ +SWAP2=\begin{bmatrix} +1 & 0 & 0 & 0 \\ +0 & 0 & 1 & 0 \\ +0 & 1 & 0 & 0 \\ +0 & 0 & 0 & 1 +\end{bmatrix} +$$

+ +

and SWAP3 gate looks like +$$ +SWAP3=\begin{bmatrix} +1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ +0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ +0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ +0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ +\end{bmatrix} +$$

+ +

The question is, how do I generate SWAP of N qubits, SWAPN?
+I need this for my Fourier transform algorithm.

+",9292,,55,,12/10/2019 16:58,12/10/2019 16:58,How to generate a SWAP of $N$ qubits?,,2,0,,,,CC BY-SA 4.0 +9136,2,,9132,12/9/2019 23:01,,1,,"

Point 1: A qubit (a particle in your words) is not rotated randomly but its rotation depends on gate acting on it. For example Hadamard gate produces a qubit with same probability of measuring $|0\rangle$ and $|1\rangle$ while $X$ gate is equivalent of classical NOT gate. Sequence of gates rotate qubit as intended for particular calculation. This sequence is callled quantum algorithm.

+ +

Point 2: Yes, measurement is done at the end of every algorithm to get probability distribution of a result. Based on this probability distribution you can infer a final result you are looking for. How to do this depends on particular algorithm.

+ +

Point 3: No, quantum gates are used for calculation, not for measurement.

+ +

Difference from classical calculations: Quantum computing is based on effects described by a quantum mechanics, so it is inherently probabilistic instead of deterministic. As a result, some algorithm can run faster and more efficient (e.g. Shor algorithm for integer factorization).

+ +

Superposition and trials: Superposition means that a qubit is in many different states simultaneously until it is measured. To get a probability distribution of those states you have to run algorithm many times to get enough samples for a statistics. You can repeat the algorithm as many times as you want. However, for some algorithms it is enough to run it only once to get desired result.

+ +

Last question on speed-up: The reason for speed-up comes from probabilistic nature of a quantum computer and completely different computing paradigm used in comparison with classical computers.

+ +

I would recomend reading this site: https://quantum-computing.ibm.com/support/guides/user-guide?section=5dcb2b45330e880045abccb0 +I think it can help you to learn more about quantum computing.

+",9006,,,,,12/9/2019 23:01,,,,1,,,,CC BY-SA 4.0 +9137,2,,9120,12/9/2019 23:29,,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|H|\psi\rangle}{ \langle \psi | \psi \rangle}$. For example if the quantum hardware doesn't give you $H|\psi\rangle$ but instead gives you $H|\psi\rangle + \epsilon |\psi\rangle $ where $\epsilon$ is some non-zero error, then when you plug everything into the proof of the variational theorem you may find that you are no longer guaranteed to always get energies equal to or higher than the ground state energy.

+",9429,,,,,12/9/2019 23:29,,,,0,,,,CC BY-SA 4.0 +9138,2,,8972,12/9/2019 23:44,,2,,"

You are probably using Python 3.8. Qiskit only works with Python 3.5, 3.6 and 3.7 - see here for details

+ +

In most cases using Python 3.7 is enough, but if you get another error: TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType you can try the below part.

+ +

After downgrading to Python 3.7.3 and pip 19.1.1 it still gave an error - it could not resolve a path to VC++ 2017 Redistributable for fastdtw.

+ +

For me it worked to hack it like this:

+ +
    +
  1. Find where you have instaleed vcruntime140.dll. I found a copy in %USERPROFILE%\Anaconda3\envs\<<environment_name>>\vcruntime140.dll
  2. +
  3. Open the file %USERPROFILE%\Anaconda3\envs\<<environment_name>>\Lib\site-packages\setuptools\msvc.py
  4. +
  5. Edit the function def VCRuntimeRedist(self) to return the path to vcruntime140.dll (don't forget to escape the \s)
  6. +
  7. run pip install qiskit
  8. +
+",7759,,7759,,1/5/2020 19:28,1/5/2020 19:28,,,,2,,,,CC BY-SA 4.0 +9139,2,,9135,12/10/2019 7:13,,6,,"

Depends on what you mean by SWAPN, that is what qubits are swapped. Your SWAP3 gate in Dirac notation is +$$|000\rangle\langle 000|+|001\rangle\langle100|+|010\rangle\langle010|+|011\rangle\langle110|+|100\rangle\langle001|+|101\rangle\langle101|+|110\rangle\langle011|+|111\rangle\langle111|$$ +that is the first and third qubits are swapped; assuming SWAPN means swapping first and N-th qubit, write SWAPN in Dirac notation and then convert it to matrix notation.

+",2105,,,,,12/10/2019 7:13,,,,0,,,,CC BY-SA 4.0 +9141,2,,9135,12/10/2019 9:00,,2,,"

""SWAPN"" isn't something that would be universally understood. But you say you want it for your Fourier Transform algorithm, so by that, I interpret that what you want is: SWAP2(1,N).SWAP2(2,N-1).SWAP2(3,N-2)...., i.e. the pairwise swap between opposite qubits.

+ +

It depends on context as to what it is you actually want to write down. For implementing in some sort of quantum circuit, the decompostion into pairwise swaps, as I've just given it, is probably ideal. Your question seems to imply that you want a matrix. In which case, +$$ +\text{SWAPN}=\sum_{x\in\{0,1\}^N}|x\rangle\langle x^R|, +$$ +where $x^R$ is just the bit string $x$, reversed.

+ +

However, there is a reason why you rarely see the swap gates explicitly written out at the end of the Fourier transform: they're rarely necessary. In many algorithms, you simply measure the qubits at the end. It's much easier to reorder the classical values of the outcomes after the measurement than the quantum state before the measurement. Even if you're not measuring, you're typically doing a sequence like: inverse Fourier transform - diagonal operator - Fourier transform (for example, HHL algorithm). So, you can get rid of the swaps at the end of the IQFT and the start of the QFT by cancelling them and just reordering the elements of the diagonal operator. Since this is usually associated with some sort of classical calculation, it's easily incorporated there.

+",1837,,,,,12/10/2019 9:00,,,,2,,,,CC BY-SA 4.0 +9142,2,,9122,12/10/2019 9:10,,2,,"

With further understanding coming from the expanded question, I'm entirely revising my answer, but the original version is kept below in case it's useful.

+ +

The point, clearly, is to show how to simulate a probabilistic classical computation. So, we will store a classical distribution by using a diagonal density matrix: +$$ +\rho=\sum_ip_i|i\rangle\langle i|. +$$ +For any stochastic matrix +$$ +S=\sum_{i,j}s_{ij}|i\rangle\langle j|, +$$ +with $\sum_is_{ij}=1$ for all $j$, we want to be able to create a new distribution +$$ +\rho'=\sum_jq_j|j\rangle\langle j| +$$ +with $q_j=\sum_ip_is_{ji}$.

+ +

We can do this by introducing two ancillas each of dimension $M$ (note, this is a diversion from what the question asked), initially in state $|00\rangle$, and by applying a unitary $U$ that acts as +$$ +U|i\rangle|0\rangle|0\rangle=\sum_{j}\sqrt{s_{ji}}|j\rangle|i\rangle|j\rangle. +$$ +It should be obvious that the state is correctly normalised, and that different values of $i$ yield orthogonal states, which are the necessary conditions for being able to define such a unitary.

+ +

Using the unitary, we evolve +$$ +\rho\rightarrow U\rho U^\dagger=\sum_{i,j,k}p_i\sqrt{s_{ji}s_{ki}}|j\rangle\langle k|\otimes |i\rangle\langle i|\otimes |j\rangle\langle k|. +$$ +If we trace out the two ancillas (equivalently, measure and forget), this forces $j=k$, and we get the answer +$$ +\sum_{i,j}p_is_{ji}|j\rangle\langle j|, +$$ +as desired.

+ +
+ +

I've not entirely understood how you're trying to argue this, so let me convey how I would go about answering it.

+ +

Imagine your system is in a state $\rho$. You want to implement a classical probabilistic transformation on it, which I would interpret as meaning ""with probability $p_i$, implement the unitary $U_i$ for $i=0,1,\ldots M-1$."". We do this by introducing an $M$-level ancilla, initially in the $|0\rangle$ state. I'm now going to describe a two-step process (although these two steps should be combined). First, implement a unitary on the ancilla that performs the conversion +$$ +|0\rangle\rightarrow\sum_{i=0}^{M-1}\sqrt{p_i}|i\rangle. +$$ +Second, implement the unitary +$$ +\sum_{i=0}^{M-1}|i\rangle\langle i|\otimes U_i, +$$ +where the ancilla is the control and the original system is the target.

+ +

If we now measure the ancilla system, we get answer $i$ with probability $p_i$, and the original system is in the state $U_i\rho U_i^\dagger$. Hence, if we forget the measurement result, we would have to describe the whole thing as +$$ +\sum_i p_iU_i\rho U_i^\dagger, +$$ +which has had the unitaries $U_i$ applied according to a classical probability distribution. If you select the unitaries to be permutation matrices, that describes classical probabilistic transitions, if I'm understanding the term as intended.

+",1837,,1837,,12/11/2019 10:41,12/11/2019 10:41,,,,4,,,,CC BY-SA 4.0 +9143,1,,,12/10/2019 10:03,,3,192,"

I saw that qiskit was just incorporated in a trapped ion device.

+ +

I transpiled my circuit to 2 backends: ibm superconducting device and aqt trapped ion device. +I noticed that for ibm, the $X$ gate is transpiled into $U_3(\pi,0,\pi)$, whereas for aqt it is $R_x(-\pi)$.

+ +

Since both objectives of them are to take $0$ to $1$, why do they use a different quantum gate to do that?

+ +

By the way, for the aqt device, $H$ gate $= R_y(\pi/2)R_x(\pi)$. +I was wondering, why are the two representations equal?

+",9105,,55,,12/10/2019 17:01,5/15/2020 4:57,Why can different technology transpile the quantum gate to different representations?,,2,0,,,,CC BY-SA 4.0 +9145,2,,9123,12/10/2019 22:05,,1,,"

I am afraid that under current state of development, quantum computers cannot be massively deployed in finance industry. However, the area is developing rapidly.

+ +

You can find some overview of possible quantum computers application in finance here: https://www.sciencedirect.com/science/article/pii/S2405428318300571

+",9006,,,,,12/10/2019 22:05,,,,6,,,,CC BY-SA 4.0 +9147,1,9151,,12/10/2019 22:44,,4,305,"

The purity of a state $\rho$ is $\newcommand{\tr}{\operatorname{Tr}}\tr(\rho^2)$, which is known to equal $1$ iff $\rho$ is pure.

+ +

Another quantity that can be used to quantify how close a state $\rho$ is to be pure is its rank. This equals the number of nonzero eigenvalues in the eigendecomposition of $\rho$, or equivalently, the minimum number of pure states that need to be mixed to obtain $\rho$. +Again, $\rho$ is pure iff its matrix rank is $1$.

+ +

Consider now two states $\rho$ and $\sigma$. Their having the same rank clearly does not imply that they have the same purity. A trivial example of this is given by $\rho=I/2$ and +$$\sigma=(1/2-\epsilon)|0\rangle\!\langle0| + (1/2+\epsilon)|1\rangle\!\langle 1|,$$ +for small enough $\epsilon>0$.

+ +

It is however less trivial to see whether $\rho$ and $\sigma$ having the same purity implies their having the same rank. If these were generic matrices, it would not be true, but it might hold for unit-trace Hermitian operators. Is this the case?

+ +

I can see that it is for two-dimensional matrices: if $\rho$ and $\sigma$ have same purity, that means that $p^2+(1-p)^2=q^2 + (1-q)^2$, with $p$ and $q$ one of the two eigenvalues of $\rho$ and $\sigma$, respectively. But in this case $\rho$ and $\sigma$ having different rank means that one of the two (say $\rho$) has full-rank while the other one has rank $1$. This would mean that $q=1$ (or, equivalently, $q=0$), while $0<p<1$. But then the condition on the purity would become $p^2+(1-p)^2=1$, which clearly cannot be satisfied for $0<p<1$ (a nice geometrical way to see it is that the solutions of this equation are the intersection of the unit circle in 2D and the line $x+y=1$).

+ +

What about the more general case?

+",55,,55,,7/20/2021 11:46,7/20/2021 11:46,Do states with the same purity always have the same rank?,,2,1,,,,CC BY-SA 4.0 +9148,2,,9132,12/10/2019 22:48,,0,,"

Quantum computing is a different paradigm than classical computing. Data exists as probabilities that one amplifies with repeated operations until the value of the solution emerges. The static data values of classical computing is not assumed.

+ +

Though I am working on a method to encode information with qubits that has similar properties to a classically encoded information. Reducing the noise in a computation should simplify programming.

+",9414,,,,,12/10/2019 22:48,,,,0,,,,CC BY-SA 4.0 +9149,2,,9129,12/10/2019 22:55,,2,,"

You can model just about any physical or information system with a quantum computer. But you need to ask yourself (1) if the system demands enough computational power (processors) to justify the extra cost, (2) whether the problem solution is reasonable to receive per the delays inherent in sharing a scarce resource (time), and (3) whether your budget permits using a quantum computer (dollars).

+",9414,,,,,12/10/2019 22:55,,,,2,,,,CC BY-SA 4.0 +9150,1,,,12/11/2019 1:00,,0,117,"

I am just new to the concepts of entanglement entropy and how it is used to measure the entanglement in systems. I want to know the role of entanglement entropy in quantum information, in general.

+",8817,,55,,11/22/2020 16:58,11/22/2020 16:58,Entanglement entropy's role in quantum information,,1,1,,,,CC BY-SA 4.0 +9151,2,,9147,12/11/2019 1:09,,4,,"

$$ +\rho = \begin{pmatrix} +a & 0 & 0\\ +0 & 1-a & 0\\ +0 & 0 & 0\\ +\end{pmatrix}\\ +\sigma = \begin{pmatrix} +b & 0 & 0\\ +0 & c & 0\\ +0 & 0 & 1-b-c\\ +\end{pmatrix}\\ +Tr (\rho^2 ) = 2 a^2 - 2a + 1\\ +Tr (\sigma^2 ) = b^2 + c^2 + (1-b-c)^2 +$$

+ +

Let's pick $a=1/2$ so $2a^2-2a+1=\frac{1}{2}$.

+ +

$$ +b=\frac{2}{3}\\ +c=\frac{1}{6}\\ +1-b-c=\frac{1}{6}\\ +Tr (\sigma^2) = \frac{4}{9} + \frac{1}{36} + \frac{1}{36}\\ += \frac{16}{36} + \frac{1}{36} + \frac{1}{36}\\ += \frac{1}{2}\\ +$$

+",434,,,,,12/11/2019 1:09,,,,1,,,,CC BY-SA 4.0 +9152,1,,,12/11/2019 2:05,,1,73,"

So I have the following code

+ +

qgan = QGAN(real_data, bounds, num_qubits, batch_size, num_epochs, snapshot_dir=None)

+ +

with num qubits being defined as

+ +

num_qubits = [2, 2]

+ +

but it is outputting the following error on the qgan line:

+ +

operands could not be broadcast together with shapes (9,) (2,)

+ +

I suspect this is due to the fact that it is currently configured to handle a 2 dimensional data set with two columns but I am attempting to feed a 2 dimensional data set with 9 columns. How do I allow the qgan to support 9 columns?

+",9444,,2293,,7/26/2021 18:35,7/26/2021 18:35,Number of columns mismatch in Qiskit,,0,2,,,,CC BY-SA 4.0 +9153,1,9155,,12/11/2019 10:23,,3,86,"

So this might be a dumb question, but I have trouble finding any information on the physical aspect of quantum computers. +Online you can find only pictures of big bulky things said to be quantum computers and searching for quantum circuits only results in descriptions of equations for quantum operations.

+ +

What I want to know is what is the quantum version of classical PCBs, are they also made on silicon wafers or is it a different material and method altogether?

+",9448,,26,,12/15/2019 13:41,12/15/2019 13:41,How are physical quantum chips made?,,1,0,,,,CC BY-SA 4.0 +9154,1,9241,,12/11/2019 10:47,,3,144,"

In the paper https://arxiv.org/abs/1909.05820 the authors introduce several Hamiltonians. For example they define +$$ +H_G = A^\dagger \left( \mathbb{I} - \vert b \rangle \langle b \vert \right) A +$$ +in equation (4), where $A$ is a complex-weighted sum of unitary matrices and $\vert b \rangle$ a quantum state prepared with the unitary $U$ (that will appear later in the question): $U\vert 0 \rangle = \vert b \rangle$.

+ +

This Hamiltonian is depicted as the ""global"" Hamiltonian and is defined such as its expectation value when the system is in the state $\vert x \rangle$ is +$$ +\langle x \vert H \vert x \rangle = \langle x \vert \left[ A^\dagger \left( \mathbb{I} - \vert b \rangle \langle b \vert \right) A \right]\vert x \rangle = \langle \psi \vert \left( \mathbb{I} - \vert b \rangle \langle b \vert \right) \vert \psi \rangle +$$ +where $\vert \psi \rangle = A \vert x \rangle$.

+ +

I may be wrong, but I think this expectation value can be interpreted as the ""part"" of $\vert \psi \rangle$ that is in the subspace orthogonal to $\vert b \rangle$.

+ +

The authors also define a ""local"" Hamiltonian: +$$ +H_L = A^\dagger U \left( \mathbb{I} - \frac{1}{n} \sum_{j=1}^n \vert 0_j \rangle \langle 0_j \vert \otimes \mathbb{I}_{\bar{j}} \right) U^\dagger A +$$ +where $U$ is a unitary matrix ""preparing"" $\vert b \rangle$ and $\mathbb{I}_\bar{j}$ is the identity operation on all qubits except the $j$-th one.

+ +

My question is: is there a interpretation of the formula for $H_L$ as I wrote above for $H_G$? I particularly need help for the interpretation of the sum, I would tend to say it is a projection on all the states that have their $j$-th qubit in the $\vert 0 \rangle$ state, but I am not sure.

+ +

EDIT: after more research, this notebook gave me a re-formulation of one of the terms: +$$ +\frac{1}{n} \sum_{j=1}^n \vert 0_j \rangle \langle 0_j \vert \otimes \mathbb{I}_\bar{j} = P = \frac{1}{2} \left( \mathbb{I} + \frac{1}{n}\sum_{j=1}^n Z_j \right) +$$ +where $Z_j$ is the $\sigma_z$ Pauli matrix applied to the $j$-th qubit, qubit indexes starting with $0$.

+ +

NOTE: the question is open, i.e. a possible answer could be ""I am pretty sure there is no easy interpretation of that thing"".

+",1386,,1386,,12/11/2019 15:04,12/17/2019 14:59,Interpretation of specific Hamiltonian operator,,1,1,,,,CC BY-SA 4.0 +9155,2,,9153,12/11/2019 10:53,,3,,"

It depends on the architecture. Superconducting quantum chips (currently the most popular architecture) are indeed fabricated on Silicon wafers. There's a nice schematic in arXiv:1901.08042. +

+",26,,,,,12/11/2019 10:53,,,,0,,,,CC BY-SA 4.0 +9156,1,,,12/11/2019 11:10,,-2,55,"

I want to know what happens to the time complexity in terms of big O analysis

+",9449,,,,,12/11/2019 11:18,How does number of shots (number of times the computation is repeated) affects time complexity,,1,0,,12/15/2019 3:10,,CC BY-SA 4.0 +9157,2,,9156,12/11/2019 11:18,,3,,"

Number of shots tells you how many times you repeat algorithm run. It is not connected with a complexity of algorithm itself.

+ +

Running time of simulation depends on number of shots linearly, so something what you can call ""total complexity"" is given by complexity of an algorithm multiplied by number of shots.

+",9006,,,,,12/11/2019 11:18,,,,0,,,,CC BY-SA 4.0 +9159,2,,9147,12/11/2019 14:26,,5,,"

The other answer already gave a counterexample.

+ +

From a geometrical point of view, the question is about the intersection of hyperplanes with hyperspheres. Indeed, the purity of a state $\rho$ with eigenvalues $(p_i)_i$ is $\sum_i p_i^2=\|\boldsymbol p\|^2$, whereas these are probabilities and therefore also constrained by $\sum_i p_i=1$.

+ +

The set of probabilities for states of purity $C^2$ is therefore given by the intersection between the hypersphere with radius $C$, and the hyperplane $\sum_i p_i=1$ (with the additional constraint that $0\le p_i\le 1$ for all $i$). +Let us denote the hyperplane $\sum_i p_i=1$ in $N$ dimensions as $\mathcal P_N$, and with $\mathcal S_N(r)\subseteq\mathbb R^N$ the $(N-1)$-sphere with radius $r$. +Fixing $C$, there are states with purity $C$ and rank $r$ whenever $\mathcal S_r(C)$ intersects $\mathcal P_N$. This doesn't happen for all values of $C$ and $r$. For example, for the smallest possible purity, $C^2=1/N$, there is a single point of intersection between $\mathcal P_N$ and $S_N(C)$, and no smaller-dimensional hypersphere of radius $c$ intersects $\mathcal P_N$.

+ +

Here is a visualisation of this for $N=3$, showing $\mathcal P_3$ and $\mathcal S_3(2/3)$:

+ +

+

+ +

We can see from this that for the purity $C^2=(2/3)^2$, we cannot have states with rank smaller than $3$. Indeed, we can go further and say that states with rank $<3$ are only possible when the purity $C^2$ is greater than or equal to $1/2$ (consistently with AHusain's answer).

+ +

Generalising this, we find that states with rank $r$ and purity $C^2$ exist whenever $C^2\ge1/r$.

+ +

To get two states with the same purity and different rank in dimension $3$, it is therefore sufficient to choose a purity $C^2\in[1/2,1)$. To find a rank-$2$ probability vector $(p,1-p)$ with this purity we then need to solve $p^2+(1-p)^2=C^2$, which has solutions $2p=1\pm \sqrt{2C^2-1}$. Note how this has solutions in $[0,1]$ only for $C^2\in [1/2,1]$. We then need to only take another point in the intersection $S_3(C)\cap \mathcal P_3$ that does not sit on one the planes $p_1=0,p_2=0,p_3=0$, and we get an example of a rank-3 state with same purity as a rank-2 one.

+ +

Generally speaking, I think the important observation is that, while states with the same purity all sit at the same distance from the origin of probability space, the distance from the origin of the hyperplanes $\mathcal P_N$ ranges from $1/\sqrt N$ to $1$. It is therefore clear that if we are looking for states with purity $C^2$, these must have distance $C$ from the origin, and therefore cannot also sit on a plane $\mathcal P_n$ (i.e. correspond to states with rank $n$) unless $C\ge 1/\sqrt n$.

+",55,,55,,12/11/2019 15:39,12/11/2019 15:39,,,,0,,,,CC BY-SA 4.0 +9161,1,9162,,12/11/2019 15:24,,3,1671,"

when I tried to execute task in ""Jupiter notebook"" in the IBM Q experience (the browser),

+ +
backend=IBMQ.get_backend(name ='ibmqx2')
+job4Cal=execute(qc,backend,shots=8192)
+job_monitor(job8Cal, monitor_async=True)
+
+Calresult = job4Cal.result()
+job8Cal.job_id()
+
+counts=Calresult.get_counts()
+
+ +

and I got the message:

+ +
---------------------------------------------------------------------------
+AttributeError                            Traceback (most recent call last)
+<ipython-input-4-2bc4021cab83> in <module>
+----> 1 backend=IBMQ.get_backend(name ='ibmqx2')
+      2 job4Cal=execute(qc,backend,shots=8192)
+      3     #job_monitor(job8Cal, monitor_async=True)
+      4 
+      5 Calresult = job4Cal.result()
+
+AttributeError: 'IBMQFactory' object has no attribute 'get_backend
+
+ +

How to fix this problem\error?

+",4524,,,,,12/11/2019 15:31,How to fix an error: AttributeError: 'IBMQFactory' object has no attribute 'get_backend',,1,0,,,,CC BY-SA 4.0 +9162,2,,9161,12/11/2019 15:31,,9,,"

The IBMQ provider has been updated so that you now have to retrieve a provider before you can get a backend. This can be done like this :

+ +
my_provider = IBMQ.get_provider()
+my_backend  = my_provider.get_backend('ibmq_qasm_simulator')
+
+ +

You may also need to update your credentials, which can be done using IBMQ.update_account().

+ +

For more information please see the README.

+",5955,,,,,12/11/2019 15:31,,,,0,,,,CC BY-SA 4.0 +9163,1,,,12/11/2019 15:55,,1,50,"

Although the architecture of a quantum computer depends on the implemented qubit system, I still wonder what the general structure of hardware parts would be.

+ +

Evidently, a quantum computer isn't merely comprised of qubits, so probably multiple devices must be required to realize the existence of a physical quantum computer. Which devices would that be and what is the pertaining purpose of each component.

+ +

In case certain helpful sources are available for finding such data, I would gladly like to receive a reference then. A schematic or primitive blueprint would also be highly appreciated.

+ +

Thank you in advance.

+",9313,,,,,12/11/2019 15:55,What are the general hardware components of a universal quantum gate computer?,,0,4,,,,CC BY-SA 4.0 +9164,2,,9122,12/11/2019 16:44,,0,,"

Suppose you want to obtain a transition matrix sending $N$ inputs into $M$ outputs.

+ +

You can then start with $N$ orthonormal vectors of length $MK$ with $K$ the dimension of the ancillary space (note that you can always think of such an orthonormal set of vectors as a subset of columns of some larger unitary matrix, like it is done in the question). +Denote the $n$-th such vector with $v^{(n)}$, whose components are written as $v^{(n)}_{mk}$, where indexes the different outputs and $k$ is a coordinate in the ancillary space (in the original post we have $N=M=K=2$).

+ +

Then, the transition matrix $S$ is a $M\times N$ matrix defined elementwise by $S_{mn}=\sum_{k=1}^K |v^{(n)}_{mk}|^2$. +The columns of this matrix always sum up to one, but the rows only do when $N=MK$.

+",55,,55,,12/12/2019 9:04,12/12/2019 9:04,,,,2,,,,CC BY-SA 4.0 +9165,1,9166,,12/11/2019 16:51,,6,93,"

I've been working through Grovers algorithm. I've read many times that $*^1H^{\otimes n}(2|0\rangle \langle0| - \mathcal{I})H^{\otimes n}$ is equivalent to $*^22|\psi\rangle \langle\psi| - \mathcal{I}$. I did verify that $*^2$ turns $\sum_x \alpha_x |x\rangle$ into $\sum_x(-\alpha_x+2\bar\alpha)$ but could not do the step before that of getting from $*^1$ to $*^2$ and I haven't seen that explained anywhere where this operation is discussed. I'd be grateful for a hint on how to do that.

+ +

I have tried to calculate $(H^{\otimes n}(2|0\rangle \langle0| - \mathcal{I})H^{\otimes n})(\sum_x \alpha_x |x\rangle)$ but only got to $\sum_x \alpha_x (\frac{1}{N} \sum_y \sum_z (-1)^{x\cdot y+y\cdot z+\delta_{y0}})|x\rangle$ and didn't come up with any simplifications for that expression.

+",9450,,26,,12/21/2019 15:15,12/21/2019 15:15,"Why, in Grover's algorithm, $H^{\otimes n}(2|0\rangle\! \langle0| - \mathcal{I})H^{\otimes n}=2|\psi\rangle \!\langle\psi| - \mathcal{I}$?",,1,0,,,,CC BY-SA 4.0 +9166,2,,9165,12/11/2019 17:10,,5,,"

If you just multiply out your first equation, you get +$$ +2H^{\otimes n}|0\rangle\langle 0|H^{\otimes n}-H^{\otimes n}IH^{\otimes n}. +$$ +If we write $|\psi\rangle=H^{\otimes n}|0\rangle$, then this is +$$ +2|\psi\rangle\langle \psi|-H^{\otimes n}IH^{\otimes n}. +$$ +Since $IH^{\otimes n}=H^{\otimes n}$, and $H^{\otimes n}H^{\otimes n}=I$, this just returns your second equation, +$$ +2|\psi\rangle\langle \psi|-I. +$$

+",1837,,,,,12/11/2019 17:10,,,,0,,,,CC BY-SA 4.0 +9167,2,,9143,12/11/2019 18:17,,4,,"

A particular gate's implementation is intrinsically tied to the underlying architecture. A U3 gate on IBM's superconducting backends is just a combination of 3 rotations alternatively around just two axes (for example rotate around X-axis, then Y-axis and then again X-axis; there are several other combinations to choose from). In fact this is the most general way in which you could take one point on a bloch sphere to any other point on it. In essence, that's what a U3 gate's signature means.

+ +

Now, to answer why this implementation of rotation varies on different backengs, here are my thoughts:

+ +
    +
  1. We'd like to keep the noise minimal while making any of those rotations. You might want to read more about how a Z gate is implemented on IBM's superconducting systems (It's virtually free of any noise). I'm not so well-wersed with Trapped-Ion device's transpiled code so can't comment on it's optimality.
  2. +
  3. I believe it could also have something to do with keeping gate abstractions intuitive enough for programmers which might give rise to different signatures for different backends.
  4. +
+",8852,,,,,12/11/2019 18:17,,,,0,,,,CC BY-SA 4.0 +9168,1,9169,,12/11/2019 18:54,,3,691,"

Not sure if this is a stupid question, but can quantum chips be spied on?

+ +

I heard that quantum particles(?) can be ""entangled"".

+ +

So is it possible that a chip manufacturer (who wishes to spy) can pretty much entangle all the particles on the chip so that what ever processing goes on inside that chip is mirrored miles away by the spy manufacturer?

+",9454,,26,,12/13/2019 18:31,5/9/2020 18:02,Can quantum chips be spied on?,,5,2,,,,CC BY-SA 4.0 +9169,2,,9168,12/11/2019 19:15,,7,,"

Quantum states are highly unstable and subject to noise, so with current levels of technology it is unlikely that this entanglement would last for any useful amount of time.

+ +

But let's assume that you have two entangled fault-tolerant qubits (one owned by a malicious manufacturer), and that they are in superposition (in the Z-basis): +$$ +\frac{1}{\sqrt{2}} (|01\rangle + |10\rangle) +$$

+ +

Where the first qubit is owned by the manufacturer. These are perfectly anti-correlated, meaning that a measurement of 0 on the first qubit causes the second to be measured as 1.

+ +

This may seem promising if you are a nefarious manufacturer; however the moment the user mesures their qubit, they collapse the superposition and the two qubits are no longer entangled, you have two separated states $|0\rangle$ in the user's computer and $|1\rangle$ in the manufacturers. You cannot bring them back into superposition without some interaction between the two qubits again.

+ +

Quantum computations are repeated many times to get the expected value. With this scheme you get only one of the (probably millions of) repeats.

+ +

And as @Sanchayan Dutta mentions, the choice of basis is important (this is what we communicate classically in teleportation), if the user were to rotate their measurement basis randomly before performing the measurement, the manufacturer would be unaware of this. The manufacturer's qubit would be in an eigenstate of the basis, but if they then chose to measure using the Z basis, it would collapse into an eigenstate of that basis.

+",9453,,9453,,12/11/2019 19:22,12/11/2019 19:22,,,,1,,,,CC BY-SA 4.0 +9170,1,,,12/11/2019 19:22,,-1,74,"

So, I'm really trying my best to understand how quantum computers work.

+ +

This is how I think they work:

+ +
    +
  1. There is a set of qubits;
  2. +
  3. Then an algorithm is put in action by the use of quantum gates that entangle these qubits and rotate them in a way to produce equal probabilities for each case (like for example in a big list of items);
  4. +
  5. At this moment the way I visualize things is like a series of ball spheres that individually act as layers that have some information relative to each case, but combined they are like a single ball sphere that has more information on it (something like photoshop layers, but in 3d);
  6. +
  7. Until this point everything seems like something that I could build in a classic computer, the difference is that in everything I read it is told to me that quantum computers do not go through all of the possibilities, but only some, as they are probabilistic. Ok, but if the probabilities start by being equal to each case, how can one find the right cases?
  8. +
  9. I read that it is by the use of phase and interference, and this is where there is lack of information and where I stop to understand how quantum computers work;
  10. +
  11. And then, in the end, qubits are collapsed so we get actual values in ones and zeros coming from those previous probabilities;
  12. +
+ +

Please, try to explain with simple terms and examples like I just did, more than this will be like what's out there, complicated and not useful, or to simple and repetitive.

+ +

It's about time someone explains quantum computing in simple ways. Why complicate what's not so complicated? If one is unable to explain how things work, and sometimes people actually working on the field, how can this technology progress? Still, I will appreciate any efforts to help me understand this technology.

+ +

If you want to use formulas and functions go ahead, but please, completely explain what they do...

+",9426,,,,,12/11/2019 22:19,What is the diference between classic probabilities and quantum probabilities?,,1,4,,12/12/2019 0:12,,CC BY-SA 4.0 +9171,2,,9170,12/11/2019 21:46,,1,,"

It is not very easy to explain how a quantum computer works. Your question is very broad. It can take even whole book to explain everything you want to know clearly, so this forum is probably not the best place to do so.

+ +

I would recommend reading this book: Hidden In Plain Sight 10: How To Program A Quantum Computer.

+ +

I am self learner in quantum computing and this book helped me much to understand basics. It cost only $1.2 in Kindle format.

+",9006,,26,,12/11/2019 22:19,12/11/2019 22:19,,,,3,,,,CC BY-SA 4.0 +9172,1,9191,,12/12/2019 6:16,,3,375,"

I do not understand the error correction process that uses quantum codes for amplitude damping channel. I will take three bit-flip code for example.

+ +

The logical state of a three bit-flip code is +$|0\rangle_L=|000\rangle$,$|1\rangle_L=|111\rangle$ with stabilizers $Z_1Z_2, Z_2Z_3$.

+ +

The amplitude damping channel on three qubits $\mathcal{E}^{\otimes 3}$ has Kraus operators $\{E_0^{\otimes 3},E_0E_1^{\otimes 2},E_0E_1E_0,E_0^{\otimes 2}E_1,E_1^{\otimes 3},E_1E_0^{\otimes 2},E_1E_0E_1,E_1^{\otimes 2}E_0\}$, +where

+ +

\begin{matrix} + E_0=\begin{pmatrix} + 1 & 0 \\ + 0 & \sqrt{1-r} + \end{pmatrix}, +E_1=\begin{pmatrix} + 1 & \sqrt{r} \\ + 0 & 0 + \end{pmatrix}. + \end{matrix}

+ +

Suppose I have a initial state $|\psi\rangle=|111\rangle$ and error $E_1E_0^2$ will transform $|\psi\rangle$ to $\sqrt{r}(1-r)|011\rangle$. By measuring the stabilizers $Z_1Z_2, Z_2Z_3$, I can find the first qubit is flipped. So I use $X_1$ to recover.

+ +

My question is that

+ +
    +
  1. the state could only be corrected back to $\sqrt{r}(1-r)|111\rangle$ after the recovery, can $\sqrt{r}(1-r)$ be recognized as the fidelity?

  2. +
  3. if I write the initial state in density matrix $\rho=|111\rangle\langle 111|$ and +\begin{equation} +\begin{aligned} +\mathcal{E}^{\otimes 3}(\rho)&=E_0^3 \rho (E_0^3)^\dagger+E_1E_0^2 \rho (E_1E_0^2)^\dagger+\cdots \\&= r^3|000\rangle\langle 000|+r(1-r)^2|011\rangle\langle 011|+\cdots. +\end{aligned} +\end{equation} +How to perform projective measurements to obtain error syndromes and correct?

  4. +
  5. $[5,1,3]$ code can correct one arbitrary error but amplitude damping errors will occur on all $5$ qubits, does that mean $[5,1,3]$ code will have bad performance for amplitude damping errors?

  6. +
+",9275,,9275,,12/12/2019 11:31,12/13/2019 13:46,Quantum error correction using bit-flip code for the amplitude damping channel,,2,0,,,,CC BY-SA 4.0 +9173,2,,9168,12/12/2019 6:25,,3,,"

Yes, and no. (Helpful answer, I know)

+ +

If you rely on buying the entire package from a single supplier, then yes. This doesn’t need to have anything to do with quantum at all. A quantum computation starts and ends with normal classical bits on a normal classical computer. If that was supplied as part of the package, it can easily have some malware built in that transmits all those classical inputs and outputs, which is sufficient for the supplier to entirely replicate everything the user got.

+ +

However, if you’re willing to separate the components a little, you can get something far, far stronger. Let’s say that, as a user, I can supply my own classical computer that I am confident is free from tampering, and I can produce my own single-qubit quantum states. I can perform a protocol called “blind quantum computation” to interact with the quantum computer. Even if the quantum computer part is completely compromised and untrustworthy, they learn essentially nothing about the computation you’re running beyond some basic property of how large the computation is. This was originally designed so that you don’t even have to own the quantum computer yourself. You can leave it with the manufacturer, who can continue to be as naughty with it as they want, and they still learn nothing!

+",1837,,,,,12/12/2019 6:25,,,,1,,,,CC BY-SA 4.0 +9174,2,,9172,12/12/2019 9:38,,2,,"

Firstly, I'm presuming that when you write $E_0^3$ it corresponds to $E_0^{q_1} \otimes E_0^{q_2} \otimes E_0^{q_3}$.

+ +
    +
  1. In question 2. you've written out how the Superoperator of the Kraus operators acts on the density matrix, In 1. we should also assume that this is the case, and the pre-factor of $\sqrt{r}(1-r)$ is a probability amplitude, so measuring with the stabilisers will collapse the state into $|011\rangle$ with probability $\sqrt{r}(1-r)$. So the state recovered after applying the corrective measurement has fidelity = 1.

  2. +
  3. To perform a projective measurement, we just need to write out the measurement operator, $M = |\psi\rangle\langle\psi|$ where $|\psi\rangle\langle\psi|$ is the measurement outcome, e.g. $|\psi\rangle = |000\rangle$ and the expectation value for this measurement is: $\langle\rho\rangle = \textrm{Trace}(M\rho)$. If the measurement outcome $|000\rangle$ is obtained, the state after measurement is $\frac{M\rho M}{\textbf{Trace}(M\rho)}$

  4. +
  5. All qubits will be subject to amplitude damping errors, and within a certain time can be expected to have relaxed into the ground state. This time is called $T_1$ time, and the trick is to do the stabiliser measurements before this time has elapsed. The stabiliser measurements are not performed at the end of the computation, but during it, and they project the logical qubits onto the `codespace' (like in Q1. where the qubits after measurement are in the $|011\rangle$ state).

  6. +
+",9453,,,,,12/12/2019 9:38,,,,2,,,,CC BY-SA 4.0 +9175,1,9177,,12/12/2019 13:28,,5,654,"

I know a three-qubit bit-flip code has a common encoding circuit as follows, +

+ +

Further, as in page 35 in Gottesman's paper, the encoding circuit can also be constructed through stabilizer generators. He illustrated the encoding circuit of the $[5,1,3]$ code, whose stabilizer generators are $g_1=Y_1Z_2Z_4Y_5$, $g_2=X_2Z_3Z_4X_5$, $g_3=Z_1Z_2X_3X_5$, $g_4=Z_1Z_3Y_4Y_5$. +

+ +

So I think the encoding circuit of three-qubit bit-flip code can also be constructed by its stabilizer generators $Z_1Z_2$ and $Z_2Z_3$ as shown below.

+ +

+ +

But in this way the circuit is different from the one in the first picture and I do not think this is right.

+",9275,,,,,5/7/2021 13:21,Quantum circuit for a three-qubit bit-flip code,,2,0,,,,CC BY-SA 4.0 +9176,2,,6501,12/12/2019 13:29,,3,,"

The second circuit applies a stabilizer formalism. A three qubits bit-flip code has stabilizer generators $Z_1Z_2$ and $Z_2Z_3$. You can find the circuit in page 473 in Nielsen and Chuang's book - quantum computation and quantum information. I also have a question about the circuit of three qubits bit-flip code. I would be appreciated if you take a look at this.

+",9275,,,,,12/12/2019 13:29,,,,0,,,,CC BY-SA 4.0 +9177,2,,9175,12/12/2019 13:54,,4,,"

You can actually, most of the time, prepare an encoded qubit state by using the stabilizers; you can also do this for the bit-flip code.

+

I have intentionally left the above sentence a little vague, because there are some very important subtleties. To really understand these subtleties, a good understanding of stabilizer codes is strongly preferred. If you don't feel comfortable enough with the subject, I advice you to read the first half of Gottesman's updated introduction on the subject instead of his thesis, which has outdated terminology and symbols and might feel a little more convoluted.

+

Preparing code states through stabilizer measurement

+

The general idea behind 'using' the stabilizers to encode a codestate into a set of (data) qubits is that you perform the stabilizer measurements to project the state of said data qubits to the eigenspaces of the stabilizer generators. To perform these stabilizer measurements, one makes use of an ancilla qubit. In your second picture (on the $[5,1,3]$ code), this is the qubit labeled $|c\rangle$. It is not a data qubit. Actually, in that picture, only four of the five data qubits are depicted.

+

The text that I linked has a clear explanation on how to perform these measurements. The general idea behind these measurements is that we measure only the ancilla; the measurement outcomes are then associated with the $+1$ and $-1$ eigenspaces of the stabilizer generators.

+

In your last picture, you show three qubits, which I expect you to mean to be the three data qubits of the bit-flip code. Therefore, there is no ancilla in play here, and this is not a correct picture. You should add one extra qubit, prepare that in the $|+\rangle$ state, and then perform a controlled $Z$ operation to the first and second data qubit. Upon measurement of the ancilla in the $X$ basis, you will have mapped to either subspace of the $Z_{1}Z_{2}I_{3}$ generator. I refer to the aforementioned text for further explanation (I can repeat that here but I think you can really benefit from reading that text).

+

Does this process, in general, give us any encoded state?

+

Another subtlety lies in the fact that this method of 'mapping to the codespace' does not give us any way of knowing which codestate we end up with. All we have done is map to the codespace. There even is a minute probability that the original state on our data qubits was perfectly orthogonal to the codespace; mathematically speaking we then end up with the null vector. In general, this will not happen often if the initial state of the qubits is $|0\rangle^{\otimes n}$, because for most codes that state is part of some codestate. (Of course, for the bit-flip code it exactly is a codestate, usually labeled as the logical $|0\rangle$ state).

+

The important thing to realize is that if we want to encode some single-quibit state $|\psi\rangle$ of only one of the data qubits into the corresponding codestate on all data qubits, stabilizer measurements are not the way to go to perform this for general states $|\psi\rangle$.

+",8141,,104,,5/7/2021 13:21,5/7/2021 13:21,,,,3,,,,CC BY-SA 4.0 +9178,2,,9168,12/12/2019 13:59,,3,,"
+

So is it possible that a chip manufacturer (who wishes to spy) can pretty much entangle all the particles on the chip so that what ever processing goes on inside that chip is mirrored miles away by the spy manufacturer?

+
+ +

No, not really.

+ +

The big reason this can't be done is that quantum entanglement doesn't allow for communication. Suppose that there's a particle A in New York, and a particle B in London, and that the particles A and B are entangled. Then, if I manipulate particle A, this will have no observable effects whatsoever on particle B. The people in London will have no idea what I'm doing in New York.

+ +

This fact is called the no-communication theorem.

+ +

Of course, that's not to say that it's impossible for a chip manufacturer to spy on the users of the chip. For example, the manufacturer could put in a hidden radio transmitter. But they can't spy by means of entanglement.

+",8960,,,,,12/12/2019 13:59,,,,0,,,,CC BY-SA 4.0 +9179,1,,,12/12/2019 15:28,,1,295,"

I'm doing an implementation/tutorial of the iterative phase estimation algorithm (IPEA) and have a problem. My Hamiltonian is a diagonal matrix $H = \begin{pmatrix} E_1 & 0 \\ 0 & E_2\end{pmatrix}$, I want to estimate both eigenvalues. When I do it instead of $E_1$ the estimated value is 0, and instead of $E_2$ the estimated value is $E_2 - E_1$. Is it possible that when I call H.evolve(t=1) +method it doesn't create a circuit for $\mathrm{e}^{-iHt}$, but instead, creates a circuit for $\mathrm{e}^{-i\hat{H}t}$ , where $\hat{H} = \begin{pmatrix}0 & 0 \\ 0 & E_2 - E_1\end{pmatrix}$?

+ +

In other words, if I have $H = \begin{pmatrix} E_1 & 0 \\ 0 & E_2\end{pmatrix}$, what should do the H.evolve(t=1) method?

+ +

a) Create a circuit for $\mathrm{e}^{-iHt}$ unitary operator.

+ +

b) Create a circuit for $\mathrm{e}^{-i\hat{H}t}$ unitary operator.

+ +

This is the link to my tutorial and the short version of it is presented here:

+ +

In the tutorial I am writing

+ +
E_1, E_2 = (0, random())
+
+ +

and it finds $E_2$, because when $E_1 = 0$, $E_2 = E_2 - E_1$.

+ +

Here in the following code, this line is changed:

+ +
E_1, E_2 = (random(), random())
+
+ +

and the algorithm estimates $E_2 - E_1$ value instead of $E_2$.

+ + + +
import numpy as np
+from random import random
+from qiskit import *
+from qiskit.aqua.operators import WeightedPauliOperator, MatrixOperator
+from qiskit.aqua.operators.op_converter import to_matrix_operator
+from qiskit.aqua.utils.controlled_circuit import get_controlled_circuit
+
+backend = BasicAer.get_backend('qasm_simulator')
+q = QuantumRegister(1)
+a = QuantumRegister(1)
+c = ClassicalRegister(1)
+
+
+def simple_hamiltonian_operator(E_1, E_2):
+    """"""
+    Creates 0.5*(E_1 + E_2)*I + 0.5*(E_1 - E_2)*Z pauli sum
+    that will be our ""simple"" Hamiltonian operator. The corresponding
+    matrix for Hamiltonian is [[E_1, 0], [0, E_2]].
+
+    """"""
+    pauli_dict = {
+        'paulis': [{""coeff"": {""imag"": 0.0, ""real"": 0.5 * (E_1 - E_2)}, ""label"": ""Z""},
+                   {""coeff"": {""imag"": 0.0, ""real"": 0.5 * (E_1 + E_2)}, ""label"": ""I""}
+                   ]
+    }
+    return WeightedPauliOperator.from_dict(pauli_dict)
+
+
+E_1, E_2 = (random(), random())
+print(""We want to estimate E_2 = {}"".format(E_2))
+
+H = simple_hamiltonian_operator(E_1, E_2)
+print(""The Hamiltonian in matrix form:"")
+print(to_matrix_operator(H).dense_matrix)
+
+t = 1
+H_circuit = H.evolve(evo_time=t, quantum_registers=q)
+H_circuit.data.__delitem__(-1) # deleting a barrier at the end of circuit
+
+# control version of the circuit
+control_H = get_controlled_circuit(H_circuit, a[0])
+
+num_bits_estimate = 10
+phase = 0
+for k_precision in reversed(range(num_bits_estimate)):
+    # Create a Quantum Circuit acting on the q register
+    k_circ = QuantumCircuit(q, a, c)
+
+    # (1) |1> eigenstate initialization
+    k_circ.x(q[0])
+
+    # (2) Initial Hadamard gate applied on ancillary qubit.
+    k_circ.h(a[0])
+
+    # (3) The control Hamiltonian applied on the qubits where control qubit is the ancillary qubit.
+    for order in range(2 ** k_precision):
+        k_circ += control_H
+
+    # (4) The phase gate and final Hadamard gate on ancillary qubit.
+    phase_shift = 2 * np.pi * phase * 2 ** k_precision
+    k_circ.u1(-phase_shift, a[0])
+    k_circ.h(a[0])
+
+    # (5) Measurement of ancillary qubit (findig the bit)
+    k_circ.measure(a[0], c[0])
+
+    # (6) executing on Quantum Computer and finding a bit from the phase
+    job = execute(k_circ, backend, shots=1000)
+    result = job.result()
+    counts = result.get_counts()
+    value = int(max(counts, key=counts.get))
+
+    # (7) phase after this iteration
+    phase += value / 2 ** (k_precision + 1)
+
+# obtaining E_2 from the estimated phase
+if E_2 > E_1:
+    eigenvalue = 2 * np.pi * (1 - phase) / t
+else:
+    eigenvalue = -2 * np.pi * phase / t
+
+print(""Eigenvalue of Hamiltonian that we want to estimate: E_2 = "" + str(E_2))
+print(""Meanwhile, E_2 - E_1 = {}"".format(E_2 - E_1))
+print(""Estimated eigenvalue of Hamiltonian: "" + str(eigenvalue))
+
+",9459,,9006,,12/15/2019 9:36,12/15/2019 9:36,A question about qiskit's WeightedPauliOperator.evolve method for IPEA (IQPE) implementation,,0,0,,,,CC BY-SA 4.0 +9180,1,,,12/12/2019 17:21,,4,566,"

I'm working on a teleport protocol and I need to open the matrix of each operator, however, there's a CZ gate between q0 and q2 at the end of it and I don't know how to write the matrix for it and operate in the state. +

+

This is the protocol, really basic, and the CZ is the last one.

+",9461,,-1,,6/18/2020 8:31,12/14/2019 19:39,How do I write the matrix for a CZ gate operating on nonadjacent qubits?,,3,0,,,,CC BY-SA 4.0 +9181,1,9182,,12/12/2019 19:10,,5,478,"

Suppose I had 3 entangled qubits and I wanted to apply a SWAP gate on the first and third qubit.

+ +

Because it's entangled I can't decompose it into individual states, and because the qubits are not adjacent I can't simply take a Kronecker product with an identity matrix.

+ +

How would I go about creating the matrix for applying this transformation? Also is there a generalization for swapping 2 arbitrary qubits in an n qubit system?

+",9390,,55,,4/29/2020 13:23,5/30/2021 15:39,SWAP gate on 2 qubits in 3 entangled qubit system,,2,0,,,,CC BY-SA 4.0 +9182,2,,9181,12/12/2019 20:28,,6,,"

Gates don't depend on states they act on. So it doesn't matter if the state is entangled or not. The gate you've described (let's call it $U$) acts on a standard basis by this rules +$$ +U |0x0\rangle = |0x0\rangle +$$ +$$ +U |0x1\rangle = |1x0\rangle +$$ +$$ +U |1x0\rangle = |0x1\rangle +$$ +$$ +U |1x1\rangle = |1x1\rangle +$$ +for each $x=0$ and $x=1$.

+ +

You can write this matrix as +$$ +U=\sum_{x=0}^1 \big(|0x0\rangle\langle 0x0 |+|1x0\rangle\langle 0x1 |+|0x1\rangle\langle 1x0 |+|1x1\rangle\langle 1x1 | \big) = +$$ +$$ += |0\rangle\langle 0| \otimes I \otimes |0\rangle\langle 0| + |1\rangle\langle 0| \otimes I \otimes |0\rangle\langle 1| + |0\rangle\langle 1| \otimes I \otimes |1\rangle\langle 0| + |1\rangle\langle 1| \otimes I \otimes |1\rangle\langle 1| +$$

+",5870,,5870,,12/12/2019 20:39,12/12/2019 20:39,,,,0,,,,CC BY-SA 4.0 +9183,2,,23,12/12/2019 20:45,,2,,"

Yes, a classical computer can simulate a quantum computer in terms of computational efficiency but it would be limited up to 23 qubits till 2005-2006 using IBM Bluegene supercomputer cluster at Forschungszentrum Juelich in Germany. However, the latest update as per 2017 is a world record of 46 qubits.

+ +

World Record: Quantum Computer with 46 Qubits simulated

+ +

Jülich, 15 December - Scientists from the Jülich Supercomputing Centre have set a new world record. Together with researchers from Wuhan University and the University of Groningen, they successfully simulated a quantum computer with 46 quantum bits – or qubits – for the first time. For their calculations, the scientists used the Jülich supercomputer JUQUEEN as well as the world’s fastest supercomputer Sunway TaihuLight at China’s National Supercomputing Center in Wuxi.

+",9302,,,,,12/12/2019 20:45,,,,0,,,,CC BY-SA 4.0 +9184,2,,9180,12/12/2019 21:01,,1,,"

What you need is:

+ +
    +
  1. SWAP q[1] and q[2]
  2. +
  3. Do CZ on q[0] and q[1] (note that we have q[2] in it right now)
  4. +
  5. SWAP q[1] and q[2]
  6. +
+ +

In terms of matrices, all you need is to multiply 3 8x8 matrices.

+ +

Hope it will help.

+",9424,,,,,12/12/2019 21:01,,,,0,,,,CC BY-SA 4.0 +9185,2,,9180,12/12/2019 21:52,,6,,"

Consider that a control qubit is $q_k$ and a target qubit is $q_{k+n}$ and you want to apply operator $U$ on the target qubit. Denote $N=2^{n+1}$. Then matrix representation of this controlled $U$ is +\begin{equation} +CU= +\begin{pmatrix} +I_{\frac{N}{2}} & O_{\frac{N}{2}} \\ +O_{\frac{N}{2}} & I_{\frac{N}{4}} \otimes U \\ +\end{pmatrix} +\end{equation}

+ +

In your case $U=Z=\begin{pmatrix}1 & 0 \\ 0 & -1\end{pmatrix}$, $k=0$ and $n=2$, so the matrix representation of operator $Z$ acting on $q_{2}$ controlled by $q_{0}$ is

+ +

\begin{equation} +\begin{pmatrix} +1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & -1 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 \\ +\end{pmatrix} +\end{equation}

+",9006,,,,,12/12/2019 21:52,,,,0,,,,CC BY-SA 4.0 +9186,1,,,12/12/2019 22:12,,3,28,"

Unification https://en.wikipedia.org/wiki/Unification_(computer_science) is the most important algorithm for symbolic computation and automatic theorem proving - essentially - it allows to find the candidate formulas that can be used for performing the next steps of inference (be it resolution in the backward chaining or other algorithms in the forward chaining). My question is - are the quantum algorithms for the unification? Google gives nothing, but I guess that there are algorithms and some perspective but different terms are used and Google can not match such research.

+",1326,,,,,12/12/2019 22:12,Quantum algorithms for the first-order and higher-order unification problem (finding substitution),,0,0,,,,CC BY-SA 4.0 +9187,1,,,12/13/2019 5:36,,1,39,"

I am working on translating a computing method I developed to model complex non-linear systems with classical computational methods into a form that is natural to quantum computing. The technique involves creating probability filters as data in order to describe the desired solution. Encoding data and program in this manner permits rapidly finding a solution to a complex real-world problem that fits a set of desirable conditions. For example, I have used this methodology to find the most highly probable stock price at a given point in time. Does anyone have any experience they can share in encoding ""non-linear probability logic"" in quantum computational style? I am having trouble finding examples of this kind of computation method.

+",9414,,55,,4/1/2021 14:36,4/1/2021 14:36,Methods for encoding non-linear probabilities as data,,0,0,,,,CC BY-SA 4.0 +9188,2,,9180,12/13/2019 7:13,,3,,"

You can write the controlled-phase gate, as applied to just those two qubits, as +$$ +I\otimes I-2|1\rangle\langle 1|\otimes |1\rangle\langle 1|. +$$ +If you want these to act on qubits 1 and 3, then you need to apply identity, $I$, on the second qubit: +$$ +I\otimes I\otimes I-2|1\rangle\langle 1|\otimes I\otimes |1\rangle\langle 1|. +$$

+",1837,,,,,12/13/2019 7:13,,,,0,,,,CC BY-SA 4.0 +9189,2,,9175,12/13/2019 12:45,,2,,"

I think this circuit performed by generators $Z_1Z_2$ and $Z_1Z_3$ works.

+ +

+ +

When $|\psi\rangle=|0\rangle$, it can have the logical state $|000\rangle$; and when $|\psi\rangle=|1\rangle$ the logical state is $|111\rangle$.

+",9275,,,,,12/13/2019 12:45,,,,0,,,,CC BY-SA 4.0 +9190,1,9193,,12/13/2019 13:04,,6,648,"

I realized that QASM supports custom gates. However, when I tried to create the gate, transpiling error appeared both on simulator and real quantum processor. I suspect that IBM has not implemented this functionality fully yet.

+ +

Does anybody (maybe from IBM) know when IBM will provide users with possibility to use custom gates?

+",9006,,9006,,12/13/2019 22:34,2/22/2022 17:59,Custom gates on IBM Q,,2,6,,,,CC BY-SA 4.0 +9191,2,,9172,12/13/2019 13:46,,3,,"

Before starting, I should probably emphasise that, although useful for the practice of working through the maths of quantum error correction on a relatively simple case, amplitude damping combined with the repetition code is a really bad thing to be thinking about. This is because, if there's an error, and they you apply a syndrome measurement, so that you detect there's one bit that is different from the other two, then you know that your initial state was $|111\rangle$ and not $|000\rangle$ because under amplitude damping noise, $|000\rangle$ never changes. This means that your syndrome measurement, if it detects an error, constitutes a measurement on your encoded qubit. It destroys any of the coherence you were trying to protect!

+ +
    +
  1. Because of the issue described above, this question doesn't make the sort of sense you'd like it to. However, remember that there are measurements going on. When you measure, you get a probability of getting a given outcome, and the output state is renormalised. At this point, it is usually the probability of success that is evaluated (sum of the probabilities for measurement outcomes which are successful in correcting the error) rather than a fidelity.

  2. +
  3. How you perform the measurement has nothing to do with the state. Perhaps you feel unfamiliar with the formalism because it's applied to a density matrix rather than a pure state. Still, it's a sequence of applying unitaries ($\rho\mapsto U\rho U^\dagger$) and projections (probability $p_i=\text{Tr}(P_i\rho)$ and output state $P_i\rho P_i/p_i$).

  4. +
  5. It's not the issue that the errors could apply to all 5 qubits that's the problem. You should still think about these errors as an independent probability $r$ of the amplitude damping error acting on each qubit (if it's in the $|1\rangle$ state) and $(1-r)$ of not happening. So, there's a case of no error with probability $(1-r)^5$ and 5 cases of just one error happening, each of probability $r(1-r)^4$. All of these are cases that can be corrected by the 5-qubit code. So, the idea is that provided $(1-r)^5+5r(1-r)^4>(1-r)$, it is less likely that there's a error on the logically encoded qubit than there would have been on a single qubit with no encoding. That makes it a worthwhile procedure.

  6. +
+",1837,,,,,12/13/2019 13:46,,,,2,,,,CC BY-SA 4.0 +9192,1,9194,,12/13/2019 14:40,,5,266,"

With reference to question on how to do quantum tomography on two qubits, I would like to ask you for help again. I tried to do the tomography on state

+ +

\begin{equation}\psi=\frac{1}{2}\begin{pmatrix}1 \\ i \\-1 \\-i\end{pmatrix}\end{equation}

+ +

This state can be prepared by application of $HX$ on first qubit and $SH$ on second one, both qubits were in state $|0\rangle$ at the beginning.

+ +

To do measurement of the state by the tomography, I evaluated eigenvectors of all observables present in two qubits tomogaphy and created measuring circuits.

+ +

Here is a list of observables, their eigenvectors and respective eigenvalues (please note that I omitted normalization in majority of cases because of simplicity):

+ +
    +
  • Observable $X\otimes X$: + +
      +
    • $-1$: $\begin{pmatrix}0 & 1 & -1 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}1 & 0 & 0 & -1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 0 & 0 & 1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 1 & 1 & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $Y\otimes Y$: + +
      +
    • $-1$: $\begin{pmatrix}0 & 1 & -1 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}1 & 0 & 0 & 1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 0 & 0 & -1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 1 & 1 & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $Z\otimes Z$: + +
      +
    • $-1$: $\begin{pmatrix}0 & 1 & 0 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 0 & 1 & 0\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 0 & 0 & 0\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 0 & 0 & 1\end{pmatrix}^T$
    • +
  • +
  • Observable $X\otimes Y$: + +
      +
    • $-1$: $\begin{pmatrix}0 & 1 & i & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}1 & 0 & 0 & -i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 0 & 0 & i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 1 & -i & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $X\otimes Z$: + +
      +
    • $-1$: $\begin{pmatrix}1 & 0 & -1 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 1 & 0 & 1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 1 & 0 & -1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 0 & 1 & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $Y\otimes X$: + +
      +
    • $-1$: $\begin{pmatrix}0 & 1 & -i & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}1 & 0 & 0 & -i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 0 & 0 & i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 1 & i & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $Y\otimes Z$: + +
      +
    • $-1$: $\begin{pmatrix}1 & 0 & -i & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 1 & 0 & i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 1 & 0 & -i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 0 & i & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $Z\otimes X$: + +
      +
    • $-1$: $\begin{pmatrix}1 & -1 & 0 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 0 & 1 & 1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 0 & 1 & -1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 1 & 0 & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $Z\otimes Y$: + +
      +
    • $-1$: $\begin{pmatrix}1 & -i & 0 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 0 & 1 & i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 0 & 1 & -i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & i & 0 & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $I\otimes X$: + +
      +
    • $-1$: $\begin{pmatrix}1 & -1 & 0 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 0 & 1 & -1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 0 & 1 & 1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 1 & 0 & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $I\otimes Y$: + +
      +
    • $-1$: $\begin{pmatrix}1 & -i & 0 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 0 & 1 & -i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 0 & 1 & i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & i & 0 & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $I\otimes Z$: + +
      +
    • $-1$: $\begin{pmatrix}0 & 1 & 0 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 0 & 0 & 1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 0 & 1 & 0\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 0 & 0 & 1\end{pmatrix}^T$
    • +
  • +
  • Observable $X\otimes I$: + +
      +
    • $-1$: $\begin{pmatrix}1 & 0 & -1 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 1 & 0 & -1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 1 & 0 & 1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 0 & 1 & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $Y\otimes I$: + +
      +
    • $-1$: $\begin{pmatrix}1 & 0 & -i & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 1 & 0 & -i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 1 & 0 & i\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 0 & i & 0\end{pmatrix}^T$
    • +
  • +
  • Observable $Z\otimes I$: + +
      +
    • $-1$: $\begin{pmatrix}0 & 0 & 1 & 0\end{pmatrix}^T$
    • +
    • $-1$: $\begin{pmatrix}0 & 0 & 0 & 1\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}1 & 0 & 0 & 0\end{pmatrix}^T$
    • +
    • $1$: $\begin{pmatrix}0 & 1 & 0 & 0\end{pmatrix}^T$
    • +
  • +
+ +

Then I realized that basis generated by eigenvectors of observables are repeating (note that I ""invented"" names for some basis for easier referencing further):

+ +
    +
  • z-basis: $Z\otimes Z$, $I\otimes Z$ and $Z\otimes I$
  • +
  • Bell basis: $X\otimes X$ and $Y\otimes Y$
  • +
  • ""Imaginary"" Bell basis: $X\otimes Y$ and $Y\otimes X$
  • +
  • ""A"" basis: $X\otimes Z$ and $X\otimes I$
  • +
  • ""B"" basis: $Y\otimes Z$ and $Y\otimes I$
  • +
  • ""C"" basis: $Z\otimes X$ and $I\otimes X$
  • +
  • ""D"" basis: $Z\otimes Y$ and $I\otimes Y$
  • +
+ +

After that I created for each basis a circuit for measuring in the basis, or in other words the circuit for converting basis states to z-basis ones. These circuits are here:

+ +

Bell basis +

+ +

Imaginary Bell basis +

+ +

A basis +

+ +

B basis +

+ +

C basis +

+ +

D basis +

+ +

Having this I created a map between basis states and z-basis and assigned each state in z-basis either value -1 or 1 in the following way

+ +

\begin{matrix} +\mathrm{observable} & -1 & 1\\ +X\otimes X & |11\rangle, |10\rangle & |00\rangle, |01\rangle\\ +Y\otimes Y & |11\rangle, |00\rangle & |10\rangle, |01\rangle\\ +Z\otimes Z & |01\rangle, |10\rangle & |00\rangle, |11\rangle\\ +X\otimes Y & |01\rangle, |10\rangle & |00\rangle, |11\rangle\\ +X\otimes Z & |10\rangle, |11\rangle & |01\rangle, |00\rangle\\ +Y\otimes X & |11\rangle, |10\rangle & |00\rangle, |01\rangle\\ +Y\otimes Z & |10\rangle, |11\rangle & |01\rangle, |00\rangle\\ +Z\otimes X & |10\rangle, |11\rangle & |01\rangle, |00\rangle\\ +Z\otimes Y & |10\rangle, |11\rangle & |01\rangle, |00\rangle\\ +I\otimes X & |10\rangle, |01\rangle & |11\rangle, |10\rangle\\ +I\otimes Y & |10\rangle, |01\rangle & |11\rangle, |00\rangle\\ +I\otimes Z & |01\rangle, |11\rangle & |10\rangle, |00\rangle\\ +X\otimes I & |10\rangle, |01\rangle & |00\rangle, |11\rangle\\ +Y\otimes I & |10\rangle, |01\rangle & |11\rangle, |00\rangle\\ +Z\otimes I & |10\rangle, |11\rangle & |00\rangle, |01\rangle\\ +\end{matrix}

+ +

When I calculated a density operator estimation and did spectral decomposition of that I really obtained state $\psi$ among eigenstates and its respective eigenvalue was the highest one. However, there was also one negative eigenvalue. So, as the density operator is a positive one, it seems that there is some mistake in my calculation.

+ +

To sum it all up:

+ +
    +
  1. I calculated eigenvalues and eigenvectors of all observables
  2. +
  3. I created circuits for measuring a quantum state in bases given by eigenvectors obtained in the first step
  4. +
  5. I assigned each eigenvector its ""mirror"" in z-basis after measuring by circuits from step 2
  6. +
  7. I prepared state $\psi$
  8. +
  9. I did a measurement of state $\psi$ in all bases obtained in step 1 with help of circuits from step 2
  10. +
  11. Based on measured probabilities, I calculated estimation of $\mathrm{Tr}(A\rho)$, where $A$ is an observable
  12. +
  13. Then, I calculated estimation of density operator $\rho$
  14. +
  15. Finnaly, I found eigenvalues and eigenvector of $\rho$. State $\psi$ should be one of eigenvectors, its respective eigenvalue should be close to 1 as pure state $\psi$ was measured.
  16. +
+ +

I did all calculations in MatLab and I used matrix representation of quantum gates to simulate both state preparation and measurement in different bases, so the calculations are exact and there is no noise.

+ +

My question: is my above described approach right?

+ +

I really appreciate any help. Thank you in advance.

+",9006,,9006,,12/13/2019 23:04,12/13/2019 23:04,Problem with quantum tomography on two qubits,,1,5,,,,CC BY-SA 4.0 +9193,2,,9190,12/13/2019 15:34,,8,,"

This is possible by using Composite Gates in Qiskit. With composite gates, you can create a circuit of gates, turn that circuit into an Instruction, and attach it to a new circuit which will perform the gates that were within your old circuit. Here is an example:

+ +
from qiskit import QuantumCircuit
+
+qc = QuantumCircuit(2, name='bell')
+qc.h(0)
+qc.cx(0, 1)
+custom_gate = qc.to_instruction()
+
+new_circ = QuantumCircuit(2)
+
+# Append custom gate. The parameters are the Instruction you made, and the qubits you will use with it
+new_circ.append(custom_gate, [0, 1])
+
+print(new_circ)
+
+'''
+This is the output
+        ┌───────┐
+q_0: |0>┤0      ├
+        │  bell │
+q_1: |0>┤1      ├
+        └───────┘
+'''
+
+ +

The to_instruction() method from QuantumCircuit turns your circuit into an instruction which can then be appended to another circuit in the future. It appears as a single gate on the new circuit, which you can name to make it more organized. When the new circuit is executed, it will run this composite gate, which will make it run through the bell state code we set earlier.

+ +

For more information about composite gates, you can go to this tutorial and scroll down to the ""Composite Gates"" section

+",6180,,,,,12/13/2019 15:34,,,,1,,,,CC BY-SA 4.0 +9194,2,,9192,12/13/2019 15:53,,3,,"

I find it a little tough to understand your calculations directly. I am especially confused by the circuit diagrams in your question; why they are there and what you are using them for.

+

If you are performing calculations on theoretical data (without noise), then I feel you can make do with an easier approach for quantum state tomography. As per my answer on your previous question (that you linked to in this question), the idea behind QST is to reconstruct a unknown state $\rho$ from the expectation values of a set of measurement observables.

+
+

When I calculated a density operator estimation and did spectral decomposition of that I really obtained state ψ among eigenstates and its respective eigenvalue was the highest one. However, there was also one negative eigenvalue. So, as the density operator is a positive one, it seems that there is some mistake in my calculation.

+
+

What exactly do you mean by 'I really obtained the state $\psi$ among eigenstates (of what?) and its respective eigenvalue was the highest one (among whose)?

+

Do you mean that the estimated density operator that you obtained had more than one nonzero eigenvalues? If you are just performing exact calculations with matrices, this should not be the case. (If you are incorporating statistical noise into your calculations then this will definitely happen).

+

Negative eigenvalues can occur in your estimation of the density matrix if there is statistical noise. This will occur in actual experiments, so people have been addressing it for quite some time now. This paper offers a way of combating negative eigenvalues.

+

Now, if you are performing your calculations solely on pure states $\rho = |\psi\rangle\langle\psi|$ and if you are calculating the expectation value for an observable $M$ as:

+

\begin{equation} +\langle M\rangle = \rm{Tr}\big[M\rho\big] = \langle\psi|M|\psi\rangle, +\end{equation}

+

then reconstructing $\rho$ via the equation +\begin{equation} +\hat{\rho}= \sum_{P_{i}\in\mathcal{P}^{2}}\rm{Tr}\big[P_{i}\rho\big]P_{i}, +\end{equation}

+

with $\mathcal{P}^{2}$ the two-qubit Pauli group, +should be a perfect reconstruction and therefore give only one nonzero eigenvalue. So then it would indicate an error in your calculations.

+

If you can add some information on how exactly you are performing these calculations (are you doing them by hand, by code, are you actually simulating the quantum circuits etc.) then I might be able to help more. Please feel free to contact me directly.

+",8141,,-1,,6/18/2020 8:31,12/13/2019 15:53,,,,4,,,,CC BY-SA 4.0 +9195,1,9196,,12/13/2019 19:58,,1,926,"

Below is the code that I am trying to execute on Google Colab using Qiskit. +I'll also paste the error that I am getting.

+ +

Code

+ + + +
backend = Aer.get_backend('qasm_simulator')
+# create Quantum Register called ""qr"" with 4 qubits
+qr = QuantumRegister(4, name=""qr"")
+# create Quantum Register called ""cr"" with 4 qubits
+cr = ClassicalRegister(4, name=""cr"")
+# Creating Quantum Circuit called ""qc"" involving your Quantum Register ""qr""
+# and your Classical Register ""cr""
+qc = QuantumCircuit(qr, cr, name=""solve_linear_sys"")        
+
+# Initialize times that we get the result vector 
+n0 = 0
+n1 = 0
+
+for i in range(10):
+    #Set the input|b> state""
+    qc.x(qr[2])
+
+    #Set the phase estimation circuit
+    qc.h(qr[0])
+    qc.h(qr[1]) 
+    qc.u1(pi, qr[0])
+    qc.u1(pi/2, qr[1])
+    qc.cx(qr[1], qr[2])
+
+    #The quantum inverse  Fourier transform 
+    qc.h(qr[0])
+    qc.cu1(-pi/2, qr[0], qr[1])
+    qc.h(qr[1])
+
+    #R(lamda^-1) Rotation
+    qc.x(qr[1])
+    qc.cu3(pi/16, 0, 0, qr[0], qr[3])
+    qc.cu3(pi/8, 0, 0, qr[1], qr[3])   
+
+    #Uncomputation
+    qc.x(qr[1])
+    qc.h(qr[1])
+    qc.cu1(pi/2, qr[0], qr[1])
+    qc.h(qr[0])
+
+    qc.cx(qr[1], qr[2])
+    qc.u1(-pi/2, qr[1])
+    qc.u1(-pi, qr[0])
+
+    qc.h(qr[1]) 
+    qc.h(qr[0])
+
+    # To measure the whole quantum register
+    qc.measure(qr[0], cr[0])
+    qc.measure(qr[1], cr[1])
+    qc.measure(qr[2], cr[2])
+    qc.measure(qr[3], cr[3])
+
+    job = execute(qc, backend=backend, shots=8192,)
+    result = job.result()
+
+    # Get the sum og all results
+    n0 = n0 + result.get_data(""solve_linear_sys"")['counts']['1000']
+    n1 = n1 + result.get_data(""solve_linear_sys"")['counts']['1100']
+
+    # print the result
+    print(result)
+#     print(result.get_data(qc))
+    plot_histogram(result.get_counts())
+
+
+#     Reset the circuit
+    qc.reset(qr)
+
+    # calculate the scale of the elements in result vectot and print it.
+    p = n0/n1
+    print(n0)
+    print(n1)
+    print(p)
+
+ +

Error

+ +
AttributeError                            Traceback (most recent call last)
+<ipython-input-15-0331fdb77f03> in <module>()
+     54 
+     55     # Get the sum og all results
+---> 56     n0 = n0 + result.get_data(""solve_linear_sys"")['counts']['1000']
+     57     n1 = n1 + result.get_data(""solve_linear_sys"")['counts']['1100']
+     58 
+
+AttributeError: 'Result' object has no attribute 'get_data'
+
+ +

Has the item get_data been removed?

+",8330,,26,,12/15/2019 15:23,12/15/2019 15:23,AttributeError: 'Result' object has no attribute 'get_data',,1,0,,,,CC BY-SA 4.0 +9196,2,,9195,12/13/2019 20:52,,3,,"

I believe result.get_data() was renamed to just result.data()

+ +

Here is the source code for the method

+",6180,,,,,12/13/2019 20:52,,,,1,,,,CC BY-SA 4.0 +9198,2,,9168,12/14/2019 8:45,,0,,"

Yes, you can in principle spy on a computation - albeit using more subtle/gentle methods than entangling everything -, but you can prevent it.

+ +

The setting is that of a client who whishes to perform a computation on a server. If nothing specific is done, the server will know the computation being performed (ie the algorithm) because you will send a sequence of commands to it. It might also spy on you data (easy if the information is classical, harder if it is quantum, but not impossible).

+ +

So basically, delegated quantum computation is not blind to a malicious server.

+ +

But you can prevent it using blind delegated quantum computing schemes. These schemes use measurement based calculus to prevent the server from learning anything from the algorithm being done and the data it ia applied to - except the length of the compuation and the size of data. One scheme for doing so is BFK09 https://arxiv.org/abs/0807.4154

+ +

You can improve on this result by adding verification. That is you prevent a malicious server to fiddle with the compuation as you verify it is doing the right job (in case he doesn't comply with your instructions, you'll catch him with high probability).

+",9393,,9393,,12/14/2019 21:48,12/14/2019 21:48,,,,0,,,,CC BY-SA 4.0 +9199,1,,,12/14/2019 13:03,,2,748,"

A physical qubit, for example, an electron with energy level (ground state and excited state) represents a simple quantum system. I was curious whether a physical system is a basis for +mathematically representing qubit in 2D space?

+ +

Why not a qubit state be in 3D Hilbert space? Is there a mathematical formulation for this even though an equivalent quantum system doesn't exist?

+ +

Note: I don't have a formal background in physics or mathematics, this question came to mind when I started reading about quantum computation.

+",8697,,26,,12/15/2019 1:24,12/15/2019 1:24,Why a single qubit is a state in 2D Hilbert space and not 3D or higher?,,1,5,,,,CC BY-SA 4.0 +9200,2,,9199,12/14/2019 14:22,,4,,"

A two-dimensional Hilbert space is very different from two spatial dimensions. In particular, two spatial directions (up/down and left/right) are described by two real parameters. A two-dimensional Hilbert space corresponds to two complex parameters, i.e. 4 real parameters. That said, quantum states have a constraint (normalisation) which means that there are effectively only three relevant parameters. This is why, if we want to visualise a qubit, we use something called the Bloch sphere in three spatial dimensions.

+",1837,,,,,12/14/2019 14:22,,,,3,,,,CC BY-SA 4.0 +9201,1,,,12/14/2019 15:42,,3,602,"

For IBMQ device based on superconducting technology, when we transpile the circuit, it is decomposed of U1,U2,U3 and CNOT gates, which are its native gates. +However for trapped ion device, its native gates are rx,ry,rxx and ms gate. +Why do the 2 technologies choose different native gates?

+",9105,,26,,12/14/2019 16:40,12/14/2019 16:40,Why qiskit superconducting device native gates different from that of trapped ion device?,,1,2,,,,CC BY-SA 4.0 +9202,2,,9201,12/14/2019 16:37,,5,,"

The choice of gates is entirely dependent on the types of interactions that occur in the different architectures. The cross resonance gate used by IBM generates the ZX interaction you want (plus other stuff) that leads to a CNOT. Trapped ions have XX type interactions that give rise to Molmer Sorensen gates. For single qubit gates it depends on what driving terms you have available to rotate your qubits on the Bloch sphere. The U gates on IBM devices are just combinations of X(pi/2) pulses and Z rotations that get done in software. So the only drive channel one needs is an X drive.

+",332,,,,,12/14/2019 16:37,,,,1,,,,CC BY-SA 4.0 +9203,2,,6722,12/14/2019 16:41,,1,,"

The device is currently undergoing planned maintenance to update the control electronics.

+",332,,,,,12/14/2019 16:41,,,,0,,,,CC BY-SA 4.0 +9204,1,9216,,12/14/2019 18:31,,40,13489,"

According to the New Scientist News, the Zapata team is able to factor 1,099,551,473,989 into its factors 1,048,589 and 1,048,601.

+

According to the New Scientist:

+
+

A quantum computing start-up company called Zapata has worked with IBM to develop a new way to factor large numbers, using it on the largest number that has been factored with a quantum computer so far...

+

The future success of the algorithm used could have big implications

+
+
    +
  • What is this new algorithm?
  • +
  • How many q-bits are required to factor 1,099,551,473,989?
  • +
+",4866,,-1,,6/18/2020 8:31,12/17/2019 14:07,"The algorithm of the new quantum factoring record 1,099,551,473,989",,3,1,,,,CC BY-SA 4.0 +9205,1,9208,,12/14/2019 18:36,,1,363,"

I was checking the limits of shots in IBMQ at the time of execution of the circuit so I was getting this error message Job Status: job incurred error at shots = 9000 what does it mean is there any limit at the no. of shots or it just some module failure

+",8527,,26,,12/14/2019 19:45,12/15/2019 1:15,Job Status: job incurred error,,1,1,,,,CC BY-SA 4.0 +9206,2,,9204,12/14/2019 18:50,,12,,"
+

What is this new algorithm?

+
+ +

It's the Variational Quantum Factoring algorithm that the team put up on arXiv last year.

+ +
+

How many q-bits are required to factor 1,099,551,473,989?

+
+ +

Doesn't seem like they've published that yet, but you should be able to estimate the upper bound from FIG. 1 of the paper; the scaling is $\mathcal{O}(n_m)$ when classical preprocessing is used.

+ +

+",26,,26,,12/15/2019 1:11,12/15/2019 1:11,,,,3,,,,CC BY-SA 4.0 +9207,2,,9204,12/14/2019 22:29,,12,,"
+

How many q-bits are required to factor 1,099,551,473,989?

+
+ +

They preprocessed down to three qubits.

+ +

+",119,,,,,12/14/2019 22:29,,,,2,,,,CC BY-SA 4.0 +9208,2,,9205,12/15/2019 1:15,,2,,"

The limit for shots on devices is 8192. For simulators it is much higher.

+",332,,,,,12/15/2019 1:15,,,,0,,,,CC BY-SA 4.0 +9209,1,,,12/15/2019 2:54,,2,783,"

I am trying to run multiple circuits in parallel using the documentation here. My codes are:

+ +
from qiskit import QuantumCircuit
+from qiskit.circuit.quantumregister import QuantumRegister
+from qiskit.circuit.classicalregister import ClassicalRegister
+from qiskit import Aer, execute
+from qiskit.providers.aer.backends import QasmSimulator
+
+def apply_measurement(circ):
+    c = ClassicalRegister(len(circ.qubits), 'c')
+    meas = QuantumCircuit(circ.qregs[0], c)
+    meas.barrier(circ.qubits)
+    meas.measure(circ.qubits,c)
+    qc = circ+meas
+    return qc
+
+qr = QuantumRegister(4)
+circ = QuantumCircuit(qr)
+for i in range(4):
+    for j in range(i+1,4):
+        circ.cx(i,j)
+
+qc = apply_measurement(circ)
+circuits = [qc for i in range(3)]
+num_shots = int(1e6)
+
+backend = Aer.get_backend('qasm_simulator')
+backend_options = {'method': 'automatic','max_parallel_threads':1,'max_parallel_experiments':1,'max_parallel_shots':1}
+noiseless_qasm_result = execute(circuits, backend, shots=num_shots, backend_options=backend_options).result()
+print(noiseless_qasm_result)
+
+backend = Aer.get_backend('qasm_simulator')
+backend_options = {'method': 'automatic','max_parallel_threads':1,'max_parallel_experiments':3,'max_parallel_shots':1}
+noiseless_qasm_result = execute(circuits, backend, shots=num_shots, backend_options=backend_options).result()
+print(noiseless_qasm_result)
+
+ +

Where I am running three copies of the same circuit. I did not see any changes in the result object obtained, nor is there any runtime improvement. Both take about 10 seconds. What should be the proper way to run those three circuits in parallel?

+",8950,,,,,12/15/2019 3:36,How to use parallel executions of circuits?,,1,0,,,,CC BY-SA 4.0 +9210,2,,9209,12/15/2019 3:36,,2,,"

Try changing your max_parallel_threads value to more than 1.

+ +

Quoting from the documentation:

+ +
+

max_parallel_threads (int): Sets the maximum number of CPU cores + used by OpenMP for parallelization. If set to 0 the maximum will be + set to the number of CPU cores (Default: 0).

+ +

max_parallel_experiments (int): Sets the maximum number of qobj + experiments that may be executed in parallel up to the + max_parallel_threads value. If set to 1 parallel circuit execution + will be disabled. If set to 0 the maximum will be automatically set to + max_parallel_threads (Default: 1).

+
+",8852,,,,,12/15/2019 3:36,,,,4,,,,CC BY-SA 4.0 +9213,1,,,12/15/2019 5:34,,2,200,"

Do quantum gates rotate a qubit around the Bloch sphere?

+

Or do quantum gates rotate the Bloch sphere around a qubit?

+

"The simplest quantum gates are the Paulis: X, Y, and Z. Their action is to perform a half rotation of the Bloch sphere around the x, y, and z axes."

+

What does this mean?

+",8491,,13968,,12/15/2021 10:13,12/15/2021 10:13,"Do quantum gates rotate a qubit around the Bloch sphere, or do quantum gates rotate the Bloch sphere around a qubit?",,2,0,,,,CC BY-SA 4.0 +9214,2,,9213,12/15/2019 5:57,,1,,"

Bloch sphere represent states of a qubit. Rotating Bloch sphere means rotating (states of) qubit.

+",2105,,,,,12/15/2019 5:57,,,,0,,,,CC BY-SA 4.0 +9216,2,,9204,12/15/2019 9:31,,42,,"

The claimed new quantum factoring record is $n=a(a+b)$ with $a=1048589=2^{20}+13$ and $b=12$. It could well be that the form $n=a(a+b)$ with $0\le b\le12$ (or other small upper bound for $b$) defines all the sizable numbers the new record-claiming method can factor (with the indicated $3$ qubits on the hardware at hand and the ∼30% success rate, based on the picture in that answer). Such $n$ are scarce: their proportion near $n$ thins out as $6.5/\sqrt n+\mathcal o(1/\sqrt n)$ [*]. The method lacks generality.

+ +

Further, the factor $a$ of such $n$ is effortlessly found using Fermat's factorization method (exposed in a fragment of letter likely to Mersenne circa 1643). If $n=a(a+b)$ with $0\le b\le2\sqrt a$ (a much larger class of integers), only the first step of Fermat's factoring is required (for all except very small $n$): compute $r=\bigl\lceil\sqrt{4n}\,\bigr\rceil$, then $a=(r-\sqrt{r^2-4n})/2$. That's enough to factor 1099551473989 by hand.

+ +

The picture and that other answer refer to Eric R. Anschuetz, Jonathan P. Olson, Alán Aspuru-Guzik, Yudong Cao's Variational Quantum Factoring (arXiv:808.08927, Aug 2018). That reduces factorization to a combinatorial problem with number of unknowns proportional to the bit length of the factors. I find nothing suggesting the preprocessing makes that sublinear in the general case, and conclude that Variational Quantum Factoring is exponential in the bit length of $n$, thus essentially pointless since we have sub-exponential algorithms for factorization on classical computers.

+ +

Similar stunts of stretching to artificially large numbers what an experimental setup allows have already been pulled. Take the record of 143=11×13 by Nanyang Xu, Jing Zhu, Dawei Lu, Xianyi Zhou, Xinhua Peng, and Jiangfeng Du in Quantum Factorization of 143 on a Dipolar-Coupling Nuclear Magnetic Resonance System (Physical Review Letters, 2012). Their experimental technique factors an integer product of two odd exactly-4-bit integers (thus with two unknown bits per factor). The scarcity of primes in range [8,15] makes 143 the only product of two distinct primes that the technique can factor. Their experimental setup iteratively minimizes a function with a 2-bit input. This achievement (I'm not joking up to this point) has been stretched, without new experiment AFAIK, to:

+ +
    +
  • 56153=233×241 by Nikesh S. Dattani and Nathaniel Bryans, Quantum factorization of 56153 with only 4 qubits (arXiv:1411.6758, 2014)
  • +
  • 4088459=2017×2027, by Avinash Dash, Deepankar Sarmah, Bikash K. Behera, and Prasanta K. Panigrahi, Exact search algorithm to factorize large biprimes and a triprime on IBM quantum computer (arXiv:1805.10478, May 2018)
  • +
  • 383123885216472214589586724601136274484797633168671371=618970019642690137449562081×618970019642690137449562091 by myself (crypto.SE, June 2018), using the technique of the above paper.
  • +
+ +
+ +

[*] Proof: for each $a$, there are $13$ values of $b$ leading to $13$ values of $n$ of the form $n=a(a+b)$ with $0\le b\le12$. For large enough $a$ there are no two $(a,b)$ leading to the same $n$[#]. When we increase $n$ by $1$, $n^2$ increases by $2n+1$. Taking the inverse, the density of squares near large $n$ is $\displaystyle\frac1{2\sqrt n}+\mathcal o(\sqrt n)$. Thus the density of $n$ of the form $a(a+b)$ with $0\le b\le12$ is $\displaystyle\frac{13}{2\sqrt n}+\mathcal o(1/\sqrt n)$.

+ +

[#] Auxiliary proof: Assume $a(a+b)=a'(a'+b')$ with $0\le b\le12$ and $0\le b'\le12$. Let $c=2a-b$ and $c'=2a'-b'$. It comes $(c-b)(c+b)/4=(c'-b')(c'+b')/4$, thus $c^2-b^2=c'^2-b'^2$, thus $c^2-c'^2=b^2-b'^2$, thus $|(c-c')(c+c')|\le144$, thus for $c\ge72$ and $c'\ge72$ the only solution is $c=c'$, hence $b=b'$. Thus for $a\ge42$ and $a'\ge42$ the only solution is $a=a'$ and $b=b'$. The bound on $a$ can be further lowered.

+",2545,,2545,,12/17/2019 6:34,12/17/2019 6:34,,,,5,,,,CC BY-SA 4.0 +9217,1,9218,,12/15/2019 10:06,,0,747,"

I am new in quantum computing. I was going through the user guide of IBM Q so I was just trying to run the python code they have provided at the end of this page enter link description here while runnig the code this error pop up "" run() got an unexpected keyword argument 'seed' "" I don't know what this 'seed' parameter do please help me to solve this problem.

+ +

In case feeling lazy to find the code in given link I have put the code blow

+ +
 # example_u3.py
+import numpy as np
+import matplotlib.pyplot as plt
+
+from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer
+
+# Define the Quantum and Classical Registers
+q = QuantumRegister(1)
+c = ClassicalRegister(1)
+
+# Build the circuits
+circuits = []
+middle = QuantumCircuit(q, c)
+meas = QuantumCircuit(q, c)
+meas.barrier()
+meas.measure(q, c)
+exp_vector = range(0,50)
+exp_theta = []
+theta = 0.0
+for exp_index in exp_vector:
+    delta_theta = 2*np.pi/len(exp_vector)
+    theta = theta + delta_theta
+    exp_theta.append(theta)
+    middle.u3(delta_theta,0,0,q)
+    circuits.append(middle + meas)
+
+# Execute the circuits
+shots = 1024
+job = execute(circuits, backend = Aer.get_backend('qasm_simulator'), shots=shots, seed=8)
+result = job.result()
+
+# Plot the result
+exp_data = []
+exp_error = []
+for exp_index in exp_vector:
+    data = result.get_counts(circuits[exp_index])
+    try:
+        p0 = data['0']/shots
+    except KeyError:
+        p0 = 0
+    exp_data.append(p0)
+    exp_error.append(np.sqrt(p0*(1-p0)/shots))
+
+plt.errorbar(exp_theta, exp_data, exp_error)
+plt.xlabel('theta')
+plt.ylabel('Pr(0)')
+plt.grid(True)
+plt.show()
+
+",8527,,26,,12/15/2019 12:18,12/15/2019 22:45,run() got an unexpected keyword argument 'seed',,1,0,,,,CC BY-SA 4.0 +9218,2,,9217,12/15/2019 10:18,,5,,"

The seed parameter has been split into two parameters - seed_simulator and seed_transplier. These ensure that if you run the simulator or transplier respectively you will recieve the same results every time, which is good for replicability. If this is not a property you need, you can remove this paramter all together so that the line reads

+ +
job = execute(circuits, backend=Aer.get_backend('qasm_simulator'), shots=shots)
+
+",5955,,5955,,12/15/2019 22:45,12/15/2019 22:45,,,,0,,,,CC BY-SA 4.0 +9219,1,9237,,12/15/2019 15:20,,0,310,"

Why doesn't Qiskit visualization work on Python IDLE 3.X like circuits.draw(), plot_histogram() and plot_bloch_vector()? Is there any way to make visualization module work on Python IDLE 3.X?

+",8527,,6180,,12/16/2019 16:26,12/16/2019 23:01,How to use Qiskit visualization in Python IDLE 3.X (Python 3.X 64-bit)?,,1,2,,12/17/2019 21:08,,CC BY-SA 4.0 +9220,1,,,12/15/2019 17:04,,-1,73,"

From my circuits in ibm q the final output is given by only a single qbit Which gives state |ψ⟩

+ +

Tell me a combination of gates to do the following

+ +

If |ψ⟩ = |0⟩ + Then output |0⟩

+ +

If |ψ⟩=α|0⟩+β|1⟩ + Then output |1⟩

+ +

If |ψ⟩=|1⟩ + Then output |1⟩

+",9495,,55,,7/26/2020 18:08,7/26/2020 18:08,Which gate combination should I use?,,2,0,,12/28/2019 18:33,,CC BY-SA 4.0 +9221,2,,9220,12/15/2019 17:46,,0,,"

In first and last case you don't need to apply any gate directly measure the qubit you will get desire answer but in the second case you can't get |1⟩ state because your |ψ⟩ is in superposition of |0⟩, |1⟩. If you try to measure the |ψ⟩ you will get $|0\rangle$ with probability $|\alpha|^2$ and $|1\rangle$ with probability $|\beta|^2$. The code below shows your second case.

+ +
import qiskit as q
+from qiskit.visualization import plot_histogram
+
+circuit = q.QuantumCircuit(2,1) 
+circuit.h(0)
+circuit.measure([0],[0])
+job = execute(circuit, backend = Aer.get_backend('qasm_simulator'), shots=1024)
+result = job.result()
+counts = result.get_counts(circuit)
+print(counts)
+circuit.draw()
+plot_histogram([counts], legend=['Device'])
+
+ +

or you can do it like this with little manipulation.

+ +
import qiskit as q
+from qiskit.visualization import plot_histogram
+
+circuit = q.QuantumCircuit(2,1) 
+circuit.x(0)
+circuit.h(0)
+circuit.h(0)
+circuit.measure([0],[0])
+job = execute(circuit, backend = Aer.get_backend('qasm_simulator'), shots=1024)
+result = job.result()
+counts = result.get_counts(circuit)
+print(counts)
+circuit.draw()
+plot_histogram([counts], legend=['Device'])
+
+",8527,,9006,,12/15/2019 19:35,12/15/2019 19:35,,,,0,,,,CC BY-SA 4.0 +9222,1,,,12/15/2019 18:30,,3,254,"

I take as a starting point Watrous's celebrated paper defining the Quantum Merlin-Arthur (QMA) class. He provides a protocol for Arthur to test whether an element $h$ is not in a group $\mathcal{H}$ with generating set $\langle g_1,g_2,\cdots, g_k\rangle$. Merlin gives Arthur a quantum state $\vert\mathcal{H'}\rangle$ that is alleged to be a pure state corresponding to the uniform superposition over all elements of $\mathcal{H}$:

+ +

$$\vert\mathcal H'\rangle = \frac{1}{\sqrt{|\mathcal H|}}\sum_{a\in + \mathcal{H}} |a\rangle.$$

+ +

However, Arthur must test that Merlin really did provide such a state $\vert\mathcal{H'}\rangle$. He does this by initially performing $j$ iterations of a controlled multiplication of $\vert\mathcal{H'}\rangle$ by elements known to be in $\mathcal{H}$, and testing that the control register reverts back to $\vert 0\rangle$ after Hadamarding. Watrous states that as long as we can post-select upon measuring $0$ in the control register, the state $\vert \mathcal{H'}\rangle$ ""will in fact be changed (by quantum magic!) to one that is invariant under right multiplication by elements in $\mathcal{H}$.""

+ +

According to these notes from O'Donnell, it might suffice to uniformly choose $j$ generators $z_i$ from $\langle g_1,g_2,\cdots, g_k\rangle$. That is, if initially $\vert \mathcal{H'}\rangle=\sum_{g\in\mathcal{G}}a_g\vert g\rangle$, then upon multiplying by $z_1$ and post-selecting $\vert 0\rangle$ on the control register for the first of the $j$ iterations, our state is:

+ +

$$\vert \mathcal{H'}\rangle=\sum_{g\in\mathcal{G}}a_g\vert g\rangle + a_g\vert gz_1\rangle;$$

+ +

upon multiplying by $z_2$ and post-selecting $\vert 0\rangle$ on the control register for the second iteration, our state is:

+ +

$$\vert \mathcal{H'}\rangle=\sum_{g\in\mathcal{G}}a_g\vert g\rangle + a_g\vert gz_1\rangle+a_g\vert gz_2\rangle+a_g\vert gz_1z_2\rangle;$$

+ +

etc.

+ +

Indeed, $\vert \mathcal{H'}\rangle$ may initially correspond to a singleton state such as the state $\vert e \rangle$, where $e$ is the identity of $\mathcal{H}$. Our probability of post-selecting $\vert 0\rangle$ in the control register appears to increase with each iteration - it may start off low, at $\frac{1}{2}$, then with ""quantum magic,"" increase to greater and greater than $\frac{1}{2}$ when $\vert\mathcal{H'}\rangle$ includes most elements of $\mathcal{H}$, then settle close to $1$ when $\vert\mathcal{H'}\rangle$ is finally right-invariant.

+ +

If we did start off with such a singleton state $\vert\mathcal{H'}\rangle=\vert e\rangle$, how many such iterations must we do to be able to post-select a state that is exponentially close to being right-invariant under elements of $\mathcal{H}$, and what is our probability of successfully post-selecting such a state?

+ +

In his wonderful lecture from 2012 at about the 25 minute mark, Watrous proposes that $j$ should be linear or at best quadratic in $\log \Vert \mathcal{H}\Vert$ and mentions that the generators should be ""cube generators"" having nice properties according to computational group theory.

+ +

But in the case of starting off in a singleton state such as $\vert e\rangle$, can we learn anything about the properties of the specific set of generators $\langle g_1,g_2,\cdots, g_k\rangle$ by post-selecting to try and build our own uniform superposition?

+",2927,,2927,,1/23/2020 21:47,8/8/2020 1:40,On the probability of preparing of a uniform superposition by performing a controlled-multiplication and post-selecting $0$,,1,6,,,,CC BY-SA 4.0 +9224,1,9226,,12/15/2019 20:02,,3,637,"

I have tried to plot a histogram for the multiple circuits for the code given below. I think I have done it correctly but don't know why it's not working. Please help me out. If possible please solve it for the Bloch sphere also

+ +
# quantum_phase_bloch.py
+import numpy as np
+from qiskit.visualization import plot_histogram
+from qiskit.tools.monitor import job_monitor
+from matplotlib import style
+from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute, Aer
+from qiskit.tools.visualization import plot_bloch_vector
+
+# Define the Quantum and Classical Registers
+q = QuantumRegister(1)
+c = ClassicalRegister(1)
+
+# Build the circuits
+pre = QuantumCircuit(q, c)
+pre.h(q)
+pre.barrier()
+
+meas_x = QuantumCircuit(q, c)
+meas_x.barrier()
+meas_x.h(q)
+meas_x.measure(q, c)
+
+meas_y = QuantumCircuit(q, c)
+meas_y.barrier()
+meas_y.s(q).inverse()
+meas_y.h(q)
+meas_y.measure(q, c)
+
+meas_z = QuantumCircuit(q, c)
+meas_z.barrier()
+meas_z.measure(q, c)
+
+bloch_vector = ['x', 'y', 'z']
+exp_vector = range(0, 2)
+circuits = []
+print(len(exp_vector))
+for exp_index in exp_vector:
+    middle = QuantumCircuit(q, c)
+    phase = 2*np.pi*exp_index/(len(exp_vector)-1)
+    middle.u1(phase, q)
+    circuits.append(pre + middle + meas_x)
+    circuits.append(pre + middle + meas_y)
+    circuits.append(pre + middle + meas_z)
+print(len(circuits))
+
+# Execute the circuit
+job = execute(circuits, backend = Aer.get_backend('qasm_simulator'), shots=1024)
+result = job.result()
+
+# trying to plot histogram 
+counts = []
+# count = np.zeros([0])
+
+for x in range(len(circuits)):
+#     count[x] = result.get_counts(circuits[x])
+    count = result.get_counts(circuits[x])
+    counts.append(count)
+
+plot_histogram(counts , legend=['1','2','3','4','5','6'])
+print(counts)    
+
+",8527,,26,,12/16/2019 14:12,12/16/2019 14:12,How to plot histogram or Bloch sphere for multiple circuits?,,1,0,,,,CC BY-SA 4.0 +9225,2,,9168,12/15/2019 20:23,,-1,,"

No,It is impossible to copy the quantum information according to No-cloning theorem. If anyone try to copy or measure the states of qubits the previous information will be lost.So no one can spy. This is the backbone of the Quantum-cryptography

+",8527,,8527,,5/9/2020 18:02,5/9/2020 18:02,,,,0,,,,CC BY-SA 4.0 +9226,2,,9224,12/15/2019 22:54,,3,,"

No output shows for your code as you have a line underneath the call to plot_histogram(). This should be the last line of the section in the Jupyter notebook if you would like the image to be displayed.

+ +

I was able to run your code by removing the final line (print(counts)) and it displayed the histogram below. +

+",5955,,,,,12/15/2019 22:54,,,,0,,,,CC BY-SA 4.0 +9227,1,,,12/16/2019 7:55,,0,142,"

I know this forum is for more technical questions...

+ +

As my interest is in music, I was thinking about the nature of analog and digital mediums. And I just thought, for some reason, we have 'Quantum Home Computers', (which I don't know if happens) would we have to encode all existing audio formats? And if for some reason we couldn't, would we need a quantum to digital to analog converter? How would sound work on Quantum Computers?

+ +

Dumb questions, I don't want to waste any of your time with, but how would audio work on quantum computers as a whole?

+",9500,,55,,8/20/2020 8:07,8/20/2020 8:07,Will there be quantum to digital converters in the same way we need digital to analog converters to communicate between the 2 mediums?,,1,0,,,,CC BY-SA 4.0 +9228,2,,9220,12/16/2019 8:38,,3,,"

As you've specified it, given a state $|\psi\rangle$, there is no deterministic strategy that can fulfil all three conditions that you specify.

+ +

However, you imply that what you actually have is a unitary procedure $U$ to create $U|0\rangle=|\psi\rangle$. This means that you can, in fact, do what you ask. It's called amplitude amplification. Basically, the Grover iterator that you need is +$$ +U^\dagger ZUZ, +$$ +where $Z$ is the standard Pauli Z matrix. You haven't specified if $\alpha$ is a known or unknown parameter. If it's known, you just need to run the thing $R$ times where $(2R+1)\theta\approx\pi/2$ and $\sin\theta=\beta$ to at least get close. If you don't know $\alpha$, there's a version of the protocol which includes phase estimation, which helps you do the job.

+",1837,,,,,12/16/2019 8:38,,,,0,,,,CC BY-SA 4.0 +9229,1,,,12/16/2019 15:38,,3,50,"

Different qubit technologies exist and for each, operations are implemented differently. My question is what the typical times are for the standard gates (single qubit rotations, Hadamard, CNOT, T, Toffoli, etc.) for the most common qubit technologies?

+ +

Furthermore, as quantum technology advances, improvements are expected in qubit coherence times among other things. Is there a limit and if so, what is it, on the gate times of above?

+",2005,,,,,12/16/2019 15:38,Gate times for different qubit technologies,,0,1,,,,CC BY-SA 4.0 +9230,1,9232,,12/16/2019 15:56,,3,185,"

Many works on quantum algorithms, including this article, mention

+ +
+

a compiled version of (Shor's factoring) algorithm

+
+ +

What's a compiled quantum algorithm?

+ +

Meta: and is it worth to create a tag for that? I don't have the required rep.

+",2545,,,,,12/16/2019 18:14,What's a compiled quantum algorithm?,,1,1,,,,CC BY-SA 4.0 +9231,1,,,12/16/2019 16:41,,3,151,"

Here are two different IBM quantum online devices,

+ +

+ +

+ +

Both of them have the 5 qubits and the same architectures. +But why do they have different error rate? +What's the different between them?

+",9105,,26,,12/16/2019 18:31,12/16/2019 21:59,"Why IBM devices have the same number of qubit and the same architecture, but the error rates are different?",,2,0,,,,CC BY-SA 4.0 +9232,2,,9230,12/16/2019 17:17,,5,,"

The Nature paper Oversimplifying quantum factoring explains the concept well.

+ +
+

All experimental realizations of Shor’s algorithm to date have relied on a further optimization, that of “compiling” the algorithm. This means employing the observation that different bases $a$ in the modular exponentiation lead to different periods of the function $a^x \bmod N$. Some of the periods are both short and lead to a factorization of the composite $pq$. [arxiv:1301.7007]

+
+ +

For instance, in this paper the authors claim having done the factorization of $21$ using Shor's algorithm. But the catch is that they had to use the fact that $21 = 3 \times 7$ to choose an ""easy"" base $a$. So it's not factorization of $21$ in the true sense; they only verified the factors. Thus, the qubits needed drastically reduced from $10$ (i.e., $2 + (3/2)\log N$, per Zalka) to only $2$ qubits! The compilation procedure was also implemented for the 2001 factorization of $15$.

+ +

It is absolutely crucial to note the following comment by Smolin et al. here.

+ +
+

Of course this should not be considered a serious demonstration of Shor’s algorithm. It does, however, illustrate the danger in “compiled” demonstrations of Shor’s algorithm. To varying degrees, + all previous factorization experiments have benefited from this artifice. While there is no objection to having a classical compiler help design a quantum circuit (indeed, probably all quantum computers will function in this way), it is not legitimate for a compiler to know the answer to the problem being solved. To even call such a procedure compilation is an abuse of language.

+
+",26,,26,,12/16/2019 18:14,12/16/2019 18:14,,,,0,,,,CC BY-SA 4.0 +9233,2,,9231,12/16/2019 18:29,,9,,"

They have different error rates because they are two different physical devices! This relates to the manufacturing processes of these chips. Every device is unique and will have its own fingerprint meaning its own error rate. Of course this is not something that manufactures do on purpose, but a side effect of making these qubit devices. It’s very difficult to make two quantum chips completely identical!

+",2136,,,,,12/16/2019 18:29,,,,0,,,,CC BY-SA 4.0 +9235,2,,9231,12/16/2019 21:59,,3,,"

I would add that thermic noise, radiocative background (mainly cosmic rays) can play role in different error rate as those noise sources are different for each quantum processor.

+ +

Moreover, as a user of IBM Q, you probably know that quantum processors are sometimes under maintenance. Since each processor is maintained in different time, their runtime is also different and this can influence error rate as well.

+",9006,,,,,12/16/2019 21:59,,,,3,,,,CC BY-SA 4.0 +9236,1,9239,,12/16/2019 22:15,,3,477,"

It is well known that any operation on a quantum computer is described with a unitary matrix (a quantum gate) because quantum computing is reversible.

+ +

Only non-reversible operation is a measurement of a qubit. Therefore, I would expect that the measurement can be described by a non-unitary matrix (or even by matrix that is not invertible).

+ +

A result of the measurement should be a probability distribution of all possible states of measured qubits.

+ +

My question: How does a matrix representing measurement of qubit(s) look like?

+",9006,,,,,12/17/2019 4:11,Matrix representation of a measurement,,2,0,,,,CC BY-SA 4.0 +9237,2,,9219,12/16/2019 23:01,,1,,"

These functions don't automatically display their output, unless you are running the code in a Jupyter notebook. I would recommend you switch over to using a Jupyter notebook if you can (you can do this inside the IBM Q Experience) as this will display all the plots for you, as long as the calls to these functions are the last line of the cell.

+ +

If this is not possible, you can display the circuit using ASCII art by calling print(circuit.draw()) or saving it to a file using circuit.draw(output='mpl', filename='circuit.png'). As for the other plotting methods, these return matplotlib images so you should be able to see them by doing plt.show() or save the figure by doing

+ +
bloch = plot_bloch_vector()
+bloch.savefig('bloch.png')
+
+",5955,,,,,12/16/2019 23:01,,,,0,,,,CC BY-SA 4.0 +9238,2,,9236,12/17/2019 1:39,,2,,"

These are called observables, which are unitary hermitian matrices whose eigenvectors are the possible outcomes of the measurement. For example, the observable of the standard computational basis is the Pauli Z operator, and the observable of the sign basis is the Pauli X operator.

+",4153,,,,,12/17/2019 1:39,,,,0,,,,CC BY-SA 4.0 +9239,2,,9236,12/17/2019 3:54,,4,,"

There is no single matrix representing measurement. Projective measurements are represented by a set of orthogonal projectors. For example, measurement of a single qubit in the standard basis is represented by projectors +$$\pi_0=\begin{pmatrix} +1 &0\\ +0 &0 +\end{pmatrix}$$ +and +$$\pi_1=\begin{pmatrix} +0 &0\\ +0 &1 +\end{pmatrix}$$

+ +

If a qubit was initially in state with density matrix $\rho$, then the post-measurement density matrix $\rho'$ is

+ +

$$\rho'=\sum_{i=0}^1\pi_i\rho\pi_i$$

+ +

Also, probability distribution of possible measurement outcomes can be obtained only by multiple measurements on an ensemble of identical systems; a single measurement gives no information about probabilities of possible measurement outcomes.

+",2105,,2105,,12/17/2019 4:11,12/17/2019 4:11,,,,0,,,,CC BY-SA 4.0 +9241,2,,9154,12/17/2019 14:59,,2,,"

To start with, let's look at $$\mathbb I - \frac{1}{n} \sum_{j=1}^n \vert 0_j \rangle \langle 0_j \vert \otimes \mathbb{I}_\bar{j} =\mathbb I - P.$$

+ +

We can rewrite $$\mathbb I = \frac{1}{n}\sum_{j=1}^n\mathbb I = \frac{1}{n}\sum_{j=1}^n\left(\left|0_j\rangle\langle 0_j\right| + \left|1_j\rangle\langle 1_j\right|\right)\otimes \mathbb I_\bar j$$ to get $$\mathbb I - P = \frac{1}{n}\sum_{j=1}^n\left|1_j\rangle\langle 1_j\right|\otimes \mathbb I_{\bar j}.$$

+ +

This is a normalised sum of projectors $$\mathbb I - P =\frac{1}{n}\sum_{j=1}^n\mathbb P_{1,j}$$ where $\mathbb P_{1, j}$ projects the $j^{\text{th}}$ qubit into state $\left|1\right>$. That is, $\mathbb I - P$ gives the proportion of qubits in state $\left|1\right>$, or more accurately, the expectation value of $\mathbb I-P$ with respect to some state gives the expected proportion of qubits to return $'1'$ when that state is measured. Equivalently, the expectation value of $P$ is the expected proportion of qubits to return $'0'$ when measured.

+ +

As $U\left|0\right> = \left|b\right>$, $U\left(\mathbb I - P\right)U^\dagger$ does with $\left|b\right>$ what $\mathbb I - P$ does with $\left|0\right>$.

+ +

Of course, the difficulty now is that $\left|b\right>$ can presumably be an entangled state, so explaining this in terms of ""expectation value of the proportion of qubits returning $'1'$ upon measurement"" isn't quite so straightforward.

+ +

However, asking the question 'are you measuring the state $\left|b\right>$?', $\left<x|H_L|x\right>$ is the expectation value of the proportion of qubits that would return 'no'.

+ +

An alternative way of thinking about it that might make more sense in this context is by realising that if $A\left|x\right> = \left|b\right> = U\left|0\right>$, $U^\dagger A\left|x\right> = \left|0\right>$ and so we arrive back at the expectation value of the proportion of qubits returning $'1'$ upon measurement of $U^\dagger A\left|x\right>$.

+",23,,,,,12/17/2019 14:59,,,,1,,,,CC BY-SA 4.0 +9242,1,9278,,12/18/2019 10:22,,4,751,"

My questions are probably more about details but the answer will help me to precisely understand the mathematical structure.

+ +

My questions are related to page 14 of this pdf.

+ +
+ +

Mathematical context:

+ +

We have $H=H_A \otimes H_B$ with $d = \mathrm{min}(\dim(H_A), \dim(H_B))$

+ +

We call $|\Omega\rangle = \frac{1}{\sqrt{d}} \sum_i |ii \rangle$ the maximally entangled state.

+ +
+ +

First question:

+ +

For me this state is ill-defined in general. If $H_A$ and $H_B$ represent the same physical system (a qubit for example), then it is well defined because if I choose $|i\rangle = | 0 \rangle$ for the first system, then as the second one is the same, I know that $|ii\rangle = |00\rangle$.

+ +

However, if the two systems are different, for example, a qubit and a harmonic oscillator how do I know how to choose the kets?

+ +

I could have (first space = qubit, second one = harmonic oscillator):

+ +

$$|\Omega\rangle = \frac{1}{\sqrt{2}} \left(|+0\rangle + |-1\rangle \right) $$

+ +

Or:

+ +

$$|\Omega\rangle = \frac{1}{\sqrt{2}} \left(|00\rangle + |11\rangle \right) $$

+ +

Would you agree with me that $|\Omega\rangle$ is an ill-defined state in general? But maybe that it doesn't matter for practical purposes? One of the confusion it gives me is the property that any maximal entangled state is of the form $\mathbb{I} \otimes U | \Omega \rangle$, $U$ being unitary. How to prove it properly if $|\Omega \rangle$ is ill-defined ?

+ +
+ +

Second question:

+ +

We can take a basis $\{ U_i \}$ of $\mathcal{M}_d(\mathbb{C})$ composed of $d^2$ unitary matrices orthogonal with respect to the Hilbert-Schmidt scalar product on matrices.

+ +

Then the family $\left( U_i \otimes \mathbb{I} \right)| \Omega \rangle$ is composed of $d^2$ orthonormal vectors.

+ +

In the document, he says that it is a basis of entangled states of $\mathbb{C}^d \otimes \mathbb{C}^d $. +I agree that it matches in terms of dimensions, but why is it a basis of this space precisely? For example, could we say as well it is a basis of $\mathbb{C}^{d^2}$? In short: is there something to understand in his statement or not really?

+",5008,,5008,,12/18/2019 10:47,12/21/2019 16:27,"Maximally entangled state definition, and orthonormal basis of maximally entangled state",,2,7,,,,CC BY-SA 4.0 +9243,1,9379,,12/18/2019 15:06,,3,516,"

In Chapter 6 of ""Quantum Computation and Quantum Information"" Textbook by Nielsen and Chuang, Exercise 6.12:

+ +
+

Exercise 6.12: (Alternative Hamiltonian for quantum search) Suppose: + $$H=|x\rangle\langle ψ|+|ψ\rangle\langle x|$$ + (1) Show that it takes time $\mathcal O(1)$ to rotate from the state $|ψ\rangle$ to the state + $|x\rangle$, given an evolution according to the Hamiltonian $H$.
+ (2) Explain how a quantum simulation of the Hamiltonian $H$ may be performed, and determine the number of oracle calls your simulation technique requires to obtain the solution with high probability.

+
+ +

(1) It is ease to get the answer for the first (1) part of the question: +$$e^{-itH}=e^{-it(|x\rangle\langleψ|+|ψ\rangle\langle x|)}=e^{-it(λ_1|m_1\rangle\langle m_1|+λ_2|m_2\rangle\langle m_2|)}$$

+ +

where $λ_1$ and $λ_2$ - eigenvalues of $H$: $λ_{1,2} = α±1,$

+ +

$α = \langle x|ψ\rangle=1/\sqrt{N}$ and eigenvalues

+ +

$$m_1=\frac{1}{\sqrt{2(1+α)}}(|x\rangle+|ψ\rangle)$$ +$$m_2=\frac{1}{\sqrt{2(1-α)}}(|x\rangle-|ψ\rangle)$$

+ +

therefore $e^{-itH}=(e^{-it(α+1)}-1)|m_1\rangle\langle m_1|+(e^{-it(α-1)}-1)|m_2\rangle\langle m_2|+1$

+ +

$$e^{-itH}|ψ\rangle=e^{-itα}(-i\sin(t)|x\rangle+\cos(t)|ψ\rangle)$$

+ +

in order to have $e^{-itH}|ψ\rangle=|x\rangle$, $t$ should be equal to $$t=\pi/2$$

+ +

(2) Unfortunately i was unable to find an answer to the second part of the question. Could anybody help me?

+ +

It is well-known how the quantum simulation of the several Hamiltonian can be performed. For example:

+ +

For the Hamiltonian $H=|x\rangle\langle x|+|ψ\rangle\langle ψ|$ the quantum simulation exist in the Nielsen and Chuang Textbook - page 258 paragraph 6.2 and in the article of Farhi and Gutmann An analog analogue of a digital quantum computation. Phys. Rev. A, 57(4):2403–2406, 1998 arXiv e-print quant-ph/9612026

+ +

For the Hamiltonian $H=2iα(|x\rangle\langle ψ|-|ψ\rangle\langle x|)$ the quantum simulation described in the article of Stephen A. Fenner +An intuitive Hamiltonian for quantum search May 2000 ArXiv

+ +

But for the Hamiltonian $H=|x\rangle\langle ψ|+|ψ\rangle\langle x|)$ I found only the general description of the possibility to use it in the quantum search Generalized Quantum Search Hamiltonian. Joonwoo Bae, Younghun Kwon. arXiv:quant-ph/0110020 and didn't find the answer how the quantum simulation can be performed.

+ +

Can anybody have an ideas how the last Hamiltonian can be simulated using Oracle quantum gate?

+",9545,,23,,12/21/2019 11:32,1/4/2020 13:21,"Nielsen and Chuang, Exercise 6.12: How to simulate the specific Hamiltonian in the search algorithm by the Oracle gates?",,2,0,,,,CC BY-SA 4.0 +9244,1,9245,,12/18/2019 15:47,,7,2586,"

I am new to Quantum Computing. I would really appreciate if some one could offer me some ideas, suggestions and/or useful references to solve the following problem about realizing an arbitrary operator by a quantum circuit.

+ +

If I start with a general two-qubit operator $\hat{U}$ (which corresponds to a 4 by 4 unitary matrix $U$ in the computational basis), what is the strategy to +(1) decompose $U$ into the basic gates, such as the $CNOT$ gate, the Hadamard gate $H$, and the single-qubit rotational gates ($R_x$, $R_y$ and $R_z$); (2) design the corresponding quantum circuit to realize this two-qubit operator $\hat{U}$ (either with ancillary qubits or not)?

+ +

In other words, what is the strategy (1) to convert the following unitary matrix (two-qubit operator $\hat{U}$ in the computational basis $\{ |00\rangle, \ |01\rangle, \ |10\rangle, \ |10\rangle \}$) +\begin{align} +U= \begin{pmatrix} +a & b & c & d \\ +b^{\ast} & f & g & h \\ +c^{\ast} & g^{\ast} & i & j \\ +d^{\ast} & h^{\ast} & j^{\ast} & k +\end{pmatrix} \ , +\end{align} +into the basic gates (e.g., $CNOT$, $H$, $R_x$, $R_y$ and $R_z$ gates); and (2) to realize the unitary matrix $U$ in a quantum circuit?

+ +

Thank you!

+",9548,,,,,12/19/2019 17:46,"How to transform e.g., a 4 by 4 unitary matrix into a quantum circuit",,2,1,,,,CC BY-SA 4.0 +9245,2,,9244,12/18/2019 17:14,,8,,"

A universal method to decompose 2-qubit unitaries into primitive gates is sometimes referred to as ""Krauss-Cirac decomposition"". Here are several sources:

+ + + +

For gates on multiple qubits, this question offers several more sources.

+",2879,,2879,,12/19/2019 17:46,12/19/2019 17:46,,,,5,,,,CC BY-SA 4.0 +9246,1,,,12/18/2019 17:17,,2,372,"

I tried implementing quantum phase estimation in qiskit, however, I'm not getting the expected results.

+ +

I choose a controlled $U1$ gate.

+ +

First of, I implemented inverse QFT operation (basically a rewrite of the textbook version in a way that I understand better) :

+ +
def qft_dagger(circ, q, n):
+    """"""n-qubit inverse QFT on q in circ.""""""
+    for i in range(n-1,-1,-1):
+        for m in range(n-i,1,-1):
+            circ.cu1(-2*math.pi/2**m, q[i+m-1], q[i])
+        circ.h(q[i])
+        circ.barrier()
+
+ +

Then, the n-qubit hadamard operation :

+ +
def n_hadamard(circ, q, n):
+    ""apply n qubits hadamard in circ on q""
+    for i in range(n):
+        circ.h(q[i])
+
+ +

Then a function to initiate state vector :

+ +
def build_state_vector(circ, inp, s):
+    ""build state vector in circ from inp a binary string""
+    for i, e in enumerate(inp):
+        if e == '1':
+            circ.x(s[i])
+
+ +

Then, the code of my experiment goes as follow :

+ +
nancilla = 3
+theta = 0.78
+q = QuantumRegister(nancilla, 'q')
+s = QuantumRegister(1, 's')
+c = ClassicalRegister(nancilla, 'c')
+
+qpe = QuantumCircuit(q, s, c)
+
+build_state_vector(qpe, '1', s)
+
+# Applying hadammard on ancilla
+n_hadamard(qpe, q, nancilla)
+
+for i in range(nancilla):
+    #Applying U^(2^(n-j)) on qubit j 
+    qpe.cu1(2*math.pi*theta*2**(nancilla-i-1), q[i], s[0])
+
+# Applying inverse QFT
+qft_dagger(qpe, q, nancilla)
+
+for i in range(nancilla):
+    qpe.measure(q[i],c[i])
+
+backend = BasicAer.get_backend('qasm_simulator')
+shots = 2**17
+results = execute(qpe, backend=backend, shots=shots).result()
+answer = results.get_counts()
+
+ +

For instance, here, I get as a result 0.25 when I should get 0.75. When increasing the number of ancilla qubits, the result don't get better.

+ +

I feel like there is something wrong in my implementation, but I have looked at every part separately and I can't tell what is wrong.

+",9551,,5955,,12/18/2019 18:06,1/7/2020 8:49,Quantum Phase Estimation implementation,,1,6,,,,CC BY-SA 4.0 +9247,1,9248,,12/18/2019 17:48,,5,260,"

I understand that CNOT and Toffoli (CCNOT) gates are not universal for quantum computation since they (alone) cannot create superposition. Moreover, it is totally possible to perform a CNOT operation where the control qubit is in superposition, $\alpha\vert 0 \rangle + \beta\vert 1 \rangle$, and target qubit to be $\vert 0 \rangle$.

+ +

My question is can we have a control qubit to be in superposition while using CCNOT, something like the following?

+ +

+ +

If yes, what will be the values for $p, q, $ and $r$? +If not, why not?

+ +

The related material I found are universality of the toffoli gate and CNOT in superposition.

+ +

Thank you in advance!

+",7528,,,,,12/18/2019 18:47,Can Toffoli operate on a qubit in superposition?,,1,0,,,,CC BY-SA 4.0 +9248,2,,9247,12/18/2019 18:37,,7,,"

Control qubit can be in superposition, why not? This is how entangled qubits are created. But the circuit you have drawn does not entangle qubits, it actually does not change qubit states at all, and $|p\rangle = \alpha| 0 \rangle + \beta| 1 \rangle$, $|q\rangle=|0\rangle$, $|r\rangle=|0\rangle$.

+ +

It would be more interesting if the input value of the 2nd qubit was $|1\rangle$; then the 2nd output value $|q\rangle=|1\rangle$, but there is no separated $|p\rangle$ and $|r\rangle$ output values, instead you have 2-qubit entangled state

+ +

$$|pr\rangle=\alpha|00\rangle + \beta|1 1 \rangle$$

+",2105,,2105,,12/18/2019 18:47,12/18/2019 18:47,,,,6,,,,CC BY-SA 4.0 +9249,1,,,12/18/2019 22:03,,3,50,"

In eqs. (33), (43)-(46), (56) of their paper, ""Separable Decompositions of Bipartite Mixed States"" https://arxiv.org/abs/1708.05336, Li and Qiao present a number of formulas pertinent to testing the separability of certain states. In particular, in eq. (54), they state that +\begin{equation} +\Pi_{\mu=1}^3 \mathcal{E}_{\mu}(A) \leq \frac{1}{27}, \hspace{.1in} \Pi_{\nu=1}^3 \mathcal{E}_{\nu}(B) \leq (\frac{2}{27})^2, +\end{equation} +is required for separability of certain $2 \times 4$ states, +where $A$ correponds to qubits and $B$ to ququarts. There doesn't seem to be an explicit formula for qutrits, say $C$, however (although some peripheral discussions). Some manipulations of mine--of which I am not fully convinced--lead me to suspect the value $\frac{1}{128}$, but I would like to be more confident of its correctness, or if not, the proper alternative.

+ +

After eq. (33), Li and Qiao note that ""$\mathcal{E}_{\mu} (A)$ and $\mathcal{E}_{\nu} (B)$ are the means of the squares of the components along the unit directions $\vec{u}_{\mu} \in \mathcal{S}_l^{(A)}$ and $\vec{v}_{\nu} \in \mathcal{S}_l^{(B)}$, respectively, and $\tau_{\mu}$ are the singular values of $\mathcal{T}$"".

+ +

Also, preceding this they write: ""[W]e define the average of the squares of the components along the directions $\vec{u}_{\mu} \in \mathcal{S}^{(A)}_{l}$ and $\vec{v}_{\nu} \in \mathcal{S}^{(B)}_{l}$ as follows +\begin{equation} +\mathcal{E}_{\mu}(A) \equiv \sum_{i=1}^L p_i |\vec{u}_{\mu} \cdot \vec{r}_i|^2 \; ,\; \mathcal{E}_{\nu}(B) \equiv \sum_{i=1}^L p_i |\vec{v}_{\nu} \cdot \vec{s}_i|^2 \; ."" +\end{equation}

+ +

Another background passage reads: ""Let $\mathcal{T} = (\vec{u}_1,\cdots,\vec{u}_{N^2-1}) \Lambda_{\tau} (\vec{v}_1, \cdots, \vec{v}_{M^2-1})^{\mathrm{T}}$ be the singular value decomposition of the correlation matrix $\mathcal{T}$ and $\Lambda_{\tau}$ has rank $l$, then we have +\begin{equation} +\mathcal{T} = \sum_{\mu =1}^l \tau_{\mu} \vec{u}_{\mu}\vec{v}_{\mu}^{\,\mathrm{T}} \; . \label{Singular-tau-def} +\end{equation} +For the $l$ nonzero values of $\tau_{\mu}$, the corresponding singular vectors $\{\vec{u}_1,\cdots,\vec{u}_l\}$ and $\{\vec{v}_1,\cdots,\vec{v}_l\}$ span two $l$-dimensional subspaces in Bloch vector space: $\mathcal{S}_l^{(A)} \equiv \mathrm{span}\{\vec{u}_1,\cdots,\vec{u}_l\} \subseteq \mathcal{S}_{N^2-1}$ and $\mathcal{S}_l^{(B)} \equiv \mathrm{span} \{\vec{v}_1,\cdots,\vec{v}_l\} \subseteq \mathcal{S}_{M^2-1}$."".

+ +

In addition, +""the corresponding decomposition of $\rho_{AB}$ can be read from equations (63) and (64), where $p_1=p_2=p_3=p_4=1/4$, and the Bloch vectors for $\rho_i^{(A,B)}$ are +\begin{align} +\vec{r}_1 = +\begin{pmatrix} +\alpha_1 \\ +-\alpha_2 \\ +-\alpha_3 +\end{pmatrix}\; , \; \vec{r}_2 = +\begin{pmatrix} +-\alpha_1 \\ +-\alpha_2 \\ +\alpha_3 +\end{pmatrix}\; , \; +\vec{r}_3 = +\begin{pmatrix} +-\alpha_1 \\ +\alpha_2 \\ +-\alpha_3 +\end{pmatrix}\; , \; +\vec{r}_4 = +\begin{pmatrix} +\alpha_1 \\ +\alpha_2 \\ +\alpha_3 +\end{pmatrix} \; , \label{Example-I-detail-1}\\ +\vec{s}_1 = +\begin{pmatrix} +\beta_1 \\ +-\beta_2 \\ +-\beta_3 +\end{pmatrix}\; , \; +\vec{s}_2 = +\begin{pmatrix} +-\beta_1 \\ +-\beta_2 \\ +\beta_3 +\end{pmatrix}\; , \; +\vec{s}_3 = +\begin{pmatrix} +-\beta_1 \\ +\beta_2 \\ +-\beta_3 +\end{pmatrix}\; , \; +\vec{s}_4 = +\begin{pmatrix} +\beta_1 \\ +\beta_2 \\ +\beta_3 +\end{pmatrix} \; . \label{Example-I-detail-2}"". +\end{align}

+ +

Clearly, some command of the authors' detailed (and rather challenging, it seems to me) argument would seem to be needed to successfully address the question.

+",3089,,55,,11/22/2020 16:58,11/22/2020 16:58,Find the qutrit analogue of certain qubit and ququart formulas of Li and Qiao for testing separability,,0,0,,,,CC BY-SA 4.0 +9250,2,,9244,12/18/2019 22:45,,2,,"

Every 2x2 unitary matrix can be decomposed to a matrix product of four matrices expresing rotations and phase shifts.

+ +

Every controlled operator (i.e. two qubit gate) can be decomposed to product of three single qubit gates acting on target qubit and two CNOT gates. Single qubit gates can be again decomposed to rotations and phase shifts are mentioned above.

+ +

In case your 4x4 matrix can be writen as Kronecker product of two 2x2 matrices, you can again apply decomposition from the first paragraph.

+ +

Based on these theorems, you can rewrite any two qubit operators in terms of CNOTs and single qubits rotations and phase shifts. All these gates are available on a quantum computer.

+ +

Please see details how to do so in Elementary gates for quantum computing.

+",9006,,,,,12/18/2019 22:45,,,,0,,,,CC BY-SA 4.0 +9251,2,,5775,12/19/2019 8:09,,1,,"

You are absolutely right. The picture in the right section correspond to the picture in the left section up to the unimportant global phase factor (-1). This fact mentioned in the Exercise 6.6.

+ +

The Box 6.1 use only one Grover iteration, so that $|ψ\rangle$ after this Grover iteration will be rotated to the (-$|x\rangle$) instead of $|x\rangle$ as in the general Grover algorithm. But this does not has any impact to the final result because the probability to find an $|x\rangle$ use the amplitude squire.

+",9545,,,,,12/19/2019 8:09,,,,2,,,,CC BY-SA 4.0 +9252,1,9346,,12/19/2019 8:20,,0,81,"

I am trying to better understand the following:

+ +
+

What is the difference between Intraphoton Entanglement and Interphoton Entanglement?

+
+ +

I am new in this field and i want to proceed some work on swapping of Intraphoton Entanglement to Interphoton Entanglement.

+",8527,,55,,7/27/2020 12:27,7/27/2020 12:27,"What is the difference between ""intraphoton"" and ""interphoton"" entanglement?",,1,1,,,,CC BY-SA 4.0 +9253,1,9259,,12/19/2019 11:11,,1,280,"

Theoretically and for sure physically (I know the quantum physics behind it) I know something about it. But not that much. That's why I ask the question here. I'm very interested. The only answer to it made it already much clearer, though not into detail, of course.

+ +

Recently, as anyone of you knows, G**gle succeeded in quantum supremacy. Which is to say they built a quantum computer (QC) that did the given job about one and a half billion ($2^{73}?$) times as fast as a classical computer (CC).

+ +

While being zillions [or more;)] times faster in executing programs [or algorithms(?)], I think, for example, the conditions under which you can use a QC are different than those of a CC, which is why I ask this question. You (maybe very very far away in the future, if Nature still exists then) can't make them very small and portable, for example.

+ +

Are the programs and programming, in other words, the jobs to be ordered, be different? I assume yes because of the fact that the QC is superfast in making (instead of calculating) zillions (or even still more) different permutations of whatever kind of objects (like a randomly made permutations of bits, like in the Ggle experiment case). I've heard QC's can be used in meteorology, but (as a side question) in what way is there a question of permutations? More generally, for what kind of jobs are QC's designed or programmed to make such permutations? Or is my assumption that a QC can **only make permutations wrong?

+ +

Does anyone have some more thoughts about this?

+",9555,,9555,,12/20/2019 5:54,12/20/2019 5:54,What is the difference between classical and quantum computers as well as computing (permuting) itself?,,1,0,,,,CC BY-SA 4.0 +9254,1,,,12/19/2019 11:33,,0,353,"

Does anyone has (or is aware of) a solution to Nielsen's QCQI 4.36 exercise: construct a circuit to add two-qubit numbers x and y modulo 4 vs $|x,y\rangle \rightarrow |x, x+y \mod 4\rangle$

+",9556,,55,,11/22/2020 16:57,11/22/2020 16:57,Quantum adder mod 4,,1,3,,12/21/2019 9:22,,CC BY-SA 4.0 +9255,2,,9254,12/19/2019 13:10,,3,,"

The trick is to break down, bit by bit, what the calculation is that you need. You'll see on the right-hand side of the circuit, I've stated what the outcomes need to be. Hopefully, you also recognise some of those outputs (particularly the top qubit), so that rapidly starts to formulate the circuit...

+ +

+",1837,,,,,12/19/2019 13:10,,,,1,,,,CC BY-SA 4.0 +9256,2,,9242,12/19/2019 14:57,,2,,"
+

For me this state is ill-defined in general

+
+ +

It's not ""ill-defined"", just not uniquely defined. If the dimensions are different you can indeed define different inequivalent states that all have the same right to be called ""maximally entangled"".

+ +

Note that the ""maximally entangled state"" is not fully characterised even in the case in which the dimensions are the same: you can define it as $\sum_i |u_i,v_i\rangle$ for every pair of orthonormal bases $(u_i)_i, (v_i)_i$ for the two spaces. Usually when these states are used this ""undefinedness"" does not matter (think e.g. of the definition of the Choi matrix using maximally entangled states). +Although it is true that when the dimensions are the same these states can all be mapped one into the other via local operations, which is not the case for ""maximally entangled states"" in spaces with different dimensions.

+",55,,,,,12/19/2019 14:57,,,,0,,,,CC BY-SA 4.0 +9257,1,,,12/19/2019 15:28,,-1,352,"

+ +

+ +

+ +

Hello,

+ +

I am uncertain; however, today at a toy museum, I might have captured a qubit on a classical computing structure, “ a broken 90-marble abacus,” as shown in the attached photos above.

+ +

I did not use it correctly, but if we set the first photo to be the state “0”, then the next one is “1”. You may say the third photo shows 0.5, but you can also say that it is a bit closer to 0 or 1. Thus, while we observe this purple marble positioned between 0 and 1, we cannot tell if it moves to 0 or 1 until we measure its displacement. Therefore, I wonder if it can be said that the classical limit of qubit emerged on classical computer in this third photo? Its probability of being 0 or 1 is fifty-fifty.

+ +

The picture below gives a further explanation with a chart of marble A's location. In abacus computing, the states of A are limited to four states, namely, resting at 0 or 1, or moving toward 0 or 1. A cannot rest between 0 and 1. Abacus computing is observed by taking two photographs during its sequence giving two locations of A. When taking the first shot, we can know A's location and not sure if it is moving or resting. Then we take a second shot and know how it moves. After all, we can tell or predict its outcome 0 or 1. Thus, when we observe the initial location of A, this is the state of the classical limit of qubit, which has fifty-fifty probability of becoming 0 or 1, until secondary observation.

+ +

This concept can be extended to tossing coin or tumbling dice. If the observer is unable to predict those outcomes by observing those motions, the observer can tell only classical probabilities.

+ +

Thank you,

+ +

Ryoji

+ +

+",5712,,5712,,1/21/2020 2:44,1/21/2020 2:44,Can a classical limit of qubit emerge on a classical computer?,,1,2,,12/19/2019 23:12,,CC BY-SA 4.0 +9258,2,,9257,12/19/2019 17:59,,2,,"

A computer that may be visualized in this simple way, like abacus with moving marbles, where the locations of the marbles are continuous, including 0.5, is called an ""analog computer"" and it is a different, and much simpler, thing than a quantum computer.

+ +

What may be changed continuously in a quantum computers aren't the observable locations (or voltages) themselves but the probability amplitudes for each configuration. When it comes to allowed values of each qubit, each of them may still be just 0 or 1 and nothing in between. However, the quantum computer allows each qubit to be indeterminate, having some probability to be 0 and some probability to be 1.

+ +

In fact, each of the $2^N$ configuration of $N$ qubits may be given some probability that is independent from others. And quantum mechanics makes it more juicy. It's not just probabilities $p_i$, $i=1 \dots 2^N$, that specify the state of the quantum computer at the moment. Instead, it's complex numbers, the probability amplitudes, $c_i$ related to $p_i$ by $p_i=|c_i|^2$, that are needed to describe the state of the quantum computer at a given moment.

+ +

An operation performed by the quantum computer is some particular linear transformation (given by a matrix, $2^N \times 2^N$) of these $2^N$ complex numbers. This calculation involving $2^N \times 2^N$ continuous numbers could be simulated by a complicated classical computer with lots of memory and representation for the continuous numbers.

+ +

However, this operation that looks complicated in the simulation is achieved by the quantum computer's step that is basically comparably difficult to an operation of a classical computer with $N$ single bits that just maps some bits to a simple function of the neighbors.

+ +

The quantum computer doesn't allow ""any"" operation with the matrices to be done and it doesn't allow the complex numbers to be measured. Instead, just the bits themselves, with results either 0 or 1, may be measured by the quantum computer. So the class of quantum computers or quantum simulations is ""more special"" than the class of operations done on a classical computer with $2^N$ complex numbers. But despite this restriction, the quantum computer is capable of doing some things much more quickly than the classical computers.

+ +

A usable quantum compouter was first built by Google and, at least according to some precise definitions of the term, has achieved ""quantum supremacy"" which means quickly doing a calculation that could only be done very slowly at the world's fastest classical computers.

+",5659,,5659,,12/19/2019 18:09,12/19/2019 18:09,,,,12,,,,CC BY-SA 4.0 +9259,2,,9253,12/19/2019 19:35,,1,,"

I would be careful with so-called ""quantum supremacy"". This term means that there are some tasks where quantum computers are faster than classical ones. However, a speed-up is different for different task, e.g. quantum algorithms allow exponential speed-up of integer factoring (Shor algorithm) or calculating values of $x^{T}Mx$, where $x$ is a solution of $Ax=b$ (HHL algorithm) but speed-up for searching (Grover algorithm) is only quadratic. Moreover, there are some tasks where quantum computers bring no speed-up (e.g. binary function parity evaluation).

+ +

Regarding your question on programming. Quantum computers are based on different paradigm than classical ones. Programming of quantum computers can be done via languages like Qiskit or Q#, which are more or less same as classical programming languages like C++. However, underlying circuity of quantum computers are totally different from classical ones.

+ +

Regarding question on application in meteorology. Currently I know about none but principialy it could be possible as atmosphere is a stochastic system and quantum computers can simulate those.

+",9006,,,,,12/19/2019 19:35,,,,5,,,,CC BY-SA 4.0 +9260,2,,9227,12/19/2019 22:52,,1,,"

First of all we have to solve a problem with storing information in a quantum form. Currently, researches work on so-called quantum RAM (qRAM) to allow a quantum computer have a bigger memory than registers in a quantum processor. Details are discussed here: Quantum Random Access Memory. This would expand capabilities of quantum computers and make them more similar to classical computers in terms of architecture.

+ +

When the issue with storing a data will be solved, we can start to think how to encode an audio data in a quantum form and how to operate with them. Of course, there will have to be a converters from a quantum data to classical ones in order to use them for playing sounds (or showing pictures on screen etc). So, you are right, a converter similar to A/D and D/A converters would be needed.

+ +

If you are interested in using quantum computers for audio processing, you would like this book: Mastering Quantum Computing with IBM QX: Explore the world of quantum computing using the Quantum Composer and Qiskit. There is a chapter dealing with using a quantum computer for producing tones via MIDI.

+",9006,,,,,12/19/2019 22:52,,,,0,,,,CC BY-SA 4.0 +9262,2,,6878,12/20/2019 8:23,,2,,"

I am by no means an expert in this sort of calculation, but I think I (mostly) agree with you.

+ +

I divided the calculation up slightly differently, which simplified things notationally. Firstly, I considered the input $|0\rangle_A|0\rangle_B$. Clearly, $H$ acting on this is just 0, so this state doesn't evolve. So, the lop-left element of $E_0$ is 1, and that of $E_1$ is 0.

+ +

Then I considered the input $|1\rangle_A|0\rangle_B$. We know that $a^\dagger a$ will always just return $|1\rangle_A$, so we only need to consider the evolution of the second system, i.e. +$$ +e^{-i\chi\Delta t(b+b^\dagger)}|0\rangle_B. +$$ +We can then follow your strategy for the calculation (I've only gone through the $E_0$ case) to find the bottom-right element is $e^{-\Delta t^2\chi^2/2}$. (Digression: if I assume the b operators are fermionic, then $b+b^\dagger$ is basically just the Pauli $X$ matrix on a qubit. Then you recover the formula that's given.)

+ +

What at first glance seems confusing is why you should only consider $E_0$ and $E_1$. Surely, there are also $E_k$ for all natural numbers $k$? Of course, they will all be of the same form as $E_1$ up to some constant of proportionality. Let's assume +$$ +E_k=\alpha_k|1\rangle\langle 1| +$$ +for $k\geq 1$. Then the relevant terms of the Master equation look like +$$ +\sum_k\frac12 E_k^\dagger E_k\rho+\frac12\rho E_k^\dagger E_k-E_k\rho E_k^\dagger=\frac12 \beta|1\rangle\langle 1|\rho+\frac12 \beta\rho|1\rangle\langle 1|-\beta|1\rangle\langle 1|\rho|1\rangle\langle 1|. +$$ +This is entirely equivalent to the action of a single operator $E_1'=\sqrt{\beta}|1\rangle\langle 1|$ with $\beta=\sum_k\alpha_k^2$. Moreover, by the fact that the map will be trace preserving, I don't need to bother actually calculating $\beta$. I know that +$$ +\beta+\langle 1|E_0|1\rangle^2=1. +$$ +(At least this part is consistent with what N&C is telling us.)

+",1837,,,,,12/20/2019 8:23,,,,1,,,,CC BY-SA 4.0 +9263,2,,4104,12/20/2019 10:45,,1,,"

By treating a quantum circuit as a network model, the network model can be optimized the order of the calculation by making a contract between tensor and tensor.

+ +

I think it is definitely important to learn TN for future qc.

+",9564,,,,,12/20/2019 10:45,,,,0,,,,CC BY-SA 4.0 +9264,1,9288,,12/20/2019 11:10,,9,236,"

Quantum teleportation is a reasonably well-defined physical process, whereby a quantum state is transferred between two separated entities that already share an entangled state. It's been demonstrated experimentally, and applications have been dreamed up. My question is: does this phenomenon occur ""naturally"" at all? Or is it in the category of things that, to the best of our knowledge, have only ever happened as a result of human ingenuity?

+ +

(I leave open the question of how exact the state transfer should be. Examples where teleportation explains something interesting about a system's behaviour would be ideal.)

+",8338,,,,,12/23/2019 11:46,Is quantum teleportation a natural phenomenon?,,1,4,,,,CC BY-SA 4.0 +9265,1,9266,,12/20/2019 11:39,,4,180,"

Elements of the Pauli group are the n-Pauli matrices with $\pm 1$ or $\pm i$ on front of them. They all commute or anti-commute between them.

+ +

The Clifford group are element that preserve the n-Pauli group under conjugation.

+ +

My question:

+ +

Is there a link between the result of the Gottesman Knill theorem, and somehow the fact that if you only use gates in the Clifford group you can simplify the circuit using commutation and anti-commutation rules from the n-Pauli group.

+ +

I didn't go into the proof of this theorem, I just would like to see if there is a handwavy but intuitive way to understand it.

+",5008,,,,,12/20/2019 11:46,Intuitive link between clifford group and gottesman-knill theorem,,1,0,,,,CC BY-SA 4.0 +9266,2,,9265,12/20/2019 11:46,,4,,"

Yes, absolutely. That's very much the root of the whole thing. You start with a state from a particular class: a stabilizer state, i.e. one which can be described by a bunch of projectors $(I+K)/2$, where $K$ is from the Pauli Group.

+ +

To determine how the state evolves under the action of the circuit, you only need to know how the circuit acts on the elements $K$. Since gates in the Clifford group preserve the Pauli group, that just says those tensor products of Paulis map into some other tensor product of Paulis (and, importantly, we case easily tell what that update is), and so we can easily describe the outcome of the computation.

+",1837,,,,,12/20/2019 11:46,,,,0,,,,CC BY-SA 4.0 +9267,1,9277,,12/20/2019 13:54,,0,182,"

How do we represent a qubit $\vert 1 \rangle$ and put in a superposition (in dirac)?

+",9567,,7528,,12/21/2019 9:37,12/21/2019 9:37,Represent qubit in a superposition,,3,0,,12/21/2019 13:50,,CC BY-SA 4.0 +9268,1,9275,,12/20/2019 14:34,,1,805,"

I am new to Qiskit and I am trying to implement some very simple 1-qubit gates.

+ +

I want to initialize the state of the qubit (to 0 and then to 1) and then apply the gate and print the new state of the qubit.

+ +
def I(input):
+
+  q = QuantumRegister(1) 
+  c = ClassicalRegister(1)
+  qc = QuantumCircuit(q, c)
+
+  if input == '1': #if input = 1, initialize the qubit to 1
+     qc.x(q[0])
+
+  qc.iden(q[0] )
+
+  qc.measure( q[0], c[0])
+
+
+  backend = Aer.get_backend('statevector_simulator')
+  result = qiskit.execute(qc, backend=backend, shots=1).result()
+  output = result.data(qc)
+
+  return output
+
+ +

And I call the function like this:

+ +
print('\nResults for the Iden gate')
+for input in ['0','1']:
+print('    Input',input,'gives output',I(input))
+
+ +

Now the output of all this is:

+ +
Results for the Iden gate
+Input 0 gives output {'statevector': [[1.0, 0.0], [0.0, 0.0]], 'counts': {'0x0': 1}}
+Input 1 gives output {'statevector': [[0.0, 0.0], [1.0, 0.0]], 'counts': {'0x1': 1}}
+
+ +

I know that the data() function returns the Instruction object, a list of Qubits objects and a list of classical bits with the order they added. +So here the second list is the list with the qubits.

+ +

But when the qubit is '0', shouldn't it return a list with all 0? I am not sure about the meaning of the output.

+",9569,,,,,12/21/2019 9:38,Print data() with statevector and qasm simulator - Qiskit,,1,0,,,,CC BY-SA 4.0 +9269,2,,9267,12/20/2019 14:36,,2,,"

$|1\rangle$ is not in superposition, it is simply state 1. After measurement you will get 1 with 100 % probability.

+ +

However, generaly, qubit can be represented as $|q\rangle = a|0\rangle + b|1\rangle$, where $a,b \in \mathbb{C}$. So, you can think of $|1\rangle$ as a superposition with $a=0$ and $b=1$.

+ +

Concerning second question, $|1\rangle = \begin{pmatrix}0\\1\end{pmatrix}$

+",9006,,,,,12/20/2019 14:36,,,,0,,,,CC BY-SA 4.0 +9270,1,,,12/20/2019 16:28,,15,470,"

Consider two noisy quantum channels (CPTP maps), $\Phi_1^A$ and $\Phi_2^A$, acting on a system $A$. Suppose that for any pure state $\left|\psi\right>\in \mathcal H_A$, +$$ +F\big(\psi, \Phi_1^A(\psi)\big) \geq F\big(\psi, \Phi_2^A(\psi)\big) +\tag{1} +$$ +where $F(\psi, \Phi(\psi))= \big<\psi\big|\Phi\big(\left| \psi \right>\left< \psi \right|\big) \big|\psi \big>$ is the fidelity between the initial state $\left|\psi \right>$ and the final state obtained after sending $\left|\psi \right>$ through the channel $\Phi$.

+ +

My question is: does Eq. (1) imply that +$$ +F_e\big(\rho^A,\Phi^A_1\big) \geq F_e\big(\rho^A,\Phi^A_2\big) +\tag{2} +$$ +for any density matrix $\rho^A$? +Here, $F_e$ denotes the entanglement fidelity, defined as +$$F_e(\rho^A, \Phi^A) = \big<\phi^{AB}\big|\big(\Phi^A\otimes I^B\big)\big(\left| \phi^{AB} \right>\left< \phi^{AB} \right|\big) \big|\phi^{AB}\big>, $$ +where $\left|\phi\right>^{AB} \in \mathcal H_A \otimes \mathcal H_B$ is a purification of the state $\rho^A$ to a system $B$. In other words, for any pure state $\left|\phi\right>^{AB} \in \mathcal H_A \otimes\mathcal H_B $, does Eq. (1) imply that +$$ +F\big(\phi^{AB}, (\Phi_1^A\otimes I^B)(\phi^{AB})\big) \geq F\big(\phi^{AB}, (\Phi_2^A\otimes I^B)(\phi^{AB})\big)? +$$

+ +

I believe that the answer to the question is yes, but I haven't found a way to prove it. The answer is certainly yes when $\rho_A$ is a pure state (i.e. when $\left|\phi\right>^{AB}$ is a product state) because $F_e(\left|\psi\right>\left<\psi\right|,\Phi) = F(\psi,\Phi(\psi))$. I've tried numerically searching for mixed states that violate the inequality (2) for a few simple choices of $\Phi_{1,2}$. For instance, taking $\Phi_1$ as the amplitude-damping channel and $\Phi_2$ as the depolarizing channel (with error rates chosen so that (1) is satisfied), I was not able to find a $\rho^A$ that violates (2). This suggests that (1) implies (2) at least for these particular channels.

+ +

To summarize, I'm looking for a proof that (1) implies (2), or else a counterexample showing that (1) does not imply (2). Thanks!

+",9568,,55,,11/22/2020 16:57,12/7/2022 21:36,Does higher channel fidelity imply higher entanglement fidelity?,,2,1,,,,CC BY-SA 4.0 +9271,2,,9267,12/20/2019 18:19,,3,,"

In your question, there is missing a key ingredient, which is: a superposition in which basis?

+ +

All pure (quantum) states are representable with only one non-zero coefficient in its native basis, and all pure states can be represented as a superposition in a different basis. Answer of @Martin Vesely gives you intuition how to represent $|1\rangle$ in a computational basis (which is its native basis). However, if you select a different basis set $\{|\psi_1\rangle, |\psi_2\rangle\}$, you can describe your state as:

+ +

$|1\rangle = \alpha_1 |\psi_1\rangle + \alpha_2|\psi_2\rangle$, where $\alpha_k = \langle\psi_k|1\rangle$, i.e. the overlap of your state with the basis that you're expanding in.

+ +

As an example, select $|\pm\rangle$ basis ($|\pm\rangle = \frac{1}{\sqrt{2}}(|0\rangle\pm|1\rangle)$, then $|1\rangle = \frac{1}{\sqrt{2}}(|+\rangle -|-\rangle)$, since $\langle \pm|1\rangle = \frac{1}{\sqrt{2}}$.

+ +

The same thinking you can apply to higher dimensional quantum states, with the difference, that you will have more basis elements (equal to dimensionality of the Hilbert space).

+",563,,,,,12/20/2019 18:19,,,,0,,,,CC BY-SA 4.0 +9272,1,9276,,12/20/2019 20:16,,5,130,"

The state vector is exponential in size, so we can manipulate an exponential quantity of information with a linear quantity of gates. However, this doesn't give us general exponential speedup because we can only extract $n$ bits of information from an $n$-qbit system via measurement. How powerful would quantum computers be if we could actually directly access the state vector, though? Would they be equivalent in power to a nondeterministic TM?

+",4153,,26,,12/21/2019 15:18,12/21/2019 15:18,How powerful would quantum computers be if we had direct access to the full state vector?,,1,2,,,,CC BY-SA 4.0 +9273,1,9274,,12/20/2019 21:49,,2,109,"

The repetition code encodes $\vert \psi \rangle = \alpha \vert 0 \rangle + \beta \vert 1 \rangle \rightarrow \vert \psi \rangle = \alpha \vert 000 \rangle + \beta \vert 111 \rangle$ using the following circuit:

+ +

+ +

where $$t_0: \vert \psi \rangle = (\alpha \vert 0 \rangle + \beta \vert 1 \rangle) \otimes \vert 0 \rangle \otimes \vert 0 \rangle = \alpha \vert 000 \rangle + \beta \vert 100 \rangle$$ +$$t_1: \vert \psi \rangle = \alpha \vert 000 \rangle + \beta \vert 110 \rangle$$ +$$t_2: \vert \psi \rangle = \alpha \vert 000 \rangle + \beta \vert 111 \rangle$$.

+ +

I am wondering what is the operator used from $t_0$ to $t_1$? +I understand that an XOR was applied there to get the desired output but what is the explicit operator (gate-wise or matrix-wise) used?

+ +

Furthermore, I tried $U = \mathbb{I} \otimes \mathbb{X} \otimes \mathbb{I}$ and applied it to $\vert \psi \rangle$ which resulted in $$\vert \psi \rangle = \alpha \vert 010 \rangle + \beta \vert 110 \rangle$$

+",7528,,,,,12/21/2019 8:04,Repetition code encoder circuit,,1,0,,,,CC BY-SA 4.0 +9274,2,,9273,12/20/2019 22:26,,4,,"

Operator applied from $t_{0}$ to $t_{1}$ is $CNOT \otimes I$, i.e. +\begin{equation} +U_1= +\begin{pmatrix} +1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ +0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ +\end{pmatrix} +\end{equation} +As a CNOT gate produces a entangled quantum state, it is not possible to express it as Kronecker product $I \otimes X$.

+ +

Your operator $I \otimes X \otimes I$ means that negation $X$ is applied on $|q_1\rangle$ and identical operator $I$ is applied on $|q_0\rangle$ and $|q_2\rangle$ always. There is no connection established between $|q_0\rangle$ and $|q_1\rangle$.

+ +

This operation changes your input qubits to $\alpha|000\rangle + \beta|110\rangle$.

+ +

Operation from $t_1$ to $t_2$ is decribed by following matrix: +\begin{equation} +U_2= +\begin{pmatrix} +1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ +0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ +0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ +\end{pmatrix} +\end{equation}

+ +

Application of $U_2U_{1}$ leads to state $\alpha|000\rangle + \beta|111\rangle$.

+",9006,,9006,,12/21/2019 8:04,12/21/2019 8:04,,,,6,,,,CC BY-SA 4.0 +9275,2,,9268,12/20/2019 23:43,,2,,"

The return from result.data(qc) is information about the result of running the circuit qc. In your example, there are 2 pieces of information returned - the statevector and the counts.

+ +

The statevector is a way of describing the state of the qubit, and the result contains the statevector from the end of the circuit. Each of the arrays in the overall array corresponds to a coefficient in front of one of the basis states, the first element is the real part and the second is the imaginary. So, for your Input 0 this statevector is saying at the end of the circuit the qubit was in the state
+$(1+0i)\vert 0 \rangle + (0+0i)\vert 1 \rangle$, which is the same as saying the qubit is in the $\vert 0 \rangle$ state.

+ +

The counts is saying how many times each output occurred in the results, so for Input 0 0x0 (aka 0) was the result once, which can be seen from the 1. This field is mainly used with the qasm_simulator.

+",5955,,5955,,12/21/2019 9:38,12/21/2019 9:38,,,,2,,,,CC BY-SA 4.0 +9276,2,,9272,12/21/2019 0:09,,3,,"
+

How powerful would quantum computers be if we could actually directly access the state vector, though?

+
+ +

Extremely powerful! Having direct state access to the state vectors would be equivalent to having a black box that takes a quantum circuit of your choice as input and tells you any amplitude of your choice to (say) polynomially many bits of precision. The relevant complexity class, in this case, is $\mathsf{P}^{\#\mathsf{P}}$ (= $\mathsf{P}^{\mathsf{PP}}$) i.e., you'll get a polynomial-time machine with a $\#\mathsf{P}$ oracle. This follows from the fact that computing quantum amplitudes is a $\#\mathsf{P}$-complete problem (see eg. Bernstein-Vazirani and Fenner-Green-Homer-Pruim). You'll find a summary here (PDF). Thanks to Prof. Scott Aaronson for providing me the wonderful references. Nevertheless, this implies such a quantum computer would be able to solve all problems in the polynomial hierarchy and by extension all problems in $\mathsf{NP}$ and $\mathsf{coNP}$, as well as all problems in $\mathsf{PP}$, while an ordinary quantum computer is supposed to efficiently solve only $\mathsf{BQP}$ problems. You might find the following diagram useful. $\mathsf{BQP}$ is the region shaded in green.

+ +

                                            

+ +
+

Would they be equivalent in power to a non-deterministic TM?

+
+ +

                                            

+ +

Note that $\mathsf{P}^{\mathsf{PP}}$ contains $\mathsf{PH}$ (by Toda's theorem), and $\mathsf{P}^{\mathsf{PP}}$ in turn is contained in $\mathsf{PSPACE}$. Both $\mathsf{PH}$ and $\mathsf{PSPACE}$ are describable in terms of polynomial-time alternating Turing machines 1, 2. Thus, such a machine with ""direct state access"" would indeed be as powerful as a polynomial-time non-deterministic Turing machine (in particular, a polynomial-time alternating Turing machine).

+ +

1: $\mathsf{PH}$ is the set of decision problems solvable in polynomial time on an alternating Turing machine with $k$ alternations starting in an existential (respectively, universal) state.

+ +

2: $\mathsf{PSPACE}$ is the set of problems decidable by an alternating Turing machine in polynomial time, sometimes called $\mathsf{APTIME}$ or $\mathsf{AP}$. ($\mathsf{PSPACE} = \mathsf{AP}$ due to [CKS81].)

+ +
+ +

+There's another related concept that you might find interesting. If you have a quantum computer that allows non-collapsing measurements along with intermediate collapsing measurements, then you then get a $\mathsf{PDQP}$ machine which can efficiently solve the Graph Isomorphism and Approximate Shortest Vector problems, unlike ordinary quantum computers. It can also search an unstructured $N$-element list in $\mathcal{O}(N^{1/3})$ time (but no faster than $\Omega(N^{1/4})$, and hence it cannot solve $\mathsf{NP}$-hard problems). For reference, check out The space ""just above"" BQP by Aaronson et al. (2014). + + +It can be shown that $\mathsf{PDQP}$ does not contain $\mathsf{NP}$ relative to an oracle. Also, while $\mathsf{PDQP}$ machines can solve problems in $\mathsf{SZK}$ in polynomial-time, it cannot efficiently solve all problem in $\mathsf{NP}$. Hence, such a machine would be less powerful than a non-deterministic Turing machine. +

+",26,,26,,12/21/2019 14:32,12/21/2019 14:32,,,,2,,,,CC BY-SA 4.0 +9277,2,,9267,12/21/2019 0:42,,3,,"

How about I approach your question from computer science perspective. A bit can be only $0$ or only $1$. A qubit can be only $0$, or only $1$, or a combination (superposition) of $0$ and $1$.

+ +

We denote a zero bit as $0$ and zero qubit as $\vert 0 \rangle$. We also denote a bit of value one as $1$ and a qubit of value one as $\vert 1 \rangle$. +Keep in mind that $$\vert 0 \rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \text{and } \vert 1 \rangle = \begin{bmatrix}0\\1\end{bmatrix}.$$ +The question now is how to represent superposition? +It is simple: it will be a combination of $\vert 0 \rangle$ and $\vert 1 \rangle$. Formally, a single-qubit $\psi$ is given as $$\vert \psi \rangle = \alpha \vert 0 \rangle + \beta \vert 1 \rangle$$ where $\alpha, \beta \in \mathbb{C}$ and $\vert \alpha \vert^2 + \vert \beta \vert^2 = 1$.

+ +

Note that $\alpha$ denotes the probability of getting $\vert 0 \rangle$ and $\beta$ denotes the probability of getting $\vert 1 \rangle$.

+ +

For example, if $\alpha = 0$, then $\beta = 1$, hence, +$$\vert \psi \rangle = \alpha \vert 0 \rangle + \beta \vert 1 \rangle$$ +$$\vert \psi \rangle = 0 \times \vert 0 \rangle + 1 \times \vert 1 \rangle$$ +$$\vert \psi \rangle = \vert 1 \rangle$$

+ +

which means our qubit will always be ""$1$"" or $\vert 1 \rangle$ (i.e., our single-qubit collapses to $\vert 0 \rangle$ 0% of the time and $\vert 1 \rangle$ 100% of the time).

+ +

How about we make $\alpha = \dfrac{1}{\sqrt{2}}$, then, $\beta = \dfrac{1}{\sqrt{2}}$, hence, we have: +$$\vert \psi \rangle = \alpha \vert 0 \rangle + \beta \vert 1 \rangle$$ +$$\vert \psi \rangle = \dfrac{1}{\sqrt{2}} \vert 0 \rangle + \dfrac{1}{\sqrt{2}} \vert 1 \rangle$$ +So, when we measure our single-qubit, it collapses to $\vert 0 \rangle$ 50% of the time and $\vert 1 \rangle$ 50% as well.

+ +

In general, performing a measurement on a qubit destroys its superposition (i.e., the qubit will behave as a bit after measurement, it could be only 0 or only 1).

+ +

Furthermore, you should have a look at the Hadamard Gate which takes a qubit and turns it into superposition.

+",7528,,,,,12/21/2019 0:42,,,,0,,,,CC BY-SA 4.0 +9278,2,,9242,12/21/2019 0:49,,2,,"

Let's say that you're working in the energy eigenbasis of a quantum harmonic oscillator $\dagger$ and label the basis states as $\{|0⟩_H,|1⟩_H,|2⟩_H,…\}$, and you have the basis $\{|0⟩_Q,|1⟩_Q\}$ for your qubit. $d$ would be $\text{min}(𝑁,2)=2$ in this case. Then say you choose the basis $$\{|0_Q0_H⟩,|0_Q2_H⟩,|1_Q0_H⟩,|1_Q2_H⟩\}$$ for $\Bbb C^2\otimes \Bbb C^2$. Or you could choose the $$\{|0_Q+_H⟩,|0_Q−_H⟩,|1_H+_Q⟩,|1_H−_H⟩\}$$ basis, where $|+⟩=\frac{1}{\sqrt 2}(|0⟩+|1⟩)$ and $|−⟩=\frac{1}{\sqrt 2}(|0⟩+|1⟩)$. Both are fine.

+ +

A valid $|\Omega⟩$ would be $\frac{1}{\sqrt 2}(|0_Q+_H⟩+|1_Q−_H⟩)$. Another valid $|\Omega⟩$ would be $\frac{1}{\sqrt 2}(|0_Q0_H⟩+|1_Q2_H⟩)$. Both the $|\Omega⟩$'s are perfectly good examples of maximally mixed states! I'm not sure ""how do I know how to choose the kets?"" is the right question.

+ +

You're right that any maximally entangled state can be constructed by applied local unitaries on some (non-unique) $|\Omega⟩$. ""Ill-defined"" is not the right term here; it's just ""non-uniquely defined"". The point is that any maximally mixed state is of the form $(I\otimes U)|\Omega⟩$ and can be expressed as some (constrained) combination of (non-unique) basis states of some (non-unique) subspace $\Bbb C^d\otimes \Bbb C^d$ of $H_A\otimes H_B$.

+ +

Perhaps you were confused because you were thinking $|\Omega\rangle$ is some unique state. That's certainly not the case! The description of $|\Omega⟩$ simply provides the mathematical structure that we expect of a legitimate maximally entangled state.

+ +

The author writes $\Bbb C^d \otimes \Bbb C^d$ and not $\Bbb C^{d^2}$ in order to emphasize that a basis is being determined for a composite system. Of course, there exists an isomorphism between the two. The idea is to choose a subspace of a common dimension for both $H_A$ and $H_B$. I do not think there's any other deeper reason for why the author chooses to write $\Bbb{C}^{d}\otimes \Bbb{C}^d$ rather than $\Bbb C^{d^2}$.

+ +
+ +

$\dagger$: In general, the Hilbert space for a quantum harmonic oscillator is infinite-dimensional i.e. $L^2(\Bbb R)$ and things get complicated. Keyl et al. apparently have a paper (arXiv:quant-ph/0212014) on this topic.

+",26,,26,,12/21/2019 16:27,12/21/2019 16:27,,,,0,,,,CC BY-SA 4.0 +9279,2,,2722,12/21/2019 16:47,,4,,"

Aaronson and Christiano proved the security of their scheme in an oracle model, where they assume the verifier has access to a membership oracle to some subspace $A$. In order to turn this into actual quantum money, it is ""sufficient"" to implement ""such an oracle"".

+ +

How would one do that? And what is ""such an oracle""? Well, the simplest question is to implement the oracle as a bank which would answer queries for you, that is, to implement private quantum money. If someone would manage to create a classical program they could give you, such that whatever you could learn from inspecting the program you could also learn just by querying it, this would constitute a full blown black box. This is the notion of Virtual Black Box (VBB), and it is known to be impossible under a variety of assumptions.

+ +

Thus, a weaker notion is required. AC tried an ad-hoc approach, where they suggested a specific subspace obfuscator (a sufficiently large list of random low degree polynomials which vanish on the hidden subspace), which were famously broken shortly after.

+ +

In a yet to be published work, Mark Zhandry has shown how an appropriate obfuscator could be constructed under the assumption of indistinguishability obfuscators and the existence of one way bijections (cf. chapter 5), which is considerably milder than the black box assumption but is still quite stronger than, say, one way functions.

+ +

So the state of the art for AC's construction is that it can be made public under the assumption of indistinguishability obfuscation (and one way bijections).

+ +

Edit: After reading the comment I realized that I've missed some of the nuance on the question.

+ +

In ACs scheme $r$ is a basis for the vector space used to construct the money state. $S_r$ is a membership oracle for that space and its dual. The basis itself is no longer required for verification. Yes, holding on to r allows to create many bills with identical serial numbers, though don't understand their incentive to do so. Also note that in the AC schemes, a small amount of identical bills (linear in the security parameter) suffices to learn how to create infinitely many identical bills without ever being told $r$ (because if you measure, say $n$ random vectors from an $n/2$-dimensional space, you get a spanning set with overwhelming probability).

+ +

Also, as far as I understand, neither of the two schemes you mentioned allows for users to know how many coins were minted without trusting the mint.

+",9575,,9575,,12/22/2019 13:44,12/22/2019 13:44,,,,14,,,,CC BY-SA 4.0 +9280,1,9285,,12/21/2019 18:06,,11,435,"

I've read in the Nielsen's, Chuang's ""Quantum Computation and Quantum Information"":

+ +
+

Classical simulation begins with the realization that in solving a simple differential equation such as $dy/dt = f(y)$, to first order, it is known that $y(t + \Delta t) \approx y(t) + f (y)\Delta t$. Similarly, the quantum case is concerned with the solution of $id|\psi \rangle/dt = H|\psi \rangle$, which, for a time-independent $H$, is just $$|\psi(t)\rangle = e^{-iHt}|\psi(0)\rangle.\ \ \ \ \ \ (4.96)$$ + Since H is usually extremely difficult to exponentiate (it may be sparse, but it is also + exponentially large), a good beginning is the first order solution $|\psi(t + \Delta t)\rangle \approx (I − iH \Delta t)|\psi(t)\rangle$. This is tractable, because for many Hamiltonians $H$ it is straightforward to compose quantum gates to efficiently approximate $I − iH \Delta t$. However, such first order solutions are generally not very satisfactory.

+ +

Efficient approximation of the solution to Equation (4.96), to high order, is possible for many classes of Hamiltonian. For example, in most physical systems, the Hamiltonian can be written as a sum over many local interactions. Specifically, for a system of $n$ particles, + $$ H = \sum_{k=1}^L H_k,\ \ \ \ \ \ \ (4.97)$$ + where each $H_k$ acts on at most a constant c number of systems, and L is a polynomial in $n$. For example, the terms $H_k$ are often just two-body interactions such as $X_i X_j$ and one-body Hamiltonians such as $X_i$. [...] The important point is that although $e^{−iHt}$ is difficult to compute, $e^{−iH_kt}$ acts on a much smaller subsystem, and is straightforward to approximate, using quantum circuits.

+
+ +

This may be a silly question, but I'm stuck with this one. Does the difficulty of obtaining $e^{-iHt}$ lies only in its size? Both $e^{-iHt}$ and $e^{-iH_kt}$ can be seen as matrices (of course, the first one is immensely larger than the latter one) and a Taylor series can be used to approximate both of them. This in turn boils down to just making a number of multiplications of $H$ (with different coefficients standing by the consecutive matrices). So, it makes sense for a sparse matrix to be easier to obtain, because we just don't have to do a number of multiplications, which would at the end give 0.

+ +

There are two things that come to my mind. First of which is a divide-and-conquer approach, where obtainment of $e^{-iH_kt}$ is simple and all ""small"" results are combined to get a big one. In fact, I think that Trotterization is this kind of approach. The second thing is a guess, that maybe $e^{-iH_kt}$ can be computed in some different way, than using Taylor series (it's a really wild guess)?

+",2098,,16606,,5/24/2022 9:39,5/24/2022 9:39,Where does precisely the difficulty in exponentiating a Hamiltonian $H$ in the quantum simulation problem lay?,,1,0,,,,CC BY-SA 4.0 +9281,1,,,12/21/2019 18:54,,2,99,"

Is it possible to write a Q# teleportation code which returns a qubit?

+ +

Thanks.

+",8487,,8487,,4/12/2020 15:28,4/12/2020 15:28,Is it possible to write a Q# teleportation code which returns a qubit?,,1,0,,,,CC BY-SA 4.0 +9282,1,9298,,12/21/2019 20:09,,4,180,"

To find the state of a qubit on the Bloch sphere we use the following formula:

+ +

\begin{equation} +|\psi\rangle=\mathrm{cos}\frac{\theta}{2}|0\rangle+\mathrm{e}^{i\phi}\mathrm{sin}\frac{\theta}{2}|1\rangle +\end{equation} +Is there any built-in function/operation for that in Q#? If not, how to implement this formula in the Q# code? I'm interested in both preparing a qubit in this state given the two angles, and finding the angles given a qubit in some unknown state.

+ +

Thanks.

+",8487,,2879,,12/22/2019 19:22,12/22/2019 19:39,What is the corresponding code for finding the state of a qubit on the Bloch sphere?,,1,2,,,,CC BY-SA 4.0 +9283,2,,8799,12/21/2019 20:09,,0,,"

I chatted with my physicist friend. If I understand him correctly, the modern view certainly uses the probabilistic cloud description. However this does not contradict with the motion of electrons which causes orbiting current (and momentum), as long as the motion does not change the probabilistic distribution. In other words, we cannot view each electron with a deterministic orbit, but the whole probabilistic cloud can move around the nucleus without changing the distribution.

+ +

Please feel free to correct this understanding. Thanks.

+ +

Happy holidays.

+",8321,,,,,12/21/2019 20:09,,,,0,,,,CC BY-SA 4.0 +9284,1,9293,,12/21/2019 20:19,,2,268,"

I saw a tutorial on this long ago, but lost it. I know that the Pauli-Z operator compiles to Rz, but how? Here are the steps I remember:

+ +

First, we have to solve for $U(t)$ in the Schrodinger equation for time-independent Hamiltonians:

+ +

$$U(t) = e^{-iHt}$$

+ +

It's weird to have a matrix in an exponent, so we use the Taylor series expansion of the exponential function:

+ +

$$ +e^x = \sum_{n=0}^{n=\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \ldots +$$

+ +

Which gives us:

+ +

$$ +U(t) = e^{-iHt} = +\sum_{n=0}^{n=\infty} \frac{(-iHt)^n}{n!} = +1 + (-iHt) + \frac{(-iHt)^2}{2!} + \frac{(-iHt)^3}{3!} + \ldots +$$

+ +

Now we use the Taylor series expansions for sine and cosine:

+ +

$$ +\sin(x) = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \ldots +$$

+ +

$$ +\cos(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \ldots +$$

+ +

I know there's some way of rewriting $U(t)$ in terms of sine and cosine, then I need to get to Rz:

+ +

$$ +Rz = +\begin{bmatrix} +e^{-i \frac{\theta}{2}} & 0 \\ +0 & e^{i \frac{\theta}{2}} +\end{bmatrix} +$$

+ +

What are the steps I'm missing? Thanks!

+",4153,,4153,,12/21/2019 22:28,12/22/2019 16:53,Compiling the Pauli-Z operator to the Rz operator for Hamiltonian simulation,,3,2,,,,CC BY-SA 4.0 +9285,2,,9280,12/21/2019 20:48,,7,,"

TL;DR: Hamiltonian simulation does not just mean ""exponentiating $H$"". It means finding a quantum circuit $U$ that approximates the matrix exponentiation $e^{-iHt}$. More importantly, the size of the Hamiltonian matrix $H$ isn't the key concern here. The gate complexity (or query complexity, in case the Hamiltonian is described as an oracle) of matrix exponentiation is. Simulating arbitrary matrix exponentiations using quantum circuits is computationally very expensive. By imposing specific restrictions on the structure of the local interaction $H_k$ matrices (like, $H_k$ can act on at most constant $c$ number of systems), the complexity of the simulation can be reduced.

+ +
+ +

Definitions

+ +

The basic goal of the Hamiltonian simulation problem, given a Hamiltonian $H$ ($2^n\times 2^n$ Hermitian matrix acting on $n$ qubits), is to find an algorithm that approximates $U$ such that $||U - e^{-iHt}|| \leq \epsilon$, where $e^{-iHt}$ is the ideal evolution and $||.||$ is the operator norm (aka spectral norm)

+ +

$$||A|| := \mathrm{max}_{|\psi\rangle\neq 0}\frac{||A|\psi\rangle||}{|||\psi\rangle||},$$ where $||\psi\rangle|| = \sqrt{\langle \psi|\psi\rangle}$ is the usual Euclidean norm of $|\psi\rangle$.

+ +

The key that determines the hardness of this problem is not so much the size of $H$ but rather the gate complexity (gate complexity and time complexity are more or less proportional). In order for the Hamiltonian simulation to be efficient, we need $U$ to be approximable by a quantum circuit containing $\mathrm{poly}(n)$ gates. Most Hamiltonians $H$ do not satisfy this criterion and are thus not efficiently simulable (you may ask for the proof for this as a separate question if you're curious!).

+ +

Commuting Hamiltonians

+ +

Fortunately, most physically occurring Hamiltonians can indeed be simulated efficiently. A very special case is the class of $k$-local Hamiltonians - these Hamiltonians can be expressed as $H = \sum_{j=1}^{m} H_j$ where each $H_j$ acts non-trivially on at most $k$-qubits. We generally assume that $m \leq \binom{n}{k} = \mathcal{O}(n^k)$. Since $k$ is supposed to be a constant, $m$ is polynomial in $n$.

+ +

It can be proved from the Solovay-Kitaev theorem that each of the individual $H_j$ operators can be simulated efficiently (cf. Ashley Montanaro's lecture notes). Now if the $H_j$'s commute we have

+ +

$$\exp(-iHt) = \exp(-i(\sum_{j=1}^m H_j)) = \prod_{j=1}^{m}\exp(-iH_jt).$$

+ +

From here it can also be shown that for any $t$ there exists a quantum algorithm that approximates the operator $e^{-iHt}$ to within $\epsilon$ in time $\mathcal{O}(m \ \mathrm{polylog}(m/\epsilon))$.

+ +

Non-Commuting Hamiltonians

+ +

However, this technique does not work for non-commuting Hamiltonian $H_j$'s since the formula $e^{-i(A+B)t} = e^{-iAt}e^{-iBt}$ does not hold for non-commuting matrices $A$ and $B$. But the Lie-Trotter product formula comes to our rescue, which says

+ +
+

Let $A$ and $B$ be Hermitian matrices such that $||A|| \leq K$ and $||B|| \leq K$, for some real $K$. Then $e^{-iA}e^{-iB} = e^{-i(A+B)} + \mathcal{O}(k^2)$.

+
+ +

Applying this formula multiple times, for any Hermitian matrices $H_1, H_2, \ldots$ satisfying $||H_j|| \leq K \leq 1$ for all $j$.

+ +

$$e^{-iH_1}e^{-iH_2}\ldots e^{-iH_m} = e^{-i(H_1+\ldots + H_m)} + \mathcal{O}(m^3K^2).$$

+ +

Therefore, there is a universal constant $C$ such that if $r \geq Cm^3(Kt)^2/\epsilon$,

+ +

$$||e^{-iH_1t/r}e^{-iH_2t/r}\ldots e^{-iH_mt/r}|| \leq \epsilon/r.$$

+ +

Hence, for any such $n$

+ +

$$||(e^{-iH_1t/r}e^{-iH_2t/r}\ldots e^{-iH_mt/r})^r - e^{-i(H_1 + \ldots + H_m)}|| \leq \epsilon$$

+ +

follows from the lemma which states that if $(U_i), (V_i)$ are sequences of $m$ unitary operators satisfying $||U_i - V_i||$ for all $1\leq i \leq m$, then $||U_m\ldots U_1 - V_m\ldots V_1||\leq m\epsilon$.

+ +

Given this result, any $k$-local Hamiltonian can be simulated simply by simulating the evolution of each term for time $t/r$ to high enough accuracy and concatenating the individual simulations. Larger the $r$, more accurate the simulation. This can be formalized as

+ +
+

Let $H$ be a Hamiltonian which can be written as the sum of $m$ terms $H_j$, each acting non-trivially on $k = \mathcal{O}(1)$ qubits and satisfying $||H_j|| \leq K$ for some $K$. Then, for any $t$, there exists a quantum circuit which approximates the operator $e^{−iHt}$ to within $\epsilon$ in time $\mathcal{O}(m^3(Kt)^2/\epsilon)$, up to polylogarithmic factors.

+
+ +

The $t^2$ dependency can be further lowered, and the complexity can be improved to $\mathcal{O}(mkt)$. You're right that there are other techniques of Hamiltonian simulation like the Taylor series ($\mathcal{O}(\frac{t\log^2(t/\epsilon)}{\log \log \frac{t}{\epsilon}}$)) and quantum walk ($\mathcal{O}(\frac{t}{\sqrt{\epsilon}})$). With the quantum signal processing algorithm it is $\mathcal{O}(t + \log \frac{1}{\epsilon})$.

+ +

References

+ + +",26,,26,,12/21/2019 21:22,12/21/2019 21:22,,,,2,,,,CC BY-SA 4.0 +9286,2,,9284,12/21/2019 22:24,,1,,"

So, you have:

+ +

$$ +U(t) = e^{-iHt} = +\sum_{n=0}^{n=\infty} \frac{(-iHt)^n}{n!} = +1 + (-iHt) + \frac{(-iHt)^2}{2!} + \frac{(-iHt)^3}{3!} + \ldots +$$

+ +

which expands to:

+ +

$$ +U(t) = +1 - i(Ht) - \frac{(Ht)^2}{2!} + \frac{i(Ht)^3}{3!} + \frac{(Ht)^4}{4!} - \frac{i(Ht)^5}{5!} - \frac{(Ht)^6}{6!} \ldots +$$

+ +

Note that raising $-1$ and $i$ to different powers follows the cycle $1 \rightarrow -i \rightarrow -1 \rightarrow i \rightarrow 1$. Note also that for $H = \sigma_z$, $H^2 = \mathbb{I}$, the identity matrix. Thus the above series becomes:

+ +

$$ +U(t) = +1 - i(Ht) - \frac{t^2}{2!} + \frac{iHt^3}{3!} + \frac{t^4}{4!} - \frac{iHt^5}{5!} - \frac{t^6}{6!} \ldots +$$

+ +

Recall the Taylor series expansions of sine and cosine:

+ +

$$ +\sin(x) = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \ldots +$$

+ +

$$ +\cos(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \ldots +$$

+ +

You can extract $\cos(x)$ from the $U(t)$ series directly:

+ +

$$ +U(t) = \cos(t) -iHt + \frac{iHt^3}{3!} - \frac{iHt^5}{5!} + \frac{iHt^7}{7!} + \ldots +$$

+ +

From which it's easy to extract $\sin(x)$:

+ +

$$ +U(t) = \cos(t) - iH \left( t - \frac{t^3}{3!} + \frac{t^5}{5!} - \frac{t^7}{7!} + \ldots \right) = \cos(t) - iH\sin(t) +$$

+ +

Now multiply both sides of the equation by the identity matrix and expand $H$ to get:

+ +

$$ +\begin{bmatrix}1 & 0 \\ 0 & 1\end{bmatrix}U(t) = \begin{bmatrix}1 & 0 \\ 0 & 1\end{bmatrix} \left( \cos(t) - i \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}\sin(t) \right) +$$ +$$ +U(t) = +\begin{bmatrix}\cos(t) & 0 \\ 0 & \cos(t)\end{bmatrix} - \begin{bmatrix} i\sin(t) & 0 \\ 0 & -i\sin(t) \end{bmatrix} +$$ +$$ +U(t) = \begin{bmatrix}\cos(t) - i\sin(t) & 0 \\ 0 & \cos(t) + i\sin(t)\end{bmatrix} +$$

+ +

Recall the identity for Euler's formula:

+ +

$$e^{ix} = \cos(x) + i\sin(x)$$

+ +

So we finally have:

+ +

$$U(t) = e^{-iHt} = \begin{bmatrix} e^{-it} & 0 \\ 0 & e^{it} \end{bmatrix} = Rz(2t)$$

+",4153,,4153,,12/21/2019 23:02,12/21/2019 23:02,,,,5,,,,CC BY-SA 4.0 +9287,1,9294,,12/22/2019 1:14,,3,191,"

Here's the Rz matrix:

+ +

$$ +Rz(\theta) = +\begin{bmatrix} +e^{-i\theta/2} & 0 \\ +0 & e^{i\theta/2} +\end{bmatrix} +$$

+ +

As I understand it, Rz rotates around the Z axis on the Bloch sphere. Since $|+\rangle$ and $|-\rangle$ are both on the Bloch sphere X-Y plane, it seems you should be able to rotate between them; however, I can't figure out a value of $\theta$ to do that.

+ +

Am I misunderstanding how the rotation gates work, or is there just a solution I'm not seeing?

+",4153,,,,,12/25/2019 6:13,Can you use Rz to flip from $|+\rangle$ to $|-\rangle$?,,4,0,,,,CC BY-SA 4.0 +9288,2,,9264,12/22/2019 1:37,,4,,"

Quantum teleportation has been suggested to be possible to occur in photosynthetic reaction centers. https://doi.org/10.1007/BF03166259

+ +

And it could in principle be occuring all the time through photochemistry in biology. Though to no real purpose, however, a related purposeful effect is the avian compass which(is hypothesized) to operate through quantum effects.

+ +

And more recently teleportation was demonstrated in a small molecule photosynthetic mimic. https://doi.org/10.1038/s41557-019-0332-8

+ +

Sorry if there are paywalls.

+",9579,,,,,12/22/2019 1:37,,,,2,,,,CC BY-SA 4.0 +9289,2,,9287,12/22/2019 2:01,,3,,"

If you use $\theta = \pi$, you get the following:

+ +

$$ +Rz(\pi)\begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} = +\begin{bmatrix} +e^{-i \pi/2} & 0 \\ +0 & e^{i \pi/2} +\end{bmatrix} +\begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} = +\begin{bmatrix} +-i & 0 \\ +0 & i +\end{bmatrix} +\begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} = +-i\begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{-1}{\sqrt{2}} \end{bmatrix} +$$

+ +

Which is equal to $|-\rangle$ under the global phase $-i = e^{-i\pi/2}$.

+",4153,,,,,12/22/2019 2:01,,,,1,,,,CC BY-SA 4.0 +9290,2,,9284,12/22/2019 5:38,,2,,"

The Euler's formula for Pauli matrices $\sigma_i$ is +$$e^{ix\sigma_i} = \cos(x)I + i\sin(x)\sigma_i$$ +Applying it to $\sigma_z$ gives +$$e^{ix\sigma_z} = \cos(x)I + i\sin(x)\sigma_z$$ +and +$$U(t) = e^{-i\sigma_zt} = \begin{bmatrix} e^{-it} & 0 \\ 0 & e^{it} \end{bmatrix} = R_z(2t)$$

+",2105,,,,,12/22/2019 5:38,,,,0,,,,CC BY-SA 4.0 +9291,2,,9287,12/22/2019 5:56,,2,,"

Just think where $|+\rangle$ and $|-\rangle$ states on the Bloch sphere ($x$ axis):

+ +

+",2105,,,,,12/22/2019 5:56,,,,0,,,,CC BY-SA 4.0 +9292,2,,9287,12/22/2019 7:33,,1,,"

On IBM Q the Rz gate is defined as

+ +

\begin{equation} +Rz(\theta) = +\begin{pmatrix} +1 & 0 \\ +0 & \mathrm{e}^{i\theta} +\end{pmatrix} +\end{equation}

+ +

If you put $\theta = \pi$ then the matrix turns to

+ +

\begin{equation} +Rz(\pi) = +\begin{pmatrix} +1 & 0 \\ +0 & \mathrm{e}^{i\pi} +\end{pmatrix} += +\begin{pmatrix} +1 & 0 \\ +0 & -1 +\end{pmatrix} +=Z +\end{equation} +Hence $Rz(\pi)|+\rangle = |-\rangle$.

+ +

You can rewrite your matrix as

+ +

\begin{equation} +Rz(\theta) = +\begin{pmatrix} +\mathrm{e}^{-i\frac{\theta}{2}} & 0 \\ +0 & \mathrm{e}^{i\frac{\theta}{2}} +\end{pmatrix} += +\mathrm{e}^{-i\frac{\theta}{2}} +\begin{pmatrix} +1 & 0 \\ +0 & \mathrm{e}^{i\theta} +\end{pmatrix} +\end{equation}

+ +

Hence the only difference is a global phase.

+ +

Overall, Rz gate matrix as defined on IBM Q seems to more convinient as you do not have to deal with a global phase coeficient.

+",9006,,,,,12/22/2019 7:33,,,,4,,,,CC BY-SA 4.0 +9293,2,,9284,12/22/2019 8:06,,2,,"

There are certain misconceptions apparent from your question, and I'll attempt to clear those first.

+ +
    +
  1. It's not weird to have matrices in the exponent. They arise very naturally when studying linear differential equations of the form $\frac{dx(t)}{dt} = ax(t)$ where $x$ is a real or complex variable. Such differential equations have unique solutions of the form $ke^{at}x(0)$. Now if you have a system of differential equations like $\mathbf{x}'(t) = \mathbf{A}(t)\mathbf{x}(t) := (x_1'(t) \ \ldots \ x_n'(t))^T = \mathbf{A}(t)(x_1(t) \ \ldots \ x_n(t))$ where $\mathbf A$ is a $n\times n$ matrix of real or complex coefficients, we suppose that the solution is of the form $\mathbf x(t) = e^{\mathbf At}\mathbf x(0)$ and then go forth and prove that it is indeed the correct and unique solution iff $e^\mathbf{A}$ is defined as $$\sum_{m=0}^{\infty}\frac{\mathbf{A}^m}{m!}.$$

    + +

    And no wonder, Schrödinger's equation is a linear (partial) differential equation that dictates the evolution of quantum states! Are you beginning to see the link now? Things can be made more rigorous here but I'd probably refer you to a differential equations textbook instead.

  2. +
  3. Be very careful regarding the application of power series. The series expansion you wrote for $e^x$ only holds for real and complex numbers $x$. A matrix isn't a number! The point is, the exponential of a matrix is defined as a power series because real functions can be ""lifted"" to square matrix functions (cf. matrix function). To emphasize, $e^{-iHt}$ is defined as $\sum_{m=0}^{m=\infty} \frac{(-iHt)^m}{m!}$ and is not a Taylor expansion in the usual sense.

    + +

    I'll give you a quick idea of how the definition of matrix exponentials $e^{\mathbf{A}}$ is motivated from the study of linear differential equations. Consider the linear ordinary differential equation system

    + +

    $$\frac{d}{dt}\mathbf{y}(t) = \mathbf{A} \mathbf {y}(t)$$

    + +

    where $\mathbf{A}$ is a $k\times k$ matrix and $\mathbf{y}(t)$ is the column vector $(y_1(t),\ldots , y_k(t))^T$.

    + +

    From here $$\frac{d^2}{dt^2}\mathbf y(t)=\frac{d}{dt}\mathbf A\mathbf y(t)=\mathbf A\frac{d}{dt}\mathbf y(t)=\mathbf A^2\mathbf y(t)$$

    + +

    and by induction, you can show that

    + +

    $$\frac{d^n}{dt^n}\mathbf y(t)=\mathbf A^n\mathbf y(t).$$

    + +

    By application of Taylor's theorem about $t=0$

    + +

    $$\mathbf y(t)=\sum_{n=0}^\infty\left.\frac{d^n}{dt^n}\mathbf y(t)\right|_{t=0}\frac{t^n}{n!}=\sum_{n=0}^\infty\mathbf A^n\mathbf y(0)\frac{t^n}{n!}=\sum_{n=0}^\infty\frac{(\mathbf At)^n}{n!}\mathbf y(0).$$

    + +

    Now the term $\sum_{n=0}^\infty\frac{(\mathbf At)^n}{n!}$ is labelled $e^{\mathbf{A}t}$. So strictly speaking (reiterating what I said before), $\sum_{n=0}^\infty\frac{(\mathbf At)^n}{n!}$ is not the ""Taylor expansion"" of $e^{\mathbf{A}t}$ but rather its defintion. This is a subtle point but is absolutely necessary to keep in mind to avoid misconceptions. Most people who do not find matrix exponentials ""intuitive"" are really stuck at this point.

  4. +
  5. Diagonal matrices like Pauli $Z$ have some nice properties. Firstly, a matrix like $\mathbf{A} = \mathrm{diag}(a_1, \ldots, a_n)$ has $n$ independent eigenvectors $e_1, \ldots, e_n$ and $n$ eigenvalues $a_1, \ldots, a_n$. Moreover, $$\mathbf{A}^m = \mathrm{diag}^m(a_1,\ldots , a_n) = \mathrm{diag}(a_1^m,\ldots, a_n^m)$$ which you can prove by induction. From the above you should be able to see that $$e^{\mathbf{A}} = \sum_{m=0}^{\infty} \frac{\mathbf{A}^m}{m!} = \mathrm{diag}(\sum_{m=0}^{\infty} \frac{a_1^m}{m!},\ldots,\sum_{m=0}^{\infty}\frac{a_n^m}{m!}) =\mathrm{diag}(e^{a_1}, \ldots, e^{a_n}).$$

  6. +
  7. The Pauli $Z$ matrix is $\mathrm{diag}(1, -1)$ and thus, $-iZt = \mathrm{diag}(-it, it)$. And from the above discussion it is clear that $$e^{-iZt} = \mathrm{diag}(e^{-it}, e^{it}) = \begin{bmatrix}e^{-it} && 0 \\ 0 && e^{it}\end{bmatrix},$$ which matches your description of $R_z(\theta)$ when $\frac{\theta}{2} = t$ or $\theta = 2t$, and so $e^{-iZt} = R_z(\theta = 2t)$. The Hamiltonian simulation would be equivalent to performing a rotation about the $z$-axis (of the Bloch sphere) by an angle of $\theta = 2t$.

  8. +
  9. Alternatively, for diagonal matrices, matrix functions $f(\mathbf{A}) $ can be directly defined as $\mathrm{diag}(f(a_1), \ldots, f(a_n)))$ instead of going via the power series definition (cf. diagonalizable matrices). This is the reason why I had earlier mentioned that it's possible to directly write down $e^{-iZt} = \text{diag}(e^{-it}, e^{it}) = R_z(\theta = 2t)$ without even invoking the Taylor series.

  10. +
  11. The decomposition into sines and cosines and invoking of Euler's formula were unnecessary in your answer. Diagonal and diagonalizable matrices make things much simpler and that is often the case in quantum mechanics as we mostly deal with Hermitian matrices (note that all Hamiltonian operators are Hermitian). For infinite-dimensional operators, diagonalization manifests in form of the spectral theorem.

  12. +
  13. Matrix exponentials (exponential maps) play a crucial role in the study of Lie groups and in translating them to Lie algebras. They're not merely some weird and ugly series expansion formulae, but are deeply rooted in differential geometry and can be visualized nicely in those terms. More on that some other day!

  14. +
+ +

This answer became a bit lengthier than usual, but I hope that I at least managed to somewhat convince you as to why it's not weird to have matrices in exponents. :)

+",26,,26,,12/22/2019 16:53,12/22/2019 16:53,,,,0,,,,CC BY-SA 4.0 +9294,2,,9287,12/22/2019 9:20,,3,,"

The more elegant approach is to view $R_z(\phi)$ as a linear transformation acting on the basis $\{|0\rangle, |1\rangle\}$. $|0\rangle$ is mapped to $e^{i\phi/2}|0\rangle$ and $|1\rangle$ is mapped to $e^{-i\phi/2}|1\rangle$ by the transformation. As, $|+\rangle = \frac{1}{\sqrt 2}(|0\rangle +|1\rangle)$ it'd be mapped to $R_z(\phi)|+\rangle = \frac{1}{\sqrt 2}(e^{i\phi/2}|0\rangle + e^{-i\phi/2}|1\rangle)$. Now the question is, for what value of $\phi$ (if at all), $R_z|+\rangle$ coincides with $|-\rangle = \frac{1}{\sqrt 2}(|0\rangle - |1\rangle)$. As global phase factors are irrelevant in quantum mechanics, you just need to check for what value of $\phi$ (if at all) the coefficients of the basis vectors are in proportion i.e.,

+ +

$$\frac{e^{i\phi/2}}{e^{-i\phi/2}} = \frac{1}{-1} \implies e^{i\phi} = -1 \implies e^{i\phi} = e^{i\pi} \implies \phi = \pi$$

+ +

assuming $\phi \in [0, 2\pi)$.

+ +

Obviously, the Bloch sphere visualization (as in @kludg's answer) makes it even more evident. You can clearly see that a anti-clockwise rotation of $\phi = \pi$ (180 degrees) about the $z$-axis ($|0\rangle$ - $|1\rangle$ axis) takes the $|+\rangle$ state to the $|-\rangle$ state.

+ +
+

                                            

+
+ +

P.S: I used $R_z(\phi)$ instead of $R_z(\theta)$ in order to match the convention in the above diagram.

+",26,,26,,12/25/2019 6:13,12/25/2019 6:13,,,,0,,,,CC BY-SA 4.0 +9295,1,,,12/22/2019 9:48,,4,197,"

How to rigorously prove that finite Hamiltonians (for $n$-qubit systems), in general, are not efficiently$\dagger$ simulable (in the Hamiltonian simulation sense) using $\mathrm{poly}(n)$ number of quantum gates?

+",26,,,,,12/22/2019 12:19,Proof that most Hamiltonian evolutions are not efficiently approximable by quantum circuits,,1,2,,,,CC BY-SA 4.0 +9296,2,,9295,12/22/2019 12:19,,4,,"

Perhaps not absolutely rigorous, but....

+ +

We know that the vast majority of unitaries require exponentially large circuits. So, define $H=i\ln U$. The vast majority of these Hamiltonians take exponentially long to simulate. While there is ambiguity in taking the log, it doesn’t matter how you choose to resolve that ambiguity because they are all “bad”.

+",1837,,,,,12/22/2019 12:19,,,,0,,,,CC BY-SA 4.0 +9297,2,,9281,12/22/2019 18:01,,2,,"

I think the code example closest to what you're looking for is task 1.4 of the Teleportation kata which gives the learner three qubits (the message qubit and the pair of qubits that Alice and Bob will entangle and share before teleportation) and asks them to transform the Bob's qubit into the message state. You'll notice that the test for this task doesn't check any classical values - it checks that the state of Bob's qubit is the same as the state in which the message qubit was prepared.

+ +

Q# doesn't allow to allocate a new qubit inside an operation and return it, so you'll need to allocate your input and output qubits before the teleportation.

+",2879,,,,,12/22/2019 18:01,,,,0,,,,CC BY-SA 4.0 +9298,2,,9282,12/22/2019 19:39,,5,,"

Prepare a qubit in state $|\psi\rangle=\mathrm{cos}\frac{\theta}{2}|0\rangle+\mathrm{e}^{i\phi}\mathrm{sin}\frac{\theta}{2}|1\rangle$, given the angles $\psi$ and $\theta$.

+ +

Let's start with a qubit in the $|0\rangle$ state, as is customary for Q#.

+ +
    +
  • You can use one of the general library operations to prepare the state, such as PrepareArbitraryState.
  • +
  • Or you can easily do it yourself using a sequence two gates: + +
      +
    • Ry($\theta$) will transform the qubit from the $|0\rangle$ state to $|\psi\rangle=\cos\frac{\theta}{2}|0\rangle+\sin\frac{\theta}{2}|1\rangle$,
    • +
    • R1($\phi$) will further transform that state into the state you need.
    • +
  • +
+ +
+ +

Figure out the angles $\psi$ and $\theta$, given a qubit in some unknown state.

+ +

This is not possible to do in Q#, unless you're willing to do some hacks that will not work on a quantum device. Since real quantum systems don't allow you to peek into their state to get their exact coefficients, Q# doesn't allow you to do this on language level either.

+ +

However, if you're running a program on a full-state simulator, you can work around this and use DumpMachine function to output the qubit state and then analyze it. Here is an example of such output for state $|-i\rangle = \frac{1}{\sqrt2}|0\rangle - \frac{i}{\sqrt2}|1\rangle$:

+ +
# wave function for qubits with ids (least to most significant): 0
+∣0❭:     0.707107 +  0.000000 i  ==     ***********          [ 0.500000 ]     --- [  0.00000 rad ]
+∣1❭:     0.000000 + -0.707107 i  ==     ***********          [ 0.500000 ]    ↓    [ -1.57080 rad ]
+
+ +

Given the complex amplitudes of the state, you can figure out $\psi$ and $\theta$.

+",2879,,,,,12/22/2019 19:39,,,,1,,,,CC BY-SA 4.0 +9299,1,9309,,12/22/2019 23:45,,2,152,"

I'm running this program (essentially a two bit random number generator) on ibmqx2 in IBM Q Experience. The backend matters. Other machines give unexpected results, but the graph looks different for other backends. So far ibmqx2 has been a good choice because a) it produces results that are far from the expected outcome and b) it produces results that are consistent run over run.

+ +
OPENQASM 2.0;
+include ""qelib1.inc"";
+gate nG0 ( param ) q  {
+ h q;
+}
+
+qreg q[2];
+creg c[2];
+
+h q[0];
+h q[1];
+measure q[0] -> c[0];
+measure q[1] -> c[1];
+
+ +

I always get results with the following shape. Note that ""11"" is a full ten points higher than ""10"". That happens almost every run. Any idea what's going on? +

+",9583,,9583,,12/23/2019 0:30,12/24/2019 4:08,Simple program produces consistently skewed results in IBM Q Experience,,2,0,,,,CC BY-SA 4.0 +9300,2,,8898,12/22/2019 23:55,,4,,"

I take your statement that programmers ""don't need to know the machinery behind the prevailing paradigm"" to mean that most scientific programmers need not know how a $\mathsf{NAND}$ gate is realized, with, say, a set of $6$ or so transistors.

+ +

However, probably a concept that is fundamental in quantum computing, that can be understood by anyone familiar with logical operations like $\mathsf{AND}$, $\mathsf{OR}$, etc. is that of reversible computing. For example quantum computing logical gates must be reversible, and gates like $\mathsf{NAND}$ etc. are ruled out. Information is lost in such gates.

+ +

However, gates like $\mathsf{XNOR}$ are still allowed in quantum computing (because they are reversible, and the input could be recovered.)

+ +

Because information cannot be erased in quantum circuits, it becomes difficult, though not impossible, to program recursive subroutines with reversible gates. See e.g. this Quanta article on the problems of recursion in quantum computing, and the recent breakthrough of Gidney.

+",2927,,,,,12/22/2019 23:55,,,,0,,,,CC BY-SA 4.0 +9301,1,9306,,12/23/2019 2:57,,5,1903,"

Elements of Quantum Computing draws a distinction between "Wave Mechanics" and "Matrix Mechanics" (p. 38). I believe the reason we use a matrix formulation is that we are not dealing with continuous quantities like position, but finite quantities like spin. But I would like to validate this assumption.

+

Quantum Information: A Brief Overview and Some Mathematical Aspects also notes this distinction on p. 3.

+

I believe my earlier version of this question mixed "Wave Mechanics" and "Matrix Mechanics" with Schrodinger and Heisenberg respectively. While Heisenberg was the first to introduce matrices to QM, his picture of QM is different than Schrodinger's. I believe that Von Neumann was able to unite these two pictures into the postulates we know and love today as described in this paper.

+",4693,,4693,,7/14/2021 19:03,7/14/2021 19:03,Why does quantum computing generally use matrix formulation of quantum mechanics rather than a continuous variable formulation?,,3,11,,,,CC BY-SA 4.0 +9302,1,,,12/23/2019 3:18,,1,343,"

I ran into a problem of how to extract circuit depth from Cirq circuit object. In Cirq circuits consist of a list of Moments. Number of moments is not equal to the circuit depth in general case. +I might be missing something, but I looked into documentation and source code and still wasn't able to find it.

+ +

So, I am wondering if there is a simple way to extract circuit depth?

+ +

This is one of the main circuit properties, it is very strange why it is not implemented directly. For example in Qiskit there are methods qc.depth() and qc.count_ops().

+ +

Thanks!

+",7896,,26,,12/23/2019 22:39,12/23/2019 22:39,Computing circuit depth in Cirq,,1,0,,,,CC BY-SA 4.0 +9303,2,,9299,12/23/2019 5:10,,1,,"

Each quantum processor has specific so-called error rate and a little bit different type of noise caused by specific conditions the processor runs in. Therefore, results produced by same circuits can be different on different quantum processors.

+ +

In your case, there is apparently a bias caused by some external factors specific for ibmqx2. You can try to run your program after ibmqx2 recalibration which occurs in regular intervals (ask IBM Q support when a next maintanance is planned). After that, results can be more correct, i.e. closer to uniform distribution.

+",9006,,,,,12/23/2019 5:10,,,,4,,,,CC BY-SA 4.0 +9304,2,,9302,12/23/2019 7:55,,4,,"

On hardware, the number of moments is the relevant metric. That is why cirq focuses on that.

+ +

To compute circuit depth in cirq, create a new circuit using just the operations. It defaults to packing them as tightly as possible, so the number of moments will be the depth.

+ + + +
depth = len(cirq.Circuit(my_circuit.all_operations()))
+
+",119,,,,,12/23/2019 7:55,,,,0,,,,CC BY-SA 4.0 +9305,2,,9301,12/23/2019 8:31,,1,,"

The quantum circuit model does not use the Heisenberg picture of quantum mechanics. Also, what is ""Dirac's Matrix Mechanics""? Quantum computing widely uses Dirac's bra-ket notation.

+ +

Quantum circuit model considers how state vectors of qubits are transformed by quantum gates which follows the Schrödinger picture of quantum mechanics.

+ +
+ +

PS: Maybe I need to say more. The difference between Schrödinger and Heisenberg pictures of QM is totally unrelated to the difference between differential equation and matrices.

+ +

Suppose I have a qubit +$$|0\rangle=\begin{pmatrix} +1\\ +0 +\end{pmatrix}$$ +and apply Hadamard gate to it; as a result, the state of the qubit changes: +$$ +\begin{pmatrix} +1\\ +0 +\end{pmatrix}\rightarrow\frac{1}{\sqrt{2}} +\begin{pmatrix} +1&1\\ +1&-1 +\end{pmatrix} +\begin{pmatrix} +1\\ +0 +\end{pmatrix} +=\frac{1}{\sqrt{2}} +\begin{pmatrix} +1\\ +1 +\end{pmatrix} +$$ +This is Schrödinger way of thinking, and it is used in Quantum Computing without saying it explicitly.

+ +

Heisenberg picture of QM is very different; It goes as follows: suppose I have $S_z$ spin operator, +$$S_z=\frac{\hbar}{2}\sigma_z=\frac{\hbar}{2}\begin{pmatrix} +1&0\\ +0&-1 +\end{pmatrix}$$ +and apply Hadamard gate to it: +$$S_z\rightarrow\frac{1}{\sqrt{2}} +\begin{pmatrix} +1&1\\ +1&-1 +\end{pmatrix}S_z +\frac{1}{\sqrt{2}} +\begin{pmatrix} +1&1\\ +1&-1 +\end{pmatrix}=\frac{\hbar}{2} +\begin{pmatrix} +0&1\\ +1&0 +\end{pmatrix}=S_x +$$ +That is, Hadamard gate transforms $S_z$ operator to $S_x$ operator (or transforms $\sigma_z$ Pauli matrix to $\sigma_x$ Pauli matrix).

+ +

This is Heisenberg way of thinking; I'm not sure it suits well to quantum circuit model.

+",2105,,2105,,12/23/2019 14:14,12/23/2019 14:14,,,,0,,,,CC BY-SA 4.0 +9306,2,,9301,12/23/2019 9:30,,6,,"

Semantics aside, I’m assuming that your question is essentially “why do we use a matrix formulation of quantum mechanics rather than a continuous variable/differential equation/integral formulation” (I may be wrong and would welcome clarification) and nothing to do with the interaction picture and the like, which some other answers seem to be touching upon.

+ +

Largely, we use the bra-ket notation of Dirac, so we might write quantities such as $\langle\psi|\phi\rangle$. These are very abstract entities. You can choose to represent these abstract entities using either a vector/matrix formalism of an integral formalism. It doesn't matter.

+ +

However, we typically choose to use vectors just because it tends to make the maths easier. Vectors have, somewhat more obviously, properties such as orthogonality built into them, so I don't end up evaluating integrals all the time. Particularly when I want to talk about a two-level system, I could describe it using two continuous functions $\psi_0(x)$ and $\psi_1(x)$, but it's just overkill.

+ +

The sort of problem that I studied as an undergraduate would talk, for example, about the infinite square well. You'd be given some initial state $f(x)$, and asked what it looks like at some later time. Perhaps you have to evaluate the probability that the particle is on the right-hand side of the well. By far the quickest way of doing this is to decompose +$$ +f(x)=\sum_n\alpha_n\psi_n(x), +$$ +where $\psi_n(x)$ are the stationary states of energy $E_n$. The only thing I really care about is the discrete set of values $\alpha_n$, which are most conveniently stored as a vector. Then the solution would be +$$ +\sum_n\alpha_ne^{-iE_nt}\psi_n(x). +$$ +Next, I decompose the state of being on the right-hand side of the well as +$$ +\sum_n\beta_n\psi_n(x). +$$ +The probability that the final state is on that side is +$$ +\left|\sum_n\beta_n^\star\alpha_ne^{-iE_nt}\right|^2. +$$ +The only integrals that I need to do are to evaluate the $\alpha_n$ and $\beta_n$. The rest of the calculation is more easily done using orthogonality/linearity properties which are all present in the integral form, but are harder to see. So you very quickly start abstracting away from the integral form and are naturally led towards linear algebra.

+",1837,,1837,,12/23/2019 17:48,12/23/2019 17:48,,,,1,,,,CC BY-SA 4.0 +9307,2,,9301,12/23/2019 11:21,,6,,"

Quantum computing, in general, does not use Heisenberg's matrix mechanics or Dirac's interaction picture.

+ +

I suggest that you carefully read the Wikipedia page on dynamical pictures. The differences between the Heisenberg picture, the Schrödinger picture and Dirac (interaction) picture are well summarized in the following chart. The development of matrix mechanics, as a mathematical formulation of quantum mechanics, is attributed to Werner Heisenberg, Max Born, and Pascual Jordan.)

+ +

+ +

In the widely used circuit model of quantum computing, the qubit states evolve in time as per the Schrödinger equation $|\Psi_s(t)\rangle = e^{-iH_st}|\Psi_s(0)\rangle$ (by application of quantum gates) while the observables are constant (note that observables in quantum mechanics are defined in terms of positive operator-valued measures). For details, read this section. So your claim that quantum computing (or quantum information theory for that matter) uses Heisenberg's matrix mechanics, is incorrect.

+ +

I presume your confusion arose because you saw matrices all around in quantum computing textbooks and thought they use some kind of ""matrix mechanics"", but in reality, Heisenberg's matrix mechanics is something completely different i.e., it's an algebraic approach to quantum mechanics using mathematical devices like ladder operators. Moreover, in Heisenberg's matrix mechanics quantum states remain constant while the operators evolve (see kludg's answer for an example). Nevertheless, DaftWullie's answer explains why matrices are preferable to using continuous-wave functions for low-dimensional finite systems like qubits in quantum computing if that's what you were confused about.

+ +

Nearly 100 years ago, von Neumann had already fairly rigorously shown the equivalence (under certain reasonable assumptions cf. this) among all the three pictures with his separable Hilbert space formulation of quantum mechanics (which really underpins all of modern quantum mechanics and quantum information theory); the three pictures differ only by a basis change with respect to time-dependency. It's just that one picture might be more useful than another in certain contexts.

+ +

Rotation of state vectors in the Hilbert space is easier to visualize than evolving observables and that's one of the reasons why the Schrödinger picture preferred in introductory approaches to quantum mechanics. And, in general, quantum computing just deals with ""toy"" systems from quantum mechanics i.e., finite-dimensional qubit or qudit systems, whereas very high-dimensional or infinite-dimensional systems are much more prevalent in the real-world (though, there are exceptions like continous variable quantum information that makes use of physical observables like the strength of electromagnetic fields whose values belong to continuous intervals).

+",26,,26,,12/29/2019 23:20,12/29/2019 23:20,,,,4,,,,CC BY-SA 4.0 +9309,2,,9299,12/24/2019 4:08,,4,,"

It seems like the skew is indeed high on qubit 0. I ran a single Hadamard followed by measure on this qubit, and see about 13% skew. The other qubits on this device seem fine (less than 2% skew).

+ +

This is probably an error on the backend's discriminator (i.e. manifesting as high readout error). To see this, you can try applying readout error mitigation (code for this exists in Qiskit Ignis). When I do this, the skew is completely gone.

+ +

+ +

This will be fixed on the backend. Thanks for reporting.

+",2503,,,,,12/24/2019 4:08,,,,4,,,,CC BY-SA 4.0 +9310,1,,,12/24/2019 6:19,,3,382,"

Does unit testing on real quantum computers make sense as any observation in the quantum system can cause the system to loose its superposition state?

+",8487,,8487,,4/11/2022 12:56,4/11/2022 12:56,Unit testing for quantum programs?,,3,1,,,,CC BY-SA 4.0 +9312,2,,9310,12/24/2019 10:14,,3,,"

From what I know, no testing framework exists yet for quantum computing. I searched approximately one year ago for one and did not find anything.

+ +

But this does not mean you can't test!

+ +

Below are the methods I ended up using when I saw that no specialised testing framework for quantum computing was out there in the wild.

+ +

Unitary simulation

+ +

This method can only be used for small circuits. It uses $2^{2n + 8 + 1}$ octets of memory, $n$ being the number of qubits used by the circuit. With 8Go of RAM, you can use this method up to $\approx 11$ qubits. A computer with 32Go of RAM can go up to $\approx 12$ qubits.

+ +

1. Circuits given by unitary matrices (no ancilla)

+ +

Imagine that some quantum algorithm requires me to implement the operation $e^{-iZ\otimes F t}$ for $Z$ Pauli $\sigma_z$ gate and $F$ a known Hermitian matrix.

+ +

I implemented this gate with a quantum circuit $C$ that does not need any ancilla qubit and I now want to check that my implementation implements correctly (maybe up to a given error) $e^{-iZ\otimes Ft}$. As the quantum circuit $C$ is assumed to act on a small number of qubits (remember, circuits are assumed small in this section), I can use a little linear algebra to compute the unitary matrix that $C$ implements.

+ +

Hopefully, some frameworks already implement the linear algebra part. For example qiskit has a unitary simulator.

+ +

The final test code would look like this in pseudo-code (as it is not specialised to one testing framework nor to one quantum computing framework):

+ +
import numpy
+
+qubit_number = 5
+absolute_error_tol = 1e-3
+relative_error_tol = 1e-3
+
+qcirc = get_quantum_circuit(qubit_number)
+implemented_unitary = unitary_simulator(qcirc).get_unitary()
+expected_unitary = numpy.zeros((2**qubit_number, 2**qubit_number),
+                               dtype=numpy.complex)
+
+assert numpy.allclose(
+    implemented_unitary,
+    expected_unitary,
+    atol=absolute_error_tol,
+    rtol=relative_error_tol
+)
+
+ +

2. Circuit given by unitary matrices (with ancillas)

+ +

To test quantum circuits that require ancilla qubits, you should ""separate"" the ancillas from the meaningful qubits.

+ +

Here I assume that all the ancillas are pushed to the end, i.e. the last qubits are all ancillas. For example: $\vert x \rangle \vert v(x) \rangle \vert a \rangle$. If it is not the case, you will need to change the indexing of the example program at the end of this section according to your quantum register layout.

+ +

Now that there are ancillas we have something else to check: are all the ancillas returned to $\vert 0 \rangle$ at the end of my quantum circuit? In other words, the action of my quantum circuit on the ancillas must be the identity matrix.

+ +

The pseudo-code for this kind of quantum circuits:

+ +
import numpy
+
+qubit_number = 5
+ancillas_number = 3
+absolute_error_tol = 1e-3
+relative_error_tol = 1e-3
+
+qcirc = get_quantum_circuit(qubit_number, ancillas_number)
+implemented_unitary = unitary_simulator(qcirc).get_unitary()
+expected_unitary = numpy.zeros((2**qubit_number, 2**qubit_number),
+                               dtype=numpy.complex)
+
+# The implemented_unitary is a matrix of size
+# (2**(qubit_number + ancillas_number), 2**(qubit_number + ancillas_number))
+# whereas the expected_unitary is of size
+# (2**(qubit_number), 2**(qubit_number)). In order to compare the
+# 2 matrices, we should ""upgrade"" the expected_unitary with identity matrices.
+expected_unitary = numpy.kron(expected_unitary, numpy.identity(2**ancillas_number))
+
+assert numpy.allclose(
+    implemented_unitary,
+    expected_unitary,
+    atol=absolute_error_tol,
+    rtol=relative_error_tol
+)
+
+ +

Statevector simulation

+ +

For simulable circuits. It uses $2^{n + 4 + 1}$ octets of memory, $n$ being the number of qubits used by the circuit. With 8Go of RAM you can use this method up to $\approx 27$ qubits. A computer with 32Go of RAM can go up to $\approx 29$ qubis. Qiskit's online simulator ibmq_qasm_simulator can go up to $32$ qubits.

+ +

1. Circuit given by unitary matrix that use a lot of ancillas

+ +

The unitary matrix simulation method is usefull, but cannot be used for medium-sized and large quantum circuits because of its large memory footprint.

+ +

When the tested quantum circuit has a lot of ""garbage"" qubits (i.e. ancillas), a little trick can allow us to test it, even if the quantum circuit needs $n + a > 20$ qubits (where $a$ is the number of ancilla qubits and $n$ is the number of ""interesting"" qubits, i.e. the total number of qubits minus the number of ancillas).

+ +

The trick is the following: as ancilla qubits should be given in the $\vert 0 \rangle$ state and returned to the same state, the input space of your quantum circuit is reduced from $2^{n+a}$ (the number of input states possible when counting the ancilla qubits) to $2^{n}$ (the number of input states really possible as ancillas should always be given in $\vert 0 \rangle$). +This means that if $n$ is sufficiently small, you can simulate the action of your quantum circuit on all the $2^n$ possible input states, and verify that the output state is correct (ancillas back to $\vert 0 \rangle$, ""interesting"" qubits in the expected state, ...).

+ +

To compute the expected state of your $n$ ""interesting"" qubits, you have 2 ways:

+ +
    +
  1. Construct the unitary matrix of size $\left( 2^n, 2^n \right)$ that represent the expected evolution performed by your quantum circuit and apply it to the input quantum state.
  2. +
  3. Compute ""by hand"" the expected output quantum state.
  4. +
+ +

For this kind of test, here is the pseudo code.

+ +
import numpy
+
+qubit_number = 5
+ancillas_number = 3
+absolute_error_tol = 1e-3
+relative_error_tol = 1e-3
+
+qcirc = get_quantum_circuit(qubit_number, ancillas_number)
+
+# The unitary matrix that your circuit should implement.
+# Replace initialisation with your unitary matrix.
+reduced_evolution = numpy.zeros((2**qubit_number, 2**qubit_number),
+                                dtype=numpy.complex)
+
+for state in range(2**qubit_number):
+    # If state = 10 (base 10), do:
+    # 10 -> 8+2 -> 1010 (base 2) -> |1010> -> vector of size 16 with zeros everywhere
+    #                                         except in the 10th entry where there is a 1.
+    qstate = integer_state_to_vector(state)
+    expected_qstate = reduced_evolution @ qstate # matrix-vector multiplication
+
+    computed_qstate = simulate(qcirc, input_state=qstate).get_statevector()
+    # The compute_qstate is a vector of 2^{qubit_number + ancillas_number} complex values.
+    # It should be the tensor product between expected_qstate and |0...0> (ancilla qubits
+    # should be reverted to |0> at the end).
+    ancilla_state_full_zero = numpy.zeros((2**ancilla_state, ), dtype=numpy.complex)
+    ancilla_state_full_zero[0] = 1.0
+
+    assert numpy.allclose(
+        numpy.kron(expected_qstate, ancilla_state_full_zero),
+        computed_qstate,
+        atol=absolute_error_tol,
+        rtol=relative_error_tol,
+    )
+
+ +
+ +

Footnote: I think I missed some things, I will come back to this answer as soon as I have more time. Do not hesitate to ask me questions if something is not explained enough.

+",1386,,,,,12/24/2019 10:14,,,,0,,,,CC BY-SA 4.0 +9313,1,9315,,12/24/2019 16:47,,4,801,"

I want to write matrix representation of qubit swap algorithm, but I seem to be stuck. +Here is the circuit I am trying to calculate using linear algebra: +

+ +

Initially $q_0 = |0\rangle$ or $\begin{pmatrix}1 & 0\end{pmatrix}^T$ while $q_1 = |1\rangle$ or $\begin{pmatrix}0 & 1\end{pmatrix}^T$ and at the end of measurement I should be getting opposite outcomes. I know that to apply first $CNOT$ gate I should first do Kronecker product on the two vectors and than multiply it by $CNOT$ matrix, but I cant figure out what needs to be done next, particularly how to apply second $CNOT$ to my quantum state (control bit $q_1$, target bit $q_0$).

+ +

Any help would be appreciated.

+",9325,,9006,,12/25/2019 7:26,12/25/2019 7:26,Representing qubit swap using linear algebra,,3,0,,,,CC BY-SA 4.0 +9314,2,,9313,12/24/2019 17:46,,1,,"

The Swap gate is represented by the matrix \begin{bmatrix} 1&0&0&0\\0&0&1&0\\0&1&0&0\\0&0&0&1\end{bmatrix}

+ +

+ +

-- Example from book Quantum Computing: An Applied Approach by Jack Hidary

+",4693,,,,,12/24/2019 17:46,,,,1,,,,CC BY-SA 4.0 +9315,2,,9313,12/24/2019 20:22,,6,,"

Here, what you need to do is to understand writing CNOT gate based on the control qubit.

+ +
    +
  1. Your first CNOT gate has qubit 1 as control and qubit 2 as target. So, what this means is the second qubit will not be flipped until qubit 1 is set to zero. I am going to use computational basis for this $CNOT_1\left|00\right> = \left|00\right>$, $CNOT_1\left|01\right> = \left|01\right>$, $CNOT_1\left|10\right> = \left|11\right>$,$CNOT_1\left|11\right> = \left|10\right>$.
  2. +
+ +

$CNOT_1 = \left[\begin{matrix}1 & 0 &0 &0\\ 0 & 1&0&0\\0&0&0&1\\0&0&1&0\end{matrix}\right]$.

+ +
    +
  1. Your second CNOT gate has qubit 1 as target and qubit 2 as control. Thus, until qubit 2 is set to 1, qubit 1 will not flipped. Again, using the computational basis $CNOT_2\left|00\right> = \left|00\right>$, $CNOT_2\left|01\right> = \left|11\right>$, $CNOT_2\left|10\right> = \left|10\right>$,$CNOT_2\left|11\right> = \left|01\right>$.
  2. +
+ +

$CNOT_2 = \left[\begin{matrix}1 & 0 &0 &0\\0&0&0&1\\0&0&1&0\\ 0 & 1&0&0\end{matrix}\right]$.

+ +
    +
  1. Your third CNOT gate is $CNOT_1$.
  2. +
+ +

What you can do to get the SWAP gate is apply these CNOT gates in the order they were applied.

+",2598,,,,,12/24/2019 20:22,,,,0,,,,CC BY-SA 4.0 +9316,1,9356,,12/24/2019 21:53,,4,299,"

I would like some help on what should be a simple computation that I'm failing to see through to the end. Suppose I have a qubit which can be in the state $|v\rangle$ with probability $p$, or $|w\rangle$ with probability $1-p$. I will choose some unitary basis $|a\rangle, |b\rangle$, and measure the qubit -- if I get $a$ I will guess the state was $v$, and if I get $b$ I will guess the state was $w$. My probability of success is +$$S = p|\langle a|v \rangle|^2 + (1-p)|\langle b | w \rangle|^2$$ +What I want is to maximize this probability. I can think of $a,b$ as functions of some parameter and apply calculus: +$$S' = p 2 \Re(\langle a' | v \rangle \langle v | a \rangle) + (1-p)2\Re(\langle b' | w\rangle \langle w | b\rangle)$$ +If we're setting this to $0$ we can ignore the factor of $2$.

+ +

Since $\langle a | a \rangle = 1$, differentiating we obtain $\Re\langle a' | a \rangle = 0$, and similarly $\Re\langle b'|b \rangle = 0$.

+ +

Writing for now $v = v_a a + v_b b$ we get $\langle v|a \rangle = \overline{v_a}$. Hence +$$\Re(\langle a'|v\rangle \langle v|a \rangle) = \Re(v_a \overline{v_a} \langle a'|a \rangle + \overline{v_a}v_b \langle a'|b \rangle)$$ +but since $v_a \overline{v_a} = |v_a|^2$ is real and $\langle a' | a \rangle$ is purely imaginary the first term dies and we obtain $\Re(\overline{v_a}v_b \langle a'|b \rangle)$. A similar computation goes for $w$, and in the end we can write

+ +

$$0 = S'/2 = \Re(p \overline{v_a}v_b \langle a'|b \rangle + (1-p) w_a \overline{w_b} (-\overline{\langle a'|b \rangle}))$$

+ +

where I used $\langle b'|a \rangle = - \overline{\langle a'|b \rangle}$ which is obtained by differentiating the relation $\langle a | b \rangle = 0$.

+ +

This is where I get stuck. It feels like I need to combine these terms somehow so some kind of cancellation between the $\langle a'|b \rangle$ and $- \overline{\langle a'|b \rangle}$ terms happen, but I don't see how to do it. Any help is greatly appreciated.

+ +

Edit: I realize now we can use $w_a \overline{w_b} = \overline{\overline{w_a}w_b}$ to obtain +$$p \Re(\overline{v_a}v_b \langle a'|b \rangle) = (1-p) \Re(\overline{w_a}w_b \langle a'|b \rangle)$$ where I can ignore the conjugate over everything on the right hand side since we're taking the real part.

+ +

(What I wrote previously after this did not make sense)

+",9168,,55,,11/11/2020 21:38,11/11/2020 21:38,Finding the optimal projective measurement to distinguish between two pure states,,1,6,,,,CC BY-SA 4.0 +9317,2,,9313,12/24/2019 23:28,,1,,"

I would add that there is also a Hadamard gate applied on a second qubit, so you will get states $|00\rangle$ and $|10\rangle$, both with a probability 50 %.

+ +

Matrix representatation of your circuit is

+ +

\begin{equation} +CNOT_1CNOT_2CNOT_1(I\otimes H) +\end{equation}

+ +

To implement only swap gate, you should remove the Hadamard gate.

+ +

Note that I used notation $CNOT_1$ and $CNOT_2$ introduced by Purva Thakre.

+",9006,,,,,12/24/2019 23:28,,,,1,,,,CC BY-SA 4.0 +9318,2,,9310,12/25/2019 2:23,,0,,"

IBM offers online access to their quantum computer to test quantum programs. Here is the link: https://www.ibm.com/quantum-computing/technology/experience. You can use the portal to check your programs by running them on an actual quantum computer.

+",9126,,9126,,12/25/2019 3:34,12/25/2019 3:34,,,,1,,,,CC BY-SA 4.0 +9319,1,,,12/25/2019 2:54,,4,97,"

I know this does vary to some extent from implementation to implementation, but I'm looking for broad 'classes' of noise.

+ +

For example, I know a very common source of noise/error is the environment - things like thermal noise, and another common source is issues with gate fidelity. Is there any sort of comprehensive list of broad classes of error like this?

+ +

Any reference here would be greatly appreciated if the list is too long for a single answer.

+",91,,,,,12/25/2019 2:54,What types of noise are there?,,0,2,,,,CC BY-SA 4.0 +9320,1,9324,,12/25/2019 5:10,,7,969,"

In Chapter 6 of ""Quantum Computation and Quantum Information"" textbook by Nielsen and Chuang, Exercise 6.5 p.255:

+ +
+

We have an oracle gate $O$ for $n$ qubit ($2^n=N$ searching items), + and we would like to construct new oracle gate $O'$ for $n+1$ qubit ($2^{n+1}=2N$ searching items) using oracle gate $O$ and extra bit $|q\rangle$ so that new oracle gate $O'$ should mark an item only if it is solution for the oracle gate $O$ and extra bit $|q\rangle$ is $|0\rangle$.

+
+ +

The exact question in the Nielsen and Chuang textbook as follows:

+ +
+

A new augmented oracle $O'$ is constructed which marks an item only + if it is a solution to the search problem and the extra bit is set to zero.

+ +

Exercise 6.5: Show that the augmented oracle $O'$ may be constructed using one + application of $O$, and elementary quantum gates, using the extra qubit $|q\rangle$.

+
+ +

Possible not very good solutions:

+ +

+ +

The problem with this solution is related to the fact that it requires to open up an Oracle gate $O$ in order to ""control"" it.

+ +

Does anybody have an idea of how to construct gate $O'$ using ""pure"" gate $O$ without ""open up"" them?

+",9545,,26,,12/25/2019 6:39,7/14/2020 0:33,"Nielsen and Chuang, Exercise 6.5: How to simulate oracle for n+1 qubits using one oracle gate for n qubits and one extra qubit?",,4,0,,,,CC BY-SA 4.0 +9321,2,,9320,12/25/2019 8:50,,0,,"

I don't think it's possible. I think that was the authors idea - to apply controlled $O$ +(despite the fact it's impossible to control black boxed unitaries https://arxiv.org/abs/1309.7976)

+ +

Update

+ +

As Craig Gidney answer suggests, we actually can control unknown black boxes if they just permute a known basis. Though we need to use an ancilla.

+",5870,,5870,,12/25/2019 15:59,12/25/2019 15:59,,,,0,,,,CC BY-SA 4.0 +9322,1,9323,,12/25/2019 10:38,,1,118,"

While reading ""Quantum Computation and Quantum Information"" (by Nielsen and Chuang) I came across this line

+ +
+

A little thought shows that if we apply $U_f$ to the state $\vert x \rangle (\dfrac{\vert 0 \rangle - \vert 1 \rangle}{\sqrt{2}})$ + then we obtain the state $(-1)^{f(x)} \vert x \rangle (\dfrac{\vert 0 \rangle - \vert 1 \rangle}{\sqrt{2}})$

+
+ +

Which was mentioned when explaining Deutsch's problem, where $\vert x, y \rangle$ is mapped to $\vert x, y \oplus f(x) \rangle$.

+ +

I was wondering, is this statement true for all unitary operations? Or is it limited to Deutsch's problem?

+",9325,,55,,9/17/2021 7:10,9/17/2021 7:10,"In Deutsch's algorithm, how to we get $(-1)^{f(x)}|x\rangle(|0\rangle-|1\rangle)$ from $|x\rangle(|0\rangle-|1\rangle)$?",,1,0,,,,CC BY-SA 4.0 +9323,2,,9322,12/25/2019 11:25,,4,,"

It is limited to matrix $U_f$ which maps $|x,y\rangle$ to $|x,y\oplus f(x)\rangle$, and the little thought is

+ +

$$U_f|x,-\rangle=\frac{1}{\sqrt{2}}(|x,0\oplus f(x)\rangle-|x,1\oplus f(x)\rangle)=$$ +$$=\begin{cases} +|x,-\rangle & \text{if }f(x)=0\\ +-|x,-\rangle & \text{if }f(x)=1 +\end{cases}=(-1)^{f(x)}|x,-\rangle$$ +where $x\in\{0,1\}$ or generally $x\in\{0,1\}^n$

+",2105,,,,,12/25/2019 11:25,,,,0,,,,CC BY-SA 4.0 +9324,2,,9320,12/25/2019 12:31,,10,,"

The simplest solution is to use an ancilla in the $|+\rangle$ state. Swap that ancilla for the oracle's output qubit, conditioned on the control qubit being false, before and after applying the oracle. Since toggling the $|+\rangle$ state has no effect, this deactivates the oracle when the control is set.

+ +

Here's this technique applied to a simple comparison oracle:

+ +

+ +

If you're not allowed to use an ancilla, I'm not sure how to make it work unless you have access to the square root of the oracle. The best I know how to do is to have the controlled oracle bitflip and phaseflip the target. Or to bitflip the target but have a 90 degree phase kickback onto the control for satisfying inputs.

+ +

+ +

+ +

Summary Update - simple solution with ancilla +

+",119,,9545,,1/2/2020 10:08,1/2/2020 10:08,,,,3,,,,CC BY-SA 4.0 +9325,2,,9320,12/25/2019 13:41,,0,,"

After some ideas of @Craig Gidney probably i found the following simple solution: +

+",9545,,,,,12/25/2019 13:41,,,,4,,,,CC BY-SA 4.0 +9326,1,9330,,12/25/2019 16:24,,6,200,"

It is well known that a quantum computer is reversible. This means that it is possible to derive an input quantum state $|\psi_0\rangle$ from an output $|\psi_1\rangle$ of an algorithm described by a unitary matrix $U$ simply by applying transpose conjugate to $U$, i.e.

+ +

\begin{equation} +|\psi_0\rangle = U^\dagger|\psi_1\rangle +\end{equation}

+ +

In article Arrow of Time and its Reversal on IBM Quantum Computer an algorithm for a time reversal and going back to an input data $|\psi_0\rangle$ is proposed. Steps of the algorithm are following:

+ +
    +
  1. Apply a forward time unitary evolution $U_\mathrm{nbit}|\psi_0\rangle = |\psi_1\rangle$
  2. +
  3. Apply an operator $U_\psi$ to change $|\psi_1\rangle$ to $|\psi_1^*\rangle$, where the new state $|\psi_1^*\rangle$ is complex conjugate to $|\psi_1\rangle$
  4. +
  5. Apply an operator $U_R$ to get ""time-reversed"" state $|R\psi_1\rangle$
  6. +
  7. Finally, apply again $U_\mathrm{nbit}$ to obtain the input state $|\psi_0\rangle$
  8. +
+ +

According to the paper, the algorithm described above simulates reversal of the time arrow. Or in other words, it simulates a random quantum fluctuation causing a time reversal.

+ +

Clearly, when the algorithm is run on a quantum computer, it returns back to initial state but without application of an inverse to each algorithm step. The algorithm simply goes forward.

+ +

My questions are these:

+ +
    +
  1. Why it is not possible to say that an application of $U^\dagger$ on output of algorithm $U$ is reversal of time arrow in general case?
  2. +
  3. It is true that above described algorithm returns a quantum computer to an initial state but it seems that the algorithm simply goes forward. So where I can see the a reversal of time arrow?
  4. +
  5. The authors of the articles have found out that when a number of qubit involved in the time reversal algorithm is increasing, the effect of time reversal diminishes:

    + +
      +
    • How is it possible to reverse time for few qubits and concurently to preserve flowing of time in forward direction for another qubits?

    • +
    • Does this mean that time flows differently for different qubits?

    • +
    • When do the qubits return to commnon time frame to be possible to use them in another calculation?

    • +
  6. +
+",9006,,26,,12/25/2019 19:13,12/30/2019 20:44,Reversal of time arrow on IBM Q,,1,1,,,,CC BY-SA 4.0 +9329,1,9332,,12/25/2019 18:08,,4,646,"

It is well known that in Bayesian learning, applying Bayes' theorem requires knowledge on how the data is distributed, and this usually requires either expensive integrals or some sampling mechanism, and, using Bayesian machine learning, (instead of Frequentist) has a significant computation cost that is required to perform the Bayesian inferences, and it could be solved with quantum computers, do you think there is a speedup using Bayesian machine learning algorithms in NISQ machines like IBM Q?

+ +

There are libraries available for QML using Qiskit and PennyLane with TensorFlow.

+ +

Also, Pycm4, Zhusuan, and Edward 2.0 will have TensorFlow backend +So, I am actually interested in ""Quantum Bayesian machine learning"" +I am about to start a master program in CS.

+ +

Is it a good idea to work/research in Bayesian QML using TensorFlow with Qiskit, PennyLane, and PyMC4 in order to run bayesian machine learning algorithms in IBM Q?

+ +

Does it have any useful approach to data science?

+",9226,,19895,,5/7/2022 0:40,5/7/2022 0:40,Quantum speedup in Bayesian machine learning on NISQ computers,,1,0,,,,CC BY-SA 4.0 +9330,2,,9326,12/25/2019 19:10,,3,,"

Of course if we have unitary evolution +$$|\psi_1\rangle = U|\psi_0\rangle$$ +then +$$|\psi_0\rangle = U^\dagger|\psi_1\rangle$$

+ +

I did not read the paper, but evidently the authors do something different, based on the following: the Schrödinger equation +$$i\hbar\frac{\partial\Psi}{\partial t}=\hat{H}\Psi$$ +changes its form if we substitute $t\rightarrow -t$ to complex conjugate: +$$-i\hbar\frac{\partial\Psi}{\partial t}=\hat{H}\Psi$$ +and its solution is also complex conjugate.

+ +

So time reversal is antiunitary operator $U_RK$ where $U_R$ is unitary and $K$ is complex conjugation.

+",2105,,,,,12/25/2019 19:10,,,,1,,,,CC BY-SA 4.0 +9331,1,,,12/26/2019 4:28,,1,145,"

Can I create a function in qiskit which receive a quantum register as an argument, and/or returns a quantum register? +In the example below, I created a quantum register, and a quantum circuit which works on it in the main function. I deliver this register to a function called ""test"" which chooses a random state for this register, but when I perform a measurement in the main function, it seems like the original state was not effected by the operation of the function since the measurement gives:

+ +

counts: +{'000': 1024}

+ +

Can any one explain this? Is there a correct way to do so? +Thanks

+ + + +

+#######################################################################
+def test(n, QP, CP):
+
+    QC_B = QuantumCircuit(QP, CP)
+
+    # choose a random state
+    for i in range(n):
+        if (np.random.randint(2) == 1):
+            QC_B.x(QP[i])
+        else:
+            QC_B.iden(QP[i])
+    QC_B.barrier()
+
+    simulator = Aer.get_backend('qasm_simulator')
+    result = execute(QC_B, simulator)
+
+    return QP
+
+
+#######################################################################
+def main():
+
+    N = 3
+    Q = QuantumRegister(N)
+    C = ClassicalRegister(N)
+    QC_A = QuantumCircuit(Q, C)
+
+    # ... 
+    # ... QC_A perform some operations on Q...
+    # ... 
+
+    QC_A.iden(Q)
+    Q = test(N, Q, C)
+
+    QC_A.measure(Q, C)
+
+    simulator = Aer.get_backend('qasm_simulator')
+    # Execute and get counts
+    result = execute(QC_A, simulator).result()
+    counts = result.get_counts(QC_A)
+    print(""counts: "")
+    print(counts)
+    return
+
+```
+
+",8031,,8031,,12/26/2019 8:51,12/26/2019 8:51,deliver a quantum register to/from a function in qiskit,,0,6,,,,CC BY-SA 4.0 +9332,2,,9329,12/26/2019 9:57,,6,,"

As far as I know, there are four possibilities for having a quantum advantage in Bayesian machine learning:

+ +
    +
  1. Gaussian processes: there is a known quantum speed-up for Gaussian processes that you can easily test on IBM Q [1,2]. The idea is to use HHL (quantum algorithm for matrix inversion) in order to compute the inverse of the kernel matrix, which is used to estimate the mean and variance estimators of your Gaussian process. It provides a exponential speed-up in the best case (sparse kernel matrix), and polynomial (quadratic) in the worst. The experiments in [2] show limited advantage for NISQ, but it is worth considering when we will have bigger devices.

  2. +
  3. MAP inference for mixture models of distributions in the exponential family: there is another speed-up for the Expectation-Maximization (EM) algorithm used for MAP inference (maximum likelihood with a prior) [6]. More precisely, the quantum algorithm is exponentially faster in the number of training point than classical EM. The caveat is that it requires to encode the data in a QRAM, which is not really NISQy (requires a lot of qubits and a fast algorithm to perform this encoding)

  4. +
  5. Energy-based model: there is also a lot of work on quantum energy-based model [3-5], which you could argue are Bayesian in spirit. The general idea of energy-based models is to find the parameters $\theta$ of the probability distribution $$p(x |\theta)=\frac{1}{Z_{\theta}}e^{-\beta E(x, \theta)}$$ +that fits your data the best. In classical energy-based model, $E(x, \theta)$ is a number, usually given by the classical Ising model $$E(x, \theta)=\sum_{ij} \theta_{ij} x_i x_j$$ and $Z_{\theta}$ is a normalization factor that is in general very hard to compute. In the quantum case, we replace the probability distribution by a density matrix $$\rho(\theta)=\frac{1}{Z_{\theta}} e^{-\beta H(\theta)}$$ and the energy function by a Hermitian matrix: $$H(\theta)=\sum_{ij} \theta_{ij} \hat{\sigma}^z_i \hat{\sigma}^z_j + \sum_i \hat{\sigma}^x_i,$$ taking advantage of both thermal and quantum fluctuations in the generative process. +[3] introduced the idea and showed examples of speed-ups on toy models, while [4] and [5] are example on how you can train such a generative model on NISQ devices.

  6. +
  7. Bayesian inference: the previous examples are not exactly quantum Bayesian inference as you probably imagined it in your question (computing the explicit posterior distribution by approximating the partition function---i.e. the expansive integral---on a quantum computer). The thing is that for energy-based model, computing the partition function exactly is #P-Hard in general and NP-Hard for local Hamiltonians (a simpler class of energy-based models), so non-tractable even for a quantum computer. However, a quantum speed-up is possible for additive approximations of the partition function, as explained in those slides. But I don't know any paper that explicitly does that in the context of Bayesian machine learning.

  8. +
+ +
+

I am about to start a master program in CS Is it a good idea to work/research in Bayesian QML using TensorFlow with Qiskit, PennyLane, and PyMC4 in order to run Bayesian machine learning algorithms in IBM Q?

+
+ +

I think so. Reproducing [2] or [4] using Pennylane (with a Qiskit backend) can be a very good exercise to learn quantum computing. If you want to do research on the subject, it would be better to do your master's thesis in a group with people who work in that area (look at the authors of the papers I've cited). Doing it alone (or with a pure-CS Professor) would be very challenging.

+ +

[1] Zhao et al., Quantum algorithms for training Gaussian Processes, Phys. Rev. A, 2018

+ +

[2] Zhao et al., Bayesian Deep Learning on a Quantum Computer, Quantum Machine Intelligence, 2018

+ +

[3] Amin et al., Quantum Boltzmann Machines, Phys. Rev. X, 2016

+ +

[4] Verdon et al., A quantum algorithm to train neural networks using low-depth circuits, arXiv, 2017

+ +

[5] Verdon et al., Quantum Hamiltonian-Based Models & +the Variational Quantum Thermalizer Algorithm, arXiv, 2019

+ +

[6] Kerenidis et al., Quantum Expectation-Maximization for Gaussian Mixture Models, arXiv, 2019

+",8545,,45,,12/26/2019 19:04,12/26/2019 19:04,,,,0,,,,CC BY-SA 4.0 +9334,1,9336,,12/27/2019 0:59,,3,97,"

On some backends, measuring the same expected value twice to the same classical register always leaves that classical register in the ""1"" state. I don't know if these results will hold over time, but when I ran the following code the outcome was striking.

+ +
OPENQASM 2.0;
+include ""qelib1.inc"";
+
+qreg q[2];
+creg c[1];
+
+measure q[1] -> c[0];
+measure q[0] -> c[0];
+
+ +

This program should always produce ""0"" in a simulator and generally produce ""0"" in a real device. Instead, the results are:

+ +

Always/Mostly ""0""

+ +
    +
  • ibmq_qasm_simulator
  • +
  • ibmq_essex
  • +
  • ibmq_burlington
  • +
+ +

Always ""1""

+ +
    +
  • ibmqx2
  • +
  • ibmq_16_melbourne
  • +
  • ibmq_ourense
  • +
  • ibmq_vigo
  • +
+ +

As a programmer, I think writes should be independent and the last write should win unless I explicitly allow some kind of quantum fuzziness.

+",9583,,9583,,12/27/2019 5:03,12/27/2019 15:41,Writing twice to same classical register -> 1 for some backends in IBM Q Experience,,1,4,,,,CC BY-SA 4.0 +9335,1,,,12/27/2019 5:17,,6,764,"

I am introduced to ancilla qubits which are usually initialized to $\vert 0 \rangle$. It seems that an ancilla qubit is equivalent to the $0$ bit in classical computing as it will evaluate to $\vert 0 \rangle$ 100% of the time. My question is that can I conclude any qubit will always be in superposition regardless of the probabilities of $\alpha$ and $\beta$ since $\vert 0 \rangle + 0\vert 1 \rangle = \vert 0 \rangle$ and $0\vert 0 \rangle + \vert 1 \rangle = \vert 1 \rangle$? How about physically, are qubits prepared according to some procedure that differ if it will be initialized to $\vert 0 \rangle$ or $\vert 1 \rangle$ or in superposition?

+ +

Edit: this is a related comment but it doesn't answer my question regarding if the process of physically preparing qubits different from non-entangled qubits vs entangled ones.

+",7528,,7528,,12/27/2019 18:53,6/24/2021 6:14,Is a qubit always in superposition?,,2,4,,,,CC BY-SA 4.0 +9336,2,,9334,12/27/2019 6:50,,3,,"

Your expectation here is correct. c[0] should be 0 (well, modulo some small readout errors). The difference between backends is just due to a software bug on some of them. This will get fixed, thanks for reporting.

+ +

As an aside, it is important to note that on current IBM devices, there is a constraint that all measurements are done simultaneously. So both qubits are measured and the state of q[0] and q[1] are determined independently and simultaneously. Then the first value will get written to c[0] followed by the second value. So the final result you see should be the state of q[0] in your program. (I just wanted to clarify that the readouts are not serialized here, but the classical write operations are).

+",2503,,2503,,12/27/2019 15:41,12/27/2019 15:41,,,,4,,,,CC BY-SA 4.0 +9337,1,9452,,12/27/2019 9:25,,2,131,"

I am trying to understand how to achieve the syndrome extraction operator matrix in quantum repetition code (if it even exists). It is given that the syndrome is defined here (page 4) as:

+ +
+

[perform] controlled-nots from the first and second received qubits to + the first ancilla qubit, then from the first and third received qubits + to the second ancilla bit.

+
+ +

First of all, are the ancilla qubits entangled with $\vert \psi \rangle$?

+ +

Here is what I have understood so far. Given $\vert \psi \rangle = \alpha \vert x_1, x_2, x_3\rangle + \beta \vert \overline{x_1}, \overline{x_2}, \overline{x_3}\rangle$ (where $\overline{x_{i}} = x_i + 1 \quad (\text{mod }2)$), we can define an operator $S$ as:

+ +

$$S: \alpha \vert x_1, x_2, x_3\rangle + \beta \vert \overline{x_1}, \overline{x_2}, \overline{x_3}\rangle \rightarrow \underbrace{\vert x_1 \oplus x_2\rangle}_{\text{1$^{\text{st}}$ ancilla qubit}} \underbrace{\vert x_1 \oplus x_3\rangle}_{\, \text{ 2$^{\text{nd}}$ ancilla qubit}},$$

+ +

or equivalently as:

+ +

$$S: \alpha \vert x_1, x_2, x_3\rangle + \beta \vert \overline{x_1}, \overline{x_2}, \overline{x_3}\rangle \rightarrow \underbrace{\vert \overline{x_1} \oplus \overline{x_2}\rangle}_{\text{1$^{\text{st}}$ ancilla qubit}} \underbrace{\vert \overline{x_1} \oplus \overline{x_3}\rangle}_{\, \text{ 2$^{\text{nd}}$ ancilla qubit}}.$$

+ +

This will yield the ancilla values corresponding to the following states: +$$ +\begin{align*} + \text{State$\qquad~~$} & \text{$~~~~$Ancilla qubits}\\ + \alpha \vert 000\rangle + \beta \vert 111\rangle &\qquad\qquad \vert 00\rangle\\ + \alpha \vert 100\rangle + \beta \vert 011\rangle &\qquad\qquad \vert 11\rangle\\ + \alpha \vert 010\rangle + \beta \vert 101\rangle &\qquad\qquad \vert 10\rangle\\ + \alpha \vert 001\rangle + \beta \vert 110\rangle &\qquad\qquad \vert 01\rangle\\ + \alpha \vert 110\rangle + \beta \vert 001\rangle &\qquad\qquad \vert 01\rangle\\ + \alpha \vert 101\rangle + \beta \vert 010\rangle &\qquad\qquad \vert 10\rangle\\ + \alpha \vert 011\rangle + \beta \vert 100\rangle &\qquad\qquad \vert 11\rangle\\ + \alpha \vert 111\rangle + \beta \vert 000\rangle &\qquad\qquad \vert 00\rangle\\\\ + \end{align*} +$$

+ +

How can I perform such operation using a matrix?

+",7528,,55,,11/11/2020 21:37,11/11/2020 21:37,Syndrome extraction operator as matrix?,,1,2,,,,CC BY-SA 4.0 +9338,2,,9335,12/27/2019 9:52,,8,,"

Superposition is a basis dependent concept. Namely the $|0\rangle$ and $|1\rangle$ states are commonly said not to be superposition states exactly because one of the two coefficients in the $\{|0\rangle,|1\rangle\}$ basis expansion is zero. However, using the x-basis representation, $\{|+\rangle, |-\rangle\}$ one finds $|0\rangle = (|+\rangle + |-\rangle)/\sqrt{2}$ and $|1\rangle = (|+\rangle - |-\rangle)/\sqrt{2}$, which are superposition states with both coefficients non-zero.

+

Qubits naturally prepare themselves in the $|0\rangle$ state if one waits long enough (much longer than the T1 time) as it is the ground state of the system. To get any other state one must apply gates to the qubit that rotate the state to the desired position on the Bloch sphere.

+",332,,16092,,6/24/2021 6:14,6/24/2021 6:14,,,,3,,,,CC BY-SA 4.0 +9339,1,9341,,12/27/2019 14:35,,7,729,"

Even though this seems to be a much asked basic question, I couldn't find a reputed answer to this:

+
    +
  • Implement a 3-qubit Toffoli gate using 3-qubit Fredkin gates.
  • +
+

The best I could do was using 4 gates to give

+

+
    +
  1. Can we use less than 4 gates?
  2. +
  3. In the above circuit how to get rid of the garbage values?(I have heard they are bad for interference)
  4. +
+

I am new to quantum computing so please correct me if I am asking something that doesn't make sense.

+",9603,,-1,,6/18/2020 8:31,1/9/2020 0:27,Can a Toffoli gate be implemented using Fredkin gates?,,1,0,,,,CC BY-SA 4.0 +9340,1,,,12/27/2019 16:30,,7,304,"

I have heard about the diamond norm, and from what I understood it is a ""nice"" tool to quantify quality of quantum gates in the NISQ era. I would like to know a little more before going in detail in the litterature.

+ +

My question are the following:

+ +

Why is it considered as a good tool to quantify quality of quantum gates? Why this tool and not another one?

+ +

What are the nice properties this tool has? I have seen in Is the diamond norm subadditive under composition? that it is subbaditive which make the tool useful to bound the diamond norm of a full algorithm given the diamond norm of each gate. Are there other some useful properties? I guess this question will be related somehow to the previous one. I tried to find this information in literature, but unfortunately all papers I read just give the definition and the diamond norm and a way to compute it numerically.

+",5008,,8776,,12/29/2019 16:43,12/29/2019 16:43,"What are the ""nice"" properties of the diamond norm and why is it used?",,0,4,,,,CC BY-SA 4.0 +9341,2,,9339,12/27/2019 17:50,,10,,"

It's not possible to implement a Toffoli using only Fredkin gates, because Fredkin gates preserve the number of 1s in the state while Toffolis do not.

+",119,,,,,12/27/2019 17:50,,,,3,,,,CC BY-SA 4.0 +9342,1,9343,,12/27/2019 20:40,,7,2916,"

Inspired by a question Toffoli using Fredkin, I tried to do ""inverse"" task, i.e. to implement Fredkin gate (or controlled swap). In the end I implemented it with three Toffoli gates.

+ +

Firstly, I started with swap gate without control qubit which is implemented with CNOTs followingly:

+ +

+ +

Then I realized that I need control qubit, or in other words that I have to control each CNOT gate. As controlled CNOT is Toffoli gate (CCNOT gate), I came to this circuit

+ +

+ +

As matrix representation of Toffoli gate controlled by qubits $|q_0\rangle$ and $|q_1\rangle$ is +\begin{equation} +CCNOT_{01} = +\begin{pmatrix} +1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ +0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ +\end{pmatrix} +\end{equation}

+ +

matrix of Toffoli gate controlled by qubits $|q_0\rangle$ and $|q_2\rangle$ is +\begin{equation} +CCNOT_{02} = +\begin{pmatrix} +1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ +0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ +0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ +\end{pmatrix} +\end{equation}

+ +

and finnaly, matrix of Fredking gate is +\begin{equation} +F = +\begin{pmatrix} +1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ +0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ +\end{pmatrix} +\end{equation}

+ +

Since $F=CCNOT_{01} CCNOT_{02} CCNOT_{01}$, the circuit is designed corectly.

+ +

Unfortunatelly, implementation of Toffoli gate requires many CNOT gates and single qubit rotation gates.

+ +

My question: Is this implementation of Fredkin gate the most efficient one?

+",9006,,55,,1/9/2020 0:39,1/9/2020 0:39,How to implement a Fredkin gate using Toffoli and CNOTs?,,1,6,,,,CC BY-SA 4.0 +9343,2,,9342,12/27/2019 21:38,,7,,"

Based on paper Five Two-Bit Quantum Gates are Sucient to Implement the +Quantum Fredkin Gate provided by Norbert Schuch, I realized that there is a more efficient implementation in terms of number of gates. Here is a result:

+ +

+ +

Matrix of CNOT acting on $|q_1\rangle$ controlled by $|q_2\rangle$ is

+ +

\begin{equation} +CNOT_{2}= +\begin{pmatrix} +1 & 0 & 0 & 0\\ +0 & 0 & 0 & 1\\ +0 & 0 & 1 & 0\\ +0 & 1 & 0 & 0\\ +\end{pmatrix} +\end{equation}

+ +

It can be verified that $(I \otimes CNOT_2)CCNOT(I \otimes CNOT_2)$ is matrix describing Fredkin gate.

+",9006,,,,,12/27/2019 21:38,,,,3,,,,CC BY-SA 4.0 +9344,1,9349,,12/28/2019 5:38,,8,1089,"

When I run this program on ibmqx2 (the backend matters) in IBM Q Experience, the results are interesting. Essentially, the program measures the error rate on $|q_0\rangle$ after fiddling with $|q_1\rangle$.

+ +
OPENQASM 2.0;
+include ""qelib1.inc"";
+gate nG0 ( param ) q  {
+  h q;
+}
+
+qreg q[2];
+creg c[1];
+
+ry(pi) q[1];
+measure q[0] -> c[0];
+
+ +

Unexpectedly, the value of $|q_0\rangle$ depends on the angle of rotation around y-axis for $|q_1\rangle$. Here are typical runs of 8 192 shots on ibmqx2.

+ +

+ +
+ry() q[1]   Error rate q[0]     Expected error rate q[0]
+0            0.940%             ~1%
+pi/4         9.351%             ~1%
+pi/2        30.273%             ~1%     
+3pi/4       52.209%             ~1%
+pi          60.742%             ~1%     
+5pi/4       51.941%             ~1%
+3pi/2       30.518%             ~1%
+7pi/4        9.509%             ~1%
+2pi          0.684%             ~1%
+
+ +

A few notes:

+ +
    +
  • For $0$ and $2\pi$ the $Ry$ operations are optimized away in the transpiled code.
  • +
  • Don't forget that we're operating on $|q_1\rangle$ and measuring $|q_0\rangle$. These qubits should be completely independent. Changes to $|q_1\rangle$ shouldn't impact $|q_0\rangle$.
  • +
  • The error rate is above 50% from $\frac{3}{4}\pi$ to $\frac{5}{4}\pi$. That suggests that application of $Ry$ on $|q_1\rangle$ does not just destabilize the system, it causes that $|q_0\rangle$ favors the $|1\rangle$ state.
  • +
  • Changing $Ry$ to $Rx$ also demonstrates the problem. Changing $Ry$ to $Rz$ makes the problem to go away.
  • +
+",9583,,9006,,12/28/2019 17:42,12/28/2019 17:42,Changing one qubit causes changes in another independent qubit on ibmqx2 in IBM Q Experience,,2,1,,,,CC BY-SA 4.0 +9345,2,,9150,12/28/2019 7:27,,1,,"

Considering your question is not specific, you can take a look at Chapters 10 (classical entropy) and 11 (quantum entropy) of this book.

+ +

Quantum entanglement entropy as we know it comes from classical Shannon theory. Claude Shannon introduced entropy in order to quantify information. You can read his paper here.

+",2598,,2598,,12/31/2019 6:12,12/31/2019 6:12,,,,0,,,,CC BY-SA 4.0 +9346,2,,9252,12/28/2019 7:41,,2,,"

Intraphoton entanglement uses the degrees of freedom from one photon only to create entanglement. So, here either polarization and linear momentum or polarization and angular momentum can be used to create entanglement. Interphoton entanglement is the entanglement created between 2 spatially separated photons. So, naturally latter is less stable than former. For this reason, this paper used former as a resource to create latter.

+",2598,,2598,,12/28/2019 21:05,12/28/2019 21:05,,,,2,,,,CC BY-SA 4.0 +9347,2,,9057,12/28/2019 7:55,,2,,"

In this paper, the authors used Knot theory to define what they call 'Path Model Representation'. In a later section they convert this representation to qubits by switching to binary.

+",2598,,,,,12/28/2019 7:55,,,,0,,,,CC BY-SA 4.0 +9348,2,,9344,12/28/2019 13:27,,6,,"

This was a readout crosstalk error that has now been resolved.

+",332,,,,,12/28/2019 13:27,,,,0,,,,CC BY-SA 4.0 +9349,2,,9344,12/28/2019 13:30,,13,,"

Thanks for pointing this out! It turns out that this device was mis-calibrated in a way that was leading to that behavior. We just fixed the calibrations, so the problem should be gone now. I apologize for the trouble, and we will try to update our routine calibrations to detect and prevent this problem from coming up in the future :-).

+",535,,,,,12/28/2019 13:30,,,,0,,,,CC BY-SA 4.0 +9350,2,,6102,12/28/2019 18:52,,3,,"

You will need to know how long it takes for each gate of the circuit to be performed. Then the decoherence error rate is simply $$e^{\frac{t_{gate}}{t_{decoherence}}}$$

+",9626,,9402,,9/9/2022 4:20,9/9/2022 4:20,,,,2,,,,CC BY-SA 4.0 +9351,1,9354,,12/29/2019 3:39,,4,159,"

I noticed that stabilizer codes and additive quantum codes are equivalent, but why? +I am confused at the word ""additive"" since the operation of stabilizer genertors is multiplication.

+",9275,,,,,12/29/2019 14:17,Why stabilizer codes are named additive quantum codes?,,1,0,,,,CC BY-SA 4.0 +9352,1,9416,,12/29/2019 11:23,,7,324,"

I'm trying to study the book: Picturing Quantum Processes: A First Course in Quantum Theory and Diagrammatic Reasoning, and would like some help with Exercise 4.12: +

+ +

The relevant equations are as follows: + +

+ +

As an aside, I would really appreciate it if anyone knows where to find the solutions of this book.

+ +

Thank you!

+",2832,,2832,,12/29/2019 11:53,1/4/2020 14:35,Diagrammatic Quantum Reasoning: Proving the loop equation using yanking equations,,2,0,,,,CC BY-SA 4.0 +9353,2,,9352,12/29/2019 12:41,,0,,"
    +
  1. Replace in the diagram in exercise 4.12 the triangles with the corresponding bending wires.
  2. +
  3. It seems that the resulting diagram is like the second identity in 4.9, but with two added straight horizontal wires. (The diagram is rotated, but that doesn't matter.) Apply this identity.
  4. +
  5. The resulting diagram is a cap with added straight wires. It is permitted to straighten the wire.
  6. +
+ +

Another way using yanking out crossings:

+ +

Start from the given diagram. Rotate the bottom bending with the cup in 3D around the vertical axis , until it the diagrams looks like the last diagram in 4.6. That is equal to a straight wire.

+ +

I hope the rewrite process I described is clear.

+",8776,,8776,,12/31/2019 15:20,12/31/2019 15:20,,,,5,,,,CC BY-SA 4.0 +9354,2,,9351,12/29/2019 13:54,,5,,"

A stabilizer code is also called an additive code, because it is closed under the sum of its elements.

+ +

The namesake is described on page 33 of ""Stabilizer Codes and Quantum Error Correction"" (link).

+ +

Additionally, additive quantum codes are the quantum version of additive codes found in coding theory.

+",8776,,8776,,12/29/2019 14:17,12/29/2019 14:17,,,,2,,,,CC BY-SA 4.0 +9355,2,,7,12/29/2019 16:36,,2,,"

I think that there are many interesting answers to your question, but I would like to point out what I personally find the most mesmerizing consequence of quantum theory to cryptography.

+ +

One of the most fascinating quantum phenomena that has no classical counterpart is no cloning. This essentially means that if you don't have enough information about some quantum state, then you can't prepare more copies of it. +This could be seen (informally) as a restatement of the uncertainty principle: if you could prepare two perfect copies of a system you know nothing about, then nothing prevents you from measuring each copy in a different basis, thereby obtaining knowledge of two mutually unbiased properties (e.g., if you could perfectly copy an electron, then you could measure its momentum in one copy and its position in the other).

+ +

No cloning is usually a huge pain. For example, consider e.g. the Miller-Rabin algorithm for primality testing. This is a randomized algorithm, which means that every time you run it it plays out a little differently. Given a prime number, this algorithm will always tell you that it is a prime. Given a composite number, it will still tell you some of the times that it is prime. However, one can prove that his happens with probability which is less than $1/2$. This implies that if you run the algorithm $n$ times on a composite number the probability that it will tell you that it is prime each and every time is at most $1/2^n$. This process is called amplification, and the underlying assumption is that we can always repeat the algorithm. While trivial classically, this assumption does not generally hold in the quantum realm, as the input state might be measured and thus irreversibly destroyed. It was shown by Marriot and Watrous that BQP algorithms can still be amplified this way, but the way to do so is highly non-trivial.

+ +

As you might have expected, now comes the ""lemons to lemonade"" stage. Because if cloning states is impossible, might we leverage that to our advantage, say, in order to design things that we don't want people to make copies of, such as money?

+ +

Amazingly, this idea predates most of quantum computation and information. As early as 1968, Steve Wiesner proposed applying no-cloning to implement money that is physically impossible to forge. More amazingly, his construction is extremely simple and only requires the ability to apply local Hadamard gates (and consequentially, the money is encoded into a completely separable state). Unfortunately, as the story goes, it seems that Wiesner was not able to publish his breakthrough for more than a decade.

+ +

The applications of no-cloning has since been extended greatly, and there is ongoing research of very natural further problems such as public quantum money (in Wiesner's scheme, only who created the money can verify it. This merits the question: is it able to make money that anyone can verify but no one could forge) (see also), quantum copy protection, uncloneable encryption, one time signature tokens, etc.. These are all fascinating primitives which are classically impossible, but might be possible using quantum computation (under some mild computational assumptions). The current state of the art is that almost all such constructions either rely on strong (or just irregular) assumptions, or on the existence of some unrealistic oracle. But keep in mind that these questions are relatively new, and the research involving them is very active!

+",9575,,,,,12/29/2019 16:36,,,,0,,,,CC BY-SA 4.0 +9356,2,,9316,12/29/2019 18:39,,1,,"

+$\newcommand{\ket}[1]{\lvert #1\rangle}\newcommand{\PP}{\mathbb{P}}$Given an arbitrary state $\ket a$, let us write the corresponding density matrix/projector as $\PP_a$. +Any such density matrix can be decomposed using a basis of Hermitian traceless operators (think the Bloch sphere representation for qubits) as $\PP_a\equiv 1/2(I + \sum_i a_i\sigma_i)$, with $\sigma_i$ the three Pauli matrices. +The overlap $|\langle a|v\rangle|^2$ between two states reads, in this formalism, as +$\operatorname{Tr}(\PP_a\PP_v)=\frac12(1 + \mathbf a\cdot \mathbf v)$, where $\mathbf a,\mathbf v$ are the vectors representing the states in the Bloch representation (Bloch sphere for qubits).

+ +

Defining $S=S(\mathbf a)$ as per the OP, we then have +$$ + 2S = p\left(1+ \mathbf a\cdot \mathbf v\right) + (1-p)\left(1- \mathbf a\cdot \mathbf w\right) \\ + = 1 + \mathbf a\cdot(p\mathbf v - (1-p)\mathbf w). +$$ +We want to maximise this quantity with respect to $\mathbf a\in\mathbb R$ with $\|\mathbf a\|=1$. An easy way is to impose the gradient $\nabla S$ be proportional to $\nabla(\|\mathbf a\|^2-1)=2\mathbf a$ (that is, to use the Lagrange multiplier method). An even easier way is to notice that, given an arbitrary (real) vector $\mathbf x$, the quantity $\mathbf a\cdot\mathbf x$ is maximised for $\mathbf a\simeq\mathbf x$.

+ +

We conclude that the maximum of $S$ is achieved when +$$\mathbf a = N[p\mathbf v-(1-p)\mathbf w],$$ +where $N\in\mathbb R$ ensures the normalisation.

+ +

+ +

Notice that, if $\langle v|w\rangle=0$, you have $\mathbf w=-\mathbf v$, and thus $2S=1+\mathbf a\cdot\mathbf v$, which gives $S_{\max}=1$ for the choice $\mathbf a=\mathbf v$. This is of course what we should expect: orthogonal states can be reliably distinguished via suitable choice of measurement.

+",55,,55,,12/30/2019 16:58,12/30/2019 16:58,,,,0,,,,CC BY-SA 4.0 +9357,1,9364,,12/30/2019 18:15,,-3,103,"

Getting this warning, help me understand this

+ +

""C:\Users\XYZ\Anaconda3\lib\site-packages\qiskit\providers\models\backendconfiguration.py:337: UserWarning: dt and dtm now have units of seconds(s) rather than nanoseconds(ns). + warnings.warn('dt and dtm now have units of seconds(s) rather ' ""

+ +

Thanks

+",9660,,9660,,12/30/2019 19:15,1/1/2020 9:12,Help me understand this warning while running qiskit command IBMQ.load_account(),,1,2,,1/1/2020 10:28,,CC BY-SA 4.0 +9358,1,,,12/30/2019 20:44,,2,146,"

How is a state of a qubit measured physically on a quantum computer?

+",9660,,2927,,12/30/2019 21:37,12/30/2019 21:37,How are states of a qubit measured in a quantum computer?,,1,1,,1/1/2020 22:38,,CC BY-SA 4.0 +9359,2,,9358,12/30/2019 21:03,,2,,"

It depends on technology used for a qubit implementation.

+ +

For example, here is an explanation provided by IBM Q team:

+ +
+

We must perform the qubit measurements in a way that does not destroy the qubit quantum state. One method is to weakly couple each qubit to a microwave resonator whose resonance characteristics depend on the state of the qubit. Once the qubit operations are completed in your score, you can measure the qubits by sending a microwave tone to their resonators and analyzing the signal it reflects back. The phase and amplitude of this reflected signal will be different depending on the qubit state. These signals in the resonator are boosted via a chain of amplifiers inside of our dilution refrigerator, including a quantum-limited amplifier at 15 mK, and a high-electron mobility transistor amplifier at 4 K.

+
+ +

Source link: IBM Q - Frequently asked questions

+",9006,,,,,12/30/2019 21:03,,,,0,,,,CC BY-SA 4.0 +9360,1,,,12/31/2019 8:22,,3,800,"

Is it possible to use Qiskit in Julia language? Or is there any wrapper that can be used to call the package from Julia language?

+",9665,,,,,1/1/2020 14:32,Qiskit in Julia language?,,1,1,,,,CC BY-SA 4.0 +9361,2,,9360,12/31/2019 20:48,,7,,"

Using PyCall it is possible to use arbitrary Python packages (such as Qiskit) in Julia and use the Python functions. At least, this is what PyCall advertises to be able.

+ +

What you describe has been done before: here is an example on GitHub.

+ +

Essentially, you would need to do this (I haven't tried this out myself):

+ +
using PyCall
+qiskit = pyimport(""qiskit"")
+
+ +

Qiskit recommends using Jupyter. Jupyter includes Julia, so it would be convenient to use this.

+ +

I did a search for a native Julia qiskit wrapper, but I did not found one.

+",8776,,8776,,1/1/2020 14:32,1/1/2020 14:32,,,,0,,,,CC BY-SA 4.0 +5096,1,15164,,1/1/2019 2:11,,4,195,"

Shor's algorithm works with very large integers; larger than 64 bits. So the built-in 64-bit Int type is insufficient for doing the classical processing (e.g. computing the multipliers $b^{2^k} \pmod{N}$). Is there a big int type suitable for those purposes?

+",119,,119,,1/3/2019 18:16,12/16/2020 17:50,Does Q# have a bigint type?,,3,2,,,,CC BY-SA 4.0 +5097,2,,5068,1/1/2019 4:23,,3,,"

Q#'s full state simulator has an OnOperationStart and OnOperationEnd events that, as the names imply, are triggered every time a quantum operation starts/ends. Thus the easiest way to get and print the sequence of gates would be to attach a handler to the OnOperationStart, for example:

+ +
        using (var qsim = new QuantumSimulator())
+        {
+            qsim.OnOperationStart += (op, arg) => Console.WriteLine($""{op.Name}:{op.Variant}"");
+
+            HelloQ.Run(qsim).Wait();
+        }
+
+ +

The event sends two parameters:

+ +
    +
  1. the operation itself, exposed via the ICallable interface; from it, you can get the Name (e.g. X), the FullName (e.g. Microsoft.Quantum.Primitive.X) or the Variant (i.e. Body, Adjoint, Controlled or ControlledAdjoint).
  2. +
  3. the argument tuple, exposed via the IApplyData interface; from it you can get the actual values the operation received or just the list of Qubits.
  4. +
+ +

This doesn't produce the circuit diagram, but as you point out, could allow you to print and feed the list of operations to other tools.

+ +

We're still actively working on this part of the Quantum Development Kit, which is why it still needs much more documentation. However, we're active monitoring stackoverflow so please let us know if you need any more help.

+",2918,,,,,1/1/2019 4:23,,,,0,,,,CC BY-SA 4.0 +5102,2,,4977,1/1/2019 20:32,,3,,"
+

Is it possible to emulate a quantum network over a classic network?

+
+

Yes. The following projects are currently available:

+

SimulaQron

+
+

SimulaQron is a distributed simulation of the end nodes in a future quantum internet with the specific goal to explore application development. The end nodes in a quantum internet are few qubit processors, which may exchange qubits using a quantum internet. Specifically, SimulaQron allows the installation of a local simulation program on each computer in the network that provides the illusion of having a local quantum processor to potential applications. The local simulation programs on each classical computer connect to each other classically, forming a simulated quantum internet allowing the exchange of simulated qubits between the different network nodes, as well as the creation of simulated entanglement.

+
+

Squanch

+
+

The Simulator for Quantum Networks and Channels (SQUANCH) is an open-source Python library for creating parallelized simulations of distributed quantum information processing. The framework includes many features of a general-purpose quantum computing simulator, but it is optimized specifically for simulating quantum networks. It includes functionality to allow users to easily design complex multi-party quantum networks, extensible classes for modeling noisy quantum channels, and a multiprocessed NumPy backend for performant simulations.

+
+

NetSquid

+
+

Currently under development at QuTech, NetSquid is the world’s first network simulator that is capable of simulating the decay of quantum information over time together with noisy operations and stochastic feedback loops. Its primary use is the prediction of the performance of quantum network protocols in a physically-realistic setting.

+
+",2645,,-1,,6/18/2020 8:31,1/1/2019 20:32,,,,0,,,,CC BY-SA 4.0 +5103,1,5113,,1/2/2019 4:31,,2,562,"
+

Figure 1.16: FANOUT with the Toffoli gate, with the second bit being the input to the FANOUT (and the other two bits standard ancilla states), and the output from the FANOUT appearing on the second and third bits.

+ +

+ +

Source: Quantum Computation and Quantum Information: 10th Anniversary Edition (Fig 1.16, p.30)
by Michael A. Nielsen & Isaac L. Chuang

+
+ +

How can we say that the third qubit is in the state $a$?

+ +

Let's assume $a = x|0\rangle + y|1\rangle$. We know that the output of the bottom two qubits is $x|00\rangle+y|11\rangle$ (entangled qubits) and the output of the second qubit must be $x|0\rangle+y|1\rangle$. Which says that they both have to be in the state $|0\rangle$ and $|1\rangle$ at the same time, and so the third qubit should have the same probabilities as like of the second qubit. But it can be $-x|0\rangle + y|1\rangle$ and many more possibilities as $x$ and $y$ are complex (as probabilities are square of modulo of coefficients).

+ +

Please correct me if my interpretation and understanding is wrong.

+",5439,,26,,1/2/2019 5:39,1/3/2019 21:53,FANOUT with Toffoli Gate,,1,4,,,,CC BY-SA 4.0 +5104,1,,,1/2/2019 4:59,,2,277,"

Given a two-qubit state of equal superposition, what is the post-measurement state (should be the same number of qubits that have changed as a result of the measurement) on one of the two qubits and the probabilities that the state will be in a given state?

+ +

Input state $\to$ CNOT $\to$ Measurement

+",5460,,26,,1/2/2019 12:02,1/2/2019 12:02,What is the post measurement state given an input and the outcome measurement?,,1,3,,,,CC BY-SA 4.0 +5105,2,,5104,1/2/2019 5:34,,1,,"

If I interpret the question correctly, we start with a state $\frac{1}{2}(|00\rangle + |01\rangle + |10\rangle + |11\rangle)$ (an equal superposition of all basis states on 2 qubits).

+ +

After we apply a CNOT, the state doesn't actually change (if the first qubit is the control, the $|10\rangle$ and $|11\rangle$ components swap amplitudes but they are equal, so nothing changes).

+ +

After we measure one of the qubits, we get 0 with probability 50% and 1 with probability 50%, and the state of the second qubit is guaranteed to be $\frac{1}{\sqrt2}(|0\rangle + |1\rangle)$. You can see this easily if you use the fact that the state is separable: $\frac{1}{2}(|00\rangle + |01\rangle + |10\rangle + |11\rangle) = \frac{1}{\sqrt2}(|0\rangle + |1\rangle) \otimes \frac{1}{\sqrt2}(|0\rangle + |1\rangle)$, so the measurement of one qubit doesn't affect the state of the second one.

+",2879,,,,,1/2/2019 5:34,,,,0,,,,CC BY-SA 4.0 +5106,1,,,1/2/2019 5:43,,3,753,"
+

What are some examples of measuring qubits in different + basis states (it's known that preferable choices are the computation + basis states $|0\rangle$, $|1\rangle$ and the Bell basis states + $|+\rangle$, $|-\rangle$ on a two-qubit system)?

+
+ +

Context: I am an undergraduate sophomore working on quantum information with a professor so this isn't for a class. Over break, I was given the task of writing a Mathematica function that provides a numerical modeling procedure for measuring a qubit. The function's inputs are the quantum state, measurement basis, and which qubit to measure. The outputs of the function are the post-measurement state of the qubit, and what the outcome of the measurement is (being $|0\rangle$ or $|1\rangle$) by running a similar function to a density probability. That being said, I am still in the process of learning this material. Thank you.

+",5460,,26,,1/2/2019 7:56,1/2/2019 7:56,What are some examples of measuring qubits in different basis states?,,1,2,,,,CC BY-SA 4.0 +5107,2,,5106,1/2/2019 7:56,,2,,"

The way that you phrase the question makes it sound like you're given a pure state, $|\psi\rangle$ of $n$ qubits, and you are tasked with performing a single qubit projective measurement on a given qubit, $k$. That's adding in a little precision to your statement which may not be accurate, so please clarify if it's not (because you also mention a Bell basis measurement).

+ +

Probably the easiest way to specify a one-qubit measurement is to accept 3-component real vector $\underline{n}=(n_x,n_y,n_z)$ which satisfies $\underline{n}\cdot\underline{n}=1$. This corresponds to a measurement observable $M=n_xX+n_yY+n_zZ$, where $X,Y,Z$ are the standard Pauli matrices.

+ +

To calculate the probability of getting the $\pm1$ measurement outcomes on qubit $k$, you calculate +$$ +p_{\pm}=\frac12\pm\langle\psi|\mathbb{I}^{\otimes(k-1)}\otimes M\otimes\mathbb{I}^{\otimes(n-k)}|\psi\rangle, +$$ +and the post-measurement state is +$$ +\left(|\psi\rangle\pm\mathbb{I}^{\otimes(k-1)}\otimes M\otimes\mathbb{I}^{\otimes(n-k)}|\psi\rangle\right)/\sqrt{p_{\pm}}, +$$ +depending on which of the two outcomes was obtained.

+ +

There are alternative approaches to calculating the effect of the measurement. Take a look at the answers to this question.

+",1837,,,,,1/2/2019 7:56,,,,1,,,,CC BY-SA 4.0 +5108,1,5110,,1/2/2019 17:26,,3,128,"

In Nielsen and Chuang, it is stated that the photonic phase shift gate acts on the single photon states as $P|0\rangle \ = \ |0\rangle$ and $P|1\rangle \ = \ e^{i\Delta}|1\rangle$, where $\Delta \ = \ (n \ - \ n_0)L/c_0$. $n$ is the index of refraction of the phase shifter, $n_0$ is the index of refraction of the surrounding space in which the photon is propagating, $L$ is the distance the photon travels through the phase shifter, and $c_0$ is the speed of light in a vacuum. It is then stated that the phase shifter acting on the dual-rail photon state is equal to: $a_0e^{-i\Delta/2}|01\rangle \ + \ a_1e^{i\Delta/2}|10\rangle$, where $a_0$ and $a_1$ are simply the coefficients on the different states. How exactly was this result obtained?

+",4907,,26,,1/2/2019 17:42,1/3/2019 14:57,Phase shifter acting on double rail states,,2,1,,,,CC BY-SA 4.0 +5109,1,5111,,1/2/2019 21:11,,3,284,"

I have some understanding that with qubits, I can represent a $2^n$ size vector using only $n$ qubits. However, I'm having trouble putting this together in a way that can make a useful circuit. Say I want to represent the input $(0 \ 0 \ 0 \ 1)$ for my circuit.

+ +

I should be able to do this with only 2 qubits. Starting with the initial state $|0\rangle|0\rangle$, which as far as I know represents the vector $(1 \ 0 \ 1 \ 0)$, I can use a not gate on the second qubit to transform that to $(1 \ 0 \ 0 \ 1)$. However, I'm not sure what operation I can do to put the first qubit into a $(0 \ 0)$ state.

+ +

On top of that, I have even less of an idea of how to represent real-value vectors, like $(0.5 \ 0.5)$ (assuming including a normalization constant). I have a feeling I can use phase, but I'm not sure how to set up a circuit to achieve this.

+ +

Edit: +Realized my earlier representation was very off. The initial state $|00\rangle$ is the same as the vector $(1 \ 0 \ 0 \ 0)$, so transforming that into the the desired $(0 \ 0 \ 0 \ 1)$ Would just require two NOT gates:

+ +
0 -- NOT -- 1
+0 -- NOT -- 1
+
+ +

However, I'm still unsure how to represent real-valued vectors, or even a vector like $(1 \ 0 \ 1 \ 0)$.

+",5465,,26,,1/3/2019 14:46,1/3/2019 14:46,Representing a real valued vector with qubits,,1,2,,,,CC BY-SA 4.0 +5110,2,,5108,1/2/2019 23:24,,3,,"

Start in

+ +

$$ +a_0 | 01 \rangle + a_1 | 10 \rangle +$$

+ +

Then apply $P \otimes I$ to get

+ +

$$ +a_0 * 1 | 01 \rangle + a_1*e^{i \Delta} | 10 \rangle +$$

+ +

But that is the same up to phase as

+ +

$$ +e^{-i \Delta /2} (a_0 * 1 | 01 \rangle + a_1*e^{i \Delta} | 10 \rangle) +$$

+ +

which simplifies to

+ +

$$ +a_0 e^{-i \Delta /2} | 01 \rangle + a_1 e^{i \Delta /2} | 10 \rangle +$$

+",434,,,,,1/2/2019 23:24,,,,0,,,,CC BY-SA 4.0 +5111,2,,5109,1/2/2019 23:31,,2,,"

$(1,0,1,0)$ means

+ +

$$ +1 (1,0,0,0) + 1 (0,0,1,0) +$$

+ +

and you already know how $| 0 0 \rangle$ and $(1,0,0,0)$ correspond.

+ +

To make $(0,0,1,0)$ the encoding would be $| 1 0 \rangle$. I'm assuming you are reading the entries as 0,1,2,3 in that order for the vector and the first qubit corresponds to the most significant bit. (Little vs Big endian). If not, make the necessary changes.

+ +

So all together you need $1 | 00 \rangle + 1 | 10 \rangle$.

+ +

For other combinations like $(a_0 , 0 , a_2 , 0)$ change the coefficents. $a_0 | 00 \rangle + a_2 | 10 \rangle$

+",434,,,,,1/2/2019 23:31,,,,2,,,,CC BY-SA 4.0 +5112,2,,5108,1/3/2019 14:57,,1,,"

For the former part: +Even a simple slab of glass can act as a phase shift quantum gate. +The difference in path covered is $(n-n_0)L \equiv \delta L$ and the time difference is $\delta L/c_0$ and then the phase shift is proportional to this time shift. Or just divide this time phase difference by some time $T$ taken by the light in a vacuum to travel the same length $L$, often taken to be any constant.

+ +

For the latter part: +Simply apply the operator $P\otimes I $ on a dual rail $a_0|01\rangle +a_1|10\rangle.$ +The fact that has been used here is that the global phase is not an observable and only the relative phase is what leads to observable quantities. It disappears when you calculate any inner product. We can safely drop the global phase as follows: +\begin{equation} +a_1e^{i\theta}|\psi_1\rangle+a_2e^{i\phi}|\psi_2\rangle \equiv e^{i\theta}(a_1|\psi_1\rangle+a_2e^{i(\phi-\theta)}|\psi_2\rangle) +\end{equation} +\begin{equation} + \equiv (a_1|\psi_1\rangle+a_2e^{i(\phi-\theta)}|\psi_2\rangle) +\end{equation} +\begin{equation} + \equiv (a_1e^{-i(\phi-\theta)/2}|\psi_1\rangle+a_2e^{i(\phi-\theta)/2}|\psi_2\rangle) +\end{equation}

+",4889,,,,,1/3/2019 14:57,,,,0,,,,CC BY-SA 4.0 +5113,2,,5103,1/3/2019 21:53,,2,,"

This section of Nielsen & Chuang is talking specifically about simulating a classical circuit with a quantum circuit using Toffoli gate. So

+ +

1) the state $a$ will not be in superposition, since you're simulating a classical circuit and you can't have superposition in a classical circuit; $a$ will always be $|0\rangle$ or $|1\rangle$.

+ +

2) you know the state of the third qubit is $a$ because the circuit is defined to used Toffoli gate, and this is the definition of how Toffoli gate acts when input qubits are $|1\rangle$ and $a$. If a different gate was used the third qubit could be in a different state, but with this gate it will be in this state.

+",2879,,,,,1/3/2019 21:53,,,,0,,,,CC BY-SA 4.0 +5114,2,,5096,1/4/2019 1:40,,6,,"

There is none at the moment (as of version 0.3). We're working on adding it as a primitive type, hopefully it will be included in the next release.

+",2879,,,,,1/4/2019 1:40,,,,1,,,,CC BY-SA 4.0 +5115,2,,5096,1/4/2019 10:30,,2,,"

In the meantime you could make

+ +

newtype LongInt = (Int,Int)

+ +

where (a,b) could represent the integer $(2^{64}*a)+(b+2^{63})$

+ +

The arithmetic operations for this would then be overridden so you define your own (a,b)*(c,d) that gives another LongInt but with potential for overflow. So if this could be wrapped in Maybe monad, that would be better.

+ +

Continue this way like ""long long int"" that are 4 times the length of a standard 16 bit int in C.

+ +

You could make a different choice of how you want to encode larger integers as combinations of Int if you want.

+",434,,,,,1/4/2019 10:30,,,,3,,,,CC BY-SA 4.0 +5116,2,,2177,1/4/2019 13:22,,12,,"

I want to add a method that does not use ancilla qubits, but does require gates more complicated than just controlled-not. I believe this method was first presented by Barenco et. al. in this paper, Lemma 7.5:

+

+

Where $V^2=U$. In your case you are interested in a "control-n not" gate, so you need to find some $V$ such that $V^2=X$. A solution that works is +$$ +V = +\frac{1}{2} +\begin{pmatrix} +1+i & 1-i \\ +1-i & 1+i \\ +\end{pmatrix} \ . +$$

+

This is a recursive definition, so the "control-n not" gate is defined in terms of the "control n-1 not" gate. This would continue until you reach the two qubit gate CNOT.

+

This implementation is a little difficult, however, a simpler one exists if one does not mind collecting a relative phase (see Lemma 7.9 of the same paper).

+

To implement a gate such as $V$ in QISKIT, you will need to use the advanced single qubit gates.

+",4230,,4230,,1/6/2022 11:04,1/6/2022 11:04,,,,3,,,,CC BY-SA 4.0 +5117,2,,2230,1/4/2019 23:59,,4,,"

For superconducting qubits, x and y rotations are usually both done with microwave pulses, and as you said the phase of the pulse determines the rotation axis. See mathematical details in this Physics Stack Exchange post: How do we perform transverse measurements in a two level system?

+ +

Rotations about the z axis are quite different; they are done by changing the qubit's resonance frequency (a.k.a. ""detune"") for a specified duration of time. For example, detuning by 1 MHz for 100 ns gives a z-axis rotation by 1/10 of a full rotation.

+",32,,26,,1/5/2019 10:00,1/5/2019 10:00,,,,0,,,,CC BY-SA 4.0 +5118,1,,,1/5/2019 0:09,,9,1574,"

I'm aware that the optimality of the quantum strategy for the CHSH game is given by Tsirelson's bound, but presentations all skip over the (admittedly much less interesting) proof of the classical strategy's optimality.

+ +

In the CHSH game, we have two players: Alice and Bob. They are separately given independent random bits $X$ and $Y$ as input, and without communication must output bits of their own ($A$ and $B$) with the goal of making true the logical formula $X \cdot Y = A \oplus B$. The claimed optimal classical strategy is for Alice and Bob to both always output $0$, which results in a win 75% of the time:

+ +

$\begin{array}{|c|c|c|c|c|c|} +\hline +X & Y & A & B & X \cdot Y & A \oplus B \\ \hline +0 & 0 & 0 & 0 & 0 & 0 \\ \hline +0 & 1 & 0 & 0 & 0 & 0 \\ \hline +1 & 0 & 0 & 0 & 0 & 0 \\ \hline +1 & 1 & 0 & 0 & 1 & 0 \\ \hline +\end{array}$

+ +

The quantum strategy (which I go over here) results in a win ~85% of the time. You can use this in a proof of the insufficiency of local hidden variables to explain entanglement as follows:

+ +
    +
  1. Assume qbits decide at time of entanglement how they will collapse (rather than at time of measurement); this means they must carry with them some information (the local hidden variable), and this information can be written as a string of bits.
  2. +
  3. Since the information is sufficient to completely describe the way in which the entangled qbits collapse, Alice and Bob could, if given access to that same string of classical bits, simulate the behavior of a shared pair of entangled qbits.
  4. +
  5. If Alice and Bob could simulate the behavior of a shared pair of entangled qbits, they could implement the quantum strategy with local classical methods using the pre-shared string of classical bits. Thus, there must exist some classical strategy giving an 85% success rate with some string of bits as input.
  6. +
  7. However, there exists no string of bits which enables a classical strategy with success rate above 75%.
  8. +
  9. By contradiction, the behavior of entangled particles is not reducible to a string of bits (local hidden variable) and thus the entangled particles must instantaneously affect one another at time of measurement.
  10. +
+ +

I'm interested in the proof of (4). I imagine this proof takes the form of a noncommunicative pair of Turing machines which take as input independent random bits $X$ and $Y$ plus an arbitrary shared bitstring, which then win the CHSH game with probability greater than 75%; presumably this results in some contradiction demonstrating the nonexistence of such TMs. So what is this proof?

+ +

Secondarily, which papers have presented a proof of the classical strategy's optimality?

+ +

Bonus question: in (1), we claim that the local hidden variable can be written as a string of bits; is there a simple reason why this is the case?

+",4153,,,,,1/19/2019 20:51,Proof of optimality for CHSH game classical strategy,,3,0,,,,CC BY-SA 4.0 +5119,2,,5118,1/5/2019 7:17,,7,,"

I would argue that this is the critical issue to understand for Bell inequalities. Finding a violation of a Bell inequality tells you that the system is not classical (note: it does not prove that it is quantum), so you need to understand what the classical thing is that the world is not.

+ +

Let's state the CHSH random variable that we're interested in: +$$ +S=A_1B_1+A_1B_2+A_2B_1-A_2B_2, +$$ +where each of $A_1,A_2,B_1,B_2$ are random variables with $\pm1$ values. The key assumption for the classical strategy is that for every run of the experiment, all four variables have a fixed value (even though we only ever find out two of the values). Hidden variables are essentially irrelevant here - they let two distant parties coordinate what those fixed values will be without having to communicate in the moment, but cannot change this basic assumption.

+ +

What are the consequences of this? Rewrite $S$ as +$$ +S=A_1(B_1+B_2)+A_2(B_1-B_2). +$$ +Now, if $B_1\in\{\pm1\}$ and $B_2\in\{\pm1\}$, then either $B_1=B_2$, in which case $B_1-B_2=0$ and $B_1+B_2=\pm 2$, or $B_1=-B_2$, such that $B_1+B_2=0$ and $B_1-B_2=\pm 2$. In either case, $S=\pm 2$. Finally, if, in every run of the experiment, $S=\pm 2$, then the average value $|\langle S\rangle|\leq 2$.

+ +

So, what you learn from violation of a Bell inequality is that, each time the experiment is run, not all of the possible answers were determined. Classically, this is possible with the locality loophole -- if both questions are known, then a winning answer can be deterministically decided without having to specify all the other possible outcomes. Otherwise, there's some inherent randomness in play at picking the answers.

+ +

As for where you might find proofs in the literature, why not follow up on the references in the wikipedia article? As I say, the classical bound is the central element, so it must be in the original papers.

+ +
+

Bonus question: in (1), we claim that the local hidden variable can be written as a string of bits; is there a simple reason why this is the case?

+
+ +

Any information can be written as a string of bits.

+",1837,,,,,1/5/2019 7:17,,,,2,,,,CC BY-SA 4.0 +5120,1,,,1/5/2019 19:24,,8,890,"

The D-wave quantum computer allows us to be able to minimize Ising models. In reading other questions and responses, particularly What would be the simplest addition that would make the D-Wave architecture universal?, XX couplings (and others have been mentioned. They (XX, YY etc. couplings) look like names for connections between qubits based on an axis but beyond that I get lost (especially since the couplers on D-waves architecture seem to be identical from pair to pair). I addition I fail to understand how they fit in with the Ising model math; what are these couplers/what purpose do they serve?

+ +

The other question that mentioned XX, YY etc. couplings: +In D-Wave's universal quantum computer, why does the YY term have to be driven along with the linear X term?

+",5219,,,,,1/7/2019 7:45,"What are XX, YY, YZ etc. couplings?",,1,0,,,,CC BY-SA 4.0 +5121,1,5122,,1/5/2019 21:41,,1,190,"

+ +

The input state on the qubit is $|1\rangle\otimes(2|0\rangle+|1\rangle)$. I am assuming this means that the first qubit has the state $|1\rangle$, and the second qubit has the state $2|0\rangle+|1\rangle$. I could be wrong though. My question is, given the quantum circuit is shown below, what is the probability of the measurement outcomes, as well as the outcome measurement, and finally the new state after measurement.

+ +

If there is anything that needs to be further specified please let me know. Thank you.

+",5460,,26,,1/5/2019 22:47,1/6/2019 19:00,Evaluate the given quantum circuit,,1,1,,,,CC BY-SA 4.0 +5122,2,,5121,1/6/2019 2:03,,3,,"

The starting state is

+ +

$$ +2 | 1 0 \rangle + | 1 1 \rangle +$$

+ +

After the $H \otimes 1$

+ +

$$ +\sqrt{2} | 0 0 \rangle - \sqrt{2} | 1 0 \rangle + 1/\sqrt{2} | 0 1 \rangle - 1/\sqrt{2} | 1 1 \rangle +$$

+ +

where the first 2 terms come from the first term above and the last two from the last term.

+ +

Then the CNOT

+ +

$$ +\sqrt{2} | 0 0 \rangle - \sqrt{2} | 1 1 \rangle + 1/\sqrt{2} | 0 1 \rangle - 1/\sqrt{2} | 1 0 \rangle +$$

+ +

You didn't normalize initially so it doesn't make sense to talk about probabilities right now. You would have to normalize by a factor of $\sqrt{5}$

+ +

Edit:

+ +

$$ +H | 1 \rangle = 1/\sqrt{2} | 0 \rangle - 1/\sqrt{2} | 1 \rangle +$$

+ +

so

+ +

\begin{eqnarray*} +H \otimes 1 | 10 \rangle &=& 1/\sqrt{2} | 00 \rangle - 1/\sqrt{2} | 10 \rangle\\ +(H \otimes 1) 2 | 10 \rangle &=& 2/\sqrt{2} | 00 \rangle - 2/\sqrt{2} | 10 \rangle\\ +&=& \sqrt{2} | 00 \rangle - \sqrt{2} | 10 \rangle\\ +H \otimes 1 | 11 \rangle &=& 1/\sqrt{2} | 01 \rangle - 1/\sqrt{2} | 11 \rangle\\ +\end{eqnarray*}

+ +

The normalization factor doesn't change with applying $H \otimes 1$ or $CNOT$. It is still $\sqrt{5}$. The normalized state is

+ +

$$ +\frac{\sqrt{2}}{\sqrt{5}} | 0 0 \rangle - \frac{\sqrt{2}}{\sqrt{5}} | 1 1 \rangle + 1/\sqrt{2*5} | 0 1 \rangle - 1/\sqrt{2*5} | 1 0 \rangle +$$

+ +

as can be checked by:

+ +

\begin{eqnarray*} +(\frac{\sqrt{2}}{\sqrt{5}})^2+(-\frac{\sqrt{2}}{\sqrt{5}})^2+(-1/\sqrt{2*5})^2+(1/\sqrt{2*5})^2 &=& \frac{2}{5}+\frac{2}{5}+\frac{1}{10}+\frac{1}{10}\\ +&=& 1 +\end{eqnarray*}

+",434,,434,,1/6/2019 19:00,1/6/2019 19:00,,,,2,,,,CC BY-SA 4.0 +5123,2,,2230,1/6/2019 12:36,,4,,"

Whilst we normally talk about $\left|0\right>$ and $\left|1\right>$ as unchanging states in quantum computing, this is not usually the case in a physical realization where there tends to be an energy difference $\Delta E$ between these states such that $\left|1\right>_\mathrm{logical} = e^{-it \Delta E / \hbar} \left|1\right>_\mathrm{physical}$. This phase rotation has the same angular frequency $\Delta E / \hbar$ that you need to drive a transition between $\left|0\right>$ and $\left|1\right>$. Their relative phase is the angle that determines if you drive a $X$- or $Y$-rotation (or rotate about an axis somewhere else in the plane spanned by the axes for $X$- and $Y$-rotations).

+ +

The easiest way to achieve a $Z$-rotation is to wait and let the $e^{-it \Delta E / \hbar}$ factor achieve it for you. However, this would be a $Z$ gate on every qubit which is not the goal if you want a $Z$ gate on one spcific qubit. To achieve that, you can for example combine partial rotations about the axes for $X$- and $Y$-gates. Its easy to verify with a globe (or any ball with marked directions) that ""half"" of an $X$ gate (a 90 degree rotation) followed by a $Y$ gate and then the reverse ""half"" if an $X$ gate (a -90 degree rotation) together is the same as a $Z$ gate.

+ +

There are more complicated tricks you could alternatively use. For example, by driving a pulse in a detuned way, you move the effective Bloch sphere rotation axis away from the equatorial plane (in which the rotation axes for $X$ and $Y$ gates lie). But this works only for moderate tiltings of this angle as the pulses' effect in the case of trying to realize a $Z$ gate this way would tend to zero: It happens infinitely slow. Hence you need to combine at least two Bloch sphere rotations to get a Z gate with such pulses driving the transition between your qubit basis state.

+",,user1039,,user1039,1/6/2019 14:27,1/6/2019 14:27,,,,0,,,,CC BY-SA 4.0 +5124,2,,5118,1/6/2019 13:37,,6,,"

One way to go about proving this is to characterise the set of all possible strategies that Alice & Bob can adopt. By ""strategy"" here I mean a possible relation between inputs and outputs, encoded in the set of four binary numbers $A_0,A_1,B_0,B_1$.

+ +

It is worth noting that it doesn't matter whether we are considering deterministic or probabilistic protocols here. The difference between these two approaches is in the way the steps of the protocol proceed, but if one considers only input and output of the protocol, without caring about how the output is actually obtained, then characterising the set of all possible input-output relations and showing that none of these combinations gives a winning probability greater than $75\%$ is enough. +In other words, using a probabilistic approach does not expand the number of possible outcomes/strategies, but only provide a different way to get to them. Because we are only interested in the final winning probability, and therefore in the overall strategy, we don't need to take into account separately deterministic and probabilistic case.

+ +

Note that, given a strategy $\mathcal S\equiv\{A_0,A_1,B_0,B_1\}$, we can write the number of input combinations for which this strategy gives the wrong result as +$$P_{\mathcal S}\equiv A_0\oplus B_0 + A_0\oplus B_1 + A_1\oplus B_0 + (1-A_1\oplus B_1),\tag1$$ +where $a\oplus b$ denotes addition modulo 2.

+ +

Our problem is to find the strategy $\mathcal S$ that minimises $P_{\mathcal S}$.

+ +

Now, there are several ways to do this.

+ +

Brute force

+ +

The simplest way, if the least elegant, is to compute the value of $P_{\mathcal S}$ for all the possible strategies $\mathcal S$. There are 16 of these, so this isn't too bad. With a few lines of code you can obtain the following table +$$ +\left( +\begin{array}{ccccc} + A_0 & A_1 & B_0 & B_1 & P_{\mathcal S} \\ + 0 & 0 & 0 & 0 & 1 \\ + 0 & 0 & 0 & 1 & 1 \\ + 0 & 0 & 1 & 0 & 3 \\ + 0 & 0 & 1 & 1 & 3 \\ + 0 & 1 & 0 & 0 & 1 \\ + 0 & 1 & 0 & 1 & 3 \\ + 0 & 1 & 1 & 0 & 1 \\ + 0 & 1 & 1 & 1 & 3 \\ + 1 & 0 & 0 & 0 & 3 \\ + 1 & 0 & 0 & 1 & 1 \\ + 1 & 0 & 1 & 0 & 3 \\ + 1 & 0 & 1 & 1 & 1 \\ + 1 & 1 & 0 & 0 & 3 \\ + 1 & 1 & 0 & 1 & 3 \\ + 1 & 1 & 1 & 0 & 1 \\ + 1 & 1 & 1 & 1 & 1 \\ +\end{array} +\right) +$$ +which confirms that indeed all possible strategies lead to the game being lost for at least one input combination (that is, in your words, to a success probability not greater than $75\%$).

+ +

But now, of course, this is not a very satisfying way to solve the problem (for me at least). It would be much nicer to have a way to prove optimality without having to check all possibilities. The main hurdle to overcome is that Eq. (1) contains both modular sums and regular sums, which makes manipulation a bit awkward, as we cannot write something like $A_0\oplus B_0+A_0\oplus B_1=A_0(B_0\oplus B_1)$.

+ +

I can see two ways around this, the second of which also sheds light to the similarities between this formalism and the regular proof of the CHSH inequalities.

+ +

First method

+ +

A way around this problem is to notice that we can express modular sums using regular sums and products, as following +$$A\oplus B=(1-A)B+A(1-B)=A+B-2AB.$$ +Simple algebraic manipulation thus allows us to write +$$A_0\oplus B_0+A_0\oplus B_1=2A_0(1-(B_0+B_1))+(B_0+B_1),\\ +A_1\oplus B_0+(1-A_1\oplus B_1)=1+(2A_1-1)(B_1-B_0),$$ +and finally +$$P_{\mathcal S}=1+2\{B_0+A_0[1-(B_0+B_1)]+A_1(B_1-B_0)\}.$$

+ +

You can now verify that if $B_0=B_1$ then $P_{\mathcal S}=1+2A_0\oplus B_0$, while if $B_0+B_1=1$ then $P_{\mathcal S}=1+2A_1\oplus B_0$.

+ +

Equivalently, one can verify that $P_{\mathcal S}$ can also be written as +$$P_{\mathcal S}=(1-2B_0)(B_1-B_0)[1+2A_1\oplus B_0] ++ [1-(B_0+B_1)](1-2B_0)[1+2A_0\oplus B_0]+ B_0(1-B_0)(...),$$ +where the last term is always zero as $B_0\in\{0,1\}$. +Note that this is just a way to express algebraically what happens in the two cases $B_0=B_1$ and $B_0=-B_1$, as +$(1-2B_0)(B_1-B_0)=1$ iff $B_0=-B_1$, +and $(1-2B_0)(1-B_0-B_1)=1$ iff $B_0=B_1$.

+ +

Second method

+ +

This involves showing that this formalism is equivalent to the one commonly used in the context of deriving the CHSH inequalities.

+ +

Denote with $\tilde A_x\equiv 1-2A_x$ the number obtained by replacing $0,1$ in $A_x$ with $+1,-1$, respectively, and similarly for $\tilde B_y$. +For example, $A_x=0$ gives $\tilde A_x=+1$. +Note that, under this mapping, we have the identities +$$A_x\oplus B_y=(1-\tilde A_x\tilde B_y)/2.$$ +We can then write

+ +

$$P_{\mathcal S}=\frac{1}{2}\left[4-\tilde A_0\tilde B_0-\tilde A_0\tilde B_1-\tilde A_1\tilde B_0+\tilde A_1\tilde B_1\right] +=2 - S/2,$$ +where we defined +$$S\equiv \tilde A_0\tilde B_0+\tilde A_0\tilde B_1+\tilde A_1\tilde B_0-\tilde A_1\tilde B_1,$$ +which you might recognise as equivalent to the operator $\hat S$ used when discussing the CHSH inequalities.

+ +

Standard arguments now give you $S=\pm 2$, and thus $\lvert S\rvert\le 2$, and finally +$P_{\mathcal S}\ge1$ (or more precisely $P_{\mathcal S}\in\{1,3\}$).

+",55,,55,,1/15/2019 9:34,1/15/2019 9:34,,,,6,,,,CC BY-SA 4.0 +5125,1,5126,,1/6/2019 22:05,,28,13556,"

I know that $re^{i\theta} = x + iy$ for any complex number $x + iy$ by Euler's formula. How do you calculate relative and global phase?

+",4693,,10480,,2/2/2021 18:30,2/2/2021 18:30,"What is the difference between a relative phase and a global phase? In particular, what is a phase?",,2,0,,,,CC BY-SA 4.0 +5126,2,,5125,1/7/2019 0:29,,30,,"

As clearly evident from the Euler's form $z=re^{i\theta}$, a phase has something to do with rotation in the Argand plane but not affect the amplitude of a complex number. You can make a set of set of infinite complex numbers with the same magnitude. It can just be regarded as the extra degree of freedom for a given complex number.

+ +

In the perspective of Quantum Information/Computing, the observable quantities are the probabilities which are proportional to the complex number amplitudes $|z|^2=|re^{i\theta}|^2=(re^{i\theta})(r^*e^{-i\theta})=r^2$ which clearly doesn't care about the the phase $\theta$.

+ +

Let's consider the most simple non-trivial example. For any quantum state with two degrees of freedom (qubit): +\begin{equation} +|\psi\rangle=r_1e^{i\theta_1}|0\rangle+r_2e^{i\theta_2}|1\rangle +\end{equation} +This is described by two complex numbers with phases $\theta_1$ and $\theta_2$ respectively. It can be rewritten as: +\begin{equation} +|\psi\rangle=e^{i\theta_1}(r_1|0\rangle+r_2e^{i(\theta_2-\theta_1)}|1\rangle) +\end{equation}

+ +

Now, if you calculate the amplitude $|\psi|^2$, the factor $e^{i\theta_1}$ in front will vanish by the argument above. This is called a global phase which is an overall phase in front. The relative phase is the quantity $\theta_2-\theta_1$ or $\theta_1-\theta_2$, however defined.

+ +

The relative phase is an observable quantity in Quantum Theory and it can be changed when a state evolved in accordance with the Schrodinger's equation $i\hbar\frac{d}{dt}|\psi\rangle=\hat{H}|\psi\rangle$.

+ +

The relative phase has also great importance when we consider the density matrix for a state defined as $\rho=|\psi\rangle \langle \psi|$ which for the example above is: +\begin{equation} +\rho=r_1^2|0\rangle\langle0|+r_1r_2e^{i(\theta_1-\theta_2)}|0\rangle\langle1|+r_2r_1e^{i(\theta_2-\theta_1)}|1\rangle\langle0|+r_2^2|1\rangle\langle1| +\end{equation}

+ +

where it is only the relative phase that appears and not the global phase. In Quantum Information point of view, this relative phase appearing in the off-diagonal terms of the above matrix carries the information of coherence of the system which is one of the most unique properties of quantum systems.

+ +

These are some general concerns of relative and global phases. It does not make any sense to talk about a relative phase for a single complex number $z$.

+ +

Also, please see the wiki articles of such concepts, they clear enough content on these as a good start. +Here you can refer to https://en.wikipedia.org/wiki/Qubit, mainly the Bloch sphere section.

+",4889,,,,,1/7/2019 0:29,,,,7,,,,CC BY-SA 4.0 +5127,1,5139,,1/7/2019 0:43,,5,266,"

In the adiabatic model, we have a system acquiring a Berry phase due to cyclic slow periodic evolution under a Hamiltonian. While in the topological phases, we talk about systems such as anyons which acquire fractional phases under permutation or exchange trajectories in space.

+ +

I am not clear about how the topological phases arise (in general)? Has it the same mechanism as the Berry phase? Is it a special kind of Berry phase characteristic of the topological system? Has the system to follow a path adiabatically and return back to its initial state for such a phase to emerge?

+",4889,,,,,1/8/2019 11:07,What is the correspondence between adiabatic phase and a topological phase?,,2,1,,,,CC BY-SA 4.0 +5128,1,,,1/7/2019 1:04,,3,1068,"

Suppose Circuits= [circuit1, circuit2, ..., circuitn] is a list of defined circuits. Then, job = execute(Circuits, backend=backend, shots=shots, max_credits=max_credits) will execute a list of circuits all together. Then, one can get the result by using job.result().get_counts. It looks like this (with the results of the first circuit execution highlighted): +

+ +

Is there any way to extract the counts like how it usually is with only one circuit in execution?

+",2757,,26,,1/7/2019 12:46,5/28/2019 15:50,Result of a job for a list of circuits on QISKit,,2,0,,,,CC BY-SA 4.0 +5129,2,,5128,1/7/2019 2:16,,3,,"

From the Getting started tutorial on Qiskit, it seems that you grab the result of job first and you access the counts via the function get_counts(circuit) for a specific circuit. So I would loop through Circuits and use this function on each:

+ +
result_submissions = job.result()
+for qc in Circuits:
+     counts = result_submissions.get_counts(qc)
+     print(counts)
+
+",4127,,,,,1/7/2019 2:16,,,,2,,,,CC BY-SA 4.0 +5130,2,,5120,1/7/2019 7:45,,8,,"

In the mentioned context, what is meant is that, between a pair of qubits that are coupled, an XX coupling means something of the form +$$ +X\otimes X\equiv\left(\begin{array}{cccc} 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \end{array}\right), +$$ +tensored with identity between all other qubits, where $X$ is the standard Pauli matrix. You then sum these terms over every possible pair of coupled qubits, possibly with different strengths. For example, in a spin chain, qubits labelled 1 to $n$, with a nearest-neighbour coupling (i.e. between all pairs $i$ and $i+1$), the XX coupling means +$$ +\sum_{i=1}^{N-1}J_i\mathbb{I}^{\otimes(i-1)}\otimes X\otimes X\otimes\mathbb{I}^{\otimes(n-i-1)} +$$ +for real parameters $J_i$. Similarly, $YY$ means replacing the $X\otimes X$ with $Y\otimes Y$.

+ +

In other contexts, the terminology can be used slightly differently. For example, in the condensed matter community, they usually talk about an ""XX Hamiltonian"". This does not mean a Hamiltonian with XX couplings. Instead, it means a Hamiltonian with terms of the form $XX+YY$ between coupled pairs of qubits. This is also called the exchange interation. To make this notation clearer, let me give further examples. An $XXX$ Hamiltonian, normally called the Heisenberg Hamiltonian, would mean couplings of the for $XX+YY+ZZ$, while $XXZ$ means $XX+YY+\Delta ZZ$ for some parameter $\Delta$. In other words, there are generally 3 terms that you have to worry about in a two-qubit coupling: $aXX+bYY+cZZ$, and a notation like ""XX"" or ""XXX"" tells you the number of non-zero terms $(a,b,c)$ which are the same. While ""XXZ"" tells you two values are the same ($a=b$), but that one value is different. The further complication is that this notation is not consistently used. Sometimes people use ""XY"" to mean $XX+YY$ and ""XYZ"" to mean $XX+YY+ZZ$.

+ +
+

what purpose do they serve

+
+ +

The purpose is to change the maths. The whole point is that without these extra terms, D-wave's quantum computer is not universal - it is incapable of implementing an arbitrary quantum computation.

+ +

Let me try to give some insight as to why that might be (I don't pretend that this applies directly). To that end, consider the simple geometry of a one-dimensional chain. You'd have some sort of Hamiltonian +$$ +H=\sum_{i=1}^{n-1}\Delta_iZ_iZ_{i+1}+\sum_{i=1}^nB_iX_i. +$$ +The great thing about this Hamiltonian, the transverse Ising model, is that it's exactly solvable via Bogoliubov and Jordan-Wigner transformations. But that means that we can classically simulate its effects and so it's not interesting from a computation perspective. However, if we add extra terms to make the Hamiltonian +$$ +H=\sum_{i=1}^{n-1}\Delta_iZ_iZ_{i+1}+\sum_{i=1}^{n-1}\tilde\Delta_iX_iX_{i+1}+\sum_{i=1}^nB_iX_i. +$$ +then we don't know how to simulate it, and it has the potential to perform interesting computations (this is a long way from proving that simulation of this Hamiltonian is BQP complete).

+",1837,,,,,1/7/2019 7:45,,,,0,,,,CC BY-SA 4.0 +5131,2,,5127,1/7/2019 8:04,,4,,"

From Wikipedia:

+ +
+

In physics, topological order is a kind of order in the + zero-temperature phase of matter (also known as quantum matter). + Macroscopically, topological order is defined and described by robust + ground state degeneracy and quantized non-Abelian geometric phases + of degenerate ground states

+
+ +

(emphasis is mine). Clearly, it is a special kind of Berry Phase, determined by the ground state degeneracy of the defining Hamiltonian.

+ +

You asked:

+ +
+

Has the system to follow a path adiabatically..

+
+ +

I'm not sure that adiabaticity of the evolution is absolutely necessary (in a similar way to the way that you can find plenty of discussion about non-adiabatic geometric phases), but in practice it's probably a good idea to minimise the occurrence of further excitations that could cause errors in what you're trying to achieve, even if, due to the nature of topological systems, it's quite unlikely that those excitations would contribute anything.

+ +
+

...and return back to its initial state for such a phase to emerge

+
+ +

Well, it wouldn't return to its initial state. The whole point of the topological phase is that you don't want it to return to its initial state. You might return it to its original position, but even that isn't necessary. People talk about braiding anyons -- essentially, swapping their positions.

+",1837,,,,,1/7/2019 8:04,,,,0,,,,CC BY-SA 4.0 +5132,1,,,1/7/2019 13:17,,5,650,"

The real devices used as backends for Qiskit have calibration data that quantifies errors ($T_1$ and $T_2$, gate fidelities, etc). This can be accessed by, for example

+ +
from qiskit import IBMQ
+IBMQ.load_accounts()
+device = IBMQ.get_backend('ibmq_5_tenerife')
+properties = device.properties()
+
+print( properties.to_dict() )
+
+ +

How can a simulation be performed that takes all of this information into account, and produces a result given a simulation of this noise?

+",409,,26,,1/7/2019 15:00,1/7/2019 15:00,How can noise on a device be simulated using measured noise parameters?,,1,0,,,,CC BY-SA 4.0 +5133,2,,5132,1/7/2019 13:17,,7,,"

This can be done using the 'Aer' component of Qiskit. The properties information can be turned into a noise model using

+ +
from qiskit.providers.aer import noise
+properties = device.properties()
+noise_model = noise.device.basic_device_noise_model(properties)
+basis_gates = noise_model.basis_gates
+
+ +

This can then be supplied to the execute() method, as is normally used to run jobs. Here is a full working example of a simulation using the noise model from the Tenerife device, for a circuit that creates a Bell pair.

+ +
from qiskit import QuantumRegister, ClassicalRegister
+from qiskit import QuantumCircuit, execute, Aer, IBMQ
+from qiskit.providers.aer import noise
+
+# Choose a real device to simulate
+IBMQ.load_accounts()
+device = IBMQ.get_backend('ibmq_5_tenerife')
+properties = device.properties()
+coupling_map = device.configuration().coupling_map
+
+# Generate an Aer noise model for device
+noise_model = noise.device.basic_device_noise_model(properties)
+basis_gates = noise_model.basis_gates
+
+# Generate a quantum circuit
+q = QuantumRegister(2)
+c = ClassicalRegister(2)
+qc = QuantumCircuit(q, c)
+
+qc.h(q[0])
+qc.cx(q[0], q[1])
+qc.measure(q, c)
+
+# Perform noisy simulation
+backend = Aer.get_backend('qasm_simulator')
+job_sim = execute(qc, backend,
+                  coupling_map=coupling_map,
+                  noise_model=noise_model,
+                  basis_gates=basis_gates)
+sim_result = job_sim.result()
+
+print(sim_result.get_counts(qc))
+
+ +

The result I got when running this was {'00': 409, '11': 411, '10': 94, '01': 110}, which shows that the expected results of '00' and '11' are indeed dominant, but '01' and '10' also appear due to the simulated noise.

+",409,,,,,1/7/2019 13:17,,,,0,,,,CC BY-SA 4.0 +5134,2,,2536,1/7/2019 13:45,,2,,"

Hope this late contribution won't be a meaningless contribution, but as mentioned in one of the comments above, by using D-Waves version of NetworkX you can visualize the Pegasus network. I have attached a few images here of the Pegasus 2 (P2) and Pegasus 6 (P6) architectures using the D-Wave NetworkX.

+ +

+ +

+ +

The reason that I find Pegasus interesting is that the architecture allows for odd number cycles, and of course the obvious scale up in the maximum degree. The theoretical inability for Chimera to have odd cycles is limiting, but practically it can be approximated using minor embedding techniques and maybe imperfect chimera, but of course, Pegasus overcomes that entirely.

+",5490,,26,,1/7/2019 14:53,1/7/2019 14:53,,,,5,,,,CC BY-SA 4.0 +5137,2,,97,1/8/2019 3:50,,4,,"
+

noise should average itself out.

+
+ +

Noise doesn't perfectly average itself out. That's the Gambler's Fallacy. Even though noise tends to meander back and forth, it still accumulates over time.

+ +

For example, if you generate N fair coin flips and sum them up, the expected magnitude of the difference from exactly $N/2$ heads grows like $O(\sqrt N)$. That's quadratically better than the $O(N)$ you expect from a biased coin, but certainly not 0.

+ +

Even worse, in the context of a computation over many qubits the noise doesn't cancel itself nearly as well, because the noise is no longer along a single dimension. In a quantum computer with $Q$ qubits and single-qubit noise, there are $2Q$ dimensions at any given time for the noise to act on (one for each X/Z axis of each qubit). And as you compute with the qubits, these dimensions change to correspond to different subspaces of a $2^Q$ dimensional space. This makes it unlikely for later noise to undo earlier noise, and as a result you're back to $O(N)$ accumulation of noise.

+ +
+

run the operations, say, a hundred times, and pick the average/most common answer?

+
+ +

As computations get larger and longer, the chance of seeing no noise or of the noise perfectly cancelling out rapidly becomes so close to 0% that you can't expect see the correct answer even once even if you repeated the computation a trillion times.

+",119,,119,,1/8/2019 18:22,1/8/2019 18:22,,,,0,,,,CC BY-SA 4.0 +5138,1,,,1/8/2019 7:15,,2,737,"

Simulated annealing is applied for deep learning using convolutional neural networks. Likewise, can quantum annealing be used?

+ +

These two papers:

+ + + +

have both used the annealing technique for optimization of the problems but with different learning types. Therefore, my concern is whether quantum annealing can be applied for convolutional neural networks as well as or not.

+ +

If yes, then how? If no, then why not?

+ +

Any reference or related theories or work will be a great help.

+",4924,,26,,1/8/2019 8:59,1/8/2019 11:58,Can quantum annealing be used for training convolutional neural networks?,,1,2,,,,CC BY-SA 4.0 +5139,2,,5127,1/8/2019 9:39,,5,,"

When a quantum system, parametrized by a manifold of classical parameters, evolves along a closed path in the parameter space, its state experiences a unitary transformation, which is called a geometric phase.

+ +

In most applications of quantum computing, this parameter space is usually a set of control parameters used to drive the system. More precisely, the system's Hamiltonian depends on a set of parameters, some of them can be controlled by the experimenter to generate an evolution according to the Schrödinger equation: +$$\frac{d|\psi(t)\rangle}{dt} = \frac{1}{i\hbar} H(x(t)) |\psi(t)\rangle$$
+The Hamiltonian $H(x)$ depends on the parameters (coordinates) $x$ belonging to the control manifold $\mathcal{M}$. The control of the system evolution is performed through the ""driving the Hamiltonian"" along the trajectories $x(t)$ by the experimenter.

+ +

An example of a space of control parameters of a quantum computing system is the parameter space of the laser pulses acting on trapped ion qubits. Here, the control parameters $x$ consist of the laser phases and exposure times.

+ +

Adiabatic phase

+ +

When the system's initial Hamiltonian has a degenerate ground state +$$ H(x(0)) |\psi_n\rangle = E_0 |\psi_n\rangle, \quad n=1, ..., N,$$ +Then if we evolve the system very slowly along a closed cycle in the parameter space, specifically if +$$\langle\psi_n|\frac{dH}{dt}|\psi_n\rangle T << E_1(t)-E_0(t)$$ +Where $T$ is the cycle time period and $E_1$ is the energy of the first excited state. Then, when the above adiabatic condition applies, the system evolves within the degenerate ground state subspace and its final state after the evolution cycle can be approximated by: + $$ |\Psi(T) \rangle = e^{\frac{-iET}{\hbar}} Pe^{\frac{i}{\hbar}\oint A_i(x) dx^i} |\Psi(0) \rangle, $$ +The term in front of $|\Psi(0) \rangle $ is the geometric phase. Both the initial $|\Psi(0) \rangle $ and the final $|\Psi(T) \rangle $, states are combinations of the ground state vectors; $P$ denotes the time ordering operator, and $A_i$ are the matrices whose elements are given by: +$$A^{mn}_i = \langle\psi_m(t)|\frac{d}{dx^i} |\psi_n(t)\rangle $$ +Where $|\psi_n(t)\rangle$ are instantaneous eigenvectors of the time varying Hamiltonian: +$$ H(x(t)) |\psi_n(t)\rangle = E_0(t) |\psi_n(t)\rangle$$,

+ +

The Lie algebra valued differential form $A_i dx^i$ is called the Wilczek-Zee non-Abelian potential. It is a non-Abelian generalization of the electromagnetic vector potential. The Wilczek-Zee potential is also a gauge potential; a change of the (computational) basis that we use for the degenerate subspace is equivalent to a gauge transformation which does not change the value of the geometric phase.

+ +

The term $e^{\frac{-iET}{\hbar}}$ is called a dynamical phase. In our case it is just a global phase which does not change the physical state. The dynamic phase in contrast to the geometric phase depends explicitly on the cycle time. If the system is rotated fast, then less dynamical phase is accumulated. The Wilczek-Zee phase in contrast depends only on the trajectory in the parameter space and not on the evolution time (as long as the evolution is not too fast to break the adiabatic theorem).

+ +

One of the major applications of the adiabatic geometric phase is in the construction of gates in holonomic quantum computers as originally proposed in the seminal paper by Rasetti and Zanardi.

+ +

non-Adiabatic phase

+ +

In quantum computation, the adiabatic condition is a burden, because it requires the controlled evolution of the system to be slow, enabling the system more time to decohere. Thus, adiabatic quantum evolution, although not excluded as a viable possibility of realizing a quantum computer, is quite constrained. But the fact is, that when the system's evolution is fast, such that the adiabatic theorem does not apply, the system still follows a unitary evolution which can be expressed by a geometric phase. However, this time, it is the responsibility of the experimenter to keep the system in the computational subspace, as the adiabatic theorem ceases to apply. In this case the final state of the system can be expressed by:

+ +

$$ |\Psi(T) \rangle = Pe^{\frac{i}{\hbar}(-\int_0^T -E(t) dt + \oint A_i(x) dx^i)} |\Psi(0) \rangle $$

+ +

This time, the Hilbert space does not need to be a degenerate ground space of a given Hamiltonian, and the energy matrix in the first term is given by: +$$E_{mn}(t) = \langle\psi_m(t)|H(t) |\psi_n(t)\rangle $$ +Here, the vectors $|\psi_n(t)\rangle$ are just the (computational) basis vectors that we choose to work with.

+ +

The above geometric phase is usually referred to as the (non-Abelian version of the) Aharonov-Anandan phase.

+ +

We observe here, there is a very big complication, the dynamical phase became a matrix and it appears inside the time ordering operator. The control of dynamical phases is very complicated and depends on our precise modeling of the system and on our precise speed in controlling the system's evolution. However, there is a trick which helps very much in the non-adiabatic case: If we can control the system along a parallel transport trajectory, in which: +$$\langle \Psi(t) |\frac{d}{dt} |\Psi(t) \rangle = 0, $$ +Then the dynamical phase becomes again a global phase factor and the geometric phase will be again be given in an expression similar to the Wilczek-Zee case (please see , for example, Sjöqvist).

+ +

Topological phase

+ +

As stated earlier, the geometric phase does not depend on the speed that we evolve the system in along the trajectory, but it depends on the shape of the trajectory itself. For example, in the Abelian case when the trajectory resides on a Bloch sphere, the geometric phase (a $U(1)$ phase in this case) is just the area enclosed by the trajectory. Thus, a change in the trajectory's shape introduces a change in the geometric phase.

+ +

However, when the Wilczek-Zee, or the Aharonov-Anandan potentials are flat, i.e., when the curvature +$$F_{ij}= \frac{d A_i }{dx^j} - \frac{d A_j }{dx^i} + [A_i, A_j] = 0$$ +vanishes, then the geometric phase does not depend on the exact details of the trajectory, but only on its homotopy class. Thus, if we choose two trajectories enclosing the same holes in the parameter space, we obtain exactly the same geometric phase, which quite a relief, because in this case we do not need to draw exact trajectories in order to generate quantum gates. For example, in braiding two non-Abelian anyons, the geometric phase is topological, and in this case, the anyon trajectories need not to be precise as long one rotates about the other.

+",4263,,4263,,1/8/2019 11:07,1/8/2019 11:07,,,,0,,,,CC BY-SA 4.0 +5140,2,,5138,1/8/2019 11:58,,2,,"

I will assume you are asking about D-Wave's quantum annealer.

+ +

If there is a part of the learning process that can fit the QUBO (Quadratic Unconstrained Binary Optimization) formulation, then yes.

+ +

The problem however is what to consider as binary variables of your problem. In CNN, we have in general real-valued parameters that we tweak for training (using Stochastic Gradient Descent for instance). At first glance, considering the cost function would not fit the requirements, especially because you have nonlinear functions applied to the real weights so it does not look like a QUBO.

+ +

The second paper you mention used it especially because the energy function of Restricted Boltzmann machines is a QUBO and they were using the machine as a Boltzmann-like sampler for estimating an intractable part in the gradient (the negative part). So it's a different setup than CNNs.

+",4127,,,,,1/8/2019 11:58,,,,0,,,,CC BY-SA 4.0 +5144,1,5209,,1/8/2019 17:51,,9,2737,"

Suppose I want to implement run several circuits one after another, but they are constructed in a similar fashion. I could reinstantiate a QuantumCircuit for each iteration, like this:

+ +
params = np.linspace(0, 2 * np.pi, num=20)
+for p in params:
+    circ = QuantumCircuit(q, c)
+    do_stuff(circ, p)
+    do_other_stuff()
+
+ +

but I'm afraid that creating a bunch of unnecessary circ objects takes too much memory or too many calls to the garbage collector.

+ +

Instead, I would like to remove the gates from the QuantumCircuit object and build the new circuit in the old object. Is it possible, and if so, is it reasonable?

+",5103,,26,,1/8/2019 18:23,1/15/2019 15:01,Can I remove gates from a QuantumCircuit?,,1,0,,,,CC BY-SA 4.0 +5145,1,5146,,1/8/2019 20:19,,3,221,"

In Cirq, is it possible to take a sub-circuit generator and use it as the sub_gate in a cirq.ControlledGate?

+ +
... instantiate circuit and qubits q0-q3 ...
+
+... define sub circuit generator:
+def my_layer():
+    """"""
+    sub-circuit generator
+    ref: https://github.com/quantumlib/Cirq/blob/master/docs/circuits.md
+    """"""
+    yield CZ(q0, q1)
+    yield [H(q) for q in (q0, q1, q2)]
+    yield [CZ(q1, q2)]
+    yield [H(q0), [CZ(q1, q2)]]
+
+... take the sub-circuit generator and do something like:
+gate = cirq.ControlledGate(sub_gate = my_layer())
+circuit.append(gate(q3))
+
+ +

In other words, how can I take a sub-circuit and make its execution conditional on a control qubit?

+",5502,,26,,1/9/2019 1:58,1/9/2019 1:58,cirq.ControlledGate from sub-circuit generator,,1,0,,,,CC BY-SA 4.0 +5146,2,,5145,1/8/2019 21:03,,1,,"

The following code snippet will do almost what you want:

+ +
class MyLayerGate(cirq.Gate):
+    def _decompose_(self, qubits):
+        a, b, c = qubits
+        return my_layer(a, b, c)
+
+    # [will be unnecessary in v0.5.0] workaround for cirq.unitary ignoring _decompose_:
+    def _unitary_(self):
+        return cirq.unitary(
+            cirq.Circuit.from_ops(self._decompose_(
+                cirq.LineQubit.range(3))))
+
+controlled_my_layer_gate = cirq.ControlledGate(MyLayerGate())
+
+ +

In the future, the # workaround part won't be necessary anymore. Currently it's needed because:

+ +

1) cirq.ControlledGate doesn't implement a _decompose_ method. I've opened an issue to fix this.

+ +

2) cirq.apply_unitary and cirq.unitary should use _decompose_ when _unitary_ isn't implemented on a gate, so that circuit simulation works when using gates with nothing but a specified decomposition. There is an in-progress PR to fix that.

+ +

Also, I do like the idea of controlling the gates coming out of a method without having to define a new class. A unified cirq.control(callable_or_gate_or_operation, optional_specified_control) method would be useful. I'll also open an issue to do that.

+",119,,119,,1/8/2019 21:14,1/8/2019 21:14,,,,0,,,,CC BY-SA 4.0 +5147,1,,,1/8/2019 22:30,,14,1499,"

I'm unclear why the Bloch sphere representation of a maximally entangled qubit shows the state of the bit as being at the origin of the sphere.

+ +

For example, this illustration

+ +

+ +

shows the effect of the simple circuit

+ +

+ +

over time, with $q_0$ on the left and $q_1$ on the right. Both qubits end up at the origin of their respective spheres following application of $CNOT$ ($q_1$ ""waits"" at its initial value until after $H$ moves $q_1$ to $x$).

+ +

Why is a maximally entangled qubit shown at the origin of a Bloch sphere?

+ +

An explanation of sorts is provided here, but I'm too much of a beginner to follow it.

+",5318,,26,,1/9/2019 3:09,3/17/2021 7:52,Why is an entangled qubit shown at the origin of a Bloch sphere?,,2,1,,,,CC BY-SA 4.0 +5148,2,,5147,1/8/2019 23:38,,10,,"

Let $(x,y,z)$ be a point in the unit ball with $x^2+y^2+z^2 \leq 1$.

+

The state associated with this point is

+

\begin{eqnarray*} +\rho &=& \frac{1}{2} (I_2 + x \sigma_x + y \sigma_y + z \sigma_z)\\ +&=& \frac{1}{2} \begin{pmatrix} +1+z&x-iy\\ +x+iy&1-z\\ +\end{pmatrix} +\end{eqnarray*}

+

This is just a convenient way to parameterize all $2\times 2$ density matrices. This doesn't work as nicely for qudits with $d \neq 2$. But since we are talking $d=2$, we might as well use this nice parameterization.

+

In particular let $(x,y,z)=(0,0,0)$, the associated $\rho$ is

+

\begin{eqnarray*} +\rho &=& \frac{1}{2} \begin{pmatrix} +1+0&0-i0\\ +0+i0&1-0\\ +\end{pmatrix}\\ +&=& \begin{pmatrix} +\frac{1}{2}&0\\ +0&\frac{1}{2} +\end{pmatrix} +\end{eqnarray*}

+

This is the maximally mixed state.

+

What is being shown is the state for only 1 qubit. This is the result after taking a partial trace over the other qubit.

+

So if looking at the first one $q_0$. It starts off in the state

+

\begin{eqnarray*} +\rho &=& | 0 \rangle \langle 0 |\\ +\end{eqnarray*}

+

which corresponds to $(x,y,z)=(0,0,1)$

+

Then it goes to

+

\begin{eqnarray*} +\rho &=& H | 0 \rangle \langle 0 | H\\ +\end{eqnarray*}

+

But after the CNOT it is

+

\begin{eqnarray*} +\rho &=& \text{Tr}_2 (\operatorname{CNOT}_{12} H | 0 0 \rangle \langle 00 | H \operatorname{CNOT}_{12}) \\ +\end{eqnarray*}

+

which ends up being the maximally mixed state corresponding to $(x,y,z)=(0,0,0)$

+

Edit: As stated above "This is just a convenient way to parameterize all $2\times 2$ density matrices. This doesn't work as nicely for qudits with $d \neq 2$. But since we are talking $d=2$, we might as well use this nice parameterization." So even if density matrices still make you queasy, don't think of the center of a sphere as being something particularly meaningful. It is just a convenient way to draw all states and in this case the center happens to line up with the maximally mixed state. So no it is not something fundamental. It doesn't generalize to other $d$ or more qubits. Don't take this particular parameterization too seriously, it just allows us to plot the state in a way to quickly convey the information visually.

+",434,,434,,3/17/2021 7:52,3/17/2021 7:52,,,,4,,,,CC BY-SA 4.0 +5149,2,,5125,1/9/2019 1:40,,6,,"

From a physical point of view, there couldn't be a bigger difference.

+ +

Global phases are artefacts of the mathematical framework you are using, and have no physical meaning. Two states differing only by a global phase represent the same physical system. +Indeed, a more careful treatment of quantum mechanics would involve defining quantum states as elements of a projective Hilbert space, in which all elements differing only by a phase are identified as equal.

+ +

On the other hand, relative phases are in some sense the core of quantum mechanics. States differing by a relative phase are different systems that evolve in different ways, although they will appear identical if only measured in the measurement basis in which they only differ by such relative phase.

+",55,,,,,1/9/2019 1:40,,,,0,,,,CC BY-SA 4.0 +5150,2,,5147,1/9/2019 6:12,,9,,"

The Bloch sphere only represents the state of a single qubit. What you’re talking about is taking a multi-qubit state, and representing the state of just one of those qubits on the Bloch sphere.

+ +

If the multi-qubit state is a product state (pure and separable), then the state of the single qubit is a pure state, and is represented as a point on the surface of the Bloch sphere. If the overall state is entangled, then the individual qubit is not pure, and is represented by a point that is on the interior of the Bloch sphere. The shorter the distance to the centre, the more mixed the individual qubit is, and hence the more entangled the global state is. The maximally entangled state yields the shortest possible distance, i.e. the point right at the centre of the sphere. AHussain’s answer gives you the mathematics of how to formally calculate that.

+",1837,,,,,1/9/2019 6:12,,,,3,,,,CC BY-SA 4.0 +5152,1,,,1/9/2019 17:03,,3,101,"

Suppose a have a circuit coded up in ProjectQ, suppose also it is that large to be hard enough to write it down as a unitary matrix by hands (e.g. order-finding, which is rather standard, but turns out to be very complex when you decompose the modular exponent into elementary 1- and 2-qubit gates, the typical Hilbert space size even for simple numbers would be $2^8-2^{10}$).

+ +

Can you propose or you maybe you already know an existing way how to obtain a unitary or even a product of unitaries that delivers the circuit results applied to initial state?

+",4264,,10480,,1/31/2021 20:37,1/31/2021 20:37,Implement a circuit as a matrix in ProjectQ,,0,1,,,,CC BY-SA 4.0 +5153,1,5161,,1/9/2019 19:25,,1,120,"

Following on from my question on educational quantum computing toys, I was wondering whether it is possible to implement the BB84 key distribution protocol with easily-obtained consumer hardware - lasers, fiber-optic cables, optical filters, etc. Does anyone know of any papers detailing this, or simple demonstrations, or whether it's theoretically possible? I did find an article detailing an experiment from the University of Waterloo.

+",4153,,26,,5/8/2019 10:21,5/8/2019 10:21,Implementing BB84 protocol with easily-obtained consumer hardware,,1,0,,,,CC BY-SA 4.0 +5154,1,5163,,1/9/2019 20:19,,7,249,"

By ""quantum compiling"", what I mean is classical algorithms to solve the following problem: given a $SU(D)$ matrix $U$ (the goal) and a set of $SU(D)$ unitary matrices $V_1 \cdots V_N$ (the gates), find a string $i_1\cdots i_K$ such that +$$ +U \approx \prod_{k=1}^K V_{i_k}\text. +$$ +In other words: given a target unitary and a set of gates, implement the target unitary from those gates. Note that I'm not just interested in optimizing a pre-existing circuit, but generating a circuit from a full unitary matrix.

+ +

What software packages are available which solve this problem? In particular, are there software packages ready-to-use with IBM Q Experience/Qiskit or Rigetti's forest?

+ +

(I understand that there are many algorithms, with different performance characteristics, which tackle this. I'm interested less in optimal performance characteristics than in low-effort usability. Is the current ecosystem well-enough-developed that I don't need to pick and implement one of these algorithms myself?)

+",5513,,409,,1/10/2019 8:09,1/10/2019 8:28,Status of software packages for quantum compiling,,1,0,,,,CC BY-SA 4.0 +5155,1,5158,,1/9/2019 21:50,,3,861,"

I want to compile $$\exp(-i \theta \sigma_i^z \sigma_j^z)$$ down to a gate sequence of single qubit rotations and CNOTs. How do I do this? What is the general procedure for compiling a unitary $U$ to an elementary gate sequence? (As I understand it, this is a very hard problem, but I am curious how I could begin going about it.)

+",5467,,26,,1/10/2019 3:23,1/10/2019 3:23,Gate sequence for exponential of product of Pauli Z operators,,1,1,,,,CC BY-SA 4.0 +5156,1,5157,,1/9/2019 22:37,,3,119,"

I want to write code that prints out the controls of each operation executed during a simulation in Q#. For example this code prints the control counts:

+ +
var qsim = new QCTraceSimulator(config);
+qsim.OnOperationStart += (op, arg) => {
+    Console.WriteLine($""{Controls(op, arg).Length""});
+}
+
+ +

I'm having trouble writing the Controls function, which extracts a list of qubits being used as controls. When the operation is uncontrolled, or controlled by 0 qubits, the returned array should be of length 0.

+ +

The issue I'm running into is that the type and layout of arg.Value varies from operation to operation, even after conditioning on op.Variant being OperationFunctor.ControlledAdjoint or OperationFunctor.Controlled. I can handle individual cases by inspecting the types, but I keep running into new unhandled cases. This indicates there's probably a ""correct"" way to do this that I'm missing.

+ +

In short, how do I implement this function:

+ +
object[] Controls(ICallable op, IApplyData arg) {
+    ???
+}
+
+ +

By ""controls"" I always mean the cs in Controlled Op(cs, ...). The same operation may have different controls when expressed in different ways. For example, the controls list of Controlled Toffoli(a, (b, c, d)) is the list [a] whereas the controls list of Controlled X([a, b, c], d) is the list [a, b, c]. A further example: the controls list of Toffoli(b, c, d) is [], even though normally one might think of the first two arguments as the controls. It is of course expected that within Toffoli(b, c, d) there may be a sub-operation Controlled X((b, c), d) where the controls list is [b, c]; I'm not thinking of controls as some kind of absolute concept that is invariant as you go down through layers of abstraction.

+",119,,26,,1/10/2019 3:21,1/11/2019 21:31,How do I get a list of control qubits from Q# operations when tracing the simulation in C#?,,1,0,,,,CC BY-SA 4.0 +5157,2,,5156,1/9/2019 23:42,,6,,"

arg.Value contains the actual tuple that the controlled operation receives at runtime. It's a two item tuple in which the first item is the control qubits, and the second another tuple with the arguments the operation normally expects, so in your case you are only interested in the first item of this tuple.

+ +

Overall, arg.Value can be anything, thus it has object as type, but fear not, using a little bit of C#'s reflection is easy to retrieve its content. The implementation you are looking for is this:

+ +
    static Qubit[] Controls(ICallable op, IApplyData arg)
+    {
+        // Uncontrolled operations have no control qubits.
+        if (op.Variant != OperationFunctor.Controlled &&
+            op.Variant != OperationFunctor.ControlledAdjoint)
+        {
+            return new Qubit[0];
+        }
+
+        // Get the first item of the (controls, args) tuple.
+        dynamic v = arg.Value;
+        QArray<Qubit> ctrls = v.Item1;
+        return ctrls.ToArray();
+    }
+
+ +

Notice the array of Qubits is encapsulated in something called a QArray<Qubit>, QArray is the data structure we use in simulation for all Q# arrays.

+",2918,,119,,1/11/2019 21:31,1/11/2019 21:31,,,,5,,,,CC BY-SA 4.0 +5158,2,,5155,1/10/2019 0:35,,5,,"

On the computational basis. This acts as $e^{-i \theta}$ when both are the same and $e^{i \theta}$ when they are different.

+ +

So first do a circuit that computes whether or not they are the same or not. That is do the following:

+ +

\begin{eqnarray*} +| 0 0 \rangle &\to& | 0 0 \rangle\\ +| 0 1 \rangle &\to& | 0 1 \rangle\\ +| 1 0 \rangle &\to& | 1 1 \rangle\\ +| 1 1 \rangle &\to& | 1 0 \rangle\\ +\end{eqnarray*}

+ +

That is the first qubit is left alone and the second is 0 when they are the same and 1 when different. This is a $CNOT_{12}$

+ +

Now do a single qubit unitary that does

+ +

\begin{eqnarray*} +| 0 \rangle &\to& e^{-i \theta} | 0 \rangle\\ +| 1 \rangle &\to& e^{i \theta} | 1 \rangle\\ +\end{eqnarray*}

+ +

on the second qubit.

+ +

Now put the second qubit back to what it was with another $CNOT_{12}$.

+ +

In total:

+ +

\begin{eqnarray*} +| 0 0 \rangle &\to& e^{-i \theta} | 0 0 \rangle\\ +| 0 1 \rangle &\to& e^{i \theta} | 0 1 \rangle\\ +| 1 0 \rangle &\to& e^{i \theta} | 1 0 \rangle\\ +| 1 1 \rangle &\to& e^{-i \theta} | 1 1 \rangle\\ +\end{eqnarray*}

+ +

It does the right thing on the computational basis and so we are done.

+",434,,,,,1/10/2019 0:35,,,,0,,,,CC BY-SA 4.0 +5159,1,5168,,1/10/2019 2:57,,1,124,"

I've been using qiskit for about a year now, and as of late, I've had issues finding an available backend to run my circuit on. Looking into the matter, I reinstalled qiskit to find that most everything had changed quite a bit. Now when I try to run just a basic test circuit program, taken from the tutorial I get this:

+ +
~$ python3 test.py
+
+Traceback (most recent call last):
+  File ""test.py"", line 27, in <module>
+    job = execute(circ, backend)
+  File ""/home/micciche/.local/lib/python3.5/site-packages/qiskit/tools/compiler.py"", line 108, in execute
+    skip_transpiler, seed_mapper, pass_manager, memory)
+  File ""/home/micciche/.local/lib/python3.5/site-packages/qiskit/tools/compiler.py"", line 67, in compile
+    coupling_map=coupling_map, seed=seed, memory=memory)
+  File ""/home/micciche/.local/lib/python3.5/site-packages/qiskit/converters/circuits_to_qobj.py"", line 61, in circuits_to_qobj
+    coupling_map))
+  File ""/home/micciche/.local/lib/python3.5/site-packages/qiskit/converters/circuits_to_qobj.py"", line 92, in _circuit_to_experiment
+    json_circuit = DagUnroller(dag, JsonBackend(dag.basis)).execute()
+  File ""/home/micciche/.local/lib/python3.5/site-packages/qiskit/unroll/_dagunroller.py"", line 38, in execute
+    self._process()
+  File ""/home/micciche/.local/lib/python3.5/site-packages/qiskit/unroll/_dagunroller.py"", line 161, in _process
+    self.backend.new_qreg(name, width)
+  File ""/home/micciche/.local/lib/python3.5/site-packages/qiskit/unroll/_jsonbackend.py"", line 98, in new_qreg
+    assert size >= 0, ""invalid qreg size""
+  TypeError: unorderable types: QuantumRegister() >= int()
+
+ +

Does anybody know how to resolve this? Thanks.

+ +

Edit: This is the code I tried to run, which I just copied from a tutorial:

+ +
import numpy as np
+from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
+from qiskit import execute
+
+# Create a Quantum Register with 3 qubits.
+q = QuantumRegister(3, 'q')
+
+# Create a Quantum Circuit acting on the q register
+circ = QuantumCircuit(q)
+
+# Add a H gate on qubit 0, putting this qubit in superposition.
+circ.h(q[0])
+# Add a CX (CNOT) gate on control qubit 0 and target qubit 1, putting
+# the qubits in a Bell state.
+circ.cx(q[0], q[1])
+# Add a CX (CNOT) gate on control qubit 0 and target qubit 2, putting
+# the qubits in a GHZ state.
+circ.cx(q[0], q[2])
+
+# Import Aer
+from qiskit import BasicAer
+
+# Run the quantum circuit on a statevector simulator backend
+backend = BasicAer.get_backend('statevector_simulator')
+
+# Create a Quantum Program for execution
+job = execute(circ, backend)
+
+result = job.result()
+
+outputstate = result.get_statevector(circ, decimals=3)
+print(outputstate)
+
+",5516,,5516,,1/10/2019 13:29,1/10/2019 15:32,TypeError: unorderable types: QuantumRegister() >= int(),,1,2,,,,CC BY-SA 4.0 +5160,2,,4035,1/10/2019 4:02,,5,,"

I came across an approach to solve differential equations using D-wave quantum annealer. The link is here: https://arxiv.org/abs/1812.10572.

+ +

The basic method is to derive the energy functional for the differential equation that is then minimized on a quantum annealer. The minimization can use finite element basis to map the energy to a localized sub graph of the D-wave machine.

+ +

The advantage of this over classical algorithm is that there is no need to even build a system of equations, so there is memory savings and avoids cost of assembly of a linear system. The solution complexity however is same as the classical conjugate gradient method: $\mathcal{O}(n)$. The HHL algorithm on the other hand can give exponential speed up, but like you said does not directly give the solution, plus we do need to assemble the linear system in the first place.

+",5517,,1386,,1/10/2019 8:02,1/10/2019 8:02,,,,1,,,,CC BY-SA 4.0 +5161,2,,5153,1/10/2019 7:15,,3,,"

I am glad you enjoyed my experiments! :) I'd be happy to talk more about how I ran that project --- dm me at twitter.com/crazy4pi314.

+ +

To your question, I don't know of any good papers or articles on the setup, but you can get a pretty reasonable demo of polarization-encoded BB84 with a few pretty common components:

+ +
    +
  • polarized laser pointer
  • +
  • some half wave plates
  • +
  • polarizers to represent Eve
  • +
  • a 50:50 beam splitter
  • +
  • 2 polarizing beam splitters
  • +
  • 2 photo detectors
  • +
+ +

It is not really quantum key distribution (consumer grade single photon sources aren't really a thing, sadly) but it worked well in a number of outreach events I have done with middle schoolers -> undergrads. We just had a bunch of ThorLabs ""Legos"" and let them in two teams try to assemble a working Alice and Bob. Then, if there was an odd number someone got to be eve with a polarizer between. We had some very simple displays on a computer showing where signal was being received at the detectors.

+",4211,,,,,1/10/2019 7:15,,,,0,,,,CC BY-SA 4.0 +5162,1,,,1/10/2019 7:28,,6,158,"

Say I have an $N \times N$ matrix and I want to know the eigenvalues to a precision of $\pm \epsilon$. How many qubits and how many gates do I need?

+",5518,,5518,,1/10/2019 8:27,2/8/2019 3:52,"How many qubits and how many gates, are required for finding the eigenvalues of a matrix?",,0,14,,,,CC BY-SA 4.0 +5163,2,,5154,1/10/2019 8:28,,6,,"

For Qiskit, there are two tools you can check out.

+ +

The two qubit kak tool does exactly what you want for 2 qubits. If you give it a two qubit unitary, it gives you a list of gates to realize this, using the standard gate set used in Qiskit. This tool uses Vatan and Williams optimal two-qubit circuit. The decomposition algorithm used is explained in Drury and Love.

+ +

Here's an example in code

+ +
from qiskit.mapper import two_qubit_kak
+import numpy as np
+
+# matrix to decompose
+perm = np.array([[0.,0.,0.,1.], [1.,0.,0.,0.], [0.,1.,0.,0.], [0.,0.,1.,0.] ])
+
+#decomposition
+permCircuit = two_qubit_kak(perm)
+
+ +

The corresponding result is

+ +
[{'name': 'u1', 'args': [0], 'params': (0.0, 0.0, 1.5707963267948968)}, {'name': 'u2', 'args': [1], 'params': (1.5707963267948966, 2.220446049250313e-16, -3.1415926535897922)}, {'name': 'cx', 'args': [1, 0], 'params': ()}, {'name': 'u1', 'args': [0], 'params': (0.0, 0.0, 1.5707963267948968)}, {'name': 'u2', 'args': [1], 'params': (1.5707963267948966, 3.141592653589793, -3.141592653589793)}, {'name': 'cx', 'args': [0, 1], 'params': ()}, {'name': 'u3', 'args': [1], 'params': (3.141592653589793, 0.0, 0.0)}, {'name': 'cx', 'args': [1, 0], 'params': ()}, {'name': 'u2', 'args': [0], 'params': (1.5707963267948966, 1.5707963267948968, -1.5707963267948957)}, {'name': 'u2', 'args': [1], 'params': (1.5707963267948966, -4.71238898038469, -1.5707963267948957)}]
+
+ +

The u1, etc here are single qubit rotations as defined by the OpenQASM standard.

+ +

Another tool is arbitary state vector initialization, which can be used for an arbitrary number of qubits. For this you can state what state vector you want, and you'll get a circuit that builds it. Obviously this is not what you asked for, but it may nevertheless be useful depending on your application.

+ +

Here's an example in code

+ +
qubit = QuantumRegister(2)
+bit = ClassicalRegister(2)
+circuit = QuantumCircuit(qubit,bit)
+
+vector = [0, 1 / np.sqrt(3), 1 / np.sqrt(3), 1 / np.sqrt(3) ]
+circuit.initialize( vector, qubit )
+
+print(circuit)
+
+ +

Here the final print command yields

+ +
                       ┌───┐┌────────────┐┌───┐┌────────────┐
+ q_0: |0>──────────────┤ X ├┤ Ry(0.7854) ├┤ X ├┤ Ry(2.3562) ├
+         ┌────────────┐└─┬─┘└────────────┘└─┬─┘└────────────┘
+ q_1: |0>┤ Ry(1.9106) ├──■──────────────────■────────────────
+         └────────────┘                                      
+  c_0: 0 ════════════════════════════════════════════════════
+
+  c_1: 0 ════════════════════════════════════════════════════
+
+ +

Other than these existing Qiskit tools, the only algorithm I know of that is planning an implementation is that of Iten, et al. I have heard that a Mathematica version will be produced soon.

+",409,,,,,1/10/2019 8:28,,,,0,,,,CC BY-SA 4.0 +5164,1,25789,,1/10/2019 9:47,,5,435,"

I'm looking for an efficient implementation of the Clifford group $\mathcal{C}_n$ +of $n$ qubits. +The Clifford group $\mathcal{C}_n$ has stucture $(2_+^{1+2n} \circ C_8).Sp(2,n)$, +where $2_+^{1+2n}$ denotes an extraspecial 2 group of $+$ type, $C_8$ the +cyclic group of order 8, and $Sp(2n,2)$ a symplectic group over the binary field. +Here ""$\circ$"" means the central product.

+ +

The Clifford group $\mathcal{C}_n$ can be used for the simulation of quantum +computing with $n$ qubits and a restricted set of qubit gates in polynomial time, +see e.g. [1]. It has a unitary complex representation of dimension $2^n$, +see e.g. [2]. Quantum theorists use an explicit construction +$\rho$ of that representation of $\mathcal{C}_n$ based on Pauli matrices, +see [1]. Vectors in $\rho$ are called state vectors. In [1] the group +$\mathcal{C}_n$ is generated by the qubit gates CNOT, Phase, and Hadamard. +These gates operate (repeatedly) on the state vectors starting at a certain +unit vector $e_0 = |0 \ldots 0 \rangle$. Let $V_0$ be the image of $e_0$ +under the operation of $\mathcal{C}_n$ in the state vector space. The states in $V_0$ are also called +stabilizer states.

+ +

I need an implementation of representation +$\rho$ that supports the following operations:

+ +
    +
  • Multiplication, inversion, and test for equality in $\mathcal{C}_n$.

  • +
  • Operation of an element of $\mathcal{C}_n$ on a state vector in $V_0$.

  • +
  • Output of an entry of the matrix representing +an element of $\mathcal{C}_n$.

  • +
  • Output of an entry of a state vector in $V_0$.

  • +
  • Some kind of qubit measurement applied to a state vector in $V_0$, +as in [1].

  • +
+ +

Entries of matrices and vectors are with respect to the representation $\rho$ +in [1]. Runtime should be polynomial in $n$.

+ +

I have some concrete ideas for such an implementation.

+ +

My question is:

+ +

Has anybody implemented a similar representation of $\mathcal{C}_n$ before?

+ +

Note that the representation in [1] implements state vectors in $V_0$ +(up to a scalar multiple), and operation of $\mathcal{C}_n$ on $V_0$, but not +the computation of entries of group elements or state vectors. In [1] elements of
+$\mathcal{C}_n$ cannot easily be tested for equality. I also need to +distingiush between scalar multiples of a state vector, which is irrelevant +in quantum theory.

+ +

[1] https://arxiv.org/abs/quant-ph/0406196

+ +

[2] https://arxiv.org/abs/math/0001038

+ +

Cross-posted from MathOverflow

+",14018,,26,,1/10/2019 13:32,4/4/2022 15:27,Efficient implementation of the Clifford group for $n$ qubits,,2,2,,,,CC BY-SA 4.0 +5165,1,,,1/10/2019 10:26,,5,424,"

Suppose we have a square matrix $M$ of size $n\times n$. It is given that any element $M_{ij}$ of $M$ is a real number and satisfies $0 \leq M_{ij} \leq 1$, $\forall$ $i,j$. No other property for $M$ is known. Is it possible to create a new matrix $U$, $s.t.$:

+ +
    +
  1. $U$ is a square matrix of size $2n\times 2n$,
  2. +
  3. $U$ is of the form $\begin{bmatrix}M&A\\B&C\end{bmatrix}$,
  4. +
  5. $A,B,C$ are all of size $n\times n$ and all of $A,B,C$ are unique linear transformations of $M$,
  6. +
  7. The elements of $A,B,C$ can take complex values,
  8. +
  9. And that $U$ is unitary, $i.e.$, $UU^\dagger = U^\dagger U = I$, (where $I$ is the identitiy matrix, and $U^\dagger$ is symbol for complex conjugate of $U$)?
  10. +
+ +

Thank you

+",5521,,26,,1/14/2019 16:55,1/14/2019 16:55,Extending a square matrix to a unitary matrix,,1,2,,,,CC BY-SA 4.0 +5166,2,,5165,1/10/2019 10:37,,4,,"

No. The rows and columns of a unitary $U$ must have a sum-mod-square of 1. +$$ +\sum_{i}|U_{ij}|^2=\sum_{j}|U_{ij}|^2=1 +$$ +Your $M$, as specified, could have a 1 element along a whole row so the sum-mod-square of the corresponding row in $U$ would be $n$. So, unless $n=1$, it's impossible without further constraints on $M$.

+",1837,,,,,1/10/2019 10:37,,,,2,,,,CC BY-SA 4.0 +5167,1,,,1/10/2019 12:22,,5,749,"

DaftWulie's answer to Extending a square matrix to a Unitary matrix says that extending a matrix into a unitary cannot be done unless there's constraints on the matrix. What are the constraints?

+",5518,,55,,6/9/2021 0:58,6/9/2021 0:58,"When can a matrix be ""extended"" into a unitary?",,3,0,,,,CC BY-SA 4.0 +5168,2,,5159,1/10/2019 13:58,,1,,"

The code you provide works fine for me, so I guess that something is wrong with your installation.

+ +

I recommend running the command

+ +
pip uninstall qiskit
+
+ +

and also

+ +
pip uninstall qiskit-terra
+pip uninstall qiskit-aqua
+pip uninstall qiskit-aer
+
+ +

and then reinstalling with

+ +
pip install qiskit
+
+",409,,,,,1/10/2019 13:58,,,,0,,,,CC BY-SA 4.0 +5169,2,,5167,1/10/2019 14:20,,9,,"

A necessary and sufficient condition is that, given an $n\times n$ matrix $M$, you can construct a $2n\times 2n$ unitary matrix $U$ provided the singular values of $M$ are all upper bounded by 1.

+ +

Sufficiency

+ +

To see this, express the singular value decomposition of $M$ as +$$ +M=RDV +$$ +where $D$ is diagonal and $R$, $V$ are unitary. Now define +$$ +U=\left(\begin{array}{cc} +M & R\sqrt{\mathbb{I}-D^2}V \\ +R\sqrt{\mathbb{I}-D^2}V & -M +\end{array}\right), +$$ +which we can only do if the singular values are no larger than 1. Let's verify that it's unitary +\begin{align*} +UU^\dagger&=\left(\begin{array}{cc} +RDV & R\sqrt{\mathbb{I}-D^2}V \\ +R\sqrt{\mathbb{I}-D^2}V & -RDV +\end{array}\right)\left(\begin{array}{cc} +V^\dagger DR^\dagger & V^\dagger\sqrt{\mathbb{I}-D^2}R^\dagger \\ +V^\dagger\sqrt{\mathbb{I}-D^2}R^\dagger & -V^\dagger DR^\dagger +\end{array}\right) \\ +&=\left(\begin{array}{cc} +RD^2R^\dagger+R(\mathbb{I}-D^2)R^\dagger & 0 \\ +0 & RD^2R^\dagger+R(\mathbb{I}-D^2)R^\dagger +\end{array}\right) \\ +&=\mathbb{I}. +\end{align*}

+ +

Necessity

+ +

Imagine I have a matrix $M$ with a singular value $\lambda>1$ and corresponding normalised vector $|\lambda\rangle$. Assume I construct a unitary +$$ +U=\left(\begin{array}{cc} M & A \\ B & C \end{array}\right). +$$ +Let's act $U$ on the state $\left(\begin{array}{c} |\lambda\rangle \\ 0 \end{array}\right)$. We get +$$ +U\left(\begin{array}{c} |\lambda\rangle \\ 0 \end{array}\right)=\left(\begin{array}{c} M|\lambda\rangle \\ B|\lambda\rangle \end{array}\right). +$$ +This output state must have a norm that is at least the norm of $M|\lambda\rangle$, i.e. $\lambda>1$. But if $U$ is a unitary, the norm must be 1. So it must be impossible to perform such a construction if there exists a singular value $\lambda>1$.

+",1837,,,,,1/10/2019 14:20,,,,5,,,,CC BY-SA 4.0 +5171,2,,5167,1/10/2019 15:45,,2,,"

$\newcommand{\bs}[1]{\boldsymbol{#1}}$Here is a slightly different way to prove what the other excellent answer did.

+ +

Note that a matrix $U$ is unitary if and only if it sends orthonormal bases into orthonormal bases. +This, in particular, means that if $U$ is unitary then $\|U\bs v\|=1$ for any $\bs v$ with $\|\bs v\|=1$.

+ +

Let us write the SVD of $M$ as $M\bs u_k=s_k\bs v_k$, where $s_k\ge0$ are the singular values of $M$.

+ +

Note that if $U$ is an extension of $M$, then $U\bs u_k=s_k \bs v_k+\bs w_k$ for some $\bs w_k$ orthogonal to $\bs v_k$ (and more generally to the whole range of $M$).

+ +

If follows that if, for any $k$, $s_k>1$, then $\|U\bs u_k\|>1$, and thus $U$ is not unitary.

+ +

On the other hand, if $s_k\le1$ for all $k$, let us show how can always construct a unitary $U$ that contains $M$ as a submatrix. +Let us denote with $\bs v\oplus \bs 0$ the vectors in the extended $2n$-dimensional space that are built by appending zeros to the $n$-dimensional vector $\bs v$, and with $\bs 0\oplus\bs v$ the vectors that are equal to $\bs v$ in the last $n$ dimensions by zero in the first $n$ ones. +Being $\{\bs u_k\}_k$ a basis for the original space, it follows that $\{\bs u_k\oplus \bs 0,\bs0\oplus\bs u_k\}_k$ is a basis for the extended space.

+ +

We will define $U$ through its action on the vectors $u_k\oplus \bs 0$ and $\bs0\oplus u_k$ as follows: +\begin{align} +U(\bs u_k\oplus \bs 0)&=s_k(\bs v_k\oplus\bs 0)+\sqrt{1-s_k^2}(\bs 0\oplus \bs v_k) \\ +U(\bs0 \oplus \bs u_k)&=\sqrt{1-s_k^2}(\bs v_k\oplus\bs 0)-s_k(\bs 0\oplus \bs v_k). +\end{align}

+ +

One can then check that all of these output vectors form an orthonormal system in the extended space, and thus $U$ is unitary.

+",55,,,,,1/10/2019 15:45,,,,2,,,,CC BY-SA 4.0 +5172,1,,,1/10/2019 18:20,,2,1769,"

I'm trying to plot a set of data using plot_histogram, but the rendered image looks like this (the larger values are outside the image): +

+ +

How can I set the y-axis to contain larger values? Or, is there any alternative way to avoid this problem? I have tried the figsize(,) option but it isn't effective.

+",2757,,26,,1/10/2019 18:29,1/10/2019 23:23,Plotting data in QISKit using plot_histogram,,1,0,,,,CC BY-SA 4.0 +5173,1,5178,,1/10/2019 22:46,,11,503,"

Qiskit can be used to submit jobs to IBM devices using Python (or Swift and JavaScript). But what if I want to use a different language?

+ +

For example, suppose I have a specific circuit I want to run. Assume I've already created it in Python Qiskit, and generated the corresponding qasm string or (ideally) the full qobj object.

+ +

I want to be able to run this and get the results back in any language of my choice.

+ +

As far as I understand, these is a way to do this via HTML. The information generated in Qiskit can be turned into a JSON, and then submitted over the web. This is the way ProjectQ sends jobs to IBM devices (though they do it in Python).

+ +

Since reverse engineering the ProjectQ code is a little daunting, I'd like a simple guide to using this feature. Especially in a language other than Python.

+",409,,20084,,10/13/2022 19:23,10/13/2022 19:23,Submitting jobs to IBMQ backend via HTTP API Requests,,1,2,,,,CC BY-SA 4.0 +5174,2,,5172,1/10/2019 23:23,,3,,"

This is a bug in the plot_histogram function. I pushed a fix for it here: https://github.com/Qiskit/qiskit-terra/pull/1661 In the meantime you can probably workaround this locally by doing something like:

+ +
fig = plot_histogram(data)
+ax = fig.axes[0]
+ax.set_ylim(0, 1)
+fig.savefig('output.png') # Or whatever you doing to output the image
+
+ +

Which will adjust the y axis boundaries to be between 0 and 1.

+",5529,,,,,1/10/2019 23:23,,,,0,,,,CC BY-SA 4.0 +5175,1,,,1/11/2019 1:30,,2,77,"

Can quantum computing do a simple simulated extrapolation of CRISPR (clustered regularly interspaced short palindromic repeats) projects using a limited number of variables? I mean something like finding short clusters of palindrome repeats in a genome sequence, where the binding can take place.

+ +

Note: I am not qualified in the CRISPR area, and this is a question a client has asked. I would love any input and even questions to feedback for extra information.

+",5383,,26,,1/11/2019 3:39,1/11/2019 3:39,Extrapolation of CRISPR,,0,0,,,,CC BY-SA 4.0 +5176,1,5219,,1/11/2019 3:15,,5,153,"

Some of my larger annealer embeddings (~200 qubits) don't anneal down to the ground state while some of them do very easily.

+ +

Are there established guidelines for designing annealer embeddings to ensure that ground state configurations can be easily found? If so, where can this information be found?

+ +

If not, is addressing this issue more a matter of properly setting annealer parameters/annealing schedule. What are some good papers with information on this?

+",4943,,26,,1/11/2019 3:28,1/17/2019 16:50,Are there established best practices for designing Dwave embeddings?,,2,5,,,,CC BY-SA 4.0 +5178,2,,5173,1/11/2019 5:27,,8,,"

I will try answering this way but I have not tried it myself. Just reverse engineering reading the code with a few notions of HTML request.

+ +

Let us assume in the language of your choice, you have the ability to send HTTP requests via GET and POST methods. The api_url is https://quantumexperience.ng.bluemix.net/api/.

+ +

To submit a job, you will send a POST request with some information (like you have filled a form on the web and you want to talk to a server). It is like addressing a server with a dictionary of information. +It will be to the link https://quantumexperience.ng.bluemix.net/api/Jobs +with the POST request header set as application/json (showing how you submit the information). The information here is submitted in a JSON formatting in the body of the request:

+ +
{
+   ""data"": QASM as string or JSON string,
+
+   ""params"": {""access_token"": access_token,
+                              ""deviceRunType"": device,
+                              ""fromCache"": ""false"",
+                              ""shots"": shots}
+
+}
+
+ +

I guess we can add in params maxCredits and other parameters for submission. +device refers to the name of the backend if I follow their comments: simulator, ibmqx4, or ibmqx5. +You get an answer back as JSON again with an id argument referring to the execution_id.

+ +

Once it is submitted, your job will be in queue. You will have to request by GET this job ID to get the answer from the backend. +The GET URL is: https://quantumexperience.ng.bluemix.net/api/Jobs/execution_id. +You will get another JSON answer (put it in a r_json variable). If it has the qasms item, see if r_json['qasms'][0] has a result item and you will get the result of the submission.

+ +

This should sum up the procedure.

+",4127,,26,,1/13/2019 16:56,1/13/2019 16:56,,,,0,,,,CC BY-SA 4.0 +5179,1,5180,,1/11/2019 8:33,,15,8015,"

When constructing the matrices for the two CNOT based on the target and control qubit, I can use reasoning:

+ +

""If $q_0$==$|0\rangle$, everything simply passes through"", resulting in an Identity matrix style $\begin{bmatrix}1&0\\0&1\end{bmatrix}$ in the top left. ""If $q_0==|1\rangle$, we need to let $q_0$ pass and swap $q_1$, resulting in a Pauli X $\begin{bmatrix}0&1\\1&0\end{bmatrix}$ in the bottom right.

+ +

$CNOT \equiv \begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{bmatrix}$

+ +

""If $q_1$==$|0\rangle$, everything simply passes through"", results in leaving $|00\rangle$ and $|10\rangle$ unaffected. ""If $q_1==|1\rangle$, we need to let $q_1$ pass and swap $q_0$, mapping $|01\rangle$ to $|11\rangle$ and $|11\rangle$ to $|01\rangle$

+ +

$CNOT \equiv \begin{bmatrix}1&0&0&0\\0&0&0&1\\0&0&1&0\\0&1&0&0\end{bmatrix}$

+ +

This all seems to check out, but here comes my question:
+I would like to know if there is a more mathematical way to express this, just as there would be when combining for instance two hadamard gates: +$H \otimes H \equiv \frac{1}{\sqrt{2}}\begin{bmatrix}1&1\\1&-1\\ \end{bmatrix} \otimes \frac{1}{\sqrt{2}}\begin{bmatrix}1&1\\1&-1\\ \end{bmatrix} = \frac{1}{2}\begin{bmatrix}1&1&1&1\\1&-1&1&-1\\1&1&-1&-1\\1&-1&-1&1 \end{bmatrix}$

+ +

And a bonus question: +How I can, using notation like ""CNOT"", show which qubit is the control bit and which qubit the target bit?

+",2794,,1837,,1/11/2019 9:59,2/22/2020 22:50,"How to construct matrix of regular and ""flipped"" 2-qubit CNOT?",,3,2,,,,CC BY-SA 4.0 +5180,2,,5179,1/11/2019 9:25,,12,,"

The CNOT gate is a 2-qubit gate, and consequently, its operation cannot be expressed by the tensor product of two one-qubit gates as the example you gave with the Hadamard gates. An easy way to check that such matrix cannot be expressed as the tensor product of two other matrices is to take matrices

+ +
    +
  • $A =\begin{pmatrix}a & b \\ c & d\end{pmatrix}$

  • +
  • $B=\begin{pmatrix}e & f \\ g & h\end{pmatrix}$

  • +
+ +

and see which values should get the elements of them so that $CNOT = A\otimes B$. Following this reasoning:

+ +

$A\otimes B= \begin{pmatrix}ae &af & be & bf \\ ag & ah & bg & bh \\ ce & cf & de & df\\cg & ch & dg & dh\end{pmatrix} $

+ +

It is clear that $b=0$ and $c=0$ are needed, as all the elements they affect must be zero, and so $a=1$ and $d=1$ because some of the elements they affect must be non-zero. This leaves last matrix as

+ +

$\begin{pmatrix}e &f & 0 & 0 \\ g & h & 0 & 0 \\ 0 & 0 & e & f\\0 & 0 & g & h\end{pmatrix}$.

+ +

From this matrix it is pretty straightforward to see that it is not possible to obtain the CNOT matrix, as for example $e=1$ so that the $(1,1)$ element is $1$, but also $e=0$ because the $(3,3)$ element is one; implying a contradiction, and so proving that CNOT cannot be expressed in such a way. The same happens with the other definition of CNOT. From a notation point of view to see which is the target and control qubit I usually use

+ +
    +
  • $CNOT(1\rightarrow2)=\begin{pmatrix}1 &0& 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1\\0 & 0 & 1 & 0\end{pmatrix}$.

  • +
  • $CNOT(1\leftarrow2)=\begin{pmatrix}1 &0& 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0\\0 & 1 & 0 & 0\end{pmatrix}$.

  • +
+ +

This way it is know that the target qubit is the one being pointed by the arrow. One thing you can express mathematically easily is the relationship between $CNOT(1\rightarrow2)$ and $CNOT(1\leftarrow2)$, which is easily proved to be

+ +

$CNOT(1\leftarrow2) = (H\otimes H)CNOT(1\rightarrow 2)(H\otimes H)$.

+",2371,,2371,,1/11/2019 9:42,1/11/2019 9:42,,,,2,,,,CC BY-SA 4.0 +5181,2,,5179,1/11/2019 9:44,,5,,"

I like to use the projectors +$$ +P_0=|0\rangle\langle 0|\equiv\left(\begin{array}{cc} 1 & 0 \\ 0 & 0 \end{array}\right)\qquad P_1=|1\rangle\langle 1|\equiv\left(\begin{array}{cc} 0 & 0 \\ 0 & 1 \end{array}\right) +$$ +to express the intuition of the controlled-not when constructing it: +$$ +CNOT=P_0\otimes\mathbb{I}+P_1\otimes X. +$$ +Here you can see very plainly the statement ""if the first qubit is in $|0\rangle$, do nothing (apply identity) to the second qubit, while if the first qubit is in $|1\rangle$, apply the bit flip"". Similarly, the reversed version is +$$ +\mathbb{I}\otimes P_0+X\otimes P_1. +$$

+ +

I'm not aware of a standard notation to specify the direction of the controlled-not. Whenever I've needed to do it, I've needed to do it a lot, and went for something very compact: $C^i_j$ to indicate a controlled not controlled by qubit $i$ and targeting qubit $j$. But it's far from standard, so whatever convention you pick, you'd want to state it quite explicitly.

+",1837,,1837,,1/11/2019 9:57,1/11/2019 9:57,,,,2,,,,CC BY-SA 4.0 +5182,1,,,1/11/2019 12:16,,3,59,"

This question is related to this question, but I'm specifically interested in self-induced collapse. Suppose that the size of a quantum system alone somehow leads to a projection of the state (a ""collapse of the wavefunction""), i.e. the collapse is self-induced by the system, without any interaction with an environment which ultimately has some effect on the knowledge of the observer. This is not standard quantum mechanics, but answers to this question lead me to think that this is a common assumption. My question is: Would this imply that large quantum computers are impossible? Maybe there are even known limits in some models?

+",104,,26,,1/11/2019 12:46,1/11/2019 12:46,Does self-induced collapse limit the size of a quantum computer?,,0,2,,,,CC BY-SA 4.0 +5184,1,,,1/11/2019 15:20,,1,35,"

Some information about the spectral properties of the hamiltonian of a given annealer emebedding is needed to determine a proper annealing schedule, correct?

+ +

What are methods that are used to find this spectral information?

+",4943,,4943,,1/11/2019 18:08,1/11/2019 18:08,What are techniques are used to esimate the spectral properties of annealer embedding hamiltonians?,,0,0,,,,CC BY-SA 4.0 +5185,1,5189,,1/11/2019 22:41,,2,135,"

The features of major search engines (looking at you, google!) prevent me from searching for an answer to this question, so I will poll the community here.

+ +

Is the state $|{\pm} i\rangle$ generally understood to mean $|0\rangle \pm i|1\rangle$, in the same way that $|\pm\rangle$ is generally understood to mean $|0\rangle \pm |1\rangle$, or should I define it in the paper I'm writing ?

+",1867,,26,,3/30/2019 7:48,3/30/2019 7:48,What is the notational convention for the single-qubit states $\lvert0\rangle\pm i\lvert1\rangle$?,,2,2,,,,CC BY-SA 4.0 +5187,1,5211,,1/12/2019 2:19,,4,315,"

I came across this circuit diagram for CV quantum state teleportation:

+ +
+

+ Source: Xanadu Strawberry Fields: Docs / Quantum algorithms / State teleportation

+
+ +

It was accompanied by a brief description, but I still feel as though I am lacking in some intuition as to why this circuit works in teleporting the state in qumode 0 to qumode 2. What would the full procedure to teleport some coherent state across a communication channel using CV quantum computing protocols be?

+ +

For more context, the beam-splitter gates are $50/50$, and the two qumodes $q_1$ and $q_2$ have been squeezed by a factor of $-2$ and $2$ respectively (although infinite squeezing would be ideal for this circuit). The measurements are the homodyne-x and homodyne-p measurement gates respectively (as shown on the circuit). This then leads to $q_2$ being condition displaced in the $x$ and $p$ quadratures, based on the previous measurements.

+ +

The part of the circuit I'm struggling to understand is the role of the second beam-splitter.

+",4907,,26,,1/14/2019 15:24,1/15/2019 21:16,Quantum teleportation over continuous variables?,,1,2,,,,CC BY-SA 4.0 +5188,2,,5185,1/12/2019 4:26,,3,,"

I think that most people would understand what you mean, although maybe mentioning they are the eigenstates of $Y$ wouldn't go amiss depending on your target audience.

+",3056,,,,,1/12/2019 4:26,,,,0,,,,CC BY-SA 4.0 +5189,2,,5185,1/12/2019 6:37,,5,,"

I’ve never seen that notation, and would expect to see it defined. Personally, I use circles with clockwise/anti-clockwise arrows, trying to conjure up a visual connection with the idea of circular polarisation. But, again, I’d define it before usage.

+",1837,,,,,1/12/2019 6:37,,,,1,,,,CC BY-SA 4.0 +5192,2,,5179,1/12/2019 23:34,,15,,"

$$ CNOT = +\begin{bmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & 0 & 1 \\ + 0 & 0 & 1 & 0 \\ +\end{bmatrix} +$$

But what does this matrix mean? The above matrix means: on a two qubit system (such as $\left|00\right>$, $\left|10\right>$, $\left|11\right>$, etc.) if the first qubit is a one, apply the not gate (X) on the second qubit. That's cool, but what if you have a 4 qubit system $\left(\left|0101\right>\right)$ or an 8 qubit system $\left(\left|00010011\right>\right)$ ? Also, let's say on the 8 qubit system you want to apply the X gate on the 7th qubit if the 2nd is one, how would you go about constructing this matrix?

+

+ +

Cookbook Method

+ +

Most books and articles will discuss a cookbook method where you build a matrix based on what the operation does to the base states. Let's work through this for the 2 qubit CNOT gate above. The above gate says if the first qubit is 1 then apply an X to the 2nd qubit. An X just changes the qubit from a 0 to a 1 or a 1 to a 0. The base states for a two qubit system are: $\left|00\right>,\, \left|01\right>,\, \left|10\right>,\, \left|11\right>$

+ +

How do I know those are the 4 states? Quantum qubit systems grow as $2^q$ where $q$ is the number of qubits. For a two qubit system $q=2$ therefore there are 4 qubit states. Then you count from 0 to 3 in binary. That is all.

+ +

First, this is how CNOT operates on the base states:

+ +

$$ CNOT\left|00\right> \rightarrow \left|00\right> $$$$ CNOT\left|01\right> \rightarrow \left|01\right> $$$$ CNOT\left|10\right> \rightarrow \left|11\right> $$$$ CNOT\left|11\right> \rightarrow \left|10\right> $$

To build a matrix you use the following trick:

+ +

\begin{align*} +CNOT &= \begin{bmatrix}\left<00|CNOT|00\right> && \left<00|CNOT|01\right> && \left<00|CNOT|10\right> && \left<00|CNOT|11\right> \\ +\left<01|CNOT|00\right> && \left<01|CNOT|01\right> && \left<01|CNOT|10\right> && \left<01|CNOT|11\right> \\ +\left<10|CNOT|00\right> && \left<10|CNOT|01\right> && \left<10|CNOT|10\right> && \left<10|CNOT|11\right> \\ +\left<11|CNOT|00\right> && \left<11|CNOT|01\right> && \left<11|CNOT|10\right> && \left<11|CNOT|11\right> \end{bmatrix} \\ \\ +&= \begin{bmatrix}\left<00|00\right> && \left<00|01\right> && \left<00|11\right> && \left<00|10\right> \\ +\left<01|00\right> && \left<01|01\right> && \left<01|11\right> && \left<01|10\right> \\ +\left<10|00\right> && \left<10|01\right> && \left<10|11\right> && \left<10|10\right> \\ +\left<11|00\right> && \left<11|01\right> && \left<11|11\right> && \left<11|10\right> \end{bmatrix} \\ \\ +&=\begin{bmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & 0 & 1 \\ + 0 & 0 & 1 & 0 \\ +\end{bmatrix} +\end{align*}

+ +

This is nice, but now suppose you want a CNOT gate between the 3rd and 9th qubit of a 10 qubit system? You will have $2^{10}$ base states and a $2^{10} \times 2^{10}$ matrix! Good luck with the cookbook method! What we need is an algorithmic method that we can code up in Python.

+ +

+ +

The Algorithmic Method

+ +

A better algorithmic way to think about quantum control gates is by using operators and tensor products. Suppose we have a two qubit system.

+ +

To say ""If the first qubit is $\left|0\right>$ leave the second qubit alone"": +$$ \left|0\rangle\langle0\right| \otimes I $$ +to leave a qubit alone you apply the Identity operator / matrix $I$

+ +

To say ""If the first qubit is $\left|1\right>$ apply X to the second qubit"":

+ +

$$ \left|1\rangle\langle1\right| \otimes X $$

Now put them together by adding them, ""If the first qubit is $\left|0\right>$ leave the second qubit alone and If the first qubit is $\left|1\right>$ apply X to the second qubit"":

+$$ \left|0\rangle\langle0\right| \otimes I + \left|1\rangle\langle1\right| \otimes X $$ + + +

+ + + +In [3]: + + +
from qudotpy import qudot
+import numpy as np
+
+zero_matrix = qudot.ZERO.ket * qudot.ZERO.bra
+one_matrix = qudot.ONE.ket * qudot.ONE.bra
+
+CNOT = np.kron(zero_matrix, np.eye(2)) + np.kron(one_matrix, qudot.X.matrix)
+print(CNOT)
+
+ + + + + + + + + + + +
[[ 1.+0.j  0.+0.j  0.+0.j  0.+0.j]
+ [ 0.+0.j  1.+0.j  0.+0.j  0.+0.j]
+ [ 0.+0.j  0.+0.j  0.+0.j  1.+0.j]
+ [ 0.+0.j  0.+0.j  1.+0.j  0.+0.j]]
+
+ + + + + + + + + + + + + +

Nice! This is a good algorithmic way to make CNOT gates (or control gates in general). For example, suppose now you want a CNOT gate of a 10 qubit system where the 3rd qubit is the control and the 9th qubit is the target:

+

""If the third qubit is $\left|0\right>$ leave the ninth qubit alone:"" +$$ I \otimes I \otimes \left|0\rangle\langle0\right| \otimes I \otimes I \otimes I \otimes I \otimes I \otimes I \otimes I $$

+

""If the third qubit is $\left|1\right>$ apply X to the ninth qubit"": +$$ I \otimes I \otimes \left|1\rangle\langle1\right| \otimes I \otimes I \otimes I \otimes I \otimes I \otimes X \otimes I $$

+

Add those two expression together and you have your 10 qubit CNOT gate.

+

The above algorithm is straightforward to implement in Python. + + + +",4359,,9006,,2/22/2020 22:50,2/22/2020 22:50,,,,0,,,,CC BY-SA 4.0 +5193,2,,5176,1/13/2019 2:32,,4,,"

On parameter setting, check our work: https://journals.aps.org/prx/abstract/10.1103/PhysRevX.5.031040 +(Basically you want to make sure that the chains representing the logical qubit have a phase transition synchronized with the minimum gap). +But in general this is a hard problem, and precision issues connected to the embedding characteristics are probably the dominant effect that influences performance.

+",410,,,,,1/13/2019 2:32,,,,0,,,,CC BY-SA 4.0 +5194,1,,,1/13/2019 12:50,,3,80,"

In the Environment and Quantum Operations in Nielsen and Chuang, section 8.2.2, they say that when you apply a unitary on a state, you expect the output as the just the state transformed by the unitary, but here we haven't taken environment into consideration.

+ +

So, we take environment into consideration and assume the state is in a product state with the environment And then apply the unitary on both, and trace out the environment.

+ +

Now, the unitary is something we specify, right? I imagine we have a machine where we can decide what unitary we want to apply and give it as input, and it gets applied on the state inside.

+ +

When we know that it might be coupled with the environment, do we apply the right unitary assuming the dimensions? Or do we just apply what we would have applied for our system only, and the dimensions get taken care of?

+ +

For example, do we just specify I, and I2 gets applied if it is a 2d system, and I4 gets applied if it's a 4d system?

+ +

Or do we exactly specify the matrix? Basically how do we apply these unitaries, atleast on a conceptual level?

+",2832,,,,,1/13/2019 12:50,What do you specify when you physically apply a unitary?,,0,3,,,,CC BY-SA 4.0 +5195,1,5196,,1/13/2019 22:45,,5,189,"

The qubit $a\left|0\right>+b\left|1\right>$ is a superposition w.r.t. the basis $\left\lbrace\left|0\right>,\, \left|1\right>\right\rbrace$ because it may collapse to $\left|0\right>$ or $\left|1\right>$ when measured w.r.t. the above basis. However the same qubit, when measured w.r.t the basis $\left\lbrace a\left|0\right>+b\left|1\right>, b^*\left|0\right>−a^*\left|1\right>\right\rbrace$, always collapses to the first vector.

+ +

Can I therefore conclude that superposition is a basis-dependent concept?

+",5543,,26,,1/14/2019 15:30,1/14/2019 15:30,Is qubit superposition a basis-dependent concept?,,1,0,,,,CC BY-SA 4.0 +5196,2,,5195,1/14/2019 4:56,,4,,"

Yes. You already have the reasoning for why. Sometimes the basis is implied but not explicitly stated though. So caution when reading something like that.

+",434,,,,,1/14/2019 4:56,,,,2,,,,CC BY-SA 4.0 +5197,1,5198,,1/14/2019 7:44,,3,563,"

In Qiskit, they have the concept of a Toffoli gate (ccx). However, the following code throws an error:

+ +
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
+from qiskit import execute, Aer
+
+q1 = QuantumRegister(2)
+qctrl = QuantumRegister(1)
+c = ClassicalRegister(2)
+qc = QuantumCircuit(q1, qctrl, c)
+
+qc.x(q1)
+qc.ccx(q1[0], q1[1], qctrl)
+qc.measure(q1, c)
+
+backend_sim = Aer.get_backend('qasm_simulator')
+job_sim = execute(qc, backend_sim)
+result_sim = job_sim.result()
+print(result_sim.get_counts(qc))
+
+ +

According to my knowledge and research, this should produce the output 111 but instead I get an error message:

+ +
+

qiskit.qiskiterror.QiskitError: ""QuantumRegister(1, 'q0') is not a tuple. A qubit should be formated as a tuple.""

+
+ +

This seems like a bug with Qiskit to me. Am I wrong? And if so, how can I fix my code?

+",5472,,26,,1/14/2019 15:30,1/14/2019 15:30,Why won't Qiskit ccx gate accept registers?,,2,0,,,,CC BY-SA 4.0 +5198,2,,5197,1/14/2019 8:32,,4,,"

It is not a bug. Qiskit makes the difference between quantum registers and quantum bits. In your case, qctrl is a QuantumRegister (as shown in your error) whereas the ccx gate expect a qubit.

+ +

For Qiskit, a qubit is defined as a Tuple of a QuantumRegister and an index. You can get a qubit from a QuantumRegister by using the indexing notation: qtrl[0] represents the first qubit (and the only one) of the QuantumRegister qctrl.

+ +

In summary, replace

+ + + +
qc.ccx(q1[0], q1[1], qctrl)
+
+ +

by

+ + + +
qc.ccx(q1[0], q1[1], qctrl[0])
+
+ +

and your issue should be fixed.

+",1386,,,,,1/14/2019 8:32,,,,0,,,,CC BY-SA 4.0 +5199,1,5201,,1/14/2019 8:32,,12,3412,"

Following is an excerpt from QCQI:

+ +

+ +

I can understand that this matrix satisfies a unitary matrix. Also, intuitively, I am able to understand it. However, what is the proof that any given Unitary Matrix can be converted as above? Like why there should be only 4 variables and not more or less? Looking for some formal authentic proof. Thanks.

+",5410,,55,,11/26/2019 10:41,4/21/2022 17:04,General parametrisation of an arbitrary $2\times 2$ unitary matrix?,,1,0,,,,CC BY-SA 4.0 +5200,2,,5197,1/14/2019 9:15,,3,,"

Nelimee has provided the answer, but there's another point to note that is too big for a comment.

+ +

In Qiskit, it is possible to pass registers to gates instead of qubits. You do this in your example with

+ +
qc.x(q1)
+
+ +

This applied x to both qubits in the register q1, and so is equivalent to

+ +
for q in range(2):
+    qc.x(q1[n])
+
+ +

This should be regarded as a kind of shortcut notation. Providing single qubits is the 'proper way' to do it, and using registers is something that can be done to make your code a bit more elegant.

+ +

Like any shortcut, it should be used with care. Specifically, you have to remain consistent. So the problem in your case was supplying a single qubit for two arguments, and a single qubit register for the last. If you'd used single qubits for all, as in Nelimee's answer, then it would work. Using single qubit registers for all would also work. But mixing and matching does not.

+",409,,,,,1/14/2019 9:15,,,,0,,,,CC BY-SA 4.0 +5201,2,,5199,1/14/2019 9:35,,16,,"
+

What is the proof that any given unitary matrix can be converted as above?

+
+

Let $U$ be an arbitrary $2\times 2$ unitary matrix. This is equivalent to the rows/columns of $U$ being orthonormal bases.

+

Let us write a generic $U$ as +$$U=\begin{pmatrix}a&b\\c&d\end{pmatrix}.$$ +The constraints imposed on the coefficients $a,b,c,d$ by the requirement of $U$ being unitary are +$$|a|^2+|c|^2=1,\qquad |b|^2+|d|^2=1,\qquad a^* b+c^* d=0.$$ +A pair of complex numbers $a,b\in\mathbb C$ satisfying $|a|^2+|b|^2=1$ can always be parametrized as +$$a=e^{i\alpha_{11}}\cos\theta,\qquad b=e^{i\alpha_{12}}\sin\theta,$$ +for some real coefficients $\alpha_{ij},\theta\in\mathbb R$.

+

It follows that using only the normalization constraint (but without taking into account the orthogonality) we can parametrize $U$ as

+

$$U=\begin{pmatrix}e^{\alpha_{11}}\cos\theta& e^{\alpha_{12}}\sin\theta\\ +e^{\alpha_{21}}\sin\theta & e^{\alpha_{22}}\cos\theta +\end{pmatrix}.$$

+

Requiring the columns to be orthogonal then gives the additional relation

+

$$e^{i(\alpha_{11}-\alpha_{12})}+e^{i(\alpha_{21}-\alpha_{22})}=0,$$ +that is, $\alpha_{11}=\alpha_{12}+\alpha_{21}-\alpha_{22}+\pi$.

+

We conclude that $U$ is parametrized by three real parameters, here denoted $\theta,\alpha_{12},\alpha_{21},\alpha_{22}$.

+

To get the form you show you simply need to change variables as follows:

+

\begin{align} +\theta&=\gamma/2, \\ +\alpha_{12} &= \alpha-\beta/2+\delta/2+\pi,\\ +\alpha_{21} &= \alpha+\beta/2-\delta/2, \\ +\alpha_{22} &= \alpha+\beta/2+\delta/2. +\end{align}

+
+

Like why there should be only 4 variables and not more or less?

+
+

While the above already proved this, it can be useful to know that this a special case of a more general result.

+

A generic unitary $n\times n$ matrix is specified by $n^2$ real parameters (see wiki page on the unitary group for more details).

+

An easy way to see this is again to remember that unitary matrices are characterised by their columns/rows forming an orthonormal system. +This amounts to $n$ real constraints (imposing each of the $n$ columns to be normalized), plus $\binom{n}{2}=n(n-1)/2$ additional complex constraints (imposing each pair of columns to be orthogonal). Each complex constraints amounts to two real constraints, so this sums up to a total of +$$n+2\binom{n}{2}=n+n(n-1)=n^2$$ +real, independent constraints.

+

A generic $n\times n$ matrix is characterised by $n^2$ complex numbers, that is, $2n^2$ real numbers.

+

We conclude that the number of free parameters of a generic $n\times n$ unitary matrix is: +$$2n^2-n^2=n^2.$$

+

Going back to the simple $2\times 2$ case above, you can see how we get back the previous result because $2^2=4$ (you might also notice that to count parameters in the special case $2\times 2$ I used a different ad-hoc strategy, rather then the one showed here to get the count in the general case).

+

Yet another way to count parameters

+

Another method I like is to think entirely in terms of orthonormal systems. +The question is: how many parameters need to be given to specify an orthonormal basis in an $n$-dimensional complex vector space?

+

Let us start by the first vector. The only constraint here is that we want the vector to be normalized. +The number of real parameters needed to specify a normalized vector in $n$-dimensions is $d_1=2n-1$.

+

Let us now add another vector. Now we have to impose both the normalization of this additional vector (one real constraint), and the orthogonality of this additional vector to the initial one (two real constraints). +The additional parameters are therefore $d_2= 2n-3$.

+

A third vector will need to be normalized (one real constraint), and orthogonal to the first two vectors ($2\times 2$ real constraints), thus $d_3=2n-5$.

+

Iterate this reasoning until you get to the last vector, which will be specified by a single real parameter.

+

The total number of parameters is therefore: +$$\sum_k d_k=(2n-1)+(2n-3)+\cdots+3+1=\sum_{k=0}^{n-1} (2k+1).$$ +In other words, the number of parameters is given by the sum of the first $n$ odd integers, which is again readily shown to equal $n^2$.

+",55,,55,,4/21/2022 17:04,4/21/2022 17:04,,,,2,,,,CC BY-SA 4.0 +5202,1,5203,,1/14/2019 18:25,,3,192,"

I am currently working on the algorithm of Deutsch. The algorithm defines two starting states, which are for $|x\rangle = |0\rangle$ and for $|y\rangle = |1\rangle$. +So far, that's clear to me. But what would happen if you change the input bits, lets say the qubits are initially in the state: $|x\rangle = |0\rangle$ and $ |y\rangle = |0\rangle$, what are the implications for the algorithm? And what would happen, if the bits in the original algorithm were switched: $|x\rangle = |1\rangle$ and for $|y\rangle = |0\rangle$ does the last idea just switch the last bit in the final states?

+ +

Suppose the input bits are 0 and 0 (according to my calculation): +I apply the H matrix to both input bits: +$$ H(|0\rangle)H(|0\rangle)=|+\rangle\cdot|+\rangle$$ +$$=\frac{1}{2}(|00\rangle+|01\rangle+|10\rangle+|11\rangle)$$ +By $f'$ I mean the negation of $f$ +$$\frac{1}{2}(|0,f(0)\rangle+|0,f'(0)\rangle+|1,f(1)\rangle+|1,f'(1)\rangle))$$ +Now let's say $ f (0) = f (1) $ (constant) then: +$$\frac{1}{2}((|0\rangle+|1\rangle)(|f(0)\rangle+|f'(0)\rangle))$$ +But what would happen if $ f (0) = f '(1)$ (balanced)?

+ +

I hope that my question has come across as understandable.

+",,user4961,55,,5/15/2019 8:32,5/15/2019 8:32,What happens in Deutsch algorithm if I use equal input bits?,,1,0,,,,CC BY-SA 4.0 +5203,2,,5202,1/14/2019 19:09,,3,,"

TL;DR: You won't be able to distinguish the constant and balanced function scenarios if you start with $|y\rangle = |0\rangle$.

+ +
+ +

If you start with $|x\rangle = |0\rangle$ and $|y\rangle = |0\rangle$:

+ +

For a balanced function $ f (0) = f '(1)$ you'll get

+ +

$$\frac{1}{2}(|0,f(0)\rangle+|0,f'(0)\rangle+|1,f(1)\rangle+|1,f'(1)\rangle)) = $$

+ +

$$= \frac{1}{2}(|0,f(0)\rangle+|0,f'(0)\rangle+|1,f'(0)\rangle+|1,f(0)\rangle)) = $$

+ +

$$= \frac{1}{2}((|0\rangle+|1\rangle)(|f(0)\rangle+|f'(0)\rangle))$$

+ +

Which is the same result as you'd get for a constant function. That's why you need to start with $|y\rangle = |1\rangle$ - you need to get a phase difference between the two scenarios somehow.

+ +
+ +

If you start with $|x\rangle = |1\rangle$ and $|y\rangle = |0\rangle$, you get the same outcome: the state both for balanced and for constant scenarios is the same, and you can't distinguish them. (The math is very straightforward so I won't write it out here).

+",2879,,,,,1/14/2019 19:09,,,,2,,,,CC BY-SA 4.0 +5204,1,,,1/14/2019 21:41,,9,559,"

Context:

+

I was going through John Watrous' lecture Quantum Complexity Theory (Part 1) - CSSQI 2012. Around 48 minutes into the lecture, he presents the following:

+
+

No relationship is known between $\mathsf{BQP}$ and $\mathsf{NP}$...they are conjectured to be incomparable.

+
+

So far so good. Then I came across Scott Aaronson's answer to Can a parallel computer simulate a quantum computer? Is BQP inside NP? He mentions these points:

+
+
    +
  • Suppose you insist on talking about decision problems only ("total" +ones, which have to be defined for every input), as people +traditionally do when defining complexity classes like P, NP, and BQP. +Then we have proven separations between BQP and NP in the "black-box +model" (i.e., the model where both the BQP machine and the NP machine +get access to an oracle), as mmc alluded to.

    +
  • +
  • And to reiterate, all of these separations are in the black-box model +only. It remains completely unclear, even at a conjectural level, +whether or not these translate into separations in the "real" world +(i.e., the world without oracles). We don't have any clear examples +analogous to factoring, of real decision problems in BQP that are +plausibly not in NP. After years thinking about the problem, I still +don't have a strong intuition either that BQP should be contained in +NP in the "real" world or that it shouldn't be.

    +
  • +
+
+

According to his answer, it seems that in the "black-box model" we can show some relationship (as in non-overlapping) between $\mathsf{BQP}$ and $\mathsf{NP}$. He cites @mmc's answer, which says:

+
+

There is no definitive answer due to the fact that no problem is known +to be inside PSPACE and outside P. But recursive Fourier sampling +is conjectured to be outside MA (the probabilistic generalization +of NP) and has an efficient quantum algorithm. Check page 3 of this +survey by Vazirani for more details.

+
+

Question:

+

It's not clear from @mmc's answer as to how the recursive Fourier sampling algorithm is related to the $\mathsf{BQP}$ class and how (or whether at all) it proves separations between $\mathsf{BQP}$ and $\mathsf{NP}$ in the "black-box model". In fact, I'm not even sure what "black-box model" means in this context, although I suspect that it refers to some kind of computation model involving quantum oracles.

+

It would be great if someone could provide a brief and digestible summary of what the recursive Fourier sampling algorithm is and how it proves separations between $\mathsf{BQP}$ and $\mathsf{NP}$. Even a rough sketch of the idea behind the proof would be okay. I'm hoping this will give me a head start in understanding the papers linked by @mmc, which are otherwise rather dense for me at present.

+",26,,-1,,6/18/2020 8:31,4/6/2019 15:08,What is recursive Fourier sampling and how does it prove separations between BQP and NP in the black-box model?,,1,0,,,,CC BY-SA 4.0 +5206,1,5207,,1/15/2019 9:00,,6,264,"

Introductory textbooks I've read define entanglement as when your product state cannot be factored into the tensor product of individual quantum states. But consider a three-qbit system:

+ +

$$C_{2,0}H_2|000\rangle = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ 0 \\ 0 \\ 0 \\ 0 \\ \frac{1}{\sqrt{2}} \\ 0 \\ 0 \end{bmatrix}.$$

+ +

In this system, the most- and least- significant qubits are entangled. However, a naive ""cannot factor"" analysis would also lead you to believe the middle qubit is entangled with the rest. The definition of entanglement must thus include permutation of qubit order in some way. So, what is this definition?

+",4153,,55,,11/30/2021 22:27,11/30/2021 22:27,Defining entanglement for systems with more than two qubits,,2,1,,,,CC BY-SA 4.0 +5207,2,,5206,1/15/2019 11:06,,5,,"

There is far more structure in entanglement than your simplistic definition seems to be implying. Yes, you could ask a question

+ +
+

Is there any entanglement in this pure state $|\psi\rangle$ of $n$ qubits?

+
+ +

Which can be answered by whether or not the entire state can be expressed as +$$ +|\psi\rangle=|\phi_1\rangle|\phi_2\rangle\ldots|\phi_n\rangle +$$ +but as you are rightly realising, you can ask far more structured questions of

+ +
+

is qubit $i$ entangled?

+
+ +

or even

+ +
+

is qubit $i$ entangled with qubit $j$?

+
+ +

or

+ +
+

What sort of entanglement does qubit $i$ share with different qubits, and how much?

+
+ +

The first is answered in much the same way as your original strategy: if it can be written as $|\phi\rangle_i\otimes|\psi\rangle_{1,2,\ldots,n\setminus i}$, then qubit $i$ is not entangled with anything. In your example, qubit 2 is not entangled, but qubits 1 and 3 are.

+ +

The second is far more subtle, and perhaps requires a more precise definition of entanglement. Should we say that qubits 1 and 2 in the state $(|000\rangle+|111\rangle)/\sqrt{2}$ are entangled? If you look at just those two qubits, they are in a maximally mixed state, i.e. not entangled, but they are definitely part or an entangled state that cannot be localised to any pair of qubits. Hence the question about the type of entanglement.

+ +

Ultimately, this really comes down to a question of why are you interested in entanglement. Usually, it's to do something with the entangled state, so you have a measure of a given state's usefulness (and that is often some form of entanglement measure), and you can ask questions with respect to that particular measure.

+",1837,,,,,1/15/2019 11:06,,,,0,,,,CC BY-SA 4.0 +5209,2,,5144,1/15/2019 14:53,,9,,"

Quantum circuits have a data attribute, which is a list of all gates. You can remove elements from this as with any Python list. For example, here's a circuit

+ +
q = QuantumRegister(1)
+circ = QuantumCircuit(q)
+
+circ.h(q[0])
+circ.s(q[0])
+circ.x(q[0])
+
+ +

Let's get rid of the S gate. First, we can look at the list of gates with circ.data. This gives

+ +
[<qiskit.extensions.standard.h.HGate at 0x11721b7b8>,
+ <qiskit.extensions.standard.s.SGate at 0x11721b828>,
+ <qiskit.extensions.standard.x.XGate at 0x11721b7f0>]
+
+ +

Element 1 of this list (i.e. the second element) is the gate we want rid of. We can do this with pop.

+ +
qiskit.data.pop(1)
+
+ +

The resulting circuit can then be seen by print(circ)

+ +
         ┌───┐┌───┐
+q0_0: |0>┤ H ├┤ X ├
+         └───┘└───┘
+
+ +

As you can see, we have succeeded in removing the S gate.

+ +

Note that you can get information about the elements of the data list using the methods name and qargs, etc, of gate objects. For example, to see that element 0 is a Hadamard, and to see which qubit it acts on, we can use

+ +
print( circ.data[0].name )
+print( circ.data[0].qargs )
+
+ +

This returns

+ +
h
+[(QuantumRegister(1, 'q0'), 0)]
+
+",409,,409,,1/15/2019 15:01,1/15/2019 15:01,,,,1,,,,CC BY-SA 4.0 +5210,1,5213,,1/15/2019 20:34,,4,1027,"
+

Promise Problem : It is a pair + $$\mathcal{A}=\{\mathcal{A}_{\text{yes}},\mathcal{A}_{\text{no}}\}$$ + where $\mathcal{A}_{\text{yes}}$ and $\mathcal{A}_{\text{no}}$ are disjoint sets of inputs (yes inputs and no inputs). Strings not contained in $\mathcal{A}_{\text{yes}} \cup \mathcal{A}_{\text{no}}$ are ""don't care"" inputs.

+ +

$\mathsf{PP}:$ The class of promise problems solvable in polynomial time on a probabilistic Turing machine with bounded error (correct on every input with probability at least $\frac{2}{3}$).

+ +

$\mathsf{BQP}:$ The class of promise problems $\mathcal{A} = (\mathcal{A}_{\text{yes}}, \mathcal{A}_{\text{no}})$ for which there exists a polynomial time-uniform family

+ +

$$\mathrm{Q} = \{\mathrm{Q}_n: n\in \Bbb N\}$$

+ +

of quantum circuits such that, for all input strings $x$, we have:

+ +

$$x\in\mathcal{A}_{\text{yes}} \implies \text{Pr}[\mathrm{Q}(x)=1]\geq \frac{2}{3}$$

+ +

$$x\in\mathcal{A}_{\text{no}} \implies \text{Pr}[\mathrm{Q}(x)=0]\geq \frac{2}{3}$$

+ +

Source: John Watrous - Quantum Complexity Theory (Part 1) - CSSQI 2012

+
+ +

Watrous says that an intuitive approach for proving the containment $\mathsf{BQP}\subseteq \mathsf{PP}$ is along the lines of: unbounded error probabilistic computations can simulate interference in quantum computations (e.g. run two probabilistic processes, and condition them on obtaining the same outputs).

+ +

Not sure what they mean by ""simulate interference"" and how it is relevant to the proof. This so-called intuitive proof doesn't seem clear to me. Could someone clarify the proof-sketch and give me an actual example of a promise problem (with a quantum algorithm) which lies in $\mathsf{BQP}$, and the corresponding equivalent classical algorithm involving two or more parallel probabilistic processes, such that the classical algorithm can be easily proven to lie in $\mathsf{PP}$? I'm finding it a bit hard to imagine without a solid example. Relevant reading material suggestions are also welcome.

+ +
+ +

Related: Query regarding BQP belonging to PP

+",26,,26,,3/14/2019 16:04,3/14/2019 16:04,Intuitive Proof: BQP ⊆ PP,,1,1,,,,CC BY-SA 4.0 +5211,2,,5187,1/15/2019 21:16,,2,,"

Here's a schematic description of quantum teleportation for general systems:

+ +
    +
  1. Alice and Bob share a maximally entangled state.
  2. +
  3. To teleport $|\psi\rangle$ to Bob, Alice performs a joint measurement of $|\psi\rangle$ and her local copy of the maximally entangled state. This measurement is entangling, in the sense that the output state after the measurement can be entangled across Alice's two systems even if it was not initially so.
  4. +
  5. Alice sends Bob a classical description of her measurement outcome. Bob applies a conditional gate to his state depending on the information received by Alice.
  6. +
  7. Bob's local state is now $|\psi\rangle$.
  8. +
+ +

In the CV version of the protocol, these steps are:

+ +
    +
  1. A maximally entangled state is produced by interacting two infinitely-squeezed states $|0\rangle_p$ and $|0\rangle_x$ on a 50:50 beam-splitter.

  2. +
  3. Interfering $|\psi\rangle$ and a local copy of the maximally entangled state in a 50:50 beam splitter creates entanglement between these systems. In combination with a homodyne measurement at the output, this is equivalent to the required entangling measurement.

  4. +
  5. Alice sends her outcome to Bob, who performs conditional displacements on his system.

  6. +
  7. Bob recovers $|\psi\rangle$.

  8. +
+ +

If you want to go beyond schematics and understand the mathematics behind the protocol, I recommend these references:

+ +

Gaussian Quantum Information, section IV.A

+ +

Teleportation of Continuous Quantum Variables

+",4294,,,,,1/15/2019 21:16,,,,0,,,,CC BY-SA 4.0 +5212,2,,5206,1/16/2019 8:57,,3,,"

One definition for whether a state $\psi \in V_1 \otimes \cdots V_n$ for $n$ qudits with various values of $d_i = \text{dim} V_i$:

+ +

$\psi$ is not entangled if it can be written as a single summand $\psi = v_1 \otimes \cdots v_n$. Conversely it is entangled if it requires more than 1 summand.

+ +

Let $\sigma \in S_n$ be a permutation and $R_\sigma$ be the corresponding operator $V_1 \otimes \cdots V_n \to V_{\sigma (1)} \otimes \cdots V_{\sigma (n)}$. If we apply $R_\sigma$ to $\psi$ and it was not entangled then we could write it as $v_{\sigma (1)} \otimes \cdots v_{\sigma (n)}$. Conversely if $R_{\sigma} \psi$ is not entangled then we get $\psi$ is not either. That means this notion of entanglement does not depend on the ordering.

+ +

One problem with this is that it is very sensitive. Consider the state $|00\rangle + \epsilon | 11 \rangle$ for small $\epsilon$.

+ +

For further information see the notion of tensor rank and border rank. Substitute $\mathbb{C}$ for the field $F$ everywhere. The statistics applications more use the $\mathbb{R}$ case. The border rank is the phenomenon underlying the W-state.

+ +

Another thing one can do is do redefinition using any set partition of $n$ into $k$ parts. For example, if $n=4$ a set partition might be $1,2,4$ and $3$ into $k=2$ parts. Then from this we define $W_1 = V_1 \otimes V_2 \otimes V_4$ and $W_2 = V_3$. Then we get the image of $\psi$ as an element of $W_1 \otimes \cdots W_k$ by an appropriate permutation and taking tensor products. One can then compute the rank in this context instead of the $V$ context. With some permutation, we can get the state to become unentangled. This is when all the entanglement has been absorbed into the set partition.

+",434,,,,,1/16/2019 8:57,,,,0,,,,CC BY-SA 4.0 +5213,2,,5210,1/16/2019 13:57,,5,,"

Since $\mathsf{BQP}$ can be defined on different universal gate sets due to the Solovay-Kitaev theorem, we can choose Hadamard gate $\operatorname{H}$ and Toffoli gate $\operatorname{CCNOT}$ as a gate set, like Scott Aaronson's definition of $\mathsf{PostBQP}$ mentioned in the following:

+ +
+

Here ‘uniform’ means that there exists a classical algorithm that outputs a description of $C_n$ in time + polynomial in $n$. Note that, by a result of Shi, we can assume without loss of generality that Cn is + composed only of Hadamard and Toffoli gates. (This is true even for a postselected quantum circuit since by + the Solovay-Kitaev Theorem, we can achieve the needed accuracy in amplitudes at the cost of a polynomial + increase in circuit size.)

+
+ +

But the definition of $\mathsf{PostBQP}$ for different universal gate sets is a little delicate, we also need the matrix element of any gate cannot be too small, namely the theorem 2.10 in Kuperberg's paper.

+ +

Note that matrix elements of these gates is either $0$ or $\pm 1$ up to some normalization (the number of Hadamard gates in such sequence), namely $$\operatorname{H}=\frac{1}{\sqrt{2}}\begin{pmatrix} 1&-1\\-1&1\\\end{pmatrix}, \operatorname{CCNOT} = \begin{pmatrix} +1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ +0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ +0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\ +0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\ +0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\ +0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ +0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\\ +0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\ +\end{pmatrix}.$$

+ +

Hence, the outcome of a polynomially long gate sequence of $\operatorname{H}$ and $\operatorname{CCNOT}$ can be simulated by counting the number of paths which their product is $1$ and the number of paths which their product is $-1$. It can be thought as the following DAG.

+ +
    +
  • Starting from a $n$-bit string $00\cdots0$ with an associated value $1$, i.e. $(00\cdots0,1)$.
  • +
  • Generating vertices in the next level of the DAG by applying a Hadamard gate (out-degree $2$) or a Toffoli gate (out-degree $1$), also let the associated value be the correspondent matrix element in the gate. For instance, leaves of $(00,1)$ by applying a Hadamard gate on the first qubit are $(00,1)$ and $(10,-1)$.
  • +
  • The ""depth"" of such DAG is the length of the gate sequence.
  • +
  • And we only care about leaves associated with string $0\cdots$ (the first qubit is $0$).
  • +
+ +

Let such polynomially long gate sequence denoted by $A_x$ where $x$ is an input of some $\mathsf{BQP}$ problem. Notice that the following in the defintion of $\mathsf{BQP}$, $$\|\Pi_1 A_x|0^n \rangle\|_2^2 = \langle 0^n| A_x^{\dagger} \Pi_1 A_x | 0^n \rangle,$$ where $\Pi_1 = |0\rangle\langle 0|\otimes I_{n-1}$, we can simply do the above construction for $A_x^{\dagger} \Pi_1 A_x$, and at the end of day, we only care above the leave associated with string $0\cdots 0$.

+ +

Then the probability of getting some leaf is $\dfrac{a-b}{2^{k}}$ where $k$ is the number of Hadamard gates, $a$ is the number of paths which the product of all associated values on such path is $1$, and $b$ is the number of paths which the product of all associated values on such path is $-1$. +Such a counting task can be calculated by $\mathsf{PP}$ machine, namely using the GapP function mentioned in Marriott-Watrous (page 6), also the proof the theorem 3.1 in Fortnow-Rogers. Also, Watrous explained a similar proof for $\mathsf{BQP}\subseteq\mathsf{PP}$ in his lecture notes.

+ +

Furthermore, the above proof of $\mathsf{BQP}\subseteq\mathsf{PP}$ can be automatically extended to show that $\mathsf{PostBQP}\subseteq\mathsf{PP}$. The reason is mentioned in Greg Kuperberg's clarification on $\mathsf{PostBQP}$, namely the matrix element of the gate in the $\mathsf{PostBQP}$ quantum circuit need an exponential accuracy (instead of a polynomial accuracy in the $\mathsf{BQP}$ case). Since the Solovay-Kitaev theorem gives an approximation algorithm in time $\text{poly}(n,\log(1/\epsilon))$ for a single $n$-qubit gate, such quantum gate with exponentially accuracy still can be generated by polynomial long quantum gates on the given universal set (such as $\operatorname{H}$ and $\operatorname{CCNOT}$). Therefore, any $\mathsf{PostBQP}$ quantum circuit can be described as a polynomial long gate sequence on $\operatorname{H}$ and $\operatorname{CCNOT}$, and we can use the same argument which we mentioned above.

+",1777,,1777,,1/27/2019 11:52,1/27/2019 11:52,,,,4,,,,CC BY-SA 4.0 +5215,1,5217,,1/17/2019 11:54,,9,526,"

To my understanding, Deutsch-Jozsa algorithm solves a specific problem in constant time, using a fixed circuit depth, compared to a classical deterministic algorithm, which would require time exponential to the number of bits used to store the input.

+ +

I thought this proves that there exist certain problems that we cannot solve in polynomial time on a classical machine (so they are not in $\mathsf{P}$), that we can solve in constant time on a quantum machine (so they are in $\mathsf{BQP}$).

+ +

This led me to a natural ""conclusion"" that $\mathsf{P} ≠ \mathsf{BQP}$. However, I believe this is actually still an open question.

+ +

Why doesn't Deutsch-Jozsa algorithm prove that $\mathsf{P} \neq \mathsf{BQP}$?

+",5463,,26,,3/4/2019 10:14,11/22/2019 7:57,Why doesn't Deutsch-Jozsa Algorithm show that P ≠ BQP?,,2,0,,,,CC BY-SA 4.0 +5216,1,,,1/17/2019 12:01,,5,376,"

Using the quantum adversary lower bound technique, how can one calculate lower bound for Majority function $f:\{0,1\}^n \to \{0,1\}$ such that $f(x)=0$ if $|x|\leq n/2$ else $f(x)=1$, $|x|$ is the hamming weight of $x$)?

+",5568,,1828,,1/21/2019 4:34,1/21/2019 4:34,Query lower bound for Majority function using the quantum adversary method,,1,1,,,,CC BY-SA 4.0 +5217,2,,5215,1/17/2019 12:45,,10,,"

I believe there are two issues here. The first isn't anything wrong with your statement, but rather that you could make a far stronger (non-quantum) statement by the same reasoning: $\mathsf{P}\neq \mathsf{BPP}$. Why is this? For testing if an $n$ bit function is constant or balanced with certainty (as required by $\mathsf{P}$), it could be that we have to check $2^{n-1}+1$ different inputs to see if they're all the same or not. However, imagine we just check 100 different, randomly chosen, input strings and see if they're all the same. The probability of a balanced function giving all the same outputs is approximately $1/2^{99}$. Hence we can determine in constant time on a classical computer whether the function is constant or balanced up to some finite accuracy threshold. It's certainly within BPP.

+ +

The question still remains as to where the reasoning falls down. The fallacy is in the construction of the algorithm. It uses an oracle. That oracle computes something using the function in a very specific way. So the statement is really ""if we compute using this oracle, then we can prove that separation"". It's said to be separation with respect to that oracle. Now you might say ""that oracle is just the evaluation of $f(x)$. What else could there be?"" but if you actually implement the algorithm, you have to program the function. So you have to know the function (or somebody else provides you with the code) and maybe you could analyse the function specification directly rather than just blindly evaluating it. (There doesn't have to be a proof that you can do better, we just have to allow for the possibility.) As a trivial example, let $x_1$ be the most significant bit of $x$, and let $f(x)=x_1$. If I wrote a program that systematically worked through all values of $x$, if I was unlucky, I'd try all $2^{n-1}$ options with $x_1=0$ first. But if I saw the function definition, I'd know immediately that it's a balanced function.

+",1837,,26,,3/4/2019 10:18,3/4/2019 10:18,,,,6,,,,CC BY-SA 4.0 +5218,1,5220,,1/17/2019 15:50,,2,159,"

I'm trying to understand the Deutsch-Josza algorithm from an adiabatic perspective as presented in Adiabatic quantum computing A: Review of modern physics, vol 90, (2018) pp 015002-1 (arXiv version).

+ +

When explaining the unitary interpolation technique, the authors begin with:

+ +
+

The initial Hamiltonian is chosen such that its ground state is the uniform superposition state [$|\phi\rangle = |+\rangle^{\otimes n}$], i.e., $H(0) = w\sum^{n}_{i = 1}|-\rangle_i \langle-|$, where $w$ is the energy scale.

+
+ +
    +
  • How can I calculate the ground state of $H(0)$?
  • +
+ +

Also, I have seen, but don't remember exactly where, an observation that $H(0)$ is introduced in a such a way that a penalty is provided for any state having a contribution of $|-\rangle$. What does it mean?

+ +

Then the paper goes on and states that:

+ +
+

An adiabatic implementation requires a final Hamiltonian $H(1)$ such that its ground state is $|\Psi(1)\rangle = U|\Psi(0)\rangle$, and that this can be accomplished via a unitary transformation of $H(0)$, i.e. $H(1) = UH(0)U^\dagger$.

+
+ +

where $U$ is a diagonal matrix such that:

+ +

$$U = diag[(-1)^{f(0)}, \dots,(-1)^{f(2^n-1)}] $$

+ +

At this point, I don't see why bother with this; since to arrive at the answer using adiabatic quantum computation I need to construct a unitary in such a way that I will already have the answer if $f$ is balanced or constant. Am I overlooking anything?

+ +
+ +

Trying to workout an example, setting $n = 1$ and making $f(x) = 1$ (constant 1).

+ +

$$H(0) = w|-\rangle\langle-| = w\pmatrix{1 & -1 \\ -1 & 1}$$

+ +

I will set $w = 1$ to get it out of the way. Then,

+ +

$$U = \pmatrix{-1 & 0 \\ 0 & -1} $$ +$$H(1) = UH(0)U^\dagger = \pmatrix{-1 & 0 \\ 0 & -1}\pmatrix{1 & -1 \\ -1 & 1}\pmatrix{-1 & 0 \\ 0 & -1}$$ +$$H(1) = \pmatrix{1 & -1 \\ -1 & 1}$$

+ +

Meaning that the ground state of $H(1)$ is $|+\rangle$.

+ +

If now I do the function $f(x) = x$, then +$$U = \pmatrix{1 & 0 \\ 0 & -1} $$

+ +

and

+ +

$$H(1) = \pmatrix{1 & 1 \\ 1 & 1}$$

+ +

which, I suppose, has ground state $|-\rangle$. And with this we can differentiate between a constant and a balanced function $f$.

+",5570,,45,,5/15/2019 15:45,5/15/2019 15:45,How to understand Deutsch-Jozsa algorithm from an adiabatic perspective?,,1,0,,,,CC BY-SA 4.0 +5219,2,,5176,1/17/2019 16:50,,4,,"

There are multiple factors that affect an embedding's performance, including what Davide mentions. Depending on your background, the following interpretation of Davide's answer might be easier for you to understand:

+ +
    +
  • Early in the anneal, the Ising (classical/user-input/final) Hamiltonian has no effect, which means that two spins in a chain are not compelled to agree.

  • +
  • As the anneal progresses, the chain couplings become increasingly impactful... so do the other Ising terms (h's and J's).

  • +
  • You want the chain terms to become important just before the other Ising terms become important. This is a fine balance that can be influenced by the strength of the chains (relative to the other terms), and by anneal offsets, which can make some qubits anneal slightly in advance of others. This D-Wave whitepaper shows an example where anneal offsets can be effective.

  • +
+ +

More generally I would start ""debugging"" an embedding by answering, in order, the following questions:

+ +
    +
  • Are one or more chains frequently (or almost always) broken in the output? If a chain frequently comes out as partly up and partly down, it suggests that one or all of the couplings in that chain need to be stronger.

  • +
  • If you find multiple embeddings of the same problem (heuristically using sapiFindEmbedding or similar), do they all ""fail"" in the same way?

  • +
  • Does your embedding have some chains that are very large compared to others? If so, the larger chains will have slower dynamics (they will be ""heavier"") and perhaps should be adjusted with anneal offsets as described in the link.

  • +
+ +

Note that if your output (without postprocessing) doesn't have any broken chains, it may suggest that your chains are too strong. This means that the non-chain terms will be very small, and therefore the problem will be sensitive to noise and will have a high effective temperature, which is bad.

+ +

Good luck!

+",4920,,,,,1/17/2019 16:50,,,,0,,,,CC BY-SA 4.0 +5220,2,,5218,1/18/2019 7:36,,2,,"
+

How can I calculate the ground state of $H(0)$?

+
+ +

The ground state means the eigenvector with lowest eigenvalue. Take your given example, +$$ +H(1)=\left(\begin{array}{cc} 1 & 1 \\ 1 & 1 \end{array}\right). +$$ +You solve $\text{det}(H(1)-\lambda\mathbb{I})=0$ to find the eigenvalues. In this case, $\lambda=0,2$. So you're interested in the smallest eigenvalue, 0. So, we solve for $H(1)|\lambda\rangle=0$, which you'll find is satisfied for the state $|-\rangle=(|0\rangle-|1\rangle)/\sqrt{2}$.

+ +

To find the ground state of $H(0)$ in its general form, the easiest way is just to recognise what's going on. If I apply +$$ +H(0)|+\rangle^{\otimes n}=0. +$$ +So, this is an eigenvector of 0 eigenvalue. Whenever I change a $|+\rangle$ into a $|-\rangle$, the eigenvector relation is still satisfied, but the eigenvalue increases by $w$ each time. So there is an energy penalty of $w$ for having a $|-\rangle$ state. In this way, we can construct a complete basis, and find all the eigenvalues: $kw$, repeated $\binom{n}{k}$ times for $k=0,1,\ldots ,n$.

+ +
+

At this point, I don't see why bother with this; since to arrive at the answer using adiabatic quantum computation I need to construct a unitary in such a way that I will already have the answer if f is balanced or constant.

+
+ +

Well, Deutsch-Jozsa is very much defined in terms of an oracle, i.e. the unitary is something that is given directly to you, and you can't look inside it to see what's happening. You do not construct the unitary $U$. The question then is how long your algorithm needs to run for in order to find out if the function is constant or balanced. This is where the adiabatic part comes in; using the oracle in an adiabatic way, you can calculate how long it takes, and find it's a constant time.

+",1837,,,,,1/18/2019 7:36,,,,0,,,,CC BY-SA 4.0 +5221,1,,,1/18/2019 14:18,,3,81,"

Define the recursive sequence $x_{i+1} = x_0 x_i \mod 21$, where $x_0 = 2$, and hence $x_1 = x_0 x_0 = 4$, and so on, generating the sequence $[2, 4, 8, 16, 11, 1]$, where the brackets mean it cycles on forever. This sequence has 6 elements so $3$ q-bits suffice to put each of these numbers in a superposition. My objective is to get $\newcommand{\qr}[1]{\left|#1\right\rangle}$

+ +

$$\qr2 + \qr4 + \qr8 + \qr{16} + \qr{11} + \qr1.$$

+ +

Being a superposition, I think I'll have to fill it with other terms until I complete a power of 2, so zeros would be fine:

+ +

$$\qr2 + \qr4 + \qr8 + \qr{16} + \qr{11} + \qr1 + \qr0 + \qr0.$$

+ +

How can I prepare such state from, say, $\qr{00000}$?

+",1589,,1867,,1/24/2019 18:45,1/24/2019 18:45,How to prepare a superposed state where its terms are elements of a sequence?,,1,5,,,,CC BY-SA 4.0 +5222,1,5224,,1/18/2019 15:21,,10,1739,"

In implementing a quantum subroutine it is important to uncompute temporary registers after use, to ensure the output state of the subroutine is not entangled with them (which would affect its behaviour).

+ +

Why is it necessary to perform this through uncomputation rather than simply setting temporary registers to zero afterwards?

+",5174,,,,,1/19/2019 23:38,Why do we have to uncompute rather than simply set registers to zero?,,3,1,,,,CC BY-SA 4.0 +5223,2,,5221,1/18/2019 16:02,,4,,"

Do you want to know about this specific sequence, or more generally?

+ +

Specifically, this is essentially a W state, about which there have been several questions in the past. You just need one extra term (effectively $|32\rangle$) that you could later change into $|11\rangle$, leaving the others untouched.

+ +

Let's say I've got a state +$$ +(|1\rangle+|2\rangle+|4\rangle+|8\rangle+|16\rangle+|32\rangle)/\sqrt{6} +$$ +This is the same as +$$ +(|000001\rangle+|000010\rangle+|000100\rangle+|001000\rangle+|010000\rangle+|100000\rangle)/\sqrt{6}. +$$ +We do controlled-nots, controlled off the first qubit targetting qubits 3, 5 and 6. This changes $|100000\rangle$ into $|101011\rangle$. Now we do a controlled-controlled-not controlled by qubits 3 and 5, targetting qubit 1. This changes the $|101011\rangle$ into $|001011\rangle$ without changing anything else. Thus, we're left with +$$ +|0\rangle(|10000\rangle+|01000\rangle+|00100\rangle+|00010\rangle+|00001\rangle+|01011\rangle)/\sqrt{6}, +$$ +which is the state you want.

+ +

More generally, meaning a state of the form +$$ +\frac{1}{\sqrt{r}} \sum_{i=0}^{r-1}|a^i\text{ mod }N\rangle, +$$ +I advise looking at the order finding algorithm for quantum computers. You're basically talking about preparing one of the eigenvectors of the order finding unitary. While you would like to be able to prepare such a state in order to find the order $r$, we don't know how to do that without first finding $r$. But, when you've run the order finding algorithm, and it randomly outputs a value of $s/r$, the state of the second register is in the eigenvector related to $s/r$. +$$ +\frac{1}{\sqrt{r}} \sum_{k=0}^{r-1}e^{-2\pi i k s/r}|a^k\text{ mod }N\rangle +$$ +Once you've got that, and you know the value $s/r$, you should easily be able to compensate for the phases.

+",1837,,1837,,1/21/2019 8:24,1/21/2019 8:24,,,,2,,,,CC BY-SA 4.0 +5224,2,,5222,1/18/2019 16:05,,2,,"

Because all operations you carry out (besides measurement) need to be unitary and this one would not.

+",4127,,,,,1/18/2019 16:05,,,,5,,,,CC BY-SA 4.0 +5225,2,,5222,1/18/2019 17:52,,4,,"

Uncomputing temporary registers seem to me to be the most efficient way to set temporary registers back to zero.

+ +

You can't measure these and classically flip them

+ +
    +
  1. because a measurement of $1$ doesn't necessarily mean the state of the temporary register is $|1\rangle$

  2. +
  3. because measuring would cause entangled qubits to collapse into a corresponding state so that would defeat the purpose of uncomputing temporary registers that you mentioned in your question.

  4. +
+ +

And somehow implementing a circuit that detected a temporary register's state moved it back to 0 would be much more difficult than simply uncomputing the temporary register.

+",4943,,26,,1/18/2019 21:36,1/18/2019 21:36,,,,0,,,,CC BY-SA 4.0 +5226,1,5229,,1/19/2019 10:32,,5,554,"

I'm a bit familiar with the concept of stochastic computing, where numbers are stored in large bit streams called ""Stochastic Numbers"", which represent numbers in the domain $[0,1]$ typically.

+ +

The Wikipedia article on stochastic computing summarizes all basic concepts and history behind it.

+ +

Does any of the concepts of stochastic computing relate to quantum computing? Or are they two very different ways of treating calculations?

+",5583,,26,,1/19/2019 11:27,1/19/2019 19:57,Does quantum computing relate to stochastic computing in any way?,,2,0,,,,CC BY-SA 4.0 +5227,2,,5118,1/19/2019 14:52,,2,,"

In the CHSH game we have 2 players Alice and Bob. Can we proof in the form of a noncommunication pair of TMs which takes as input independant random bits x and y plus an arbitrary shared bitstring, that ALice and Bob win the CHSH game with probability greater than 75%.

+ +

We ask Alice and Bob questions x and y with probability p(xy) they give answers a and b. The rules of the game are denoted using $V(a,b|x,y)$wich takes the value ""1"" if a and b are the winning answers. The probability that Alice and Bob win the game is maximized over all possible strategies +$ P_{win} = max_{strategy} \sum_{x,y} p(x,y) | \sum_{a,b} V(a,b|x,y) p(a,b|x,y). $ +Where $p(a,b|x,y) $ is the probability that Alice and Bob produce answers a and b given x and y.

+ +

+ +

In terms of probabilities there is an distinction between a classical deterministic prob and a classical shared ramdoness probability. A deterministic classical stratey is given by the functions $f_{A}(x) = a$ and $f_{B}(y) = b $ that take the questions x and y.

+ +

If we have shared randomness another string r is used with a sharing probability $p(r)$. Classicaly Alice and Bob can only apply functions $a = f_{A}(x,r)$ and $b = f_{b}(y,r)$ +This gives $ p(a,b|x,y) = \sum_{x,y}^{} (p(r)) p(a,b|x,y,r) $ +In this case the pobability of winning the game is

+ +

$ P_{win} = max_{strategy} \sum_{x,y} p(x,y) \sum_{a,b} V(a,b|x,y)\sum_{r}p(r)p(a,b|x,y,r)$. In this case of shared randomnes we have an extra term with the string r. Alice and Bob can fix the best possible r given a deterministic strategy for a and b. +So it is possible to run an algorithm on a Turing machine using a string r according to the test setup in the picture. Problem how do we find the best possible string r?

+ +

Another way to look at it is to say that the string r as a shared randomness is referred to as a hidden variabele in physics. So the Hidden Variabele Theory is equivalent to using a string r in a turing machine. Therefore we might just as well make use of a proof of the CHSH inequality. Furthermore we can compare an arbitrary HVT (dashed line ) and QM results for a photonic experiment. +

+ +

A compact proof of the CHSH inequality based on a hidden variabele can be found in the article Entangled photons, nonlocality and Bell inequalities in the undergraduate laboratory.

+",1773,,1773,,1/19/2019 20:51,1/19/2019 20:51,,,,0,,,,CC BY-SA 4.0 +5228,2,,5226,1/19/2019 19:46,,4,,"

The two are very different ways of treating calculations. You've probably heard that qbits ""can be both 0 and 1 at the same time"" or similar; this isn't accomplished by assigning them a value in the domain $[0, 1]$, but rather a linear combination of $0$ and $1$:

+ +

$\alpha|0\rangle + \beta|1\rangle = \begin{bmatrix} \alpha \\ \beta \end{bmatrix}$

+ +

This is called a state vector, and quantum operations take the form of matrices multiplying this state vector.

+ +

If you're interested in learning more, I have created a video on quantum computing you might find instructive here.

+",4153,,,,,1/19/2019 19:46,,,,0,,,,CC BY-SA 4.0 +5229,2,,5226,1/19/2019 19:57,,6,,"

Scott Aaronson relates quantum and stochastic computation as follows: quantum computation is stochastic computation, but using the 2-norm instead of the 1-norm as the conserved quantity.

+ +

In both paradigms you form vectors of weighted states, and operate on those vectors using matrices. So they have many similarities. But in stochastic computation the weights have to add up to 1 (as probabilities do) whereas for quantum computation the squares of the weights have to add up to 1 (as amplitudes do).

+",119,,,,,1/19/2019 19:57,,,,1,,,,CC BY-SA 4.0 +5230,2,,1192,1/19/2019 20:33,,4,,"

You can't ignore the constant factors when comparing quantum computation to classical computation. They're too large.

+ +

For example, here is an image from some slides I presented last year:

+ +

+ +

The things along the bottom are magic state factories. They have a footprint of 150K physical qubits. Since the AND gate uses 150K qubits for 0.6 milliseconds, we surmise that the spacetime volume of a quantum AND gate is on the order of 90 qubit seconds.

+ +

One of my coworkers' goals is to use 1 cpu per 100 qubits when performing error correction. So we might say that 90 qubit seconds requires 0.9 cpu seconds of work. We've made the quantum constructions several times more efficient since the above image was made, so let's call it 0.1 cpu seconds instead.

+ +

(There are many assumptions that go into these estimates. What kind of architecture, error rates, etc. I'm only trying to convey an order of magnitude idea.)

+ +

It takes 63 AND gates to perform a 64 bit addition. 63*0.1 cpu seconds ~= 6 cpu seconds. Quantumly, a 64 bit addition costs more than a CPU second. Classically, a 64 bit addition costs less than a CPU nanosecond. There's easily a constant factor difference of 10 billion here. If you compare against a parallel classical machine, such as a GPU, the numbers get even worse. You can't ignore constant factors with that many digits.

+ +

For example, consider Grover's algorithm, which allows us to search for a satisfying input to a function in sqrt(N) evaluations of the function instead of N evaluations. Add in the constant factor of 10 billion, and solve for where the quantum computer starts to require fewer evaluations:

+ +

$$\begin{align} +N &> 10^{10} \sqrt{N}\\ +N &> 10^{20} +\end{align}$$

+ +

Grover's algorithm can't parallelize the evaluations, and the evaluations require at least one AND gate, so basically you only start seeing CPU time benefits when the search is taking tens of millions of years.

+ +

Unless we make the constant factors a lot better, no one is ever going to use Grover search for anything useful. Right now the quantum-vs-classical situation is exponential advantage or bust.

+",119,,119,,1/19/2019 21:57,1/19/2019 21:57,,,,0,,,,CC BY-SA 4.0 +5231,2,,5216,1/19/2019 23:03,,2,,"

First, note that for functions that do not change their value upon permutation of their inputs—or in other words, functions that only depend on the Hamming weight $|x|$ of the input—it is known that the polynomial method tightly characterizes the query complexity, see Beals et al. In particular, this can be applied to the majority function $MAJ(x_1, \ldots, x_n)$ to obtain a tight $\Theta(n)$ bound of the query complexity.

+ +

As you asked specifically for a derivation of the $\Omega(n)$ lower bound via the adversary method, one can proceed as follows, following Ambainis’ initial paper about the adversary method (note that ever since, there were numerous further developments regarding the adversary method, see for instance Belov’s thesis and the references cited therein):

+ +

Theorem 2 in Ambainis' paper asserts that a lower bound can be shown if one can identify a hard distribution for the function $f$. Technically, this means to find two sets of inputs $X, Y\subseteq \{0,1\}^n$ that lead to different evaluations of the function (i.e., $f(x)\not= f(y)$ for all $x\in X$ and $y \in Y$) and a relation $R \subset X \times Y$ (which makes sure that the two distributions are close in a suitable sense), such that the following hold:

+ +
    +
  • For every $x\in X$, there are at least $m$ different $y \in Y$ such that $(x,y) \in R$,
  • +
  • for every $y \in Y$, there are at least $m’$ different $x \in X$ such that $(x,y) \in R$,
  • +
  • for every $x \in X$ and $i \in \{1, \ldots, n\}$, there are at most $\ell$ different $y\in Y$ such that $(x,y)\in R$ and $x_i\not= y_i$, and
  • +
  • for every $y \in Y$ and $i \in \{1, \ldots, n\}$, there are at most $\ell’$ different $x\in X$ such that $(x,y)\in R$ and $x_i\not= y_i$.
  • +
+ +

If all this holds, then the query complexity of $f$ can be lower bounded by $\Omega\left(\sqrt{\frac{m m’}{\ell \ell’}}\right)$.

+ +

For $MAJ$, one can define an adversary as follows: let $X = \{x : |x|=n/2\}$, $Y = \{y : |y|=n/2+1\}$, and define the relation as $R = \{ (x,y) : |x \oplus y|=1\}$. Then clearly each fixed $x$ can be extended in at least $n/2$ ways to obtain an element in $Y$ that is related to $x$, i.e., $m\geq n/2$. Similarly, $m’ \geq n/2$. For a fixed $x$, and a fixed location $i\in \{1, \ldots, n\}$ there can be at most one bit-vector $y$ that has Hamming distance $1$ from $x$ (namely, this happens precisely when $i$ is not in the support of $x$), so $\ell=1$. By a similar argument, $\ell’=1$. Putting is all together yields the lower bound of $\Omega\left(\sqrt{\frac{n/2 \cdot n/2}{1 \cdot 1}}\right) = \Omega(n)$.

+",1828,,1828,,1/20/2019 1:09,1/20/2019 1:09,,,,0,,,,CC BY-SA 4.0 +5232,2,,5222,1/19/2019 23:38,,7,,"

While it is definitely possible to reset registers after using them (namely, by simply measuring them) the issue is that doing so can potentially destroy interference that one might want to achieve by subsequent computations with the quantum data. Unfortunately, this is the most common case encountered in quantum algorithms, such as e.g. the computation of arithmetic in Shor's factoring and dlog algorithms or the computation of a Boolean predicate in case of Grover's search algorithm.

+ +

Concretely, assume that we have two registers, a data register $A$, an output register $B$, and an ancilla register $C$ and that half-way through the computation we arrived at an entangled state $\sum_{x} \alpha_{x} |x\rangle |f(x)\rangle |g(x)\rangle$, where the inputs are held in $A$, the function values $f(x)$ are computed into $B$, and the values $g(x)$ are results of some intermediate computations that is stored in the scratch register $C$.

+ +

If we now, instead of uncomputing the register $C$ so that it holds $|0\rangle$ (or some other state that is unentangled with registers $A$ and $B$), we decide to reset the register $C$, this will have the following detrimental effect: we will measure (at random) some value $c_0$ and the state will collapse to the superposition of all $x$ that are consistent with this measured value, so that the state will become (up to normalization):

+ +

$$ \sum_{x: g(x) = c_0} \alpha_x |x\rangle |f(x)\rangle. $$

+ +

Note that this can be vastly different from the state $\sum_x \alpha_x |x\rangle |f(x)\rangle$ that we really wanted (and actually only for constant functions $g$ yields the correct result). Indeed, if $g$ is a permutation, only a single $x$ will survive from the initial superposition! Hence, temporary/scratch registers have to be uncomputed if we want to do subsequent computations with the data in the other registers.

+",1828,,,,,1/19/2019 23:38,,,,5,,,,CC BY-SA 4.0 +5233,2,,4437,1/20/2019 0:08,,3,,"

The question is whether taking the Fourier transform $\operatorname{QFT}|gH\rangle$ followed by sampling allows to efficiently recover generators of the hidden subgroup $H\leq G$. While the problem is wide open for non-abelian groups (see this paper for a discussion of the limitations of the Fourier sampling method for instances in case of $G=S_n$, $G=PSL(2,\mathbb{F}_q)$ and other non-abelian groups), for abelian groups $G$ the PO is correct that Fourier sampling solves the abelian hidden subgroup problem.

+ +

The basic idea is to perform several measurements $\operatorname{QFT}|gH\rangle$ and to note that a result $z$ can be sampled if and only if $z\in H^\perp$ holds, where $H^\perp = \{ g \in G : \chi_g(h)=1 \; \forall h \in H\}$. Here we (non-canonically) identified the characters $\chi \in \hat{G}$ with the elements of $G$ (which is possible if and only if $G$ is abelian). One can prove that doing this procedure $\log^2(|G|)$ times will with constant probability uniquely characterize $H$ from the measurement results $z_1, z_2, \ldots$.

+ +

What is more, if the group $G$ is explicitly known (i.e., one knows an isomorphism to a direct product of cyclic groups), then one can efficiently compute $H$ from $H^\perp$ using classical post-processing which essentially is linear algebra. A good reference for this is Brassard and Hoyer. If the group $G$ is abelian, but the structure is not known, then one can first discover the structure of $G$ and then find $H$ in a subsequent step. This was described in Cheung and Mosca. However, all this assumes at a minimum that $G$ has the structure of a black-box group with unique encoding. As shown by Ivanyos et al, even in case of non-unique encodings, one can recover the hidden subgroup, provided certain additional assumptions hold such as the existence of oracles for identity and membership test.

+",1828,,26,,1/20/2019 9:34,1/20/2019 9:34,,,,0,,,,CC BY-SA 4.0 +5234,1,5236,,1/20/2019 3:17,,4,744,"

I am a physics and math undergraduate and I want to learn quantum computing mainly I want to try doing research. Are there any resources online courses or books or websites? I not familiar with the concepts of computing. In particular, it would be really helpful if the books are for physics people.

+",,user5585,26,,1/20/2019 8:03,1/23/2019 10:36,Resources for learning quantum computing from an undergraduate physics perspective,,2,1,,,,CC BY-SA 4.0 +5235,2,,5234,1/20/2019 4:32,,1,,"

Some answers have already been proposed in this previous question and in this one. Nielsen and Chuang's book is the reference but may introduce much and very fast. But you have many introduction PDFs like An Introduction to Quantum Computing (Michal Charemza). I would recommend crossing different sources to learn even material for non-physicists, like An Introduction to Quantum Computing for Non-Physicists (Rieffel & Polak). Look at quantum development kits like Q#, Qiskit, pyQuil and follow their docs and getting started.

+",4127,,26,,1/20/2019 8:55,1/20/2019 8:55,,,,0,,,,CC BY-SA 4.0 +5236,2,,5234,1/20/2019 8:46,,2,,"

I had already mentioned some beginner level resources in this answer to Does a study guide exist that starts from a “purely CS background” and advances towards “making a new quantum programming language”? I'll list some other good resources others which I have found since then, which I believe will be more suitable for physics undergrads.

+ +
    +
  1. University of Waterloo's USEQIP 2011-12 lectures are now available on YouTube. Ideally, you should follow them in sequential order and if you devote full-time you should be able to grasp the basics of quantum computing in around 2 weeks. The lectures are extremely well structured and specifically aimed at pre-final year undergrads. They cover both theoretical and experimental topics like linear algebra, quantum algorithms, practical decoherence modeling, error correction, quantum dots, quantum key distribution, spin-polarized transport, superconducting qubits, quantum foundations, and NMR quantum computing. Generally, it's quite rare to find undergrad-level lectures by the leading quantum computing scientists like Michele Mosca, Andrew Childs, and Raymond Laflamme themselves. So you're lucky!
  2. +
  3. John Watrous' 2006 lecture notes are a great resource to accompany Vazirani's lectures and notes. You can think of this as an abridged undergrad-version of Nielsen and Chuang. It covers the basics of quantum algorithms, quantum information, cryptography, and error correction. This will be more useful if you're bent towards the computer science side of quantum computing.

  4. +
  5. John Watrous' 2011 lecture notes provide a very thorough exposition of quantum information theory (some of the topics discussed there are not even available in Nielsen and Chuang). You may go ahead with it once you're done with the resources mentioned in points 1 and 2, and find yourself sufficiently interested in quantum information theory. I've personally only been able to go through the first couple of chapters so far, as it's quite dense. Not recommended for beginners but definitely useful for the advanced students.

  6. +
  7. To get a basic idea of quantum complexity theory, go through Quantum Complexity Theory (Part 1) - CSSQI 2012 and Quantum Complexity Theory (Part 2) - CSSQI 2012. I believe complexity theory is a topic which very few physics students have a solid grounding in. But it's extremely helpful to have at least an undergrad level knowledge of computational complexity theory if you wish to pursue higher studies in quantum computing, even if you choose the physicist's path.

  8. +
  9. The CSSQI 2012 playlist also has topics like topological quantum computing and quantum control theory. I haven't watched all of them yet, but from what I've seen, they seem to be very high quality lectures, aimed at beginners.

  10. +
+",26,,26,,1/23/2019 10:36,1/23/2019 10:36,,,,0,,,,CC BY-SA 4.0 +5237,1,,,1/20/2019 13:21,,1,172,"

I have created a $16\times 16$ unitary operator using a Hamiltonian by finding its exponential

+ +

$$U=\exp(-iH\delta t)$$

+ +

If I set $\delta t=1$ then I can take this matrix and input it into quirk using the custom gate maker.

+ +

Some gates have the option to rotate wrt time. These are the ""spinning"" gates $Z^t$ etc, which performs the rotation $R_Z(\theta=2\pi t)$

+ +

Is there some way to generalize this spinning to any unitary matrix with a time component?

+ +

I feel there must be a way to do it by adjusting $U$. Perhaps by rotating all qubits by some angle and then applying a modified $U$? But I'm not sure if it's possible since we'd need to do something like $U'|a\rangle=U^a|0\rangle.$

+",5594,James,26,,1/20/2019 20:13,1/21/2019 4:09,Creating a time dependent custom gate in Quirk,,1,0,,,,CC BY-SA 4.0 +5238,2,,5237,1/20/2019 21:45,,1,,"

The only way to make a time-dependent custom gate is to decompose the desired unitary into a circuit using the built-in time-dependent gates (typically $X$, $Y$ or $Z^t$), then make a custom circuit gate using that circuit. (Assuming you're not willing to implement the gate by editing the source code.)

+ +

The reason I didn't add support for e.g. using the variable $t$ in a custom matrix or rotation gate is that I'm worried that storing the equation could result in very unfortunate backward compatibility constraints (e.g. future versions needing to reproduce existing parsing bugs to keep circuit links from breaking or changing behavior). Also, it doesn't play well with the ""ensure unitary"" option.

+",119,,26,,1/21/2019 4:09,1/21/2019 4:09,,,,4,,,,CC BY-SA 4.0 +5239,2,,4893,1/20/2019 22:18,,4,,"

Background - CPT (and $\mathcal{CPT}$) symmetry in QFT

+ +

I think the first step in answering is this is explaining what CPT (also, $\mathcal{CPT}$) symmetry from a quantum computing perspective is not. If this same question on physics SE was asked, I would refer them to chapters 23 and 40 of Srednicki's Quantum Field Theory for the full-blown explanation. However, while that is useful background for understanding the CPT operation from a computational perspective, the important point is that the Parity $\left(\mathcal P\right)$ and Time $\left(\mathcal T\right)$ reversal transformations are operations that act on the spatial and temporal co-ordinates, giving unitary Parity $\left(P\right)$ and Time $\left(T\right)$ operators on the field, as well as additional Charge conjugation operations $\left(\mathcal C\text{ and }C\right)$ and so, may change depending on the particle being looked at/used. Implementing these transformations on a quantum computer would then mean that different 'implementations' of computer could act differently under the $\mathcal C,\, \mathcal P$ and $\mathcal T$ operations, which is not so good.

+ +

$\mathcal{PT}$-symmetric Hamiltonians

+ +

However, what this does lead to is the realisation that Hamiltonians can be non-Hermitian, yet have real eigenvalues due to having $\mathcal{PT}$ symmetry (of the 'reversing the spatial and temporal co-ordinates' sense) as discovered by Bender and Boettcher. This symmetry can be broken (the Hamiltonian has real eigenvalues) or unbroken (the Hamiltonian has complex eigenvalues), with a phase transition (often known as the exceptional point) in between. This allows for the definition of $\mathcal P\text{ and }\mathcal T$ ($\mathcal T$ is complex conjugation), as well as the $\mathcal{PT}$ inner product: for a state $\psi\left(x\right)$ and Hamiltonian $H$ with eigenstates $\phi_n\left(x\right)$,

+ +

\begin{align} +\mathcal P\left(x, y\right) &= \delta\left(x+y\right) \\ +&= \sum_n\left(-1\right)^n\phi_n\left(x\right)\phi_n\left(-y\right) \\ +\mathcal{PT}\psi\left(x\right) &= \psi^{\mathcal{PT}}\left(x\right) \\ +&= \int dy\, \mathcal P\left(x, y\right)\mathcal T \psi\left(y\right) = \psi^*\left(-x\right) \\ +\left\langle\psi|\chi\right\rangle^{\mathcal{PT}} &= \int dx\,\psi^{\mathcal{PT}}\left(x\right)\chi\left(x\right) +\end{align}

+ +

As per Bender, Brody and Jones, in the unbroken regime, an operator $\mathcal C$ (resembling the charge conjugation operator in QFT mentioned above) can be defined, as well as the $\mathcal{CPT}$ inner product $\left\langle\psi|\chi\right\rangle^{\mathcal{CPT}}$:

+ +

Eigenvectors of the $\mathcal{CPT}$ operator

+ +

In the unbroken phase, the eigenvalues of the Hamiltonian are real. As the parity reversal operator has no effect on a number and the time reversal operator is complex conjugation, we have that $\mathcal{PT}E_n\phi_n = E_n\mathcal{PT}\phi_n$ and so, the eigenstates of the Hamiltonian are simultaneously eigenstates of the $\mathcal{PT}$ operator (it's assumed that the eigenvectors are non-degenerate for simplicity, although this breaks down at the exceptional point).

+ +

As shown by Weigert, we also have the completeness relation $\sum_n\left(-1\right)^n\phi_n\left(x\right)\phi_n\left(y\right) = \delta\left(x-y\right)$.

+ +

We also have that $\left(\mathcal{PT}\right)^2\phi_n\left(x\right) = \mathcal{PT}\phi^*_n\left(-x\right) = \phi_n\left(x\right)$, giving eigenvalues $e^{-i\omega_n}$ as $\mathcal Te^{-i\omega_n} = e^{i\omega_n}\mathcal T$. This eigenvalue is absorbed into the definition of the eigenvector so that $\phi_n\left(x\right)\rightarrow e^{-\frac{1}{2}i\omega_n}\phi_n\left(x\right)$ and now $\mathcal{PT}\phi_n\left(x\right) = \phi_n\left(x\right)$.

+ +

This gives that $\left\langle\phi_n|\phi_m\right\rangle^{\mathcal{PT}} = \int dx\,\phi_n\left(x\right)\phi_m\left(x\right)$. However, this is not necesarily positive, so we define an additional operator, $\mathcal C$, alongside the $\mathcal{CPT}$ inner product, in order to satisfy the completeness relation:

+ +

\begin{align}\mathcal C\left(x, y\right) &= \sum_{n=0}^\infty \phi_n\left(x\right)\phi_n\left(y\right) \\ +\mathcal C\phi_n\left(x\right) &= \left(-1\right)^n\phi_n\left(x\right) \\ +\psi^{\mathcal{CPT}}\left(x\right) &= \int dy\, \mathcal C\left(x, y\right)\psi^*\left(-y\right) \\ +\left\langle\psi|\chi\right\rangle^{\mathcal{CPT}} &= \int dx\,\psi^{\mathcal{CPT}}\left(x\right)\chi\left(x\right) +\end{align}

+ +

Computationally, discrete Hamiltonians/systems are more commonly used than continuous ones and helpfully, the above applies in the same/equivalent way to continuous systems (swapping continuous for discrete where applicable) as above.

+ +

The eigenvalues of the $\mathcal{CPT}$ operator

+ +

Having defined parity and time reversal operators and a new operator that looks like charge conjugation in order to satisfy the completeness relation, we have the answer of what the eigenvalue of the $\mathcal{CPT}$ operator is already written down: $$\mathcal{CPT}\phi_n\left(x\right) = \left(-1\right)^n\phi_n\left(x\right),$$ where $\phi_n$ is an eigenstate of both the $\mathcal{CPT}$ operator and some $\mathcal{PT}$-symmetric Hamiltonian.

+ +

But what do these eigenvalues mean?

+ +
    +
  • As per the linked answer, it's analogous to the result in QFT where the eigenstates of the system are invariant under $\mathcal{CPT}$ reversal

  • +
  • The Hamiltonian is in the unbroken regime (that is, it has real eigenvalues)

  • +
  • As such, the eigenbasis is complete

  • +
  • the eigenvectors corresponding to the $-1$ eigenvalues have a negative $\mathcal{PT}$ inner product

  • +
  • Which feels similar to the notions of positive and negative charge of e.g. positrons and electrons, only, it's not that

  • +
  • Not much else, really

  • +
+",23,,23,,1/21/2019 14:35,1/21/2019 14:35,,,,2,,,,CC BY-SA 4.0 +5240,1,,,1/21/2019 11:29,,2,98,"

I know I must define $U_f$, the unitary operator, on the computational basis. But what's my computational basis here?

+",1589,,26,,1/21/2019 21:18,1/21/2019 21:18,What's my computational basis if I want to define a unitary operator that implements a function such as $f(i) = 2^{i+1} \text{mod 21}$?,,2,0,,,,CC BY-SA 4.0 +5241,2,,5240,1/21/2019 12:58,,2,,"

First, I would say you need to specify registers, their size, their role and what will they will contain.

+ +

It depends on the $i$ you want to apply this function, which is to be represented as a bitstring (in this case, I guess an unsigned integer representation) that will be one of the computational basis. It can be a particular one or just a superposition. You need to define the registers (the one containing $i$, garbage register containing intermediary results and the one containing the result). +Mathematically, your operator will have the following effect if you uncompute intermediary results : +$$ U_f | i \rangle | 0 \rangle_g | 0 \rangle_f = | i \rangle | 0 \rangle_g | f(i) \rangle_f $$

+ +

Secondly, to define this unitary, you need the sequence of unitary operations that will achieve your goal. It is recommended to not create a unitary operator by specifying the matrix.

+",4127,,4127,,1/21/2019 14:41,1/21/2019 14:41,,,,0,,,,CC BY-SA 4.0 +5242,2,,5240,1/21/2019 14:26,,2,,"

Presumably you want to work with qubits? So the usual computation basis applies: $|0\rangle$ and $|1\rangle$ for a single qubit, and a composite basis of $|x\rangle$ for $x\in\{0,1\}^n$ when composing $n$ qubits.

+ +

What I guess you're asking is how you translate your problem onto qubits. For that, you need to make the decimal values correspond to particular bit values. The conventional way of doing this is using the binary string $x$ like a binary number, which corresponds to a decimal value. There are a number of different numbering conventions you can pick from but, for example, you might have +$$ +x=x_0x_1x_2\ldots x_{n-1}, +$$ +meaning that the corresponding decimal value is +$$ +x_{n-1}+2x_{n-2}+4x_{n-3}+\ldots+2^{n-2}x_1+2^{n-1}x_0. +$$ +$n$ bits lets you represent any decimal number 0 to $2^n-1$.

+",1837,,,,,1/21/2019 14:26,,,,0,,,,CC BY-SA 4.0 +5245,1,,,1/22/2019 16:25,,5,481,"

In quantum information theory, classical-quantum channels are considered to be channels whose input is the realizations $x\in\mathcal{X}$ of a classical random variable to a quantum state $\rho_x^B$, that is

+ +

$$W:x\rightarrow\rho_x^B$$

+ +

where each quantum state $\rho_x$ is described by a positive semi-definite operator with unit trace. This kind of channels are useful due to the fact that they arise in the reality, such as an optic fiber communication link, and so codes taking into account the impact of quantum mechanics can be constructed to make the link perform better.

+ +

I was wondering if someone can give reference about more examples of real life communication scenarios where this kind of channels can be useful to describe them apart from the optical link example that is the most typical one.

+",2371,,55,,12/4/2021 12:42,12/4/2021 12:42,Real-life examples of classical-quantum channels,,0,6,,,,CC BY-SA 4.0 +5246,1,5247,,1/22/2019 22:53,,6,673,"

In Circuit composition and entangled states section of Wikipedia's article on Quantum logic gates the final result of a combined Hadamard gate and identity gate on $|\Phi^{+}\rangle$ state is:

+ +

$ M \frac{|00\rangle + |11\rangle}{\sqrt{2}} = \frac{1}{2} \begin{bmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1\end{bmatrix} \begin{bmatrix}1 \\ 0 \\ 0 \\ 1\end{bmatrix} = \frac{1}{2} \begin{bmatrix} 1 \\ 1 \\ 1 \\ -1 \end{bmatrix} = \frac{|00\rangle + |01\rangle + |10\rangle - |11\rangle}{2}$

+ +

How exactly does the $\begin{bmatrix} 1 \\ 1 \\ 1 \\ -1 \end{bmatrix}$ translate into $|00\rangle + |01\rangle + |10\rangle - |11\rangle$ states?

+ +

I had no problems translating $|00\rangle$ into $\begin{bmatrix}1 \\ 0 \\ 0 \\ 0\end{bmatrix}$ and $|11\rangle$ into $\begin{bmatrix}0 \\ 0 \\ 0 \\ 1\end{bmatrix}$ but I'm not exactly sure how do you reverse the process in this example.

+",5575,,55,,6/4/2020 15:03,6/4/2020 15:03,How to translate matrix back into Dirac notation?,,2,0,,,,CC BY-SA 4.0 +5247,2,,5246,1/22/2019 23:27,,3,,"

First read about the standard representation of qubit systems of and the basics of bra-ket notation.

+ +
+

I had no problems translating $|00\rangle$ into $\begin{bmatrix}1 & 0 + & 0 & 0\end{bmatrix}^T$ and $|11\rangle$ into $\begin{bmatrix}0 & 0 + & 0 & 1\end{bmatrix}^T$ but I'm not exactly sure how do you reverse + the process in this example.

+
+ +

Cool. Then you should also be able to understand that $|00\rangle + |11\rangle \equiv \begin{bmatrix}1 & 0 & 0 & 0\end{bmatrix}^T + \begin{bmatrix}0 & 0 & 0 & 1\end{bmatrix}^T = \begin{bmatrix}1 & 0 & 0 & 1\end{bmatrix}^T$. Yes? Read on.

+ +
+

How exactly does the $\begin{bmatrix} 1 & 1 & 1 & -1 \end{bmatrix}^T$ + translate into $|00\rangle + |01\rangle + |10\rangle - |11\rangle$ + states?

+
+ +

The standard basis states of a $2$-qubit sytem $|00\rangle,|01\rangle,|10\rangle,|11\rangle$ i.e. standard basis elements of $\Bbb C^2\times \Bbb C^2$ can be mapped to the four $4\times 1$ column vectors $$\begin{bmatrix} 1 & 0 & 0 & 0 \end{bmatrix}^T, \begin{bmatrix} 0 & 1 & 0 & 0 \end{bmatrix}^T,\begin{bmatrix} 0 & 0 & 1 & 0 \end{bmatrix}^T \& \ \begin{bmatrix} 0 & 0 & 0 & 1 \end{bmatrix}^T.$$ This is essentially an isomorphism from $\Bbb C^2\times \Bbb C^2$ to $\Bbb R^4$.

+ +

You say that you already know the following mappings:

+ +

$$\begin{bmatrix} 1 & 0 & 0 & 0 \end{bmatrix}^T \to |00\rangle$$ +$$\begin{bmatrix} 0 & 1 & 0 & 0 \end{bmatrix}^T \to |01\rangle$$ +$$\begin{bmatrix} 0 & 0 & 1 & 0 \end{bmatrix}^T \to |10\rangle$$ +$$\begin{bmatrix} 0 & 0 & 0 & 1 \end{bmatrix}^T \to |11\rangle$$

+ +

Now you simply need to expand the column vector $\begin{bmatrix} 1 & 1 & 1 & -1 \end{bmatrix}^T$ in terms of its basis elements, as follows:

+ +

$$\begin{bmatrix} 1 & 1 & 1 & -1 \end{bmatrix}^T$$ $$= \begin{bmatrix} 1 & 0 & 0 & 0 \end{bmatrix}^T + \begin{bmatrix} 0 & 1 & 0 & 0 \end{bmatrix}^T + \begin{bmatrix} 0 & 0 & 1 & 0 \end{bmatrix}^T + \begin{bmatrix} 0 & 0 & 0 & -1 \end{bmatrix}^T$$

+ +

$$= \begin{bmatrix} 1 & 0 & 0 & 0 \end{bmatrix}^T + \begin{bmatrix} 0 & 1 & 0 & 0 \end{bmatrix}^T + \begin{bmatrix} 0 & 0 & 1 & 0 \end{bmatrix}^T - \begin{bmatrix} 0 & 0 & 0 & 1 \end{bmatrix}^T$$

+ +

$$\implies \begin{bmatrix} 1 & 1 & 1 & -1 \end{bmatrix}^T \equiv |00\rangle + |01\rangle + |10\rangle - |11\rangle$$

+ +

In case you can't understand the last couple of steps, review Matrix addition. And you're done!

+ +

Note: $T$ stands for transpose.

+",26,,26,,1/23/2019 0:07,1/23/2019 0:07,,,,1,,,,CC BY-SA 4.0 +5248,2,,5246,1/22/2019 23:28,,3,,"

This is using vector addition.

+ +

$|00\rangle = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}$

+ +

$|01\rangle = \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}$

+ +

so:

+ +

$|00\rangle + |01\rangle = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \\ 0 \\ 0 \end{bmatrix}$

+ +

by the rules of vector addition. Adding in the other two terms:

+ +

$|00\rangle + |01\rangle + |10\rangle - |11\rangle = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix} + \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix} - \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \\ 1 \\ -1 \end{bmatrix}$

+ +

The reason you might want to write a state vector this way is to see how measurement of one qbit affects the other, for example (see here).

+",4153,,,,,1/22/2019 23:28,,,,0,,,,CC BY-SA 4.0 +5251,1,,,1/23/2019 11:58,,6,187,"

I'm having some trouble understanding quantum interactive proof systems (QIP systems) and the related circuit constructions. Interactive proof systems model these type of situations:

+

+

Interactive proof systems:

+
+

To say a promise problem $\mathcal{A}$ has an interactive proof system +means there exists a verifier meeting two conditions:

+

Completeness: For every input $x\in \mathcal{A}_{\text{yes}}$, there must exist a prover strategy causing the verifier to accept with +high probability.

+

Soundness: For every $x\in \mathcal{A}_{\text{no}}$, all prover strategies must cause the verifier to reject with high probability.

+
+

Classical protocol for graph non-isomorphism:

+

Now let's consider the classical proof system for the graph non-isomorphism problem.

+
+

Input: Two simple undirected graphs $G_0$ and $G_1$.

+

Yes: $G_0$ and $G_1$ are not isomorphic. ($G_0 \ncong G_1$).

+

No: $G_0$ and $G_1$ are isomorphic. ($G_0 \cong G_1$).

+

There is a simple (classical) interactive proof system requiring just +one question and response:

+
    +
  1. The verifier randomly chooses a bit $b\in\{0,1\}$ and a permutation $\sigma \in S_n$, and sends $\mathcal{H}=\sigma(G_b)$ to the prover.

    +
  2. +
  3. Implicitly, the prover is being challenged to identify whether $b=0$ or $b=1$. If the prover guesses correctly, the verifier accepts +(or outputs $1$), otherwise he rejects (or outputs $0$).

    +
  4. +
+
+

Quantum interactive proof systems:

+
+

The quantum interactive proof system works exactly the same as the +classical model except that the prover and verifier may exchange and +process quantum information. General assumptions and notions of +completeness and soundness are unchanged. The model may be formalized +in terms of quantum circuits. An illustration of an interaction:

+
+

+
+

(There are 6 messages in this example.)

+
+

Quantum protocol for graph non-isomorphism?

+

The previous section on quantum interactive proof systems appears rather vague to me. I'm not sure how we can map a classical interactive proof system protocol to an equivalent quantum protocol or construct a quantum circuit for it (as shown in the above example).

+

For simplicity, let's just take the graph non-isomorphism problem. What would be a quantum circuit i.e. a quantum interactive proof system for the graph non-isomorphism problem? How to construct such a quantum circuit, given that we know the corresponding classical proof system protocol?

+
+

Note: All quotes are from John Watrous - Quantum Complexity Theory (Part 2) - CSSQI 2012 (timestamp included).

+",26,,2927,,2/11/2021 0:12,2/11/2021 0:12,How to construct a quantum circuit (QIP system) for the graph non-isomorphism problem?,,1,1,,,,CC BY-SA 4.0 +5252,1,5257,,1/23/2019 12:24,,5,303,"

Group non-membership problem:

+
+

Input: Group elements $g_1,..., g_k$ and $h$ of $G$.

+

Yes: $h \not\in \langle g_1, ..., g_k\rangle$

+

No: $h\in \langle g_1, ..., g_k\rangle$

+

Notation: $\langle g_1, ..., g_k\rangle$ is the subgroup generated by $g_1,...,g_k$.

+
+

Quantum proof:

+
+

The group non-membership problem is in $\mathsf{QMA}$. The idea is +simple: for $\mathcal{H} = \langle g_1, ..., g_k\rangle$, the quantum +proof that $h\in \mathcal{H}$ will be the state

+

$$|\mathcal H\rangle = \frac{1}{\sqrt{|\mathcal H|}}\sum_{a\in + \mathcal{H}} |a\rangle.$$

+
+

Questions:

+

I think the idea of the proof is that if $|h\rangle$ can be shown to be orthogonal to $|\mathcal H\rangle$ then it would imply that that $h \not\in \mathcal{H}$. Otherwise, $h\in \mathcal{H}$. But how exactly are we supposed to assign quantum states (i.e. the $|a\rangle$'s) corresponding to the elements of $\mathcal{H}$? Do we need to assign separate binary strings to all the elements of the group generated by the elements of $G$, such that they can be represented by qubit systems?

+

And if we do assign such binary strings a priori, wouldn't it be much simpler to directly (classically) check whether the string assigned to $h$ matches with any of the strings corresponding to the elements of $\mathcal{H}$? I can't really see the speed advantage here. Could someone clarify this "quantum" proof?

+
+

Note: All quotes are from John Watrous - Quantum Complexity Theory (Part 2) - CSSQI 2012 (timestamp included).

+",26,,-1,,6/18/2020 8:31,5/21/2020 21:50,Quantum proof for the group non-membership problem,,2,0,,,,CC BY-SA 4.0 +5253,1,,,1/23/2019 18:29,,2,931,"

I am currently working on the Grover algorithm and have a few questions.

+ +

In the third step of the algorithm, a phase shift is performed on all states, except $|0\rangle$. My question is, why is the state $|0\rangle$ omitted here?

+ +

And then I would like to know how to show that the unitary operator corresponding to the phase shift in the Grover iteration is $2|0\rangle\langle0|-I$. +I do not know how to show it exactly but my idea was: Lets say in this example: +$2|0\rangle\langle0|-I=\begin{pmatrix}1&0\\0&-1\end{pmatrix}$ +For example, if I apply the $|0\rangle$ and $|1\rangle$ states now, then this results in: +$\begin{pmatrix}1&0\\0&-1\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix}=\begin{pmatrix}1\\0\end{pmatrix}$ +And for the other state $|1\rangle$: +$\begin{pmatrix}1&0\\0&-1\end{pmatrix}\begin{pmatrix}0\\1\end{pmatrix}=\begin{pmatrix}0\\-1\end{pmatrix}$ +This means that on the state $|0\rangle$ the operator does not cause a phase shift, but already on the last one $|1\rangle$. But is that enough to show that +the unitary operator corresponding to the phase shift in the Grover iteration is $2|0\rangle\langle0|-I$?

+ +

I hope that my question is understandable. Thanks for coming answers.

+ +

PS: If anyone still has good sources regarding the Grover algorithm, +I would be very happy if they could send me a link to good documentation, just to dig deeper into the subject matter.

+",4974,,55,,8/9/2020 5:51,8/9/2020 5:51,"In Grover's algorithm, why is the unitary corresponding to the phase shift $2\lvert0\rangle\langle0\rvert-I$?",,2,1,,,,CC BY-SA 4.0 +5254,1,5258,,1/23/2019 19:57,,5,1413,"

I am an undergraduate in Engineering physics, yet to take classes on Quantum mechanics, but none (if I'm not mistaken) on quantum information and quantum algorithms, and I am curious about the subject so I've began reading some things to get the basics on quantum computing (I've been reading Quantum Computing since Democritus by Scott Anderson) so as to move afterwards to Qiskit.

+ +

As for Qiskit learning, I am a bit lost, as it is such a new concept, there are little to none tutorials available online, I only found a collection of Jupyter Notebooks on GitHub (https://github.com/Qiskit/qiskit-tutorials) that, however helpful, are overwelming and seem directed to someone that already needs to learn Qiskit and has a project that needs it. My goal to learn it is to be ready for when I need it, to just add a tool in my toolbox. But to do so I need some advice for I am stuck.

+ +

Also, I would like to ask if anyone knows any online course with verified certificate's related to the subject.

+ +

Thank's in advance.

+",5620,,26,,1/23/2019 20:37,2/9/2022 2:09,Path to learn Qiskit as a tool for the future,,2,2,,,,CC BY-SA 4.0 +5255,2,,5253,1/23/2019 20:15,,4,,"

The third step applies a phase shift to all states except $|0\rangle$ so that steps 2-4 taken together would perform inversion about mean. This is not the only possible choice for these steps; this question has an excellent answer detailing the logic behind this choice and several alternatives.

+ +
+ +

For the second part of the question, both operators are defined on all basis states, albeit in a different manner. You can just check that the effect of both definitions on all basis states is the same; this would mean that the operators are the same.

+",2879,,,,,1/23/2019 20:15,,,,2,,,,CC BY-SA 4.0 +5256,2,,5253,1/24/2019 3:07,,2,,"

The reason behind the choice of $\lvert 0^{\otimes n}\rangle$ as reference state, found in many basic treatments of Grover's algorithm, is best understood by considering the technique that generalizes it: the so-called quantum amplitude amplification.

+ +

The goal of amplitude amplification is a very generic one: given some initial state +$\lvert\psi_{in}\rangle$, we want to transform it into a state that belongs to a given target subspace $\mathcal H_{target}$. +The initial state $\lvert\psi_{in}\rangle$ is assumed to be known, but $\mathcal H_{target}$ needs not be (and can indeed be seen as the goal of the algorithm).

+ +

This is consistent with what you have in the special case of Grover's algorithm with $\lvert\psi_{in}\rangle=\lvert+,\cdots,+\rangle=H^{\otimes n}\lvert 0,\cdots, 0\rangle$ and $\mathcal H_{target}=\mathbb C\lvert \psi_{target}\rangle$ one-dimensional and encoding the state that we are trying to find, and given only indirectly via oracular access to a function $f$ such that $f(x)=1$ iff $x=\lvert\psi_{target}\rangle$, and $f(x)=0$ otherwise.

+ +

In the general amplitude amplification scheme, the way we get from the initial to the target space is via repeated application of a pair of two reflections, $-S_t S_i$, where +$$S_i\equiv 2\lvert \psi_{in}\rangle\!\langle \psi_{in}\rvert-I, \\ +S_t\equiv 2\lvert \psi_{t}\rangle\!\langle \psi_{t}\rvert-I,$$ +and we used the notation $\lvert\psi_t\rangle\simeq\sum_{x\in\mathcal H_{target}}\lvert x\rangle$.

+ +

As it turns out, the product of two reflections amounts to a rotation in state space: +$$\newcommand{\ketbra}[1]{\lvert #1\rangle\!\langle #1\rvert} +R\equiv-S_t S_i=-4\ketbra{\psi_{in}}\psi_{t}\rangle\!\langle \psi_t\rvert ++2(\ketbra{\psi_{in}}+\ketbra{\psi_t})-I,$$ +which brings the initial state $\lvert\psi_{in}\rangle$ closer to the target, as long as the initial overlap is not too big to begin with: +$$R\lvert\psi_{in}\rangle=(1-4\lvert\langle\psi_{in}\rvert\psi_{t}\rangle\rvert^2 )\lvert\psi_{in}\rangle+2\langle\psi_t\rvert\psi_{in}\rangle\lvert\psi_t\rangle,$$ +$$\langle\psi_{in}\rvert R\lvert\psi_{in}\rangle=1-2\lvert\langle\psi_{in}\rvert\psi_{t}\rangle\rvert^2.$$ +You can then verify how repeated applications of $R$ get you closer and closer to the target.

+ +

This shows how there is nothing special about the choice of $\lvert0\rangle$ often used: what is needed is a pair of reflections, one with respect to the initial state and the other with respect to the projector over the target state/space.

+ +
+

Why does the operator corresponding to the phase shift in Grover's algorithm correspond to $2\ketbra0-I$?

+
+ +

Let $\lvert\psi\rangle$ be any state, and define $S\equiv 2\ketbra\psi-I$. Then, +$$S\lvert\psi\rangle=2\lvert\psi\rangle-\lvert\psi\rangle=\lvert\psi\rangle,$$ +while for any $\lvert\phi\rangle$ such that $\langle\phi\rvert\psi\rangle=0$, +$$S\lvert\phi\rangle=-\lvert\phi\rangle.$$

+",55,,,,,1/24/2019 3:07,,,,2,,,,CC BY-SA 4.0 +5257,2,,5252,1/24/2019 4:07,,5,,"
+

I think the idea of the proof is that if $|h\rangle$ can be shown to be orthogonal to $|\mathcal H\rangle$ then it would imply that that $h \not\in \mathcal{H}$. Otherwise, $h\in \mathcal{H}$.

+
+ +

Not really as far as the method shown in the linked video is concerned.

+ +

The algorithm described there uses a controlled-unitary operation of the form +$$\newcommand{\ketbra}[1]{\lvert #1\rangle\!\langle #1\rvert} +\mathcal U_h\equiv\ketbra0\otimes I+\ketbra1\otimes \mathcal M_h,$$ +where $\mathcal M_h$ is the unitary that acts on each state $\lvert g\rangle$ representing the group element $g$ by sending this state into the state that represents the group element $hg$: +$$\mathcal M_h\lvert g\rangle=\lvert hg\rangle.$$ +Then, you can readily verify that $\mathcal M_h\lvert \mathcal H\rangle=\lvert \mathcal H\rangle$ (because $h\mathcal H=\mathcal H$), which I would call the ""main idea"" here. We are exploiting the fact that, given an arbitrary state $h\in G$, +$$h\in\langle g_1,...,g_n\rangle=\mathcal H\Longleftrightarrow \mathcal M_h\lvert \mathcal H\rangle=\lvert \mathcal H\rangle,\\ +h\notin\mathcal H\Longleftrightarrow \mathcal M_h\lvert \mathcal H\rangle\perp \lvert \mathcal H\rangle, +$$ +the latter fact following from the general result of group theory that $xH\cap H=\{\}$ if $x\notin H$ and $H$ is a subgroup of a group $G$.

+ +

Having $\mathcal M_h$ as controlled by an additional qubit can then be thought of as just a gimmick to have the first qubit tell us deterministically which one of the two cases are we dealing with.

+ +

In the case $h\in\mathcal H$, we have +$$\lvert +\rangle\lvert\mathcal H\rangle\xrightarrow[]{\mathcal U_h}\lvert+\rangle\lvert\mathcal H\rangle +\xrightarrow[]{H_1}\lvert0\rangle\lvert\mathcal H\rangle,$$ +while in the case $h\notin\mathcal H$, we get (ignoring normalization constants) +$$ +\lvert +\rangle\lvert\mathcal H\rangle\xrightarrow[]{\mathcal U_h}\lvert0\rangle\lvert\mathcal H\rangle+\lvert1\rangle\lvert hH\rangle\xrightarrow[]{H_1} +\lvert0\rangle\otimes(\lvert\mathcal H\rangle+\lvert h\mathcal H\rangle) + +\lvert1\rangle\otimes(\lvert\mathcal H\rangle-\lvert h\mathcal H\rangle). +$$ +Now, it doesn't really matter what the exact states in the second register are in the last bit. What matters is that we have something of the form $\lvert0\rangle\lvert a\rangle+\lvert 1\rangle\lvert b\rangle$, with $\langle a\rvert b\rangle=0$. +For any state like this, measuring the first qubit gives you equal probabilities of finding $\lvert0\rangle$ and $\lvert1\rangle$. +You then just need to repeat the experiment a few times to assess with good probability whether the measurement results on the first qubit are always equal or uniformly distributed.

+ +
+

But how exactly are we supposed to assign quantum states (i.e. the $|a\rangle$'s) corresponding to the elements of $\mathcal{H}$? Do we need to assign separate binary strings to all the elements of the group generated by the elements of $G$, such that they can be represented by qubit systems?

+
+ +

This is a possible way, but really it doesn't matter how you do the encoding for the sake of the algorithm. The only thing that matters is that different group elements must be assigned orthogonal states. +After this, you can decide to assign binary strings to each group element and then convert these to qubits, or just use appropriate high-dimensional qudits, or whatever else might be more convenient in the specific use-case.

+ +
+

And if we do assign such binary strings a priori, wouldn't it be much simpler to directly (classically) check whether the string assigned to $h$ matches with any of the strings corresponding to the elements of $\mathcal{H}$? I can't really see the speed advantage here. Could someone clarify this ""quantum"" proof?

+
+ +

Indeed, if you do know the classical representation of $h$ in the encoding of your choice, then you already essentially have the solution to the problem.

+ +

However, this might not be the case. You might only have access to the unitary $\mathcal U_h$. You might have $\lvert h\rangle$ as input (the quantum state, not the classical description of the corresponding group element), and use the state to implement $\mathcal U_h$, and thus using this protocol to figure out whether $h\in \mathcal H$, without even knowing what $h$ actually is.

+",55,,,,,1/24/2019 4:07,,,,0,,,,CC BY-SA 4.0 +5258,2,,5254,1/24/2019 8:22,,4,,"

For a certificate, check out these MIT courses that you can participate in online. They are done in collaboration with IBM.

+ +

IBM also recently gave awards for university level courses that use Qiskit. You can find all the best submissions here. These are also courses you can follow along at home (though there won't be a certificate).

+ +

Regarding the Jupyter notebook tutorials, I'd suggest starting with this one which is an interactive guide to basic quantum operations.

+ +

For advice for when you are stuck, I'd suggest the quantum computing stack exchange. I'm sure I don't need to provide a link for that ;)

+ +

Disclosure: I work for IBM.

+",409,,,,,1/24/2019 8:22,,,,0,,,,CC BY-SA 4.0 +5259,1,5265,,1/24/2019 11:40,,5,745,"

Apparently, the decomposition of a state into an ensemble of pure states is not unique. I can't understand why, as if I understood correctly a ""pure state ensemble decomposition"" is just the diagonalization of the density operator

+ +

$$\rho=\sum_{k=0}^rp_k|\psi_k\rangle\langle\psi_k| $$

+ +

where $r$ is the rank of $\rho$ and $|\psi_k\rangle$ are its eigenvectors with associated eigenvalues $p_k$.

+ +

Such a diagonalization is unique up to permutations of the $|\psi_k\rangle$, i.e. there exists a unique basis where $\rho$ is diagonal. How can the pure ensemble decomposition not be unique? What have I misunderstood?

+",5125,,55,,6/20/2022 8:11,6/20/2022 8:11,How can pure state ensemble decompositions not be unique?,,3,1,,,,CC BY-SA 4.0 +5260,2,,5259,1/24/2019 12:13,,3,,"

For any matrix $\rho$, there are (typically) many different choices of $\{p_i\}$ and $\{|\psi_i\rangle\}$ such that +$$ +\rho=\sum_ip_i|\psi_i\rangle\langle\psi_i|. +$$ +The simplest way to do it, with the fewest number of terms, is always the eigenvalue decomposition, but there are other ways as well. You do not have to use the eigenvector decomposition.

+ +

We should start by noting that not even the eigenvector decomposition is unique if you have repeated eigenvalues. For example, the maximally mixed state can be written as +$$ +\rho=\frac{1}{d}\mathbb{I}=\frac{1}{d}\sum_{i=1}^d|u_i\rangle\langle u_i| +$$ +where $\{|u_i\rangle\}$ is any orthonormal basis of dimension $d$.

+ +

Now we can use this to show how there can be many different ways of decomposing something even if there aren't repeated eigenvalues. Take a one-qubit state +$$\rho=p_0|v_0\rangle\langle v_0|+(1-p_0)|v_1\rangle\langle v_1|$$ +where $p_0>\frac12$ and $\langle v_0|v_1\rangle=0$. We could write this as +$$ +\left((p_0-q)|v_0\rangle\langle v_0|+(1-p_0-q)|v_1\rangle\langle v_1|\right)+q\mathbb{I} +$$ +for any $q\leq 1-p_0$, and we can decompose $\mathbb{I}$ in terms of any one (or more) orthonormal bases that we want to. You have a larger ensemble, but it still describes the same $\rho$. As an example, look at +$$ +\rho=\left(\begin{array}{cc} \frac45 & 0 \\ 0 & \frac15 \end{array}\right) +$$ +I'm going to rewrite this as +$$ +\rho=\left(\begin{array}{cc} \frac35 & 0 \\ 0 & 0 \end{array}\right)+\left(\begin{array}{cc} \frac15 & 0 \\ 0 & \frac15 \end{array}\right) +$$ +You can easily check that this is the same as, for example, +$$ +\rho=\frac35|0\rangle\langle 0|+\frac{1}{5}(|+\rangle\langle +|+|-\rangle\langle -|). +$$ +This means that $\rho$, as well as being described by the ensemble $\{(\frac45,|0\rangle),(\frac15,|1\rangle)\}$, we can also use the ensemble $\{(\frac35,|0\rangle),(\frac15,|+\rangle),(\frac15,|-\rangle)\}$.

+",1837,,1837,,1/25/2019 7:45,1/25/2019 7:45,,,,5,,,,CC BY-SA 4.0 +5261,1,5267,,1/24/2019 12:22,,7,1841,"

I am having problems with this task.

+ +

Since the Hadamard gate rotates a state $180°$ about the $\hat{n} = \frac{\hat{x} + \hat{z}}{\sqrt{2}}$ axis, I imagine the solution can be found the following way:

+ +

First rotate $\hat{n}$ so it lies in the $z$-$y$ plane: +$$R_z(\pi/2)$$ +Then rotate $\hat{n}$ so it is parallell with the $z$-axis: +$$R_x(\pi/4)$$ +Now do the desired rotation about the $z$-axis: +$$R_z(\pi)$$ +Then rotate $\hat{n}$ back to its original position. +The Hadamard gate can then be written: +$$H = e^{i\lambda}R_z(-\pi/2)R_x(-\pi/4) R_z(\pi) R_x(\pi/4) R_z(\pi/2) $$ +However, this doesn't seem to work. Can someone explain where my logic is flawed? Thank you very much

+",5632,,26,,3/29/2019 19:39,3/29/2019 19:39,"Hadamard gate as a product of $R_x$, $R_z$ and a phase",,3,2,,,,CC BY-SA 4.0 +5262,2,,5261,1/24/2019 12:55,,2,,"

Check exercise 4.4 of this PDF. It should explain your concern.

+ +

I think you are right but maybe when doing your calculations, you are not dividing by 2 the angles in the rotation matrix definition.

+",4127,,4127,,1/25/2019 10:43,1/25/2019 10:43,,,,1,,,,CC BY-SA 4.0 +5263,1,,,1/24/2019 13:54,,2,487,"

Both the words 'Quantum Key Distribution' and 'Quantum Key Exchange' are used in quantum cryptography in the problem of a secure key distribution for encryption/decryption between parties. There are popular algorithms like the BB84, B94 and E91 protocols for the above-stated task.

+ +

However what I want to know is that is there a difference between the two terms 'Quantum Key Distribution (QKD)' and 'Quantum Key Exchange (QKE)' or both represent the same concept?

+",4594,,26,,5/8/2019 10:22,6/16/2020 6:04,What is the difference between quantum key distribution and quantum key exchange?,,1,1,,,,CC BY-SA 4.0 +5264,2,,5252,1/24/2019 16:26,,4,,"

This result concerns the black-box group model, which is a fairly standard model in computational group theory. It is intended to represent minimal assumptions on the groups we're working with. In the black box group model we assume that each group element has a (unique) string representation of a fixed length, and a black-box performs the group operations for us.

+ +

The literal answer to the question of how we assign binary strings to the group elements is therefore that we don't: this is assumed to have already been done. Note that if the length of the binary string representations of the group elements is $n$, then there could be exponentially many (in $n$) different group elements, which is why the simpler classical check is unsatisfactory. The verification procedure here, assuming we're given a quantum proof as described, requires time polynomial in $n$.

+ +

To motivate this model, let's consider the specific example of matrix groups. In particular, let us suppose that every group element we're working with is an $N\times N$ matrix with entries in $\mathbb{Z}_p$ (integers modulo $p$) for some large prime number $p$, such that the matrix is invertible modulo $p$. In other words, our group $G$ is the general linear group $\text{GL}(N,p)$.

+ +

Now, you can easily represent elements of $\text{GL}(N,p)$ as binary strings of length $n = N^2 \lceil \log(p)\rceil$ by simply encoding each element of $\mathbb{Z}_p$ using binary notation and then concatenating the encodings of the entries together. Knowing this assignment of strings to group elements by itself does not, however, solve the problem: if you had group elements (i.e., matrices) $h$ and $g_1,\ldots,g_k$, and wanted to be convinced that $h\not\in\langle g_1,\ldots,g_k\rangle$, you would still have a lot of work to do, and it would be a very difficult computational task in general.

+ +

However, because we can efficiently perform the group operations (multiplication and inversion) on these string encodings, we can easily adapt any method based on the black-box group model by replacing the group oracle with circuits that efficiently perform these group operations. Thus, for this example of $\text{GL}(N,p)$ , there exist quantum proofs that will convince an efficient (i.e., polynomial-time) verifier that $h\not\in\langle g_1,\ldots,g_k\rangle$ when this statement is true and not when it is false.

+ +

The appeal of the black-box group model is that this is reasoning extends to many other concrete ways of representing group elements and performing operations. There is, of course, nothing specific about $\text{GL}(N,p)$ or any other group to the result.

+ +

Concerning the idea of the method, gIS has already answered this part very well (so let me suggest that you accept that answer if you find it to be helpful).

+",1764,,,,,1/24/2019 16:26,,,,2,,,,CC BY-SA 4.0 +5265,2,,5259,1/24/2019 19:00,,7,,"

Suppose that we're talking about $n\times n$ density operators, so that the rank will never exceed $n$. Now suppose that you choose $N$ to be much larger than $n$, and then arbitrarily pick a probability vector $(p_1,\ldots,p_N)$ and pure states $|\psi_1\rangle,\ldots,|\psi_N\rangle$. Assuming that more than $n$ of the entries in the probability vector are nonzero, and the vectors $|\psi_1\rangle,\ldots,|\psi_N\rangle$ represent distinct states, the decomposition +$$ +\rho = \sum_{k=1}^N p_k |\psi_k\rangle \langle \psi_k | +$$ +for the operator $\rho$ you have selected through this process will surely be different from the spectral decomposition of $\rho$.

+ +

Note that for a given $\rho$, it will always be possible to do something along these lines. If the rank of $\rho$ is 1, it will be trivial (meaning that every $|\psi_k\rangle \langle \psi_k |$ will have to be equal to $\rho$, assuming $p_k >0$), but as long as the rank of $\rho$ is at least 2, there will be a continuum of different inequivalent ways to do this.

+ +

In particular, for any choice of $\varepsilon > 0$ and $|\psi\rangle$ for which +$$ +\rho - \varepsilon |\psi\rangle \langle \psi| +$$ +is positive semidefinite, you could write +$$ +\rho = \varepsilon |\psi\rangle \langle \psi| + (1-\varepsilon) \sigma +$$ +for +$$ +\sigma = \frac{\rho - \varepsilon |\psi\rangle \langle \psi|}{1-\varepsilon} +$$ +and then recurse on $\sigma$. For any choice of $|\psi\rangle$ in the image of $\rho$, not just eigenvectors of $\rho$, this will be possible so long as $\varepsilon$ is small enough. And, as long you take $\varepsilon$ small enough each time, you could recurse as long as you like, and in general you will get different decompositions of $\rho$.

+",1764,,1764,,1/24/2019 19:07,1/24/2019 19:07,,,,2,,,,CC BY-SA 4.0 +5266,2,,5261,1/25/2019 7:55,,3,,"

As far as I can tell, it works fine. If I use the channel-state duality to view this sequence of operation's effect in Quirk's output display, it's the Hadamard gate's matrix:

+ +

+ +

Maybe you're multiplying or dividing by 2 somewhere you shouldn't be, when performing the operations?

+",119,,,,,1/25/2019 7:55,,,,1,,,,CC BY-SA 4.0 +5267,2,,5261,1/25/2019 8:14,,5,,"

Why do you say that it doesn't work? If I enter the following code into Mathematica, it works fine:

+ +
X = {{0, 1}, {1, 0}};
+Z = {{1, 0}, {0, -1}};
+FullSimplify[-I MatrixExp[-I Pi Z/4].MatrixExp[-I Pi X/8].MatrixExp[I Pi Z/2].MatrixExp[I Pi X/8].MatrixExp[I Pi Z/4]]
+
+ +

The only thing that I had to remember was to halve the angles compared to how you wrote them (because $R_Z(\pi)$ should give a $Z$ rotation, which is $e^{i\pi Z/2}$). That's the place that I always make the mistake with these calculations...

+",1837,,,,,1/25/2019 8:14,,,,1,,,,CC BY-SA 4.0 +5269,1,5300,,1/25/2019 14:11,,4,838,"

I am just starting to get around Qiskit, I'm going at baby steps, so I tried to run the code below and I noticed three things:

+ +
    +
  1. I tried using matplotlib_circuit_drawer() instead of circuit_drawer(), but is return a DeprecationWarning and sugested using circuit_drawer. I assume this is due to the constant updates and the functions are going to change frequently;

  2. +
  3. In the qc.measure(q, c) I get a highlight in PyCharm saying Unresolved attribute reference 'measure' for class 'QuantumCircuit', and I don't know what that really means;

  4. +
  5. I think this is also related to 1). When using draw(qc) I get the warning DeprecationWarning: The current behavior for the default output will change in a future release. Instead of trying latex and falling back to mpl on failure it will just use ""text"" by default +'""text"" by default', DeprecationWarning) and no image pops up. However when I use print(qc) the circuit pops up in text format;

  6. +
+ +

How can I be up to date about the commands?

+ +
from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit
+from qiskit.tools.visualization import circuit_drawer as draw
+
+c = ClassicalRegister(2)
+q = QuantumRegister(2)
+qc=QuantumCircuit(q, c)
+
+qc.measure(q, c)
+draw(qc)
+
+",5620,,26,,1/25/2019 14:14,1/29/2019 2:48,Deprecation warnings in Qiskit (circuit drawing),,1,0,,,,CC BY-SA 4.0 +5273,1,5277,,1/26/2019 7:57,,5,6967,"

I'm new to this field of science. I'm curious about how quantum computing can win 97% of times in a coin flipping experiment?

+ +

Refer this link: Ted Talk by Shohini Ghose

+ +

To give an idea about how this coin experiment works:

+ +
    +
  1. Quantum Computer plays a move but it is not revealed to the Opponent[Human].
  2. +
  3. Opponent[Human] plays a move and it is also not revealed to the Quantum Computer.
  4. +
  5. Finally Quantum Computer plays a move.
  6. +
  7. Results are shown. If its heads, then Quantum Computer wins. Else, Opponent[Human] wins.
  8. +
+ +

Here, playing a move refers to ""Flipping the coin"". The video talks of superposition and how it can recover heads every time in the final move. This made me think about 2 possibilities:

+ +
    +
  1. Quantum computer is tracking something low level in hardware. So, it knows every time, what did the opponent played.
  2. +
  3. Superposition and the third state is just a way, to not consider Opponent's Move (i.e. Ignoring Opponent's move). So, it is actually all the moves of Quantum Computer. So, it knows how to win. If this is the case, then actually there is no randomness or uncertainty added in the game by Opponent.
  4. +
+ +

Just same as how the magician does the coin flipping trick. He practices and controls the flipping power of his thumb, so he knows every time he flips the coin, whether its going to be heads or tails.

+",5643,,55,,2/14/2021 18:56,2/14/2021 18:56,How can quantum computing win 97% of times in coin flipping experiment?,,1,5,,,,CC BY-SA 4.0 +5275,1,5276,,1/26/2019 23:10,,3,1139,"

I have been told that one of the great keys that unlock quantum computing's potential is the reversibility of quantum logic gates as for classical gates there's some loss of information, but I cannot grasp this concept. Mathematically I see why the quantum logic gate is reversible, it is a mere unitary operator but on the classical one I don't see where the information is lost, could someone clarify it?

+",5620,,26,,1/27/2019 8:02,1/27/2019 8:02,Reversibility and irreversibility of logic gates (quantum vs classical),,1,1,,,,CC BY-SA 4.0 +5276,2,,5275,1/26/2019 23:40,,2,,"
+

Mathematically I see why the quantum logic gate is reversible, it is a + mere unitary operator but on the classical one I don't see where the + information is lost, could someone clarify it?

+
+ +

For illustration, let's take the classical XOR gate.

+ +

+ +

Say you know that the output or end result of a certain XOR operation is 1. Now what could have been the possible values for A and B? Either A = 0 & B = 1 or A=1 & B = 0. That is, you cannot unambiguously reconstruct its two inputs from its single output i.e. the information about the initial state of A and B is lost after the XOR logic operation. This is exactly what they mean when they mean by ""irreversibility of classical logic gates"".

+ +

Interestingly, the reversible quantum version of the XOR gate is the CNOT gate.

+ +

However, there are exceptions like the classical NOT gate.

+ +

+ +

For the NOT gate, if you're given that the output state 1, then you can unambiguously say the initial state of A was 0. Similarly, if you're given NOT A is 0, you can unambiguously say that A was 1. No information is lost here during the logic operation.

+ +

It's possible to perform all classical logic operations using only reversible gates. But in those cases, often it becomes necessary to use ancilla bits. For instance, the reversible Toffoli gate gate can implement all classical logic functions. The Toffoli gate has a quantum version too. Basically, all reversible classical logic operations can be directly mapped to quantum gate operations, which are unitary and reversible. In case you're wondering why quantum gates are unitary, read this answer.

+ +
+

I have been told that one of the great keys that unlock quantum + computing's potential is the reversibility of quantum logic gates as + for classical gates there's some loss of information, but I cannot + grasp this concept.

+
+ +

That's true. Read up the Wikipedia articles on reversible computing and Landauer's principle. Note that there's two kinds of reversibilities: logical reversibility and physical reversibility. A universal Turing machine can be made both physically and logically reversible. Logical and physical reversibility together would enable running efficient algorithms and energy-efficient computation in quantum computers.

+",26,,26,,1/27/2019 0:34,1/27/2019 0:34,,,,1,,,,CC BY-SA 4.0 +5277,2,,5273,1/27/2019 0:41,,6,,"

We translate this game into conventional QC terminology as follows:

+ +
    +
  • The coin is a single qbit state $|\psi\rangle=\begin{bmatrix}\alpha \\ \beta\end{bmatrix}$ where $\alpha, \beta \in \mathbb{C}$ and $|\alpha|^2 + |\beta|^2 = 1$
  • +
  • ""Flipping"" the coin is application of the bit-flip operator $X = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$
  • +
  • The ""heads"" state is defined as $|0\rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$ and ""tails"" as $|1\rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix}$
  • +
  • The quantum computer ""plays"" by applying the Hadamard operator $H = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & \frac{-1}{\sqrt{2}} \end{bmatrix}$
  • +
+ +

The game is conducted as follows:

+ +
    +
  1. The coin is initialized to the $|0\rangle$ ""heads"" state.
  2. +
  3. The computer plays, applying the Hadamard operator to the coin (operators are applied using matrix multiplication). The coin enters the $|+\rangle = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix}$ state.
  4. +
  5. The human plays, choosing whether to flip the coin (apply the $X$ operator). However, since the $X$ operator just flips the state vector upside down, $X$ has no effect; $X|+\rangle = |+\rangle$. No matter what, the state is $|+\rangle$ after the human plays.
  6. +
  7. The computer plays, applying the Hadamard operator again, taking the coin to the $|0\rangle$ ""heads"" state.
  8. +
+ +

Thus the computer always wins, except for $3\%$ of the time when errors cause it to not behave according to this model.

+ +

The example deals with the basic quantum states $|0\rangle$, $|1\rangle$, $|+\rangle$, and $|-\rangle$, plus the common ways of moving between them with the $X$, $H$, and $Z$ gates. This is the same material you learn about in IBM's Hello Quantum game.

+ +

This isn't a great example to use to illustrate how a quantum computer works (since it only makes sense if you already know how a quantum computer works), but I guess the speaker only had ten minutes.

+",4153,,26,,1/27/2019 8:12,1/27/2019 8:12,,,,5,,,,CC BY-SA 4.0 +5278,1,5279,,1/27/2019 0:53,,3,144,"

The Wikipedia article on logical reversibility says:

+ +
+

...reversible logic gates offered practical improvements of + bit-manipulation transforms in cryptography and computer graphics.

+
+ +

But I guess that's not all? Aren't reversible logic gates a necessity for the (efficient) execution of quantum algorithms? [1]

+ +

To clarify, I'm basically asking this: Isn't the use of reversible operations or unitaries necessary for efficiently executing quantum algorithms? Or are there models of quantum computation which can execute these algorithms efficiently without making use of logically reversible operations at all?

+ +
+ +

[1]: Inspired from Reversibility and irreversibility of logic gates (quantum vs classical).

+",26,,26,,1/27/2019 8:25,1/28/2019 7:55,Aren't reversible logic gates a necessity for efficiently executing quantum algorithms?,,1,4,,,,CC BY-SA 4.0 +5279,2,,5278,1/27/2019 6:51,,4,,"

Originally, I misunderstood the question, and was answering a question like ""Is it true that quantum computers are necessarily formulated only out of reversible gates?"". However, I now understand that the question was intended to be ""Must there always be a reversible step inside a quantum computation?""

+ +

No - there are some computational schemes, such as the this paper, in which every computational step can be formulated as a dissipation, which is non-reversible.

+ +

Another way to think about it is in terms of the measurement-based model. Here, one must prepare a particular state, and perform a sequence of measurements on it. Usually, we talk about the initial state preparation as a unitary, but that's not necessary. The usual cluster state is the common eigenstate of a set of stabilizers $\{K_n\}$ ($K_n^2=1$ and $[K_n,K_m]=0$). So, imagine you take some initial state of a system, and start measuring sets of qubits according to the stabilizers $\{K_n\}$. The state people normally talk about preparing is the +1 eigenstate of all of these. Obviously, it's quite unlikely the we succeed in preparing that. However, we will have a record of which stabilizers gave -1 answers. It's a particular property of these stabilizers that each one anti-commutes with a $Z$ on a particular site, while all others commute with that particular $Z$. This means that the list of stabilizers with -1 values corresponds to a list of sites with $Z$ errors. But, knowing that, we can just incorporate the existence of the $Z$ rotations into the measurement bases of the computation. Everything can be achieved through measurements! (Although you require 5-qubit measurements. While not impossible, I think most people would consider implementing them using some unitaries and single-qubit measurements, but the formalism doesn't require it.)

+ +
+ +

Original Answer

+ +

No. Usually, we phrase quantum algorithms in terms of unitaries (reversible) plus measurements (not reversible). You might even argue that for many algorithms, with a deterministic output, the final measurement does nothing, and hence does not do anything irreversible.

+ +

However, this is partially the fault of the gate model which hides measurement at the end. In fact, there is some degree of choice about trading off between the two. For example, measurement-based computation implements one very simple unitary operation that may have nothing to do with the computation to be performed, and then the computation itself is specified by the measurement choices, and the measurements also detect the outcomes. This extreme certainly shows that it is not necessary to have reversibility.

+",1837,,1837,,1/28/2019 7:55,1/28/2019 7:55,,,,6,,,,CC BY-SA 4.0 +5280,1,,,1/27/2019 8:41,,16,377,"

I like making diagrams to describe computations. For the surface code, an excellent tool is 3d topological diagrams. Here is an example diagram (made by me in SketchUp):

+ +

+ +

The basic idea is that white boundaries are places where Z observable chains can terminate, black boundaries are places where X observable chains can terminate, and the computation is defined by how these boundaries are merged/split/braided/etc (other colors are used for labeling.). There is a simple correspondence between the diagram and what a quantum computer running the surface code would actually be doing.

+ +

Although these diagrams are a good tool for describing topological computations, not everyone knows how to read them. Is there a reference I can point them toward when they ask?

+ +

An example of a paper using these diagrams is A bridge to lower overhead quantum computation (Fowler & Devitt, 2013).

+ +

+ +

You may notice that the two diagrams I've included look different in their details. That's because the second one is using braiding whereas the first one is using lattice surgery. But it's ultimately the same diagrammatic concept.

+",119,,26,,1/27/2019 10:25,1/1/2023 22:06,Reference that explains how to read 3d topological diagrams for surface code computations,,1,2,,,,CC BY-SA 4.0 +5281,1,5282,,1/27/2019 11:26,,6,238,"

I'm using Mermin's Quantum Computer Science book to understand Shor's algorithm, but I can't figure out why one of the phase factors drops out of the probability for measuring a certain y.

+ +

This is the application of the QFT on the superposition of the first register in Shor's algorithm ($x_0$ is the offset and $r$ is the period): +\begin{align*}U_{FT}\frac{1}{\sqrt{m}}\sum_{k=0}^{m-1}\left|{x_0+kr} \right>_n&=\frac{1}{2^{n/2}}\sum^{2^n-1}_{y=0}\frac{1}{\sqrt{m}}\sum_{k=0}^{m-1}e^{2\pi i(x_0+kr)/2^n}\left |{y} \right>_n \\ &=\sum^{2^n-1}_{y=0}e^{2\pi i x_0 y/2^n}\frac{1}{2^n\sqrt{m}}\left(\sum_{k=0}^{m-1}e^{2\pi ikry/2^n}\right)\left |{y} \right>_n\end{align*}

+ +

According to Mermin, the probability of getting the result $y$ is $p(y) = \frac{1}{2^nm}\big |\sum_{k=0}^{m-1}e^{2\pi ikry/2^n}\big |^2$. Why can we just ignore $e^{2\pi i x_0 y/2^n}$?

+",5051,,26,,1/27/2019 14:26,7/12/2019 15:19,What happens with first phase factor in QFT?,,1,3,,,,CC BY-SA 4.0 +5282,2,,5281,1/27/2019 14:41,,7,,"

If you have a quantum state like $$|\Psi\rangle_n = a_0|0\rangle_n+a_1|1\rangle_n+...+a_n|2^n-1\rangle_n$$ and you measure it in the $\{|0\rangle_n,...,|2^{n-1}\rangle_n\}$ basis, then the probability $p(y)$ of getting the state $|y\rangle_n$ is $|a_y|^2$ where $a_y \in \Bbb C$ (i.e it's a complex number).

+ +

In your example, $$a_y = e^{2\pi i x_0 y/2^n} \frac{1}{2^n\sqrt{m}} \sum_{k=0}^{m-1}e^{2\pi ikry/2^n}.$$

+ +

Remind yourself that for a complex number $re^{i\theta}$, the modulus is $$|re^{i\theta}| = |r||e^{i\theta}|=|r| \cdot 1=|r|$$ (since $e^{i\theta}$ has a modulus of $1$) and the square of the modulus is $|r|^2.$ Note that I've not specified $r$ is real; it could still be a complex number itself.

+ +

In your case, the $e^{i\theta}$ is $e^{2\pi i x_0 y/2^n}$ and so you don't see it in $p(y)$, as $p(y)$ is essentially $|a_y|^2$. This $e^{i\theta}$ has a special name — it's a global phase for $a_y|y\rangle_n$.

+",26,,6065,,7/12/2019 15:19,7/12/2019 15:19,,,,0,,,,CC BY-SA 4.0 +5283,1,5285,,1/27/2019 19:48,,1,805,"

Suppose we have the quantum circuit below with a quantum register of 2 qubits and a classical register of 2 bits. The Hadamard gates and CNOT gate are not important for the question. When we measure a qubit we collapse it into one of the computational basis states (let's suppose we are working with the basis $ \{|0\rangle,|1\rangle\}$). But on Nielsen and Chuang's book, it says

+ +
+

...this operation [measurement] converts a single qubit state $|\psi \rangle=\alpha |0\rangle +\beta |1\rangle$ into a probabilistic bit $M$ (...) which is $0$ with a probability of $|\alpha|^2$, or 1 with a probability of $|\beta|^2$.

+
+ +

Now here's what I don't understand:

+ +
    +
  1. If the measurement is an irreversible process then the probability of the resultant state is towards the initial quantum state it was in, that is, if the resultant state is $1$ with a probability of, say, $63\%$, that means that is has a $63\%$ probability that the initial state was $|\psi \rangle= |1\rangle$. However, after it has collapsed to a bit, then, there is no probability associated with it, it certainly is $1$ for all future measurements, it shouldn't be a probabilistic bit.

  2. +
  3. In the circuit below, what is the need of registering the state of the qubit in a classical bit if it has collapsed irreversibly into that same state? Does it only make sense to do so when it is the end of the circuit?

  4. +
+ +

+",5620,,26,,1/27/2019 21:36,1/27/2019 22:09,Measurement of a qubit and storage of the information on a bit,,1,0,,,,CC BY-SA 4.0 +5284,2,,5251,1/27/2019 19:59,,1,,"

As I understand $\mathsf{IP}$ and similarly $\mathsf{QIP}$, two parties, prover Peggy and verifier Vicky, engage in a number of rounds that are polynomial in $n$. Each round consists of Vicky providing a challenge to Peggy, then Peggy replying with a response, with the challenges and responses being a function of the previous rounds. Eventually after the polynomial number of rounds, Vicky should be convinced by Peggy. This is how I read Shamir's $\mathsf{IP=PSPACE}$ paper - after each round, Peggy simplifies a polynomial based on challenges from Vicky, until eventually Vicky can be assured that the polynomial is non-zero.

+ +

This is distinct from the standard protocol used for the graph non-isomorphism $GNI$ problem. In $GNI$, the weaker Vicky challenges the powerful Peggy with a single round to determine which graph Vicky has permuted. The $GNI$ protocol can be run a plurality of times between Vicky and Peggy to amplify soundness, but each round is done independent of the others, and there is no challenge/response that is based on previous challenge/responses.

+ +

Furthermore the classes $\mathsf{MA}$ and $\mathsf{QMA}$ are different still - here the powerful Merlin provides the weaker Arthur initially with a classical/quantum certificate (not the other way around).

+ +

Watrous ended the 2000 paper ""Succinct Quantum Proofs for Properties of Finite Groups"" with an open question as to whether $GNI\in\mathsf{QMA}$.

+ +

Okamoto and Tanaka offer an answer Watrous's problem in the affirmative with their 2007 paper ""Graph Non Isomorphism Has a Succinct Quantum Certificate."" Although there are some areas in the paper that are causing me a little bit of confusion, as I understand it Merlin's quantum certificate $\mathsf{MA}$ protocol for $GNI$ consists of $O(n^{12})$ replicates of their FIG. 1. Their verification procedure entails Arthur burning through most of these by measuring random replicates without performing any quantum gates, just to confirm that the structure of the certificates for remaining replicates is highly likely to be correct. They then have Arthur permute adjacency matrices conditioned on the value of their garbage registers (going from FIG. 1 to FIG. 2). At the end they have Arthur perform some CNOTs and Hadamard transforms on remaining replicates, to get a rough measure of the structure of the replicates and how close the vectors in the replicates are to one another.

+ +

In step 6 in their protocol, Arthur has possession of a state that should be a uniform superposition of (an appropriately normalized version of)

+ +

$$\sum_{b\in\{0,1\},i\in S_n}\vert b\rangle\vert \pi_i(G_b)\rangle$$

+ +

for rigid graphs $G_0$ and $G_1$. That is, the state that Arthur possesses consists of a uniform superposition over all adjacency matrices that are equivalent to either the given $G_0$ or the given $G_1$. Arthur can then Hadamard and measure $\vert b \rangle$. Depending on whether $G_0\not\cong G_1$, after Hadamarding Arthur should measure $b=1$ the appropriate number of times.

+ +

Even though Okomoto and Tanaka's protocol uses $O(n^{12})$ replicates, it still is fundamentally an $\mathsf{MA}$ protocol, as most of these replicates are for improving soundness. The protocol does not use the sophistication of more than one round of interaction in $\mathsf{QIP}$ (the second figure in the question). Certainly such a multi-round $\mathsf{QIP}$ protocol is likely to exist, because $GNI\in\mathsf{AM}\subseteq\mathsf{IP}=\mathsf{PSPACE}=\mathsf{QIP}$, but at least according to Okomoto and Tanaka, it would be overkill and a single round is sufficient.

+",2927,,2927,,1/28/2019 21:22,1/28/2019 21:22,,,,0,,,,CC BY-SA 4.0 +5285,2,,5283,1/27/2019 20:35,,2,,"
+

If the measurement is an irreversible process then the probability of + the resultant state is towards the initial quantum state it was in, + that is, if the resultant state is $1$ with a probability of, say, + $63\%$, that means that is has a $63\%$ probability that the initial + state was $|\psi \rangle= |1\rangle$.

+
+ +

This is a fundamental misinterpretation. If the resultant state after measurement is $|1\rangle$ with $63\%$ probability, then it simply means that the initial quantum state was of the form $\sqrt{0.27}e^{i\theta}|0\rangle + \sqrt{0.63}e^{i\phi}|1\rangle$ where $\theta,\phi\in \Bbb R$ (of course, assuming we measured in the $\{|0\rangle, |1\rangle\}$ basis). This initial quantum state collapses to the state $|1\rangle$ with $63\%$ probability! Don't think of it as ""if the resultant state is $|1\rangle$ with $63\%$ probability it means that the initial quantum state was $|1\rangle$ with $63\%$ probability."" That's wrong. Qubits can totally exist in a linear superposition of $|0\rangle$ and $|1\rangle$ and do not necessarily need to be either one of them i.e. either $|0\rangle$ or $|1\rangle$. A superposition is a perfectly valid state of existence for a qubit! It also does not make sense to say: it's both $|0\rangle$ and $|1\rangle$ at the same time. Quantum mechanics is a mathematical model of reality and it does not need to match with your classical intuitions and need not be describable with the limited English vocabulary we apply for classical objects. We need to extend our vocabulary to describe qubits and that's where mathematics helps us. The word ""superposition"" is a mathematical term in this context.

+ +
+

However, after it has collapsed to a bit, then, there is no + probability associated with it, it certainly is $1$ for all future + measurements, it shouldn't be a probabilistic bit.

+
+ +

I believe the word in the term that's confusing you is ""converts"". I'd say don't overthink this. They simply mean that on measurement of a qubit in the state $a|0\rangle + b|1\rangle$ there $|a|^2$ probability of getting $|0\rangle$ and $|b|^2$ probability of getting $|1\rangle$. The term ""probabilitic bit"" here is simply an abstraction. They mean that upon measurement you can imagine your qubit to be a ""bit"" with a value of either 0 or 1. That is, it has the value 0 with probability $|a|^2$ and value 1 with probability $|b|^2$. But this is assuming they don't know the measurement result yet. They're simply mathematically modelling the measured qubit as a probabilitic bit without the knowledge of the result of the measurement. Of course, if you know the result of the measurement it's going to be either 0 or 1 with $100\%$ probability.

+ +
+

In the circuit below, what is the need of registering the state of the + qubit in a classical bit if it has collapsed irreversibly into that + same state? Does it only make sense to do so when it is the end of the + circuit?

+
+ +

This is already answered in Why do we need a Classical Register for carrying out Quantum Computations?

+ +

The results of the measurements are basically classical information i.e. 0 or 1 if you're measuring in the $\{|0\rangle, |1\rangle\}$ basis. Remember that in reality you're measuring things like electron spin. You need to store that classical information somewhere for future use, and that is what copying the results of the measurement to the classical bits achieves. And yes, in the gate model it's generally done after the measurements (which is usually the final step of a quantum algorithm).

+",26,,26,,1/27/2019 22:09,1/27/2019 22:09,,,,4,,,,CC BY-SA 4.0 +5286,1,,,1/27/2019 22:55,,9,1053,"

Consider the following game:

+ +

I flip a fair coin, and depending on the outcome (either heads/tails), I'll give you one of the following states:

+ +

$$|0\rangle \text{ or } \cos(x)|0\rangle + \sin(x)|1\rangle.$$

+ +

Here, $x$ is a known constant angle. But, I don't tell you which state I give you.

+ +

How can I describe a measurement procedure (i.e. an orthonormal qubit basis) to guess which state I'm given, while maximizing the chance of being right? Is there an optimal solution?

+ +

I've been self-studying quantum computing, and I came across this exercise. I don't really know how to even start, and I would really appreciate some help.

+ +

I think that a good strategy would be to perform an orthogonal transformation with

+ +

$$\begin{bmatrix} +\cos(x) & -\sin(\theta)\\ +\sin(x) & \cos(\theta) +\end{bmatrix}.$$

+ +

Can't make much progress...

+",5656,,26,,1/28/2019 10:49,1/29/2019 13:58,Optimal strategy to a quantum state game,,2,1,,,,CC BY-SA 4.0 +5287,1,5361,,1/27/2019 23:31,,9,589,"

It is known that there are big companies behind the specific qubit implementations (e.g. ion traps, superconducting loops, topological qubits, etc.). But I have not managed to find the company that is backing/implementing diamond vacancy quantum computers. Currently, it seems to me that this technology is confined only to the laboratories of universities. I am speaking about Nitrogen-vacancy center.

+ +

So - is there any company that backs and implements diamond vacancy quantum computers?

+",1326,,26,,1/28/2019 8:20,4/1/2022 17:58,Is there any company that backs and implements diamond vacancy quantum computers?,,4,1,,,,CC BY-SA 4.0 +5288,2,,5286,1/28/2019 7:09,,1,,"

The key is in the optimal strategy for distinguishing two non-orthogonal states. This is something called the Helstrom measurement, which I described here.

+",1837,,26,,1/28/2019 7:45,1/28/2019 7:45,,,,0,,,,CC BY-SA 4.0 +5289,2,,5286,1/28/2019 9:16,,8,,"

We simply translate the binary result of a qubit measurement to our guess whether it's the first state or the second, calculate the probability of success for every possible measurement of the qubit, and then more find the maximum of a function of two variables (on the two-sphere).

+ +

First, something that we won't really need, the precise description of the state. The full state of the system that depends both on superpositions a well as a classical fair coin may be encoded in the density matrix +$$ \rho = \frac 12 \pmatrix{1&0\\0&0} + \frac 12 \pmatrix{\cos^2x &\sin x \cos x\\ \sin x\cos x & \sin^2 x} $$ +where the left column and upper row corresponds to the basis state ""zero"" and the remaining ones to ""one"". It's helpful to rewrite the density matrix in terms of the 4-element basis of the $2\times 2$ matrices, +$$ \rho = \frac 12+ \frac{\sin x \cos x}{2} \sigma_x + \left(\frac{\cos^2 x - \sin^2 x}{4}+\frac 14\right) \sigma_z $$ +That may be written in terms of the angle $2x$: +$$\rho = \frac 12 + \frac {\sin 2x}{4} \sigma_x + \frac{\cos 2x +1}{4} \sigma_z $$ +Now, regardless of the mixed state, this is still a two-level system and all measurements on the two-dimensional Hilbert space are either trivial (measurements of a $c$-number) or equivalent to the measurement of the spin along an axis, i.e. measurements of +$$ V = \vec n \cdot \vec \sigma $$ +which is a unit 3D vector multiplied by the vector of Pauli matrices. OK, what happens if we measure $V$? The eigenvalues of $V$ are plus one or minus one. The probability of each may be obtained from the expectation value of $V$ which is +$$\langle V \rangle = {\rm Tr} (V \rho) $$ +The traces of products only contribute if $1$ meets $1$ (but we assume there was no term in $V$) or $\sigma_x$ meets $\sigma_x$ etc., in which cases the trace of the matrix gives an extra factor of 2. So we have +$$\langle V \rangle = \frac{\sin 2x}{2}n_x + \frac{\cos 2x +1}{2} n_z $$ +We get the eigenvalue $\pm 1$ with the probabilities $(1\pm\langle V \rangle) / 2$, respectively. Exactly when $\cos x = 0$, the two initial ""head and tail"" states are orthogonal to one another (basically $|0\rangle$ and $|1\rangle$) and we may fully discriminate them. To make the probabilities $0,1$, we must simply choose $\vec n=(0,0,\pm 1)$; note that the overall sign of $\vec n$ doesn't matter for the procedure.

+ +

Now, for $\cos x \neq 0$, the states are non-orthogonal i.e. ""not mutually exclusive"" in the quantum sense and we can't measure directly whether the coin was tails or heads because those possibilities were mixed in the density matrix. In fact, the density matrix contains all probabilities of all measurements, so if we could get the same density matrix by a different mixture of possible states from coin tosses, the states of the qubit would be strictly indistinguishable.

+ +

Our probability of success will be below 100% if $\cos x\neq 0$. But the only meaningful way to use the classical bit $V=\pm 1$ from the measurement is to directly translate it to our guess about the initial state. Without a loss of generality, our translation may be chosen to be +$$ (V = +1) \to |i\rangle = |0\rangle \\ $$ +and +$$ (V = -1) \to |i\rangle = \cos x |0\rangle + \sin x |1 \rangle.$$ +If we wanted the opposite, cross-identification of the heads-tails and the signs of $V$, we could simply achieve it by flipping the overall sign of $\vec n \to -\vec n$.

+ +

Let's call the first simple initial state ""heads"" (the zero) and the second harder one ""tails"" (the cosine-sine superposition). The probability of success is, given our translation from $+1$ to heads and $-1$ to tails, +$$ P_{\rm success} = P(H) P(+1|H) + P(T) P(-1|T). $$ +Because it's a fair coin, the two factors included above are $P(H)=P(T)=1/2$. The most difficult calculation among the four probabilities is $P(-1|T)$. But we have already made a harder calculation above, it was the $(1-\langle V\rangle) / 2$. Here we just omit the constant term proportional to $n_z$ and multiply by two: +$$ P(-1|T ) = \frac 12 - \sin 2x \frac{ n_x}2 - \cos 2x \frac{ n_z}2 $$ +The result for ""heads"" is simply obtained by setting $x=0$ because the ""heads"" state equals ""tails"" states with $x=0$ substituted. So +$$ P(-1|H) = \frac{1-n_z}{2} $$ +and the complementary $1-P$ probability is +$$ P(+1|H) = \frac{1+n_z}{2} $$ +Substitute those results to our ""success probability"" to get +$$P_{\rm success} = \frac{1+n_z +1 - (\sin 2x)n_x - (\cos 2x)n_z}{4} $$ +or +$$P_{\rm success} = \frac 12 - \frac{n_x}4 \sin 2x + \frac{n_z}{4} (1-\cos 2x ) $$ +If we define $(n_x,n_z)=(-\cos \alpha,-\sin\alpha)$, we may also write it as +$$ P_{\rm success} = \frac 12 +\frac{\sin(2x+\alpha)-\sin \alpha}{4} =\frac 12+\frac{\sin x \cos(x+\alpha)}{2} $$ +We want to maximize that over $\alpha$. Clearly, the maximum is for $\cos(x+\alpha)=\pm 1$ where the sign agrees with that of $\sin x$ i.e. $\alpha=-x$ or $\alpha=\pi -x $ and the value at this maximum is +$$ P_{\rm success} = \frac{1+|\sin x|}{2}$$ +which sits in the interval 50% and 100%.

+ +

That's a nice measurement which is really quantum mechanical. We use a different measurement than that of $\sigma_z$, i.e. the classical measurement of the bit. Instead, we measure the spin along the axis in the $xz$-plane that is defined by the same nonzero angle as the angle $x$ at the beginning, with some correct signs and shifts by multiples of $\pi/2$. Note that if you measured simply $\sigma_z$, the classical bit, the success rate would be just $(3-\cos 2x)/4$, also between 50% and 100%, but smaller than our result. In particular, for a small $x=0+\epsilon$, our optimal result would be Taylor-expanded as $1/2+|x|/2$ while the non-optimum result using the classical measurement would increase above $1/2$ more slowly, as $1/2+x^2/2$.

+ +

For many hours, a wrong answer (a mistake in the final portions) was posted here, despite the fact that I had previously fixed many wrong factors of two. I posted a slightly edited version of this answer on my weblog where some discussion may take place:

+ +
+

The Reference Frame: A fun simple problem in quantum computing

+
+ +

On that page, I also write the eigenstates of the measured operator in the appendix. The arguments in the angles may be surprising for some folks who think that this problem is obvious in terms of the wave functions or that the wave functions after the measurement have to be simple.

+",5659,,26,,1/29/2019 13:58,1/29/2019 13:58,,,,2,,,,CC BY-SA 4.0 +5291,1,,,1/28/2019 11:27,,4,2123,"

I get below error when I run a code on spyder environment:

+ +

File C:/MYPYTHON Programs/My Quantum Programs/Shor algo.py, line 4, in from qiskit import QuantumProgram

+ +
ImportError: cannot import name 'QuantumProgram' from 'qiskit' 
+(C:\Users\gurmo\Anaconda3\envs\Qiskitenv\lib\site-packages\qiskit__init__.py)
+
+",5663,,26,,1/28/2019 11:30,8/16/2019 15:22,ImportError: cannot import name 'QuantumProgram' from 'qiskit',,1,0,,,,CC BY-SA 4.0 +5292,2,,5291,1/28/2019 15:20,,8,,"

QuantumProgram was removed in Qiskit 0.6.0. (Release Notes) Your example code is likely for an older version. You can either install Qiskit 0.5.7, or find an updated Shor's Algorithm example.

+",52,,52,,1/29/2019 12:55,1/29/2019 12:55,,,,0,,,,CC BY-SA 4.0 +5293,1,5306,,1/28/2019 15:26,,5,1187,"

I have seen that it is possible to represent the Grover iterator as a rotation matrix $G$. My question is, how can you do that exactly? +So we say that $|\psi\rangle$ is a superposition of the states of searched and not searched elements, that can be represented like this: +$$|\psi\rangle=\sqrt{\frac{N-1}{N}}|\alpha\rangle+\sqrt{\frac{1}{N}}|\beta\rangle$$ +Now you can rewrite that so you get this expression: +$$|\psi\rangle=\cos(\theta/2)|\alpha\rangle+\cos(\theta/2)|\beta\rangle$$ +I have seen that an application of the Grover iteration can be represented as a rotation matrix, e.g. in this form: +$$G=\begin{pmatrix}\cos(\theta)&-\sin(\theta)\\\sin(\theta)&\cos(\theta)\end{pmatrix}$$ +But how do you get to the shape, what are the necessary steps and calculations?

+ +

I hope that the question is expressed as understandably and clearly.

+",,user4961,55,user4961,2/2/2021 10:32,2/2/2021 10:32,How is Grover's operator represented as a rotation matrix?,,1,2,,,,CC BY-SA 4.0 +5294,1,,,1/28/2019 15:51,,3,115,"

$\mathsf{PostQMA}$ can be defined as the following (see Morimae-Nishimura and Usher-Hoban-Browne):

+ +
+

A promise problem $\mathcal{L}=(\mathcal{L_{yes},L_{no}})$ is in $\mathsf{PostQMA(c,s)}$ if there exists a polynomially bounded function $m:\mathbb{Z}^+\rightarrow \mathbb{N}$ and a polynomial time quantum verifier $V$, which is a polynomial time uniformly generated family of quantum circuits $\{V_{x}\}_{x\in\{0,1\}^n}$ on $n+m$ qubits such that for every input $x$ and $(\langle \psi|\otimes\langle0|^{\otimes m}) V_x^{\dagger} (|0\rangle\langle0|\otimes I_{n+m-1}) V_x(|\psi\rangle\otimes |0\rangle^{\otimes m}) > 2^{-p(n)}$ for some polynomial $p$:

+ +
    +
  • Completeness: if $x \in \mathcal{L}_{yes}$, there exists a witness $|\psi\rangle$ such that $$\frac{(\langle \psi|\otimes\langle0|^{\otimes m}) V_x^{\dagger} (|00\rangle\langle00|\otimes I_{n+m-2}) V_x(|\psi\rangle\otimes |0\rangle^{\otimes m})}{(\langle \psi|\otimes\langle0|^{\otimes m}) V_x^{\dagger} (|0\rangle\langle0|\otimes I_{n+m-1}) V_x(|\psi\rangle\otimes |0\rangle^{\otimes m})} \geq c.$$
  • +
  • Soundness: if $x \in \mathcal{L}_{no}$, for any witness $|\psi'\rangle$ such that $$\frac{(\langle \psi|\otimes\langle0|^{\otimes m}) V_x^{\dagger} (|00\rangle\langle00|\otimes I_{n+m-2}) V_x(|\psi\rangle\otimes |0\rangle^{\otimes m})}{(\langle \psi|\otimes\langle0|^{\otimes m}) V_x^{\dagger} (|0\rangle\langle0|\otimes I_{n+m-1}) V_x(|\psi\rangle\otimes |0\rangle^{\otimes m})} \leq s.$$
  • +
+
+ +

Namely, we do the postselection such that if the first output qubit is $0$, then we consider the second output qubit. Usually, $\mathsf{PostQMA}:=\mathsf{PostQMA(2/3,1/3)}$. As mentioned in Morimae-Nishimura, the error bound can be amplified from $(2/3,1/3)$ to $(1-2^{-r(n)},2^{-r(n)})$ for any polynomial $r$.

+ +
+ +

The naive approach is requiring polynomially many copies of the witness and using the standard Chernoff bound on indicators which indicate whether $x \in \mathcal{L}_{yes}$ or $\mathcal{L}_{no}$ and repeat such trials. As mentioned in Aaronson's paper on $\mathsf{PostBQP}$.

+ +
+ +

A little-advanced approach is requiring two copies of the witness. Using the proposition 2.9 in Kuperberg's paper, the $\mathsf{PostBQP}$ verifier $\mathcal{V}$ can be thought as two quantum polynomial-time algorithms run by Alice and Bob that report ""yes"" with probabikity $a$ and $b$ respectively. For some constant $c>1$, postselection guarantee the free-to-retry property: +- $\mathcal{V}$ reports ""yes"" if $a > cb$; +- $\mathcal{V}$ reports ""no"" if $a < cb$.

+ +

And Alice and Bob are free to retry if $(a,b)$ is not in either above ranges. Hence, we can do something similar to the Marriott-Watrous gap amplification (or the phase estimation variant), consider the following projections: +$$\begin{aligned} +\Pi_0 &= I_n\otimes |0\rangle\langle 0|^{\otimes m},\\ +\Pi_1^A &= V_x^{\dagger} (|00\rangle\langle 00|\otimes I_{n+m-2}) V_x,\\ +\Pi_1^B &= V_x^{\dagger} (|01\rangle\langle 01|\otimes I_{n+m-2}) V_x.\\ +\end{aligned}$$ +Invoking Marriott-Watrous procedure for $\Pi_0\Pi_1^A\Pi_0$ and $\Pi_0\Pi_1^B\Pi_0$ and using the free-to-retry property, then we can do the same thing with the standard Chernoff bound.

+ +
+ +

Therefore, the final question is that could we do the promise gap amplification using only one copy of the witness (i.e. strong error reduction) for $\mathsf{PostQMA}$?

+ +

Historically, such strong error reduction usually will have complexity-theoretic consequences, such as showing that $\mathsf{QMA}\subseteq \mathsf{PP}$ or $\mathsf{PreciseQMA}\subseteq \mathsf{PSPACE}$ (see space-efficient strong error reduction). So such strong error reduction for $\mathsf{PostQMA}$ might give us a direct proof for $\mathsf{PostQMA}\subseteq\mathsf{PSPACE}$.

+ +

Two facts might be helpful:

+ +
    +
  • Morimae-Nishimura proved that $\mathsf{PostQMA}=\mathsf{PreciseQMA}$ where $\mathsf{PreciseQMA}$ is a $\mathsf{QMA}$-type class with exponentially small completeness-soundness gap. And $\mathsf{PreciseQMA}$ have such strong error reduction (but it needs exponential time) -- so even such strong error reduction for $\mathsf{PostQMA}$ exists, it might need exponential time to amplify.
  • +
  • Aaronson proved that $\mathsf{PostBQP}$ machine can do efficiently generated uniformly polynomial-size bounded-error quantum circuits, where the circuits can consist of arbitrary $1$- and $2$-qubit invertible linear transformations. It is not clear to me whether such Marriott-Watrous type error reduction exists for invertible gates complexity class or not.
  • +
+",1777,,,,,1/28/2019 15:51,Does strong error reduction for PostQMA exist?,,0,0,,,,CC BY-SA 4.0 +5295,1,,,1/28/2019 16:06,,6,152,"

I have seen their applications in quantum state tomography but not in computation as such.

+",5667,,26,,1/28/2019 16:07,1/31/2019 9:38,Do weak measurements (with/without weak values) have any application in quantum computation?,,1,3,,,,CC BY-SA 4.0 +5296,1,5297,,1/28/2019 17:52,,1,81,"

As far as I know, correlation of two qubits in the $X$ basis implies that under a simultaneous bit flip, the composite quantum state must be invariant. For instance, $A$ and $B$ can be said to be correlated in the $X$ basis if they share a Bell state i.e.

+ +

$$|\Psi\rangle_{AB} = \frac{1}{\sqrt{2}}(|0\rangle_A\otimes |0\rangle + |1\rangle_A\otimes |1\rangle_B).$$

+ +

Under simultaneous bit flip it becomes

+ +

$$|\Psi\rangle_{AB}' = \frac{1}{\sqrt{2}}(|1\rangle_A\otimes |1\rangle_B + |0\rangle_A\otimes |0\rangle_B).$$

+ +

Clearly, $$|\Psi\rangle_{AB}=|\Psi\rangle_{AB}'.$$

+ +

Preskill uses the notation $X\otimes X = 1$ to denote this kind of correlation [1]. He also uses a similar notation $Z\otimes Z$ to imply correlation in the $Z$ basis. Any idea where this notation comes from? It doesn't seem obvious to me. At first sight, I would have considered $X\otimes X$ to mean the tensor product of the Pauli-$X$ operator with itself.

+ +
+ +

[1]: John Preskill - Introduction to Quantum Information (Part 1) - CSSQI 2012 (~44:10)

+",26,,26,,3/30/2019 7:52,3/30/2019 7:52,Why is correlation in the $X$ basis represented as $X\otimes X = 1$?,,1,0,,,,CC BY-SA 4.0 +5297,2,,5296,1/28/2019 18:37,,3,,"

It is the tensor product of the Pauli X with itself. Preskill is specifying the kind of correlation by giving you a matrix with a +1 eigenspace corresponding to the desired set of states. States where the simultaneous application of an $X$ gate to each qubit has no effect, including phase kickback when conditioned on an ancilla qubit.

+ +

This notation is very common in the stabilizer formalism. For example, error correcting codes that are stabilizer codes are often specified by a set of tensor-products-of-Paulis that must be repeatedly measured, e.g. $X_1 X_3 Z_5 Z_7$. When errors occur, the state will flip between the +1 and -1 eigenspaces of some of the measured stabilizers.

+",119,,26,,1/28/2019 18:50,1/28/2019 18:50,,,,0,,,,CC BY-SA 4.0 +5298,1,,,1/28/2019 19:16,,6,179,"

This isn't my area but the recent Quanta article How Space and Time Could Be a Quantum Error-Correcting Code struck me as interesting. They mention:

+ +
+

In their paper[1] conjecturing that holographic space-time and quantum + error correction are one and the same, they described how even a + simple code could be understood as a 2D hologram. It consists of three + “qutrits” — particles that exist in any of three states — sitting at + equidistant points around a circle. The entangled trio of qutrits + encode one logical qutrit, corresponding to a single space-time point + in the circle’s center. The code protects the point against the + erasure of any of the three qutrits.

+
+ +

The rest of the article more or less makes sense, but this is one point where I got stuck.

+ +
    +
  1. It's not very clear to me why one space-time point can be modeled specifically by a logical ""qutrit""? What's so special about a ""qutrit"" in this context? Why not a ""qubit"" or a general ""qudit""?

  2. +
  3. How exactly does the entangled trio perform the error correction of the central logical qutrit?

  4. +
+ +

Note that I'm not acquainted with the AdS/CFT formalism. So an exposition aimed at a general audience is preferable.

+ +

[1]: Bulk Locality and Quantum Error Correction in AdS/CFT (Almheiri et al., 2014)

+",26,,26,,1/29/2019 10:55,1/29/2019 14:47,Why can a point in anti-de Sitter space be modeled as a logical qutrit and how is its error correction done?,,0,2,,,,CC BY-SA 4.0 +5299,1,,,1/28/2019 20:11,,3,631,"

I was trying the qiskit Terra tutorial and it seems that the code provided to connect to an actual quantum computer doesn't run properly. With my API token generated and stored into the variable ""my_token"", I typed :

+ +
IBMQ.save_account(my_token)
+IBMQ.load_accounts()
+
+ +

and got the following error message :

+ +
------------------------------------------------------------------
+TypeError                        Traceback (most recent call last)
+<ipython-input-21-7eeefb4c8c69> in <module>()
+----> 1 IBMQ.save_account(my_token)
+      2 IBMQ.load_accounts()
+
+~/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/ibmqprovider.py in save_account(self, token, url, overwrite, **kwargs)
+    134         """"""
+    135         credentials = Credentials(token, url, **kwargs)
+--> 136         store_credentials(credentials, overwrite=overwrite)
+    137 
+    138     def active_accounts(self):
+
+~/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/credentials/_configrc.py in store_credentials(credentials, overwrite, filename)
+    122     # Read the current providers stored in the configuration file.
+    123     filename = filename or DEFAULT_QISKITRC_FILE
+--> 124     stored_credentials = read_credentials_from_qiskitrc(filename)
+    125 
+    126     # Check if duplicated credentials are already stored. By convention,
+
+~/anaconda3/lib/python3.6/site-packages/qiskit/providers/ibmq/credentials/_configrc.py in read_credentials_from_qiskitrc(filename)
+     61         if 'verify' in single_credentials.keys():
+     62             single_credentials['verify'] = bool(single_credentials['verify'])
+---> 63         new_credentials = Credentials(**single_credentials)
+     64         credentials_dict[new_credentials.unique_id()] = new_credentials
+     65 
+
+TypeError: __init__() missing 1 required positional argument: 'token'
+
+ +

Please tell me where I got it wrong.

+",5569,,26,,1/28/2019 20:37,1/28/2019 23:42,Why can't I connect to an IBMQ device?,,1,0,,,,CC BY-SA 4.0 +5300,2,,5269,1/28/2019 23:08,,3,,"

Qiskit Terra 0.7 changed visualization quite a bit. This blog post from the Qiskit team might be helpful.

+ +

Here's your code, updated for Qiskit Terra 0.7.2:

+ + + +
from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit
+
+c = ClassicalRegister(2)
+q = QuantumRegister(2)
+qc=QuantumCircuit(q, c)
+
+qc.measure(q, c)
+
+# draws an ascii circuit
+print(qc)
+
+# Output:
+#             ┌─┐
+# q0_0: |0>───┤M├
+#          ┌─┐└╥┘
+# q0_1: |0>┤M├─╫─
+#          └╥┘ ║
+#  c0_0: 0 ═╬══╩═
+#           ║
+#  c0_1: 0 ═╩════
+
+# draws a circuit with Matplotlib 
+diagram = qc.draw(output=""mpl"")
+
+# if you'd like to save to a file
+diagram.savefig(""test.svg"", format=""svg"")
+
+
+ +

Here's the SVG that was generated (converted to PNG for StackExchange): +

+ +

As for your second question... this sounds like something with your IDE's access to the library symbols. I don't have help for you there, except to say it's a fairly common problem. Good luck!

+ +
+ +

Note: This advice applies to Qiskit 0.7.x. Qiskit is rapidly evolving and you should expect breaking changes on new versions. You can find the release notes here.

+ +
+ +

Troubles installing Matplotlib/visualizations?

+ +

Per the blog post, you should be able to run:

+ +

pip install qiskit[visualization]

+ +

While it has worked for me in the past, it currently returns:

+ +

qiskit 0.7.2 does not provide the extra 'visualization'

+ +

As a workaround, you can install the packages this ""extra"" references:

+ +

pip install matplotlib nxpd ipywidgets pydot

+ +

Also, in the off chance you are using MacOS with virtualenv, you may run into this issue. I had to use venv to get it to work.

+ +

Good luck!

+",52,,52,,1/29/2019 2:48,1/29/2019 2:48,,,,0,,,,CC BY-SA 4.0 +5301,2,,5299,1/28/2019 23:42,,4,,"

I was able to reproduce your issue by changing the key a few times... seems to be a bug.

+ +

Either way, I was able to resolve my issue by removing the qiskitrc file.

+ +

rm ~/.qiskit/qiskitrc (your location may vary)

+ +

After that, set the key again and you should be good.

+",52,,,,,1/28/2019 23:42,,,,0,,,,CC BY-SA 4.0 +5302,1,,,1/29/2019 4:59,,1,89,"

I am reading that entangled particles can share information across long distances and the speed is usually faster than the speed of light...so am I right in assuming that future communications in the world will be without satellites and cell phone towers? Two entangled computers can talk instantaneously ...say between New York and Mumbai? I sit in New York and feed in ""A"" in my computer, that information shows up in my friend's computer in Mumbai? Only thing is these two computers (processors/monitors) need to be entangled during manufacture?

+",5671,,55,,12/15/2021 20:32,12/15/2021 20:32,Transmission of information over long distances,,1,2,,,,CC BY-SA 4.0 +5303,2,,5302,1/29/2019 8:57,,5,,"

No. As far as we know, entangled states do not permit faster than light communication. You might be able to use them for things like doubling bandwidth (see superdense coding) or sending quantum states, but that will all happen at the speed of light (or slower).

+ +

It is true that entangled states do seem to know something about the constituent elements faster than they ought to know. If the two parties make measurements on the entangled state, although the individual outcomes are random, the measurement results display correlations. However, these correlations between measurement results cannot be used to communicate anything.

+ +

The other thing that must be emphasised is that it's not quite so simple as ""these two computers (processors/monitors) need to be entangled during manufacture"". Every communication action that uses entanglement consumes that entanglement. So, you need a constantly replenishing supply.

+",1837,,,,,1/29/2019 8:57,,,,0,,,,CC BY-SA 4.0 +5304,1,,,1/29/2019 13:00,,3,66,"

In An optimal quantum algorithm to approximate the mean and its application for approximating the median of a set of points over an arbitrary distance Brassard presents a quantum algorithm for finding the mean output of a function

+ +

$F(1,..,N) \implies [0,1]$

+ +

in time $O(1/\text{error})$. The paper implies that an equivalent classical algorithm would take $O(1/\text{error}^2)$ (actually it gives results for error in terms of time, but no matter).

+ +

The classical algorithm is not actually given but I assume it would just be repeated sampling from $F$ with error properties depending on the sample mean formula $\sigma_\bar{F}=\sigma_F/\sqrt{n}$. The validity of $\sigma_\bar{F}$ therefore does not depend on the distribution of $F$, although if we are interested in the distribution of $\bar{F}$ then the distribution of $F$ becomes important.

+ +

Does Brassard's mean1 algorithm differ at all from the classical counterpart in its dependence on distribution of $F$? i.e. the distribution does not matter so far as $\sigma_\bar{F}$ is concerned but is important if we are interested in the distribution of the mean?

+",5174,,26,,1/29/2019 13:17,1/29/2019 13:17,Does Brassard's algorithm for calculating the mean make implicit assumptions on distribution?,,0,3,,,,CC BY-SA 4.0 +5306,2,,5293,1/29/2019 18:50,,5,,"

This is essentially the same calculation I outlined in this other answer (though it might not be immediately obvious).$\newcommand{\ket}[1]{\lvert#1\rangle}\newcommand{\ketbra}[2]{\lvert#1\rangle\!\langle#2\rvert}$

+

Let us denote with $\Pi_Y$ and $\Pi_N=I-\Pi_Y$ the projectors onto the "yes space" and the "no space". +Given an initial state $\ket\psi$, the goal is getting as close to a state in $\Pi_Y$ as possible, as fast as possible.

+

Because $\{\Pi_Y,\Pi_N\}$ define a separation of the full space, any state can be decomposed using these operators. In particular, we can write +$$\ket\psi=\cos\theta\ket\alpha+\sin\theta\ket\beta,$$ +where $\theta$ is defined via $\cos\theta\equiv\|\Pi_Y\ket\psi\|$, while $\ket\alpha\equiv\Pi_Y\ket\psi/\cos\theta$ and $\ket\beta\equiv\Pi_N\ket\psi/\sin\theta$ (I'm using a slightly different notation with the $\theta$ than the one in the OP, sorry about that).

+

The Grover iterator is defined as $G=-S_\psi S_Y$, where $S_Y$ and $S_\psi$ are reflections in state space, that is, operators which leave untouched some subspace and change the sign on everything else. +More specifically $S_Y$ flips the "yes space", while $S_\psi$ flips the direction corresponding to the initial state $\ket\psi$ (that is, it leaves the direction of the initial state untouched and flips everything else). +Mathematically, these reflections can be written as +$$S_Y\equiv I - 2\Pi_Y, \qquad +S_\psi\equiv I - 2\ket\psi\!\langle\psi\rvert.$$ +It follows that the Grover operator reads +$$G=(I-2\ket\psi\!\langle\psi\rvert)(2\Pi_Y-I).$$ +Expanding this product we get +$$G=2\Pi_Y-I-4 \lvert\psi\rangle\!\langle\psi\rvert\Pi_Y + 2\ket\psi\!\langle\psi\rvert.$$ +Expanding $\ket\psi$ in terms of $\ket\alpha$ and $\ket\beta$, and remembering the property of $\ket\alpha$ that $\Pi_Y\ket\alpha=\ket\alpha$, you can readily verify that this expression becomes, after a bit of algebra, the following (let me use here the shorthand notation $c\equiv\cos\theta$ and $s\equiv\sin\theta$):

+

$$G=2\Pi_Y-I+2s^2\ketbra\beta\beta-2c^2 \ketbra\alpha\alpha +2cs (\ketbra\alpha\beta-\ketbra\beta\alpha).$$

+

Now this represents a rotation in state space of some angle with respect to some axis, but because we are only interested in the action of $G$ on states spanned by the $\ket\alpha$ and $\ket\beta$ states, we need only analyse how $G$ acts on these two states. We then readily get: +\begin{align} +G\ket\alpha&=-\cos(2\theta)\ket\alpha-\sin(2\theta)\ket\beta, \\ +G\ket\beta&=\phantom{-}\sin(2\theta)\ket\alpha-\cos(2\theta)\ket\beta. \\ +\end{align} +Collecting the corresponding amplitudes in a matrix, we conclude that the action of $G$ in the space spanned by $\ket\alpha$ and $\ket\beta$ can be represented as +$$G\doteq\begin{pmatrix}-\cos(2\theta) &\sin(2\theta)\\-\sin(2\theta) & -\cos(2\theta)\end{pmatrix}.$$

+

Note that this shows that the result holds in a more general scenario that the one often used when first explaining Grover's algorithm. +You can however easily reduce to the standard situation (which you also use in your post) by having $\ket\psi$ be a balanced superposition of all basis states, and $\Pi_Y$ a trace-1 projector (that is, a projector over a one-dimensional subspace).

+
+

Another derivation with different notation

+

Let us use the shorthand notation $\psi\equiv\ketbra\psi\psi$, $Y\equiv\Pi_Y$ and $N\equiv\Pi_N$. We then have +\begin{align}G = (I-2\psi)(2Y-I) += &Y(1-2\psi)Y - 2N\psi Y \\ +& +2 Y\psi N -N(1-2\psi)N. +\end{align} +Then, specialising to the case $\ket\psi=\cos(\theta)\ket y+\sin(\theta)\ket n$, we get +$$G = Y(I - 2\cos^2(\theta) \ketbra y y)Y + \sin(2\theta)(\ketbra y n - \ketbra n y) \\ +- N(I- 2 \sin^2(\theta) \ketbra n n)N,$$ +and in particular its action on $\ket y$ and $\ket n$ is +\begin{align} +G\ket y &= -\cos(2\theta)\ket y - \sin(2\theta)\ket n, \\ +G\ket n &= \phantom{-}\sin(2\theta) \ket y - \cos(2\theta) \ket n. +\end{align}

+",55,,55,,8/9/2020 11:27,8/9/2020 11:27,,,,2,,,,CC BY-SA 4.0 +5307,1,,,1/29/2019 19:09,,1,68,"

When I run a QASM program on a QE simulator, I get this error.

+ +
No handlers could be found for logger        
+""IBMQuantumExperience.IBMQuantumExperience""
+
+ +

What does this mean and how do I fix it?

+",5676,,26,,1/29/2019 19:17,1/29/2019 19:17,QE error: No handlers could be found for logger,,0,1,,,,CC BY-SA 4.0 +5308,1,5309,,1/29/2019 19:41,,3,762,"

Is there a way to access the results of measurements 'per shot' performed on a backend such as one of the real IBM machines?

+ +

I know it can generate a histogram from the cumulative data, but I was wondering if it is possible to see what the measurement outcomes were for a particular shot out of the standard 1024.

+",5679,,26,,1/29/2019 19:45,1/30/2019 2:26,Qiskit: 'per shot' result,,1,0,,,,CC BY-SA 4.0 +5309,2,,5308,1/30/2019 2:26,,1,,"

There is indeed. You just need to use get_memory() instead of get_counts() (and also use a memory=True flag in the execute function. It works with the local qasm simulator and the 5 qubit device (and not currently with the cloud-based qasm simulator or 14 qubit device).

+ +

Here's an example using it to generate a series of random bits.

+ +
q = QuantumRegister(1)
+c = ClassicalRegister(1)
+circ = QuantumCircuit(q, c)
+
+circ.h(q)
+
+circ.measure(q,c)
+
+job = execute(circ, Aer.get_backend('qasm_simulator'), shots=10024, memory=True)
+data = job.result().get_memory()
+
+",409,,,,,1/30/2019 2:26,,,,2,,,,CC BY-SA 4.0 +5311,1,,,1/30/2019 4:04,,2,223,"

In VQE we wish to minimize some cost function $F(\vec{x})$ that is dependent on a quantum state $\left| \psi_\vec{x} \right>$ which is prepared by a unitary $U(\vec{x})$ depending on some (typically real) parameters $\vec{x} \in \mathbb{R}^n$. A typical example for the cost function is the energy expectation value of some hamiltonian, i.e. $F(\vec{x}) = \left< \psi_\vec{x} \right|H \left|\psi_\vec{x} \right>$. Usually I can't measure my cost function directly, but only learn about it by making more and more measurements. For optimization I need some accuracy to decide in which direction to take the next optimization step, but I don't want to take arbitrarily many samples before moving on, since each sample means preparing $\psi_\vec{x}$ and measuring its energy w.r.t $H$.

+ +

Is there any research done, on what are optimal (in the sense of minimizing the number of calls to my quantum computer) sampling strategies for this kind of problem? Or what should I search for? ""optimizing functions from samples"" doesn't get me anywhere.

+ +

Cheers, +Jan Lukas

+",4850,,,,,3/28/2021 0:04,Optimal sampling strategy for VQE,,1,0,,,,CC BY-SA 4.0 +5315,1,5317,,1/30/2019 13:21,,8,1527,"

I am trying to reconstruct the time evolution of a Hamiltonian on the quantum computing simulator, quirk. Ideally I would like to generalise this to any simulator. The unitary matrix is

+ +

$$U(t)=e^{-iHt}$$

+ +

and I've found a way to decompose the Hamiltonian into the following form:

+ +

$$U(t)=A+B(t)$$

+ +

Both $A$ and $B(t)$ can be implemented individually. (Although A is a non-unitary diagonal matrix consisting of 0s and 1s) One with a static, custom matrix gate and the other using a series of time dependent and standard gates.

+ +

Is there a systematic way to reconstruct $U(t)$ generally? There is no limit on the number of ancillary gates

+",5594,,5594,,1/31/2019 14:29,3/9/2019 9:16,Is there any method of adding two operators in a circuit?,,3,5,,,,CC BY-SA 4.0 +5316,2,,5315,1/30/2019 13:51,,10,,"

Below is a recent paper by Gilyén et al on doing ""quantum matrix arithmetics"", allowing to implement linear combinations of unitary operators. They consider the general case where the linear combination in itself might not be unitary. Since the linear combination in your case is unitary, maybe there's a more efficient way.

+ +

[1]: Gilyén, András, et al. ""Quantum singular value transformation and beyond: exponential improvements for quantum matrix arithmetics."" arXiv preprint arXiv:1806.01838 (2018).

+",282,,26,,1/30/2019 16:45,1/30/2019 16:45,,,,0,,,,CC BY-SA 4.0 +5317,2,,5315,1/30/2019 16:59,,9,,"

What you are trying to do is called Hamiltonian Simulation.

+ +

If your exponential can be split in a sum of unitary matrices, @smapers' answer guide you to a good algorithm: the Linear Combination of Unitary (LCU) algorithm.

+ +

In addition to the paper linked by @smapers, here are some other papers/videos explaining LCU:

+ + + +

PS: there are plenty of other algorithms to perform Hamiltonian simulation. If your exponential can be split into known unitary matrices, LCU is probably the best algorithm, but you should know that it is not the only algorithm capable of simulating Hamiltonian. You can find more links in one of my previous answers about Hamiltonian Simulation. If you think you need more links on Hamiltonian Simulation algorithms just let me know.

+",1386,,,,,1/30/2019 16:59,,,,3,,,,CC BY-SA 4.0 +5318,1,,,1/30/2019 17:32,,2,1924,"

I am currently working on the Grover algorithm again. In many lectures and documents, as well as books, I noticed that there is always talk of looking for a single element of $N$ elements. Now I read to Nielsen that Grovers algorithm can also be used for multiple searches. For example if you are looking for $M>1$ elements from $N$

+ +

Now comes the problem, in Nielsen is e.g. said that the process does not change fundamentally. I tried an example by looking for a single element, you can see the result here, I have successively applied the individual steps of the algorithm:

+ +
+ +

Searched item: $|01\rangle$

+ +

Input: $|00\rangle$

+ +

Hadamard on n-bits: +$$ H|00\rangle=\frac{1}{2}(|00\rangle+|01\rangle+|10\rangle+|11\rangle)$$ +Apply $ U_f $ to bits: +$$\frac{1}{2}(|00\rangle-|01\rangle+|10\rangle+|11\rangle)$$ +Hadamard on n-bits (again): +$$\frac{1}{4}(|00\rangle+|01\rangle+|10\rangle+|11\rangle- +|00\rangle+|01\rangle-|10\rangle+|11\rangle ++|00\rangle+|01\rangle-|10\rangle-|11\rangle ++|00\rangle-|01\rangle-|10\rangle+|11\rangle) +=\frac{1}{2}(|00\rangle+|01\rangle-|10\rangle+|11\rangle)$$ +Phase Shift: +$$\frac{1}{2}(|00\rangle-|01\rangle+|10\rangle-|11\rangle)$$ +Hadamard transform (again): +$\frac{1}{4}(|00\rangle+|01\rangle+|10\rangle+|11\rangle +-|00\rangle+|01\rangle-|10\rangle+|11\rangle ++|00\rangle+|01\rangle-|10\rangle-|11\rangle +-|00\rangle-|01\rangle-|10\rangle-|11\rangle) +=\frac{1}{4}(4|01\rangle)$$

+ +

So you see directly that the searched (single) element ($|01\rangle$) comes out, the question is, what happens if I say we are looking for two elements e.g $|01\rangle, |10\rangle$?

+ +
+ +

This is understandable for me as far as possible, especially that even at the end exactly one single element is in the register, that one has searched.

+ +

Now my question comes: What happens if I search for several elements? Let's say, how do you stay with the example and are you looking for another element? How about the individual steps of the algorithm and, most importantly, what is in the register afterwards?

+ +

I am very much looking forward to your answers and hope that my question is clear and understandable. Thanks in advance!

+",,user4961,,,,1/30/2019 23:58,Grover algorithm for more than one element,,1,0,,,,CC BY-SA 4.0 +5320,2,,5318,1/30/2019 23:58,,2,,"

Firstly, the general case:

+

When looking for a single element, you apply the inversion $U_f = I - 2\left|\psi\rangle\langle\psi\right|$, where $\left|\psi\right>$ is the searched-for element. When searching for $M$ elements, forming a subset $S$, this inversion becomes $$U_f = I - 2\sum_{x\in S}\left|x\rangle\langle x\right|,$$ which is now an inversion about $\left|S\right> = \frac{1}{\sqrt M}\sum_{x\in S}\left|x\right>$ for states in the subspace spanned by $\left|S\right>$ and $\left|+\right>$.

+

In the single element case, the angle $\gamma$ between $\left|+\right>$ and $\left|\psi\right>$ can be given by $\sin\gamma = \left<\psi|+\right> = \frac{1}{\sqrt N}$, with an initial angle between the starting state $\left|+\right>$ and $\left|\psi\right>$ of $\gamma_0 = \frac{1}{2}\pi - \gamma$. After $T$ iterations, the angle between the current state and the $\left|\psi\right>$ becomes $$\gamma_T = \frac{1}{2}\pi - \left(2T+1\right)\sin^{-1}\frac{1}{\sqrt N},$$ as after each iteration, the current state shifts by $2\gamma$. This gives a probability of obtaining $\left|\psi\right>$ of $$\sin^2\left(\left(2T+1\right)\sin^{-1}\frac{1}{\sqrt N}\right)$$ and so we take $$T = \left\lfloor\frac{\pi\sqrt N}{4}\right\rfloor.$$

+

In the multiple element case, this extends to $\sin\gamma = \left<S|+\right> = \sqrt{\frac{M}{N}}$, we get a probability of obtaining the state $\left|S\right>$ of $$\sin^2\left(\left(2T+1\right)\sin^{-1}\sqrt{\frac{M}{N}}\right)$$, giving $$T = \left\lfloor\frac{\pi}{4}\sqrt{\frac{N}{M}}\right\rfloor.$$

+

The given example

+

We're looking for the 2 elements $\left|01\right>$ and $\left|10\right>$, so $M=2,\, N = 4\implies T=1$. Following the algorithm:

+

\begin{align*}H^{\otimes 2}\left|00\right> &= \frac{1}{2}\left(\left|00\right\rangle+\left|01\right\rangle+\left|10\right\rangle+\left|11\right\rangle\right)\\ +U_fH^{\otimes 2}\left|00\right> &= \frac{1}{2}\left(\left|00\right\rangle-\left|01\right\rangle-\left|10\right\rangle+\left|11\right\rangle\right) \\ +H^{\otimes 2}U_fH^{\otimes 2}\left|00\right> &= \left|11\right\rangle \\ +-U_0H^{\otimes 2}U_fH^{\otimes 2}\left|00\right> &= -\left|11\right\rangle \\ +-H^{\otimes 2}U_0H^{\otimes 2}U_fH^{\otimes 2}\left|00\right> &= \frac{1}{2}\left(-\left|00\right\rangle+\left|01\right\rangle+\left|10\right\rangle-\left|11\right\rangle\right).\end{align*}

+

In this specific case, this is obviously no more help than picking at random. Going back to the probability of obtaining $\left|S\right>$, we have that $\sin^{-1}\frac{1}{\sqrt 2} = \frac{\pi}{4}$ and that $$\sin^2\left(\frac{\pi}{4}\left(2T+1\right)\right) = \frac{1}{2},$$ so the probability of obtaining the correct result is 1/2, as a result of $N=2M$.

+",23,,-1,,6/18/2020 8:31,1/30/2019 23:58,,,,4,,,,CC BY-SA 4.0 +5321,1,5322,,1/31/2019 1:50,,3,79,"

The R operation in Q# is listed by Microsoft in the documentation as follows

+ +

operation R (pauli : Pauli, theta : Double, qubit : Qubit) : Unit

+ +

However, when I try to use the following command in a Q# operation,

+ +

R(PauliX,0,Q1);

+ +

I get an error, referencing the line of code for the R command:

+ +

The type of the given argument does not match the expected type.

+ +

Q1 is of course a Qubit, so I don't see what could be causing the problem. I've also been having difficulty getting the R1 gate working, but I suspect for similar reasons.

+ +

To see the relevant documentation, please visit R operation, Q# Docs.

+",5689,,2879,,5/10/2019 7:08,5/10/2019 7:08,Type error creating R gate in Q#?,,1,0,,,,CC BY-SA 4.0 +5322,2,,5321,1/31/2019 1:59,,2,,"

The second argument theta has to be a Double, and 0 is a constant of type Int. Q# doesn't have implicit type casting, so you need to make sure your second argument is a Double. If you're looking for a rotation by zero angle, you'll need to do R(PauliX, 0.0, Q1);. Alternatively, you can use ToDouble to cast an integer parameter to a Double.

+",2879,,,,,1/31/2019 1:59,,,,1,,,,CC BY-SA 4.0 +5323,1,5325,,1/31/2019 6:09,,4,700,"

I know how to create controlled versions of gates like X, Y, Z. For example, a controlled X gate would be implemented by writing

+ +

(Controlled X)([control],target);

+ +

However, I've tried numerous times to create a controlled R1 gate with no success, and there are no examples available on the Q# documentation or elsewhere on the web from what I've seen. As an example of what I've attempted, I've tried

+ +

(Controlled R1)([control],theta,target);

+ +

and get the following error:

+ +

The shape of the given tuple does not match the argument type.

+ +

From what I gather the issue is that an X gate does not require any additional parameters, whereas an angle needs to be specified for the R1 gate to be well defined.

+ +

To see the relevant documentation, please visit R1 Operation, Q# Docs, and Operations and Functions, Q# Docs.

+",5689,,2879,,1/6/2020 19:02,1/6/2020 19:02,Creating controlled R1 gates in Q#?,,1,0,,,,CC BY-SA 4.0 +5324,2,,4827,1/31/2019 6:33,,2,,"

Absolutely! BB84 can be implemented over LiFi. There are however certain constraints and inefficiencies involved, which will have to be taken into account for implementation - possibly leading to the usage of BB84 variants like Decoy State, with higher efficiencies than pure BB84.

+ +
    +
  1. A four non-orthogonal polarization basis encoded single photon would be very inefficient (mainly loss and complexity of implementation) primarily due to mobility of participants and ambient light noise. We will have to switch to phase encoding, RFI QKD protocol or the decoy state variant of BB84 as an alternate improvement strategy.

  2. +
  3. Aligning the transmitter and receiver to deliver weak coherent pulses will be challenging, assuming that the transmitter will be handheld or mobile.

  4. +
  5. The Detector needs to be precisely placed and current cost implications will force us to implement a single detector/multiple transmitter system. This would imply that we have to have a multiplexing (and coordination) strategy for serving individual transmitters. Also, the efficiency shows significant variations on the positioning of the detector in the room (line of sight) and the field of view angle. Losses of the order of 30-50dB have been observed in experimental results.

  6. +
+ +

Hope the insight helps.

+",5690,,5690,,1/31/2019 12:30,1/31/2019 12:30,,,,0,,,,CC BY-SA 4.0 +5325,2,,5323,1/31/2019 6:52,,3,,"

If the base operation takes several arguments, you need to enclose the corresponding arguments of the controlled version of the operation in parentheses to convert them into a single tuple. In your case, you need to call it as (Controlled R1)([control], (theta, target));.

+ +

This is covered in the ""Controlled"" section of Q# type model documentation with Rz gate used as an example. I wonder how to make this information more discoverable...

+",2879,,,,,1/31/2019 6:52,,,,1,,,,CC BY-SA 4.0 +5326,1,5329,,1/31/2019 9:16,,3,121,"

In the last chapter of John Preskill's Lecture Notes for Physics 219: +Quantum Computation (PDF), he mentions the following on pg.12.

+ +
+

This behavior is compatible with the spin-statistics connection: the + angular momentum $J$ of the $n$-anyon molecule satisfies

+ +

$$e^{-2\pi i J_n} = e^{-2\pi i n^2 J} = e^{i n^2 \theta}.$$

+ +

For example, consider a molecule of two anyons, and imagine rotating + the molecule counterclockwise by $2\pi$. Not only does each anyon in + the molecule rotate by $2\pi$; in addition one of the anyons revolves + around the other. One revolution is equivalent to two successive + exchanges, so that the phase generated by the revolution is + $e^{i2\theta}$. The total effect of the two rotations and the + revolution is the phase

+ +

$$\exp[i(\theta + \theta + 2\theta)] = e^{i4\theta}.$$

+
+ +

Not only does each anyon in the +molecule rotate by $2\pi$; in addition one of the anyons revolves around the +other. One revolution is equivalent to two successive exchanges so that +the phase generated by the revolution is $e^{i2\theta}$.

+ +

How is this possible? A molecule here is just a localized region of two close anyons in the given space. Rotating the ""molecule"" should just be equal to revolving the two anyons one complete orbit about each other, that must give me a phase of $e^{i2\theta}$. +What is meant by

+ +
+

Not only does each anyon in the + molecule rotate by $2\pi$...

+
+ +

As far as I know, ""rotation"" of an anyon is no permutation in Topological QC. +What's the concept involved here with additional $e^{i2\theta}$ phase that we are getting?

+",4889,,26,,1/31/2019 14:52,1/31/2019 15:08,Topological anyonic molecule statistics,,1,2,,,,CC BY-SA 4.0 +5327,2,,5295,1/31/2019 9:38,,1,,"

The weak measurement was primarily built as a tool for tomography for obvious reasons, to estimate and approximate the state statistically with the least disturbance. +They do not have much use in the conventional Quantum Circuit model and other formalisms because the measurement and readout are performed after all the gate operations are done on specific qubits, and because you require to extract the maximum information out of the measurement, there isn't any intrinsic requirement of a weak measurement. Also, in all conventional circuits, we have the state and register initialization only once, in the start of the protocol. This is the basic layout of most quantum algorithms in use.

+ +

However, there are recent few extended protocols where you require to preserve and re-initialize the qubits successively after readout, there comes the use of weak measurement wrt certain trade-off parameters.

+ +

One such article which claims to increase efficiency using weak measurements is (without restarting a whole protocol every time): https://iopscience.iop.org/article/10.1088/1367-2630/13/5/053024/meta

+",4889,,,,,1/31/2019 9:38,,,,0,,,,CC BY-SA 4.0 +5328,1,,,1/31/2019 11:23,,4,482,"

If I have a mutually commuting set of observables $\{A, B, C, D,...\}$ and when we talk of simultaneous measurements of these observables, do we mean a single apparatus is required for simultaneous measurement or a series of apparatuses are required?

+ +

Because ""simultaneous"" suggests that at the same instant knowing values of all observables.

+",5667,,26,,1/31/2019 13:59,1/31/2019 14:00,What does simultaneous measurement of a mutually commuting set of observables mean?,,2,1,,,,CC BY-SA 4.0 +5329,2,,5326,1/31/2019 11:50,,3,,"

The spin-statistics theorem requires a particle's wave function to acquire the same phase when it is rotated by an angle of $2 \pi$ about itself and when exchanged with an identical (indistinguishable) particle. For example, a fermion acquires a phase of $-1$ both in exchange and self-rotation.

+ +

Thus, when we think of an anyon as a flux-charge entity, we have to think of it also as an extended object having an inner structure of a spinning body, or equivalently, when it rotates about its axis, its own charge rotates around its own flux.

+ +

The self-rotation explains the doubling of the topological phase of the anyon molecule.

+ +

This property is explained, possibly more clearly, by Pachos, (sections 2.1.2 and 4.1.6). The following figure explains the phase acquired in self-rotation is taken from section 2.1.2:

+ +

+ +

Pachos description of the figure:

+ +

(a) Anyons can be described effectively as composite particles with an attached magnetic flux, and a ring with electric charge, $q.$ When anyon 1 moves around anyon 2 along loop $C$ its charge circulates the flux of the other anyon and the Aharonov-Bohm effect gives rise to a non-trivial statistical phase.

+ +

(b) When the composite particle rotates around itself by $2\pi$ it again acquires a phase factor as its charge circulates its flux, which can be attributed to a spin.

+ +

Abelian and non-Abelian anyons can be described by means of mathematical objects called ribbon categories. Pachos in section 4.1.6 (figure 4.9), shows how this ribbon model explains the spin statistics theorem, in an example when creation of an identical anyon-anti-anyon pair, their exchange, then their annihilation back to the vacuum is identical to replacing the exchange by a rotation of one anyon about itself.

+ +

+ +

Pachos description of the figure:

+ +

An anyon $q$ and an anti-anyon $\bar{q}$ denoted with their worldribbons are pair-created, exchanged and then fused to the vacuum. The exchange process can be continuously deformed to rotating one of the anyons around itself by $2\pi$. This equivalence can be nicely verified with a belt.

+",4263,,4263,,1/31/2019 15:08,1/31/2019 15:08,,,,0,,,,CC BY-SA 4.0 +5330,2,,5328,1/31/2019 12:05,,3,,"

A mutually commuting set of observables can be perfectly measured (in principle) simultaneously in the sense that they can be brought in the diagonal form to have the same eigenvector basis. ""Simultaneous"" here means the simultaneous sharing of the eigenvectors and not necessarily ""simultaneous in time"". Hence, it can be thought to be a simultaneous measurement in time also, with different apparatus. And hence 'an apparatus' that can share the measurement operators constructed from the same eigenbasis can perfectly measure (project) them all perfectly. Such an apparatus can always be constructed for these observables.

+ +

It might be confused with the position-momentum uncertainty relation where it is stated about the incompatible measurement 'in time'. But it essentially is the same phenomenon there because $\hat{x}$ and $\hat{p}$ do not commute and hence cannot be brought to the same eigenbasis at once. one can be measured making the other have great standard deviation and vice versa.

+ +

Also, refer to this question (precisely the same question asked on StackExchange Physics):

+",4889,,26,,1/31/2019 14:00,1/31/2019 14:00,,,,0,,,,CC BY-SA 4.0 +5331,2,,5315,1/31/2019 12:17,,4,,"

It seems that you need oblivious fixed point amplitude amplification. See Theorem 26-28 in the aforementioned paper: arXiv:1806.01838 [quant-ph].

+ +

As a first step, you can implement $\frac{A+B(t)}{2}$ as a block of a unitary. This is however not a unitary itself, but then you can turn it into a unitary using oblivious fixed point amplitude amplification. If you also happen to know the (spectral) norm of $A+B(t)$, then ordinary oblivious amplitude amplification suffices.

+",5692,,26,,3/9/2019 9:16,3/9/2019 9:16,,,,0,,,,CC BY-SA 4.0 +5332,2,,4876,1/31/2019 13:07,,2,,"

Forrelation might be such a problem. The question is ""Is a first Boolean function highly correlated with the Fourier transform of a second Boolean function?"" This is solved with $1$ quantum query but Aaronson and Ambainis showed that classically one needs $\Omega(\sqrt N /\log N)$ random queries.

+ +

See also the Quanta magazine article- by the work of Raz and Tal the problem is likely to be out of the polynomial hierarchy. Considering Norbert Schuch's comment about $\mathsf{BQP}\subseteq\mathsf{PSPACE}$, this may be about as good a separation as can be expected.

+",2927,,,,,1/31/2019 13:07,,,,0,,,,CC BY-SA 4.0 +5333,1,,,1/31/2019 13:18,,5,1022,"

What is the difference between the D-Wave systems and the newly-born IBM Q System One?

+",5693,,26,,1/31/2019 14:10,1/31/2019 14:44,D-Wave systems and IBM Q System One,,1,1,,,,CC BY-SA 4.0 +5334,2,,5328,1/31/2019 13:55,,1,,"

It depends a bit on the context, but the idea is that if two observables commute that means that measuring one will not affect measurement results of the other, and you can therefore think of the values of $A$ and $B$ in a given state as ""simultaneously existing"".

+ +

This means that you can characterize a state by the measurement outcomes you will get if you measure it in the different bases. For example, you might have a state $\lvert\psi\rangle$ which gives outcome ""$1$"" if you measure the observable $A$ and outcome ""$-1$"" if you measure the observable $B$, and therefore you can assign to the state the labels ""$1_A,-1_B$"", to represent this fact.

+ +

Note how this contrasts sharply with the case of noncommuting observables. If $A$ and $B$ do not commute, then measuring $A$ changes the results of measuring $B$, and vice versa. This means that you cannot meaningfully assign to a state labels representing what results you would get by measuring $A$ and $B$, because the order in which you do that changes the kind of results you would get.

+",55,,,,,1/31/2019 13:55,,,,2,,,,CC BY-SA 4.0 +5335,2,,5333,1/31/2019 14:35,,4,,"

When referring to the commercial quantum computers of both parties, it is that both are based on a different quantum principles.

+ +

The D-Wave machine works via quantum annealing and is suited for optimization problems. The machine by IBM is a gate-based quantum computer, similar to how digital computers work at the elementary level.

+ +

As the two quantum paradigms differ, it is also hard to compare them based on for instance the number of qubits (~2,000 vs. 20). The details of both machines can easily be found online.

+",2005,,26,,1/31/2019 14:44,1/31/2019 14:44,,,,1,,,,CC BY-SA 4.0 +5338,1,5339,,1/31/2019 16:51,,1,99,"

What is the proof that any $2^n\times 2^n$ quantum operator can be expressed in terms of the tensor product of $n$ number of $2\times 2$ quantum operators acting on a single qubit space each?

+",4889,,26,,2/1/2019 21:53,2/6/2019 23:50,Proof that $2^n \times 2^n$ operator be decomposed in terms of $2 \times 2$ operators,,1,2,,,,CC BY-SA 4.0 +5339,2,,5338,1/31/2019 17:00,,4,,"

I presume you mean a $2^n\times 2^n$ quantum operator, $U$?

+ +

Let's assume we can write +$$ +U=\sum_{x,y\in\{0,1\}^n}U_{xy}|x\rangle\langle y|. +$$ +All we have to do is show that we can construct any $|x\rangle\langle y|$ using Pauli operators. But this is just the same as +$$ +\bigotimes_{i=1}^n|x_i\rangle\langle y_i|, +$$ +so provided I can create any $|x_i\rangle\langle y_i|$ for $x_i,y_i\in\{0,1\}$ using Pauli matrices, I'm done. It's a simple exercise to check +$$ +|0\rangle\langle 0|=(\mathbb{I}+Z)/2\qquad |1\rangle\langle 1|=(\mathbb{I}-Z)/2 +$$ +and +$$ +|0\rangle\langle 1|=(X+iY)/2\qquad |1\rangle\langle 0|=(X-iY)/2. +$$

+",1837,,,,,1/31/2019 17:00,,,,1,,,,CC BY-SA 4.0 +5340,1,,,1/31/2019 18:35,,6,858,"

I'm trying to implement Grover's algorithm in pyQuil, but I'm having trouble creating the oracle matrix given the function $f$, where $f(x)=1$ if $x=w$ and $f(x)=0$ otherwise. In most of the implementations I've seen, either a mysterious oracle function is called or the matrix representation is created using the knowledge of the index, which requires classical computation of all the $f(x)$ values, defeating the purpose of Grover search.

+ +

Can someone show me exactly how to create in the matrix (in say pyQuil) when writing the algorithm from scratch without classically computing all of the $f(x)$ values?

+",5694,,55,,4/14/2019 14:49,4/14/2019 14:49,How to create the oracle matrix in Grover's algorithm?,,1,0,,,,CC BY-SA 4.0 +5343,2,,4017,2/1/2019 8:46,,5,,"

Update on the subject: there are several implementations in the wild. I don't know if you still need them, but even if you don't it will hopefully be useful to other people.

+

I chose to list the implementations by "provenance" rather than by the algorithm used because there are not that much implementations. This may change in the future.

+
    +
  1. Qiskit-aqua: Qiskit is the library of IBM for quantum computing. Qiskit-aqua is the part of the library that deals with quantum algorithms.

    +

    The Qiskit-aqua implementation can only simulate Hamiltonians that are a sum of hermitian matrices that can be written as tensor products of Pauli operators. To do so, they used the Trotter-Suzuki formula.

    +

    The documentation is available here.

    +
  2. +
  3. simcount: Implementation of 3 hamiltonian simulation algorithms for a specific kind of hamiltonian. Based on Quipper. All their work is explained in the paper Toward the first quantum simulation with quantum speedup (Andrew M. Childs, Dmitri Maslov, Yunseong Nam, Neil J. Ross, Yuan Su, 2017).

    +

    The 3 algorithms (and their variations) implemented in the repository have been optimised for a very specific Hamiltonian $$H = \sum_{j=1}^n \left( \vec{\sigma}_j \cdot{} \vec{\sigma}_{j+1} + h_j \sigma_j^z \right).$$

    +

    The implementations are available here.

    +
  4. +
  5. QatHS (disclaimer: I did this one): Implementation of the Trotter-Suzuki formula along with Hamiltonian Simulation algorithms for black-box oracles. The oracle-based Hamiltonian Simulation algorithms are based on a Master thesis available here (requires to ask for the PDF, I could not find it elsewhere).

    +

    In short: you can simulate any Hermitian matrix as long as you have an oracle for each of the matrices in your decomposition. Integer-weighted matrices have been extensively tested with the wave equation solver implementation, fixed-points weighted matrices should also work but have not been tested as thoroughly.

    +

    The implementation is available here.

    +
  6. +
+",1386,,1386,,9/25/2020 7:35,9/25/2020 7:35,,,,6,,,,CC BY-SA 4.0 +5344,2,,5340,2/1/2019 9:05,,8,,"

For most functions $f(x)$, there is nothing better than calculating all the values. After all, for most functions, there is no better way of defining the function than giving its truth table.

+ +

Probably, you want to talk about the relatively small fraction of cases in which the function $f(x)$ has some reasonably compact description. In that case, you should be able to design a classical circuit for its implementation. If you can do that, you can make the implementation reversible. And, once you've done that, it's no problem programming that reversible implementation into a quantum computer to act in the place of your oracle. And the whole point of Grover's search is to minimise the number of calls to the oracle, and hence minimise the number of times the function is evaluated.

+ +

At this point, some philosophical questions may arise, some of which were discussed here. Particularly regarding search, remember that the function would not typically be defined by having the marked item programmed into it directly, just that the function can run and recognise the marked item. You can think of this a bit like factoring. If I give you a large composite number of factor, you can run some code to determine if a particular integer is a factor or not. It doesn't mean that the code you've written already knows what the factors are.

+",1837,,,,,2/1/2019 9:05,,,,0,,,,CC BY-SA 4.0 +5345,1,5348,,2/1/2019 9:40,,3,350,"

What is the Hamiltonian of a single ion in an ion trap? How to derive that formula? Also, how exactly can we create superposition by sending laser beams? I am interested in knowing the exact solutions of the Schrodinger's equation in this scenario. It will be helpful if someone can answer them or at least point to a book where I can find the answer.

+",5410,,26,,2/1/2019 22:15,2/1/2019 22:15,Ion trap qubit Hamiltonian calculation manipulation,,1,1,,,,CC BY-SA 4.0 +5346,1,5349,,2/1/2019 11:17,,4,409,"

I am currently reading various survey papers in Quantum Machine Learning, such as ""Quantum Machine Learning"" by Biamonte, Wittek, Pancotti, Rebentrost, Wiebe, and Lloyd. To me, it is not clear when they are talking about Adiabatic Quantum Computing or the Logic Gate approach.

+ +

Example: +""The quantum basic linear algebra subroutines (BLAS)—Fourier transforms, finding eigenvectors and eigenvalues, solving linear equations—exhibit exponential quantum speedups over their best known classical counterparts [8, 9, 10].""

+ +

Question: Are these people always talking about one of the two technologies (if so, which?), or are they discussing them interchangeably?

+",2794,,26,,2/1/2019 21:46,2/4/2019 8:33,How to recognize if a paper is talking about quantum annealing or gate logic?,,2,0,,,,CC BY-SA 4.0 +5347,2,,5346,2/1/2019 11:59,,6,,"

I've not looked at those papers specifically, but there are several different models for quantum computation (see here), including the gate model and the adiabatic model, which are polynomial time equivalent. That means if one has an exponential speedup, so does the other. The discussion should be interchangeable.

+ +

The title, if not the question body, also asks about quantum annealing. So, to summarise the comments:

+ +
    +
  • Adiabatic QC is a special case of quantum annealing. So, in that sense, since adiabatic is one of those interchangeable ones, so is quantum annealing.
  • +
  • However, when people talk about quantum annealing, they are often thinking beyond the adiabatic case, with non-adiabatic trajectories, finite temperature etc. Here, the answer is simply we don't know if it is polynomial time equivalent with the other models. Many people believe that it has equivalent computational power, but it has not been proven.
  • +
+",1837,,1837,,2/4/2019 8:33,2/4/2019 8:33,,,,3,,,,CC BY-SA 4.0 +5348,2,,5345,2/1/2019 12:51,,2,,"

The general Hamiltonian of a trapped ion is simply its kinetic, vibrational energy along with the potential energy interaction (Coulombic) with other ions (if in the neighborhood): +(For a single trapped ion) +\begin{equation} +H=\frac{|p|^2}{2m}+\frac{m}{2}(\omega_x^2x^2+\omega_y^2y^2+\omega_z^2z^2) +\end{equation} +where usually $\omega_x,\omega_y\ll \omega_z$ (nearly a 1D vibrational mode). +But this not via which the quantum information processing is achieved. In principle, the aim is to minimize the effect of this Hamiltonian and cool the ion via laser cooling to minimize the splitting levels via this Hamiltonian.

+ +

The key to quantum computation lies in the atomic structure (as @DaftWullie pointed out) of the ion, which is coupled to a laser. We usually isolate the atomic levels and tune the laser with the transition frequency. The effective way is to extract out a $\mathbb{C}^2$ Hilbert space associated with the hyperfine structure of the atom where nuclear and electronic spin both interact.

+ +

The basic idea is to isolate two internal states in an approximately harmonic potential, which is used for multiple ions (qubits). For single qubit operations, for example, apply a EM field with a sharp frequency $\omega_0$, the transition frequency of internal states, it turns on an internal Hamiltonian

+ +

\begin{equation} +H_{int}=\frac{\hbar \omega_0}{2}(S_+ e^{i\phi}+S_-e^{-i\phi}) +\end{equation} +which will give rise to a superpositon of the two internal states. $S_\pm$ are the spin operators governing the internal total spin states and $\phi$ is the phase associated (rotation). From this by tuning the parameters involved, we can form single qubit gates.

+ +

The procedure is similar for multi-qubit gates where we couple both the ions by a known mechanism, like the laser coupling and we formulate the Hamiltonian associated with the given transitions. Gates like the Controlled-unitary are somewhat hard to achieve because of their non-local nature. All these Hamiltonians can be easily solved analytically in the matric form (writing the Hamiltonian in the basis of the possible ket states involved with the given isolated levels).

+ +

In experiment it is very difficult to achieve a particular transition without other couplings involved and hence the ion is cooled to the order of $mK$ and tuned at very fine frequencies. The scalability is very hard to achieve in experiment.

+ +

To my knowledge, the best place to start it is the Nielsen and Chuang book, Physical Realization chapter from pg.309 onwards. +Also refer to this webpage by Oxford (who have a great group in Ion Trap experiments): https://www2.physics.ox.ac.uk/research/ion-trap-quantum-computing-group/intro-to-ion-trap-qc

+ +

Watch this talk: https://www.youtube.com/watch?v=WOQ_jWe62EA

+ +

Read via the wikipage: https://en.wikipedia.org/wiki/Trapped_ion_quantum_computer and few references therein.

+ +

And if time permits, refer to https://www.sciencedirect.com/science/article/pii/S0370157308003463 which was one of the foundational work in this area.

+ +

Hope this helps.

+",4889,,,,,2/1/2019 12:51,,,,0,,,,CC BY-SA 4.0 +5349,2,,5346,2/1/2019 16:21,,3,,"

In this particular one (by quickly overlooking), they refer mostly to the logic gate approach. But nothing prevent them from talking about both. It depends on the algorithm and on which original model it was thought/designed on. Generally, if it is linear algebra based, it will be the logic gate approach. If they refer to optimization of a QUBO, they will talk about a D-Wave quantum annealer (should be mentionned in an introduction part), a specific case of quantum annealing.

+ +

If you want to be sure which one for each algorithm, the best way when it is not clear is looking at the references. That helped me a lot figure out details like that.

+",4127,,,,,2/1/2019 16:21,,,,1,,,,CC BY-SA 4.0 +5355,1,,,2/2/2019 16:46,,3,68,"

An article entitled ""Experimental data from a quantum computer verifies the generalize Pauli exclusion principle"" by Scott E. Smart, David I. Schuster, and David A. Mazziotti has just appeared

+ +

In the study, they generate sets of random pure states of 3 fermions in 6 orbitals and examine their 1-RDM's (reduced density matrices). For this purpose, they employ ""the IBM Quantum Experience devices (ibmqx4 and ibmqx2), available online, in particular, the 5-transmon quantum computing device"". Can one adapt their approach to testing the ""separability probability"" question (arXiv:quant-ph/9804024) in any form (fermionic, or otherwise)?

+ +

In particular, can the conjectures that the two-qubit separability probabilities are $\frac{8}{33}$, $\frac{25}{341}$ or +$1-\frac{256}{27 \pi^2}$, depending upon the choice of Hilbert-Schmidt, Bures or operator monotone function $\sqrt{x}$ measures (arXiv:1701.01973, arXiv:1901.09889) be evaluated? If one could generate random (using Fubini-Study measure) pure four-qubit states, and find the reduced two-qubit systems, then perhaps one could examine the Hilbert-Schmidt instance (p. 422 of Bengtsson-Zyczkowski monograph).

+ +

I see that there is 2011 and subsequent work of J. A. Miszczak (arXiv:1102.4598) concerning the (Mathematica) generation of random numbers through quantum processes, and their use in the production of random quantum states (such as I am seeking)--through standard (Ginibre-ensemble/random matrix theory) algorithms. But, I think, this is (presently?) comparatively slow in relation to pseudo-random means. Also, can the random states be generated ""more directly"" with the IBM devices? (Smart, Schuster, Mazziotti prepare initial pure states and then perform ""arbitrary unitary transformations"" [""generated on the quantum computer""] to obtain random pure states.)

+",3089,,55,,7/1/2021 17:53,7/1/2021 17:53,"Can ""experimental data from a quantum computer"" be used to test separability probability conjectures?",,0,0,,,,CC BY-SA 4.0 +5356,1,5358,,2/2/2019 20:58,,5,196,"

Measurements create entropy as we all know. But computers themselves are deterministic machines. Most devices use processor heat as a source for random number generation as far as I know - which has lead to problems in the past. Any cryptographic key is only as good as the entropy source from which its content originate. When I try to collect binary entropy as results from a quantum measurement it is still a simulation - yet for huge numbers it converges well to the distribution I should obtain. So how does the simulator collect the entropy for the measurement outcomes?

+",5705,,26,,2/2/2019 21:18,2/2/2019 21:46,Where does the Xmon simulator from Googles cirq framework its entropy from?,,1,0,,,,CC BY-SA 4.0 +5357,2,,1269,2/2/2019 21:05,,1,,"

Easiest thing talk about the algorithms for each architecture and the difference between physical and logical qubits. As far as I know we do not know yet how to perform quantum error correction efficiently on an adiabatic machine. Most computations on these devices are just repeated lots and lots of times without much error correction. For the gate model error correcting codes exist - leading to a smaller number of logical qubits. On the other hand the gate model is universal so you can run algorithms on it which are proved to be faster than any known classical counterpart (notably Grover and Shor). Thus the gate model is much more powerful and still worth investigating.

+",5705,,,,,2/2/2019 21:05,,,,0,,,,CC BY-SA 4.0 +5358,2,,5356,2/2/2019 21:46,,5,,"

Cirq uses numpy's pseudo random number generator to pick measurement results, e.g. here is code from XmonStepper.simulate_measurement:

+ +
    def simulate_measurement(self, index: int) -> bool:
+        [...]
+        prob_one = np.sum(self._pool.map(_one_prob_per_shard, args))
+        result = bool(np.random.random() <= prob_one)
+        [...]
+
+ +

Cirq simulations are not intended to be a source of cryptographically secure entropy.

+",119,,,,,2/2/2019 21:46,,,,1,,,,CC BY-SA 4.0 +5359,1,5368,,2/3/2019 11:21,,5,203,"

Context:

+ +

+ +
+

Three coins on the table. Each is either heads or tails. You can + uncover any one of the three coins, revealing whether it is heads or + tails but then you choose two the other two coins disappear --- you'll + never know whetehr those two other coins are heads or tails.

+
+ +

I'm a bit confused by Preskill's description of a Bell experiment [$\dagger$]. He describes a game, using correlated coins. Donald sitting in Denver manufactures three pairs of correlated coins. He then sends one set of coins (containing coin from each correlated pair) to Alice in Pasadena and another set of coins to Bob in Waterloo. Now according to the rules of the game: if Alice or Bob uncover any one coin from their set (to check if it's head or tails), the other two coins instantaneously disappear (and we can't ever know the states of those disappeared coins). Also, if Alice and Bob uncover the same number coin from their respective set (say if both choose coin number 2), they always observe the same side (i.e. either both get heads or both get tails).

+ +

+ +
+

There are many sets of coins, identically prepared by Donald (in Denver). For each of the three coins, in Pasadena or Waterloo, the probability is $\frac{1}{2}$ that the coin is heads or tails. But, if Alice and Bob both uncover the same coin, the outcomes are perfectly correlated. We know it always works, we've checked it a million times.

+
+ +

+ +
+

Bob reasons:

+ +
    +
  • We know the correlation is always perfect.
  • +
  • And surely what Alice does in Pasadena exerts no influence on what Bob finds when he uncovers a coin in Waterloo.
  • +
  • So, in effect, Alice and Bob, working together can learn the outcome when any two of the coins are uncovered in Waterloo.
  • +
+ +

Bell reasons:

+ +

$$\sum_{x,y,z \in \{H,T\}} P(x,y,z)= 1$$

+ +

$$P(1,2)_{\text{same}} = P(HHH) + P(HHT) + P(TTH) + P(TTT),$$ + $$P(2,3)_{\text{same}} = P(HHH) + P(THH) + P(HTT) + P(TTT),$$ + $$P(1,3)_{\text{same}} = P(HHH) + P(HTH) + P(THT) + P(TTT).$$

+ +

$$\therefore P(1,2)_{\text{same}} + P(2,3)_{\text{same}} + + P(1,3)_{\text{same}} = 1 + 2P(HHH) + 2P(TTT) \geq 1$$

+
+ +

I do understand that the sum of these three probabilities is greater than one because there are some constraints already involved and that the three cases: $(1,2)_{\text{same}}, (2,3)_{\text{same}}$ and $(1,3)_{\text{same}}$ are not mutually exclusive; like if we uncover all three coins at least two have to be the same. So naturally, there's some redundancy leading to a sum of probabilities that is greater than one!

+ +
+ +
+

Alice and Bob repeat the measurement a million times, and found ...[$\dagger\dagger$] + $$P(1,2)_{\text{same}} = P(2,3)_{\text{same}} = P(1,3)_{\text{same}} = \frac{1}{4}$$

+ +

How could Bell's prediction be wrong? Bell assumed the probability distribution describes our ignorance about the actual state of the coins under the black covers, and there is no ""action at a distance"" between Pasadena and Waterloo. The lesson:

+ +
    +
  • Don't reason about counterfactuals (""I found H when I uncovered 1; I would have found either H or T if I had uncovered 2 instead, I just don't know which.""). When the measurements are incompatible, then if we do measurement 1 we can't speak about what would have happened if we had done measurement 2 instead.

  • +
  • Quantum randomness is not due to ignorance. Rather, it is intrinsic, occuring even when we have the most complete knowledge that Nature will allow.

  • +
+ +

Note that the quantum correlations do not allow A and B to send signals to one another.

+
+ +
+ +

I believe Preskill's actually referring to shared pairs of Bell states between Alice and Bob here rather than the coin setup. I'll try to clarify the difference between the two setups.

+ +

The Classical Coin Game:

+ +

If we were to consider the setup using classical coins as described in the question, the probabilities would have turned out to be considerably different. It is given that the same numbered coins on Alice's and Bob's side always turn out to have the same side. Now, the important point here is that ""coins"" can't exist in superposition, unlike qubits! Their only states of existence are either heads or tails. So according to the correlation described in the question if we can know the state of all the coins on Alice's side we already know the the state of all the coins on Bob's side! That is,

+ +

$$P(1,2)_{\text{same}} = P(HHH) + P(HHT) + P(TTH) + P(TTT)$$ +$$\implies P(1,2)_{\text{same}}= \frac{1}{2}.\frac{1}{2}.\frac{1}{2} + \frac{1}{2}.\frac{1}{2}.\frac{1}{2} + \frac{1}{2}.\frac{1}{2}.\frac{1}{2} + \frac{1}{2}.\frac{1}{2}.\frac{1}{2} = \frac{1}{2}$$

+ +

Similarly, $P(2,3)_{\text{same}}$ and $P(1,3)_{\text{same}}$ are also $\frac{1}{2}$! As you can see, the answer isn't $\frac{1}{4}$ in this setup.

+ +

The Quantum Game:

+ +

Here Alice and Bob share three $|\Phi^+\rangle$ Bell pairs. I'll denote Alice's qubits with $A$ (numbered $1,2,3$) and Bob's qubits with $B$ (numbered $1,2,3$). The overall state is:

+ +

$$|\Phi^+\rangle \otimes |\Phi^+\rangle \otimes |\Phi^+\rangle$$ +$$ \small{= \frac{1}{\sqrt{2}}(|0\rangle_{A1}|0\rangle_{B1} + |1\rangle_{A1} |1\rangle_{B1}) \otimes \frac{1}{\sqrt{2}}(|0\rangle_{A2}|0\rangle_{B2} + |1\rangle_{A2} |1\rangle_{B2}) \otimes \frac{1}{\sqrt{2}}(|0\rangle_{A3}|0\rangle_{B3} + |1\rangle_{A3} |1\rangle_{B3})}$$

+ +

From here, in this quantum case too:

+ +

$$P(1,2)_{\text{same}} = P(\text{A1} = |0\rangle \ \cap \ \text{B2} = |0\rangle) + P(\text{A1} = |1\rangle \ \cap \ \text{B2} = |1\rangle) $$ +$$ = (\frac{1}{\sqrt 2})^2.(\frac{1}{\sqrt 2})^2 + (\frac{1}{\sqrt 2})^2.(\frac{1}{\sqrt 2})^2 = \frac{1}{2}$$

+ +
+ +

Question:

+ +

So I'm not quite sure how Preskill came up with the probabilities $$P(1,2)_{\text{same}} = P(2,3)_{\text{same}} = P(1,3)_{\text{same}} = \frac{1}{4}$$ in either the quantum case or the classical case. Could someone clarify? I did go through the proof for $P(X=Y) = \frac{1}{4}$ in the light polarization experiment, but in that experiment $P(X=Y)$ means given photon passed X, the probability that it passes Y is. There they didn't mention anything about Bell pairs, and so I can't quite relate the two experiments. Here the situation is rather different; we want to know what is the probability of the two qubits $\text{A1}$ and $\text{B2}$ having the same state after consecutive or simultaneous measurements? And for this question I don't quite see how the answer is $\frac{1}{4}$.

+ +
+ +

[$\dagger$]: John Preskill - Introduction to Quantum Information (Part 1) - CSSQI 2012 (timestamp included)

+ +

[$\dagger \dagger$]: John Preskill - Introduction to Quantum Information (Part 2) - CSSQI 2012 (timestamp included)

+",26,,55,,12/4/2021 12:41,12/4/2021 12:41,"Why is $P(1,2)_{\text{same}} = \frac{1}{4}$ and not $\frac{1}{2}$ in Preskill's Bell experiment?",,1,0,,,,CC BY-SA 4.0 +5361,2,,5287,2/3/2019 12:44,,5,,"

It's unlikely. And even if there is, they've not announced it publicly. Most of the private companies and startups in this area are still in the stealth mode. This is the most complete list of quantum computing startups that I know of. Among the companies listed, Atom Computing may be working on diamond-based quantum computers, but they haven't released much information yet.

+ +

All I could find about them is: ""Utilizing techniques pioneered by quantum gas and precision measurement experiments, Atom Computing will create machines using optically trapped neutral atoms capable of reaching the large qubit numbers needed for error-corrected quantum computing."" For what it's worth, one of their co-founders Jonathan King specializes in this area and was a co-author on Multi-spin-assisted optical pumping of bulk 13C nuclear spin polarization in diamond (Pagliero et al., 2018).

+ +

You may also be interested in the article Toward mass-producible quantum computers published by MIT news, which discusses the current progress in NV-center based quantum computing. Now why diamond-based quantum computing isn't so mainstream is a good question, but you should probably ask that in a new thread.

+",26,,,,,2/3/2019 12:44,,,,1,,,,CC BY-SA 4.0 +5362,1,,,2/3/2019 18:37,,3,45,"

According to Christopher Monroe: ""Modular Ion Trap Quantum Networks: Going Big"", the hyperfine states of the valence electron in the Yb+ is used as a qubit. I know that we can change the spin orientation of this electron by using precession by appropriately applying a magnetic field for a specific duration. However, he mentions that the qubit can be manipulated using lasers. I am unable to understand how this is done. Laser beam will only give a oscillating magnetic field right? How can this be used to create precession over any arbitrary axis (as required by Bloch Sphere rotations)?

+",5410,,26,,2/3/2019 18:53,2/3/2019 18:53,Spin precession using a laser,,0,0,,,,CC BY-SA 4.0 +5363,1,,,2/3/2019 21:09,,5,336,"

I understand the first step in the Cirac-Zoller controlled-phase gate; about how to move the state from the electronic state to the vibrational mode state. However, I am unable to understand how a $2\pi$ pulse gives the -1 sign to the state and how it is applied conditioned on the vibrational mode. Any help is appreciated.

+",5410,,26,,2/4/2019 4:57,2/7/2019 21:45,How does a $2 \pi$ pulse in Cirac Zoller give a -1 sign to the state?,,1,5,,,,CC BY-SA 4.0 +5364,1,5365,,2/3/2019 22:33,,5,323,"

I have tried to implement Grover's algorithm for three qubits in python/numpy and the first two iterations work like a charm but the third one starts to diverge. Is this expected, or is there a bug in the code? I expected the inversion around the mean to blow up the coefficient of the marked state in each iteration. The code follows Nielsen closely, with a silly Oracle that hard-codes the negation of the basis state. The Python code requires a little bit of set-up but the essential idea is:

+ +
    +
  • Define a phase shift operator of -1 on all basis states except zero.
  • +
  • Define a reflection around the mean operator as Hadamard ⊗ Phase Shift ⊗ Hadamard.
  • +
  • Define the full Grover step as the Oracle followed by the reflection.
  • +
  • Start with an equally balanced state.
  • +
  • Repeatedly apply the Grover step.
  • +
+ +

Source code:

+ +
import numpy as np
+
+def dagger(m):
+    return np.transpose(np.conjugate(m))
+
+def proj(m):
+    return m * dagger(m)
+
+# identity matrix for 3 qubits = 8x8 matrix
+id3 = np.identity(2**3)
+
+# hadamard matrix for 1, 2 and 3 qubits
+H1 = np.matrix([[1.0, 1.0], [1.0, -1.0]], dtype=np.complex256) / np.sqrt(2)
+H2 = np.kron(H1, H1)
+H3 = np.kron(H2, H1)
+
+# 3 qubit zero vector |000>
+zero3 = np.array([[1],[0],[0],[0],[0],[0],[0],[0]], dtype=np.complex256)
+
+# phase shift operator  2*|0><0| - I  for 3 qubits
+PS3 = 2 * proj(zero3) - id3
+
+# reflection around the mean
+R = H3 * PS3 * H3
+
+# 3 qbit oracle, marking/negating state |101> = column vector (0 0 0 0 0 1 0 0)
+O = id3
+O[5,5] = -1
+
+# grover operator
+G = R * O
+
+# start state |000>
+x0 = H3 * zero3
+
+# apply grover step three times
+x1 = G * x0
+print x1
+
+x2 = G * x1
+print x2
+
+x3 = G * x2
+print x3
+
+ +

The output of the program is shown below. The coefficient (driving the probability) for the state to search for is 0.88 after one iteration, then 0.97 but then falls back to 0.57. Am I missing any essential step in the algorithm?

+ +
[[ 0.1767767+0.0j]
+ [ 0.1767767+0.0j]
+ [ 0.1767767+0.0j]
+ [ 0.1767767+0.0j]
+ [ 0.1767767+0.0j]
+ [ 0.88388348+0.0j]
+ [ 0.1767767+0.0j]
+ [ 0.1767767+0.0j]]
+[[-0.088388348+0.0j]
+ [-0.088388348+0.0j]
+ [-0.088388348+0.0j]
+ [-0.088388348+0.0j]
+ [-0.088388348+0.0j]
+ [ 0.97227182+0.0j]
+ [-0.088388348+0.0j]
+ [-0.088388348+0.0j]]
+[[-0.30935922+0.0j]
+ [-0.30935922+0.0j]
+ [-0.30935922+0.0j]
+ [-0.30935922+0.0j]
+ [-0.30935922+0.0j]
+ [ 0.57452426+0.0j]
+ [-0.30935922+0.0j]
+ [-0.30935922+0.0j]]
+
+",5389,,26,,2/4/2019 5:03,2/4/2019 7:37,Why is Grover's algorithm not converging monotonically? (Python implementation),,2,0,,,,CC BY-SA 4.0 +5365,2,,5364,2/3/2019 23:01,,4,,"

This seems normal by applying the definition of the inversion about average operator which transforms the amplitudes $\alpha_i $ by the formula :

+ +

$$ - \alpha_i + 2 \langle\alpha\rangle\,, $$

+ +

Apply this to your example (using the above formula for each step to verify your intermediary steps) and you should retrieve this numbers. This operator is periodic. After the maximum number of operations giving you the highest probability of the desired state to be measured, you will reset the amplitudes if you apply it another time, meaning you have to reapply again to amplify its amplitude the same way.

+",4127,,,,,2/3/2019 23:01,,,,1,,,,CC BY-SA 4.0 +5367,2,,5364,2/4/2019 7:37,,4,,"

Your algorithm is working exactly as it should. Grover's algorithm does not monotonically converge. Instead, the better intuition is to think about a point moving around a circle at constant speed. If you choose the right moment, you will be close to a particular point, but leave it longer and it'll go past, although it will eventually come back again.

+ +

Indeed, the amplitude of the marked item after $n$ iterations should be +$$ +\sin((2n+1)\theta) +$$ +where $\sin\theta=\frac{1}{\sqrt{N}}$ and $N$ is the number of items being search over. In this case, $N=8$, so $\sin\theta=\frac{1}{\sqrt{8}}$ and the first few values of the marked amplitude will be +$$ +0.883883, 0.972272, 0.574524, -0.110485,\ldots +$$ +Thus, you stop after 2 iterations and have extremely high probability of finding the marked item, but you continue to the third iteration and it gets worse again. The point is that since you know $\sin\theta$, you can predict the value of $n$ such that $\sin((2n+1)\theta)\approx 1$, and know when to stop. (Note that this is a better and better approximation as $N$ gets larger.) You measure the outcome, and get some answer $x$. You then input that to the oracle again and test if it is the correct answer. If not, you start the whole algorithm again, and repeat until success.

+",1837,,,,,2/4/2019 7:37,,,,2,,,,CC BY-SA 4.0 +5368,2,,5359,2/4/2019 8:05,,2,,"
+

I do understand that the sum of these three probabilities is greater + than one because there are some constraints already involved; like if + we uncover all three coins at least two have to be the same. So + naturally, there's some redundancy leading to a sum of probabilities + that is greater than one!

+
+ +

I would say the explanation is simpler than that. Remember that the rule for adding probabilities and them summing to 1 only applies if (i) the set of events is mutually exclusive and (ii) covers everything that could possibly happen. Now, the set of things that are added together do include everything that can happen because, as you said, at least two coins must come out the same. However, they're not mutually exclusive. It can be that 1 and 2 get the same answer and 1 and 3 get the same answer. These are the cases TTT and HHH.

+ +
+

I believe Preskill's actually referring to shared pairs of Bell states between Alice and Bob here rather than the coin setup.

+
+ +

Implicitly, yes. But that's not important. The philosophy is important. Bell predicts something. You do an experiment of some form. The experimental details are irrelevant, but the outcome is different from the prediction. Why? One of the assumptions of the model must be incorrect.

+ +
+

So I'm not quite sure how Preskill came up with the probabilities

+
+ +

As I tried to say above, that is not necessarily the point. He could have picked anything arbitrarily to make his point.

+ +

If I were trying to build a model, I'd build it a bit differently to yours. I'd give Alice and Bob a single entangled state +$$ +|\Psi\rangle=\frac{1}{\sqrt{2}}(|00\rangle+|11\rangle) +$$ +Alice and Bob each choose from one of 3 possible measurement bases, +$$ +Z,\quad \frac{-Z+\sqrt{3}X}{2},\quad \frac{-Z-\sqrt{3}X}{2}. +$$ +When a measurement is performed, it gives answers $\pm 1$ which we correspond with the heads and tails outcomes of the coins. +You can verify that for each basis $\sigma$, +$$ +\langle\Psi|\sigma\otimes\sigma|\Psi\rangle=1, +$$ +meaning that is both parties choose the same measurement (aka coin), they get the same result. You can also see that the individual outcomes are 50:50 by evaluating +$$ +\langle\Psi|\sigma\otimes\mathbb{I}|\Psi\rangle=0. +$$

+ +

If we take two different measurements $\sigma$ and $\tau$, then +$$ +\langle\Psi|\sigma\otimes\tau|\Psi\rangle=-\frac12. +$$ +Since this is effectively evaluating $P(\text{same})-P(\text{different})$ with $P(\text{same})+P(\text{different})=1$, you can see that $P(\text{same})=\frac14$.

+ +

How is this different from what you suggested? Well one of the important things is that the analogy should be clearer. With measurements on the same qubit, you can only measure one of them, and you cannot simultaneously measure the outcomes, i.e. the other two coins disappear. In what you were measuring, it was still in principle possible to perform all 3 measurements because the measurement operators would have commuted.

+",1837,,1837,,2/4/2019 9:35,2/4/2019 9:35,,,,0,,,,CC BY-SA 4.0 +5369,1,5372,,2/4/2019 16:07,,3,275,"

I have no idea how to read Dirac notation.

+ +

$$\left|↑↑ \right\rangle \tag{1}$$ $$\left|↑↓\right\rangle+\left|↓↑\right\rangle \tag{2}$$ $$\left|↑↓\right\rangle-\left|↓↑\right\rangle \tag{3}$$ $$\left|↓↓\right\rangle \tag{4}$$

+ +

What do the above expressions mean? Can you explain this in terms of the superposition?

+ +

Note: I am a sophomore in high school and have no linear algebra background. I am taking a science research course on quantum computing. Obviously, Dirac notation pops up a lot, but I don't know how to read it or tell what it is saying.

+",5719,,23,,2/4/2019 20:05,2/4/2019 20:07,How to read Dirac notation (without algebra)?,,1,2,,,,CC BY-SA 4.0 +5370,1,,,2/4/2019 16:17,,3,526,"

I'm dealing with Simon's algorithm a bit and ""stumbled"" upon something called for the algorithm. It is said that if the period is $s = 0^n$, then it is an injective function, that is, a 1 to 1 function. How can you show that this is so?

+ +

Then I would be interested. Moreover, if that is not the case, so $s \neq 0^n$, then why is it a 2 to 1 function?

+",4974,,55,,2/7/2019 10:36,2/7/2019 10:36,"In Simon's algorithm, why is $f$ one-to-one if (and only if) $s=0^n$?",,1,0,,,,CC BY-SA 4.0 +5371,2,,5370,2/4/2019 16:39,,3,,"

This is basically the definition of the type of function that you apply Simon's algorithm to. You are required to have a function $f(x)$ such that +$$ +f(x)=f(y) +$$ +if and only if $x\oplus y=0$ or $s$.

+ +

Hence, if $s$ is all zeros, the outcomes are all unique: if $f(x)=f(y)$ then $x=y\oplus 000\ldots 0$, but bitwise addition modulo with 0 doesn't change the bit values, so $x=y$.

+ +

On the other hand, if $s$ is non-zero, there are exactly two values that give the same value of $f(x)$ since $x\oplus00\ldots 0=x$, just leaving the distinct $y=x\oplus s$.

+ +
+ +

To add, following a comment. I suspect we need to go further back and understand the notation better. There is a function $f(x)$. It accepts, as an argument, a sequence of $n$ bit values, which we write as a variable $x$ (we write $x\in\{0,1\}^n$ as a shorthand for conveying it's made up of $n$ bit values). The answer is a sequence of $n$ bit values, which we write as $y=f(x)$. We are promised that $a$, also a sequence of $n$ bit values exists such that +$$ +f(x)=f(x\oplus a). +$$ +The calculation $x\oplus a$ has a very specific meaning; we take each bit of $x$ (call the $i^{th}$ bit $x_i$) and each bit of $x$ and return the sequence where they have been added together modulo 2: +$$ +x_i\oplus a_i=x_i\text{ XOR }a_i=x_i+a_i\text{ mod }2=\left\{\begin{array}{cc} 0 & x_i=a_i \\ 1 & x_i\neq a_i\end{array}\right. +$$ +So, for example +$$ +00110\oplus 01010=01100. +$$ +A key feature of this bitwise addition function is that +$$ +x\oplus a\oplus a=x. +$$

+ +
+ +

An example of a suitable $f(x)$ is +$$ +\begin{array}{c|cccccccc} +x & 000 & 001 & 010 & 011 & 100 & 101 & 110 & 111 \\ +f(x) & 010 & 011 & 000 & 001 & 010 & 011 & 000 & 001 +\end{array} +$$ +Here, you can see that each value of $f(x)$ is repeated exactly twice. So, we find two values of $x$ that give the same output, say $001$ and $101$. These correspond to values $x$ and $x\oplus a$, so we can find $a$ with +$$ +a=x\oplus(x\oplus a)=001\oplus101=100. +$$ +Then you can check for every $x$ that $f(x)=f(x\oplus 100)$.

+",1837,,1837,,2/5/2019 8:54,2/5/2019 8:54,,,,3,,,,CC BY-SA 4.0 +5372,2,,5369,2/4/2019 16:53,,6,,"

The dirac notation itself, the $|$ and $\rangle$ parts is simply a notation to remind you that you're dealing with quantum states. What you write inside this `ket' is completely arbitrary.

+ +

In the examples you give, somebody has (probably) chosen to depict a quantum system of two quantum bits. The up arrow and the down arrow depict two distinguishable states, i.e. we could measure each qubit and ask ""is it up or down""? They have also made an implicit connection between an ordering of the labels and the qubits themselves.

+ +

So, the first example says that both qubits are ""up"". The last one says that they are both ""down"".

+ +

The middle two are very similar, so let's just talk about $\left|↑↓\right\rangle+\left|↓↑\right\rangle$. You could effectively read this as saying ""if you ask which of the two qubits is up or down, you have a 50:50 chance of the first being up and the second down, or vice versa"".

+ +

You asked for an example using superposition. Examples 2 and 3 that you gave are using a particular type of superposition called entanglement. Basically, whenever you have more than one ket, you've got superposition. When the superpositions span different physical entities (such as two qubits), that superposition is entanglement.

+ +

But we can talk about superposition of a single qubit. If we start from $\left|↑\right\rangle$, i.e. the qubit is ""up"", we can talk about any superposed state of the form +$$ +\cos\theta \left|↑\right\rangle+\sin\theta e^{i\phi}\left|↓\right\rangle. +$$ +If you asked whether it's up or down, you'd get answer ""up"" with probability $\cos^2\theta$, and ""down"" with probability $\sin^2\theta$.

+ +

The problem is if you only talk about the question ""up or down?"" you can't really see anything quantum happening. To do that, you have to perform measurements in other bases, and then you really start to need to do the maths properly.

+",1837,,23,,2/4/2019 20:07,2/4/2019 20:07,,,,5,,,,CC BY-SA 4.0 +5374,1,5375,,2/5/2019 3:03,,7,1042,"

I'm struggling to find much about the language QCL, rather than about quantum computing itself.

+ +

Is there anything out there like that? It doesn't have to be free.

+",5722,,10480,,3/20/2021 23:24,3/20/2021 23:24,What resources are available for learning QCL?,,1,0,,,,CC BY-SA 4.0 +5375,2,,5374,2/5/2019 4:26,,6,,"

A quick googling reveals that Bernhard Ömer has worked extensively on this topic. Check out the documentation section here. He describes the installation procedure on the corresponding GitHub page.

+ +
    +
  1. Quantum Programming in QCL (PDF)
  2. +
+ +
+

My master thesis in computing science deals with computational and architectural questions of quantum programming and illustrates the design of quantum algorithms in QCL. For readers with a CS rather than a physical background, this book also features a brief introduction into quantum physics in general.

+
+ +
    +
  1. A Procedural Formalism for Quantum Computing (PDF)
  2. +
+ +
+

My master thesis in theoretical physics about QCL. Besides a general introduction to quantum programming and a description of the language, a complete QCL implementation of the Shor algorithm is presented.

+
+ +
    +
  1. Structured Quantum Programming (PDF)
  2. +
+ +
+

My PhD thesis on structured programming languages for quantum computing (latest revision Jan 9 2009).

+
+ +
    +
  1. Classical Concepts in Quantum Programming
  2. +
+ +
+

This paper from the QS2002 conference describes classical concepts in QCL, including new features like conditional operators, quantum conditions and quantum if-statements. The print version appeared in the International Journal of Theoretical Physics 44/7, pp. 943-955, 2005.

+
+ +

Also, check out these video lectures on QCL by Macheads101:

+ + +",26,,26,,2/5/2019 4:45,2/5/2019 4:45,,,,1,,,,CC BY-SA 4.0 +5376,1,5382,,2/5/2019 9:59,,3,163,"

I found something in a lecture on Simon's algorithm that I do not quite understand how to interpret. There the following is said:

+ +

$$\sum_{y\in\{0,1\}^n}|y\rangle\left(\sum_{x\in\{0,1\}^n} (-1)^{x\cdot y}|f(x)\rangle\right)$$

+ +

So we assume a 1 to 1 function and $s=0$. As far as that is understandable. Then it says (that's the part I'm not quite sure of): ""The probability that a measurement in String Y results is:""

+ +

$$\left|\left|\frac{1}{2^n}\sum_{x\in\{0,1\}^n} (-1)^{x\cdot y}|f(x)\rangle\right|\right|^2=\frac{1}{2^n}$$

+ +

I try to make something more understandable, which I do not quite understand. So if you have a 1 to 1 function then that means that each value occurs exactly once, say you have three bits, then there are 8 states, that is from 000 to 111. These then also occur with the same probability of 1/8 for each state. But now I do not quite understand the result of the top formula, why is $\frac{1}{2^n}$ out there, why is not it squared? What happens to the sum there? What is the exact calculation behind it?

+ +

I mean, on the one hand, I understand why $\frac{1}{2^n}$ comes out there, but on the other hand, I do not quite understand the calculation ($||...||^2$) behind it, I hope somebody can explain it a bit.

+",4974,,26,,2/5/2019 14:56,2/5/2019 20:49,Simon's Algorithm - Probability that the measurement results in a string Y,,2,0,,,,CC BY-SA 4.0 +5377,2,,5376,2/5/2019 15:15,,2,,"

The first state in your question is not a valid quantum state as it is not normalized.

+ +

The result comes directly from the axioms of quantum mechanics. You just have to apply the Born rule. For a state $\sum_y ~ a_y |y\rangle$ the probability of measuring $|y\rangle$ is $|a_y|^2.$

+ +

Now suppose you are given a state $\sum_y ~ a_y |y\rangle|0\rangle + b_y |y\rangle|1\rangle$. The probability of getting $|y\rangle$ should be sum of probabilities of getting $|y\rangle|1\rangle$ or $|y\rangle|0\rangle$. This, according to the Born rule is $|a_y|^2 + |b_y|^2. $

+ +

So extending this logic to the case of a state of the form $\sum_y ~ |y\rangle|\psi_y\rangle$, we get that the probability of measuring $|y\rangle$ becomes $|| |\psi_y\rangle||^2.$

+",2663,,,,,2/5/2019 15:15,,,,0,,,,CC BY-SA 4.0 +5378,1,5381,,2/5/2019 19:11,,0,195,"

$\newcommand{\ket}[1]{|#1\rangle}$Is there some standard computational basis defined in quantum computing? Can I just call $\{\ket{0}, \ket{1}\}$ the standard computational basis?

+",1589,,26,,3/30/2019 7:52,3/30/2019 7:52,"Can I call $\{|0\rangle, |1\rangle\}$ the ""standard computational basis"" as it is done in linear algebra?",,2,2,,,,CC BY-SA 4.0 +5379,2,,5378,2/5/2019 19:12,,3,,"

Yes, $|0\rangle$ and $|1\rangle$ is commonly called the computational basis. Some sources also call it the classical basis.

+",4153,,,,,2/5/2019 19:12,,,,2,,,,CC BY-SA 4.0 +5380,1,5385,,2/5/2019 19:54,,2,307,"

I was redirected from theoretical computing to quantum computing for this question. I've been mildly researching quantum computers to figure out how entanglement and superposition are utilized for higher performance. I understand what these are and I've gotten to the point where it looks like the key is in the logic gate but explanations are vague other than stating that simultaneous possible configurations of all 0s and 1s can be processed at the same time. But what is the actual mechanism involved?

+ +

I would like a condensed understanding of how the quantum effect is utilized for any particular function. Is this possible or is the explanation too complex for a simple description? +My background is Aeronautical Engineering, then Math and Physics Education as a late second career (BA in Math Education, MA in Science Education).

+",5728,,55,,2/7/2019 10:21,2/8/2019 16:51,What is the actual mechanism behind quantum computing?,,2,2,,,,CC BY-SA 4.0 +5381,2,,5378,2/5/2019 20:18,,2,,"

You can either call it the standard basis (as it can be mapped to the natural orthonormal basis of $\Bbb R^2$) or the computational basis, of the $2$-dimensional complex Hilbert space. The latter is more frequently used in the context of quantum computing, but you'll see mathematicians using the former more. Anyway, calling it the ""standard computational"" basis is simply redundant when you're dealing with $\Bbb C^2$, although I've seen some authors use it. For instance, check page 5 of From Qubits to Continuous-Variable Quantum Computation (Sanders et al., 2002).

+ +

Related: What is the Computational Basis?

+",26,,1589,,2/7/2019 2:08,2/7/2019 2:08,,,,0,,,,CC BY-SA 4.0 +5382,2,,5376,2/5/2019 20:49,,1,,"

In the first state you write they omitted to write the normalization factor. This is not rare to see, as one can usually easily deduce what the normalization should be from the context (though it might not be a very pedagogical choice).

+ +

To deduce the correct normalization in this case, you need only notice that, because $f$ is one-to-one, the sum over $x$ is something of the form $\sum_x c_x \lvert x\rangle$ for some coefficients $c_x$ with $\lvert c_x\rvert=1$, and where the sum is over all $n$-digit binary strings. There are $2^n$ of these, and therefore the state (just the one inside the parentheses) should more precisely be written as +$$\frac{1}{2^{n/2}}\sum_{x\in\{0,1\}^n} (-1)^{x\cdot y}|f(x)\rangle.$$ +A similar reasoning applies to the outer sum, so that the overall state, written with the normalization included, is +$$\frac{1}{2^n}\sum_{y\in\{0,1\}^n}|y\rangle\left(\sum_{x\in\{0,1\}^n} (-1)^{x\cdot y}|f(x)\rangle\right).$$

+ +

This brings you to the second equation. To compute the norm there, you now notice that, again because $f$ is one-to-one, +$$\left|\left|\frac{1}{2^n}\sum_{x\in\{0,1\}^n} (-1)^{x\cdot y}|f(x)\rangle\right|\right|^2 +=\frac{1}{2^{2n}}\sum_{x\in\{0,1\}^n}\lvert (-1)^{x\cdot y}\rvert^2 +=\frac{1}{2^{2n}}\sum_{x\in\{0,1\}^n}1 +=\frac{1}{2^{2n}}2^n=\frac{1}{2^n}.$$

+",55,,,,,2/5/2019 20:49,,,,1,,,,CC BY-SA 4.0 +5383,1,,,2/5/2019 21:03,,2,38,"

Let's say I have chosen the valence electron of Yb+ as my qubit. I want to consider it's hyperfine structure as the two-level energy states.

+ +

Are my following assumptions correct?

+ +
    +
  1. If the magnetic moment of the electron is parallel to that of the nucleus, then the potential energy will be minimum

  2. +
  3. If the magnetic moment of the electron is anti-parallel to the nucleus, then the PE will be maximum

  4. +
  5. I can use a circularly polarized laser to create Rabi oscillations (should it be always circularly polarized light? why can't I use a linearly polarized laser)

  6. +
+ +

Now, given this exact scenario, what will be the Hamiltonian of the electron so that I can solve for the SE?

+",5410,,26,,2/5/2019 21:28,2/5/2019 21:28,Hamiltonian of the valence electron of Yb+ ion,,0,1,,12/28/2021 16:41,,CC BY-SA 4.0 +5384,1,,,2/5/2019 21:21,,3,57,"

Please check this Rabi oscillations image1:

+ +

+ +

Now, let's say I want to create a superposition of E1 and E2, so I started an EM field tuned to a frequency related to E2-E1. But, let's say there is another energy difference E3-E1, as per the above image there is still some probability (though it will never be 1) that E1 to E3 transition might occur. Isn't it? Or is there something wrong in my understanding?

+ +
+ +

1 Source: https://commons.wikimedia.org/wiki/File:Mplwp_Rabi_oscillations.svg

+",5410,,23,,2/5/2019 21:31,2/7/2019 21:52,Rabi oscillations with different energy differences,,1,0,,,,CC BY-SA 4.0 +5385,2,,5380,2/5/2019 22:29,,2,,"

A qbit is a two-element vector:

+ +

$|\psi\rangle = \begin{bmatrix} \alpha \\ \beta \end{bmatrix}$

+ +

where $\alpha, \beta \in \mathbb{C}$ and $|\alpha|^2 + |\beta|^2 = 1$, a property called the 2-norm.

+ +

We have two important qbit values which we associate with the classical bits 0 and 1:

+ +

$|0\rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$ and $|1\rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix}$

+ +

A qbit is in superposition when it is in any state other than $|0\rangle$ or $|1\rangle$. When people say superposition means the qbit ""is both 0 and 1 at the same time"", what they mean is it is a linear combination of 0 and 1:

+ +

$|\psi\rangle = \begin{bmatrix} \alpha \\ \beta \end{bmatrix} = \alpha\begin{bmatrix} 1 \\ 0 \end{bmatrix} + \beta\begin{bmatrix} 0 \\ 1 \end{bmatrix} = \alpha|0\rangle + \beta|1\rangle$

+ +

We operate on qbits with quantum logic gates, which must always be equivalent in action to unitary matrices. For example, here's the bitflip or ""not"" operator:

+ +

$X|0\rangle = \begin{bmatrix} 0 & 1 \\ 1 & 0\end{bmatrix}\begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \end{bmatrix} = |1\rangle$

+ +

We represent the state of multiple qbits through their tensor product:

+ +

$\begin{bmatrix} a \\ b \end{bmatrix} \otimes \begin{bmatrix} c \\ d \end{bmatrix} = \begin{bmatrix} ac \\ ad \\ bc \\ bd \end{bmatrix}$

+ +

Note that the size of the product state vector grows exponentially with the number of qbits:

+ +

$\begin{bmatrix} a \\ b \end{bmatrix} \otimes \begin{bmatrix} c \\ d \end{bmatrix} \otimes \begin{bmatrix} e \\ f \end{bmatrix} = \begin{bmatrix} ace \\ acf \\ ade \\ adf \\ bce \\ bcf \\ bde \\ bdf \end{bmatrix}$

+ +

Ordinarily this doesn't matter very much, but sometimes qbits become entangled, which means their product state cannot be factored into the tensor product of individual qbits:

+ +

$\begin{bmatrix} \frac{1}{\sqrt{2}} \\ 0 \\ 0 \\ \frac{1}{\sqrt{2}} \end{bmatrix} \ne \begin{bmatrix} a \\ b \end{bmatrix} \otimes \begin{bmatrix} c \\ d \end{bmatrix}$

+ +

When this happens, applying a quantum logic gate to $n$ qbits (which takes the form of a $2^n \times 2^n$ unitary matrix) can manipulate $2^n$ pieces of information (the elements of the product state, called amplitudes) in one shot. However, there's a bottleneck: you can only ever get $n$ bits of information out of an $n$-qbit system (through measurement), even though the $n$-qbit system contains $2^n$ pieces of information. This bottleneck means we cannot ""solve problems by trying all possible solutions simultaneously"" or some other such nonsense you might have read, and quantum computers can only provide speedup in very specific problem domains.

+ +

I gave a lecture where I expand on these concepts here.

+",4153,,,,,2/5/2019 22:29,,,,2,,,,CC BY-SA 4.0 +5386,1,,,2/6/2019 0:36,,-2,174,"

What are some of the most probable directions for quantum computation to go in the future and what research still needs to be done in the field?

+",5719,,26,,4/11/2019 14:13,4/11/2019 14:13,Future research in quantum computation and information,,1,1,,2/6/2019 4:50,,CC BY-SA 4.0 +5387,2,,5386,2/6/2019 2:02,,2,,"

One research direction that's in some ways just getting going is making the constant factors on the costs of quantum computation smaller. For example, the the first international workshop on quantum resource estimation (QRE2019) didn't happen ten years ago, it's happening later this year.

+ +

Given known techniques, if you try to run a classical computation on an error corrected quantum computer, it will be billions or trillions of times less efficient. So basically quantum algorithms start with that as a penalty factor. The constant factors are so bad that, unless we make serious improvements, no one will ever see a benefit in practice from running Grover's search algorithm.

+ +

As another example, the meat of Shor's algorithm is basically just one modular exponentiation done under superposition. Modular exponentiations are an operation your computer can do in a fraction of a second. Yet the resource estimates for running Shor's algorithm are huge.

+",119,,,,,2/6/2019 2:02,,,,0,,,,CC BY-SA 4.0 +5388,1,,,2/6/2019 19:32,,2,472,"

Was wondering if anyone has any historical data/charts showing the number of over logical qubits over time. I am hoping to include something illustrative of Moore's law as applied to quantum computing for a presentation. Thank you.

+",5736,,26,,2/6/2019 19:34,2/6/2019 19:59,Chronological list of improvements in number of logical qubits,,2,0,,,,CC BY-SA 4.0 +5389,2,,5388,2/6/2019 19:53,,1,,"

I don't know if such a chart already exists, but I'd refer you to the Timeline of quantum computing on Wikipedia and the citations therein. It is quite comprehensive and you can extract the ""number of qubits vs. time"" data from there and create your own charts.

+ +

There's also this but it misses out on a lot of details (and is a bit misleading):

+ +

+ +

Nevertheless, I'd like to mention that the number of qubits by itself is not a good measure of the performance of quantum computers. And Moore's law is not really applicable to quantum computing. Please read through the following threads.

+ + +",26,,26,,2/6/2019 19:59,2/6/2019 19:59,,,,0,,,,CC BY-SA 4.0 +5390,2,,5388,2/6/2019 19:58,,1,,"

I recommend you the Quantum Computing Report page, where several news about quantum computing and other interesting data about the quantity of qubits and quality of them in each existing nowadays is presented. The link I added refers to a post called ""Applying Moore's law to quantum qubits"" as you are specifically requiring such information.

+",2371,,,,,2/6/2019 19:58,,,,0,,,,CC BY-SA 4.0 +5391,1,,,2/6/2019 23:34,,8,894,"

Suppose we are using GA (Grover's algorithm) such that we are given it has 2 or more solutions. The search space is of size $N$. We all know Grover's algorithm has, at worst, a time complexity proportional to $\sqrt{N}$. +Now assume we are using quantum phase estimation to get the exact number of solutions in GA to precision $p$ bits (which is actually an angle on the complex unit circle) – so this means we will need to apply quantum phase estimation to get this angle – from this we get the exact numbers of solutions in GA. Using GA with phase estimation in this way is well known.

+ +

My question is, does the quantum phase estimation algorithm, in the worst case, run in polynomial time and polynomial space according to $N$?

+",5737,,26,,2/7/2019 13:31,4/15/2021 1:04,What is the complexity of the quantum phase estimation in Grover's algorithm?,,1,6,,,,CC BY-SA 4.0 +5393,1,5394,,2/6/2019 23:56,,4,129,"

$\newcommand{\qr}[1]{|#1\rangle}$Grover algorithm's input is a superposition, representing the haystack, and the Bell state $\qr{-}$. The $\qr{-}$ seems utterly important: when I replaced $\qr{-}$ by, say, $\qr{+}$, the oracle became the identity operator and so Grover's algorithm couldn't work with it. So it seems that we need $\qr{-}$ so that $$U_f\qr{i}\qr{-} = (-1)^{f(i)}\qr{i}\qr{-},$$ which is the phase kickback tricky. Is $\qr{-}$ the only state that can do the trick for Grover's algorithm?

+",1589,,26,,3/30/2019 7:52,3/30/2019 7:52,Is the $|-\rangle$ state the only one that can do the trick for Grover's algorithm?,,2,1,,,,CC BY-SA 4.0 +5394,2,,5393,2/7/2019 0:01,,3,,"

It would still work if you rotated the $|−\rangle$ state, you refer to, by an angle with cosine less than $\frac{1}{L}$ where $L$ is the square root of the size of the search space (which is a power of 2). So it works with a different state which is a small rotation of the $|-\rangle$ state.

+",5737,,26,,2/7/2019 8:12,2/7/2019 8:12,,,,3,,,,CC BY-SA 4.0 +5395,1,5397,,2/7/2019 0:23,,9,439,"

Was it David Deutsch? Can you say who was the first paper to mention the phase kickback trick?

+",1589,,26,,2/7/2019 8:05,2/9/2019 0:13,Who discovered the phase kickback trick?,,2,0,,,,CC BY-SA 4.0 +5396,1,,,2/7/2019 1:02,,1,87,"

I have this cq-state:

+ +

$$\frac{1}{2} \times (|0\rangle \langle0|_A \otimes \rho^0_E + |1\rangle \langle1|_A \otimes \rho^1_E)$$

+ +

Where Alice (A) is classical and an adversary Eve (E) has some knowledge about Alice's system. If Alice's measurement is 0, then Eve's knowledge is $\rho^0_E$ and similarly, if Alice's measurement is 1, then Eve's knowledge about it is $\rho^1_E$. Now, how do I measure how different these $\rho$s are? How do I separate it from the system and measure their difference?

+ +

I was using projectors on the standard basis to filter them out. But is there a standard way?

+",2403,,26,,2/7/2019 7:59,2/7/2019 12:45,Better Way Of Separating Two CQ-States,,1,1,,,,CC BY-SA 4.0 +5397,2,,5395,2/7/2019 3:06,,14,,"

The phase kickback trick appears in this paper:

+ +
+

Richard Cleve, Artur Ekert, Chiara Macchiavello, Michele Mosca. Quantum Algorithms Revisited. Proceedings of the Royal Society of London A, 454(1969): 339-354, 1998.

+
+ +

The authors credit Alain Tapp for independently discovering the same improvement to Deutsch's algorithm that results from using this trick. (Deutsch's original algorithm, which did not make use of the phase kickback trick, was in fact not deterministic; the algorithm we now typically call Deutsch's algorithm is actually the improved version proposed in the above paper.)

+",1764,,,,,2/7/2019 3:06,,,,0,,,,CC BY-SA 4.0 +5398,1,5406,,2/7/2019 4:42,,9,2704,"

I’m currently studying the Shor’s algorithm and am confused about the matter of complexity. From what I have read, the Shor’s algorithm reduces the factorization problem to the order-finding problem or period of modular exponentiation sequence of some random $x$ such that $1 < x < N$.

+ +

I have no problem regarding the idea of the algorithm. But I'm wondering if Shor’s algorithm creates such a sequence by repeated squaring (which is an efficient way classically). In my understanding, the term ""efficient"" means that the complexity of the algorithm is polynomial in time.

+ +

Given that there is an efficient way to create the sequence classically, can we not just add a little check for whether we have encountered $x^{r} = 1 \ \text{mod} N$? During the creation process, it should not increase complexity to exponential-time, right?

+ +

Why bother with quantum Fourier transform at all? Did I misunderstand it in some way?

+",4729,,4729,,2/7/2019 7:50,2/8/2019 15:33,Why is quantum Fourier transform required in Shor's algorithm?,,2,2,,,,CC BY-SA 4.0 +5399,2,,5398,2/7/2019 5:20,,3,,"
+

Given that there is an efficient way to create the sequence + classically, can we not just add a little check for whether we have + encountered $x^{r} = 1 \ \text{mod} N$? During the creation process, + it should not increase complexity to exponential-time, right?

+ +

Why bother with quantum Fourier transform at all? Did I misunderstand + it in some way?

+
+ +

The answer to the above question is that there exists no known classical (non-quantum) algorithm that can find this period efficiently (in polynomial complexity). So that means there is no efficient classical algorithm to find the period of functions like $x = 2^r_{1} \ \text{mod} N$. That is not to say such a classical algorithm does not exist – just that no one knows such a classical algorithm.

+ +

The classical discrete Fourier transform has exponential complexity – however, the quantum version of that Fourier transform has polynomial complexity. So we do need to bother with the quantum Fourier transform.

+",5737,,26,,2/7/2019 7:44,2/7/2019 7:44,,,,2,,,,CC BY-SA 4.0 +5400,2,,5393,2/7/2019 7:40,,3,,"

Remember that the states $|+\rangle$ and $|-\rangle$ form a basis. That means that any state $|\psi\rangle$ that you use can be written as +$$ +|\psi\rangle=\alpha|+\rangle+\beta|-\rangle. +$$ +By linearity, we can basically treat what these two components do separately. The $|+\rangle$ component is basically useless and gives the correct output with probability $1/N$ if there are $N$ items in the database, while the $|-\rangle$ component returns the marked item with a probability close to 1. Hence the overall success probability of a single run is approximately +$$ +p=\frac{|\alpha|^2}{N}+|\beta|^2. +$$ +With, on average $1/p$ repetitions, we'll find the answer we're looking for. So long as $1/p<\sqrt{N}$, we still get a speed-up over the classical case. Hence, roughly, we want $|\beta|^2>1/\sqrt{N}$.

+ +

A similar analysis can be repeated whenever the phase kickback trick is used (with the caveat that you never do anything to that qubit that should be in $|-\rangle$ except do the operation that creates the phase kickback, but I believe that is always the case)

+",1837,,,,,2/7/2019 7:40,,,,0,,,,CC BY-SA 4.0 +5405,2,,5396,2/7/2019 10:00,,2,,"

In quantum information theory, the standard way to obtain what it is called reduced density operator from a quantum system composed by several quantum states is to use the so-called partial trace operation. For the case where there are two quantum states, $\rho^{AB}$ can be reduced to $\rho^A$ and $\rho ^B$ in the following way:

+ +
    +
  • $\rho^A=tr_B(\rho^{AB})$
  • +
  • $\rho^B=tr_A(\rho^{AB})$
  • +
+ +

This operator acts like it is tracing out one of the systems from the whole density matrix that describes the whole system. Apart from that, in order to measure how different two quantum states are, the fidelity measurement is used usually in quantum information theory. Such the measure is defined as

+ +
    +
  • $F(\rho,\sigma)=\sqrt{\rho^{1/2}\sigma\rho^{1/2}}$
  • +
+ +

where $\rho$ and $\sigma$ are quantum density matrices. These things are explained in the Nielsen and Chuang book, refer there for more information.

+",2371,,26,,2/7/2019 12:45,2/7/2019 12:45,,,,2,,,,CC BY-SA 4.0 +5406,2,,5398,2/7/2019 12:09,,7,,"

The essential feature of this problem is that while both the quantum and classical algorithms can make use of the efficient classical function of calculating $a^k\text{ mod }N$, the issue is how many times does each have to evaluate the function.

+ +

For the classical algorithm you're suggesting, you'd calculate $a\text{ mod }N$, and $a^2\text{ mod }N$, and $a^3\text{ mod }N$, and so on, until you hit a repeating value. You have to perform $r$ evaluations, and $r$ could be quite large. Indeed, it could be $O(N)$. It's this large number of repetitions that kills this idea for the classical algorithm.

+ +

By comparison, the quantum algorithm only evaluates the order once. You then need the Quantum Fourier Transform in order to be able to compare all the simultaneously calculated values because you cannot access all of these values all at once. The QFT is what does all the magic.

+",1837,,,,,2/7/2019 12:09,,,,2,,,,CC BY-SA 4.0 +5407,1,,,2/7/2019 12:36,,2,91,"

This is a question in the Nielsen and Chuang textbook (Exercise 2.2).

+ +
+

Suppose $V$ is a vector space with basis $|0\rangle$ and $|1\rangle$ + and $A$ is a linear operator from $V \to V$ such that $A|0\rangle = + |1\rangle$ and $A|1\rangle =|0\rangle$. Given a matrix representation + for $A$, with respect to the input basis $\{|0\rangle, |1\rangle\}$ + and output basis $\{|1\rangle, |0\rangle\}$. Find input and output + basis which give rise to a different matrix representation of A.

+
+ +

My doubts:

+ +
    +
  1. Why do we mention the input and output specifically? Isn't the matrix-dependent only on the input and output as long as the transformation is in the same vector space?

  2. +
  3. How to solve the second part of the question?

  4. +
+",5614,,26,,2/7/2019 13:08,2/7/2019 13:08,Nielsen & Chuang Exercise 2.2 - Matrix representations in different input and output basis,,0,4,,4/14/2019 11:51,,CC BY-SA 4.0 +5408,1,,,2/7/2019 13:20,,4,750,"

I am currently running the following document from this Qiskit documentation.

+ +

This notebook is running in Jupyter, and I started Jupyter from the Mac terminal within a Conda environment. Normally, this works fine with Qiskit. The problem is that when I run the command:

+ +

ae._circuit.draw(output='latex')

+ +

I get the following error:

+ +

WARNING: Unable to compile latex. Is 'pdflatex' installed? Skipping latex circuit drawing... +

+ +

I tried conda install pdflatex and many variations of this, but nothing worked so far. Does anyone know how to solve this problem?

+",5600,,26,,2/7/2019 13:24,2/7/2019 16:12,LaTeX error when drawing circuits with Qiskit,,1,0,,,,CC BY-SA 4.0 +5409,1,,,2/7/2019 13:49,,7,3614,"

I don't understand, why is the control not gate used so often. As far as I understand it, if you apply two 2 level operations on two qubits then you get a 4 x 4 matrix by the tensor product. So how would you express the CNOT gate as a product of the one matrix acting upon the first qubit and the second acting on the second qubit?

+ +

Another thing which I have difficulty understanding is why we use so many single qubits and CNOT gates for implementing the Toffoli gate? Can't we implement it using just an AND between the first two qubits and then applying a controlled NOT for the third one?

+",5742,,55,,2/8/2019 11:32,11/28/2022 6:35,Composing the CNOT gate as a tensor product of two level matrices,,3,1,,,,CC BY-SA 4.0 +5410,2,,5409,2/7/2019 14:16,,13,,"

The whole point is that CNOT cannot be written in the form $A\otimes B$. This is absolutely essential because if we only ever had operators of the form $A\otimes B$, states of the form $|\psi\rangle\otimes|\phi\rangle$ would always remain separable. There's be no entanglement, and all quantum circuits would be easy to simulate on a classical computer.

+ +

As for the Toffoli construction you describe, we require that in a quantum circuit, all gates are reversible. The AND gate is not reversible as you can see from the way the number of outputs is smaller than the number of inputs (so it's impossible to know what the inputs were just by looking at the outputs).

+ +
+ +

The above answers the question actually asked. However, I infer from the follow up comments of the OP, both here and on other questions, that there's something else that they're trying to get at. Here's my attempt to resolve some confusion.

+ +
+

Any $N\times N$ matrix can be composed as a product of ""two-level matrices"".

+
+ +

This is the normal matrix product, not the tensor product. A ""two-level matrix"" in this context is a matrix which is the identity everywhere except for two basis elements $s$ and $t$, on which the $2\times 2$ matrix is an arbitrary unitary matrix. The controlled-not is by no means an exception to this rule. In fact, it's a particularly simple example because controlled-not is a two-level matrix where $s=10$ and $t=11$. That makes it a particularly natural building block which allows the further statement

+ +
+

Any $2^n\times 2^n$ two-level matrix can be decomposed in terms of $2\times 2$ two-level matrices and the special case $4\times 4$ two-level matrix that is controlled-not.

+
+ +

remembering that any system on which the gate does not act requires us to take the tensor product of the operator with identity in order to make it act on the correct dimension.

+",1837,,1837,,2/20/2019 12:06,2/20/2019 12:06,,,,14,,,,CC BY-SA 4.0 +5411,2,,5408,2/7/2019 15:23,,3,,"

You are missing the pdflatex binary. Install pdflatex from your OS's LaTeX installer. For MacOS, follow this link: Where do I get the pdflatex program for Mac?.

+",5744,,26,,2/7/2019 16:12,2/7/2019 16:12,,,,0,,,,CC BY-SA 4.0 +5413,1,5419,,2/7/2019 19:05,,1,901,"

I am new to quantum computing and saw this argument on this site but I don't understand it.

+ +
    +
  1. First of all, I don't understand what is exactly meant by 'reversible'. Because even if you had a unitary matrix operation that doesn't mean you would be able to tell what were the inputs. For example the XOR gate which is like CNOT but without the control output, is actually unitary but that doesn't mean I can reverse the process. I can sometimes somewhat say what were the inputs but can I always tell 0,1 from 1,0 as inputs?

  2. +
  3. Suppose now, you have a 4x4 unitary matrix acting on two qubits as a tensor product of two operations. How can you reverse the process? I am not seeing how just being 'unitary' helps you? Can you tell what came in? +Another thing I don't understand: if all the point of control gates is because of unitary matrices have to be reversible, then again why would we need control in first place?

  4. +
  5. Granted that all of your operations are Unitarian then also compositions and multiplications would be Unitarian. Then why do you need a control to guarantee reversibility if you claim reversibility follows from the unitary property?

  6. +
+ +

Sure I am missing something here. But what is it? What's the point of control gates? Everyone says it's for reversibility. Why we need reversibility? People say due to unitarity. Unitarity is needed to keep the normal size of the probability vector. But then again, if all of them are unitary they are already reversible (if they aren't then again why is reversibility needed) so why then use controlled gates?

+",5742,,5742,,2/7/2019 20:47,2/8/2019 3:22,Is it correct to say that we need controlled gates because unitary matrices are reversible?,,3,0,,,,CC BY-SA 4.0 +5414,2,,5409,2/7/2019 20:02,,5,,"

Any two qubit Controlled-U gate is not decomposable as $A\otimes B$ in general. The whole point is that a conditional operator has a non-local nature and it gives rise to non-trivial correlations when operated on a state.

+ +

The Physics behind is that; imagine a Controlled operation which can be factored as $A\otimes B$, and the sub-systems (or the two qubits) are separated non-locally in space. then the only way to perform a controlled conditional operation is to measure the state of a first qubit, convey the outcome classically to the second qubit and apply the desired unitary on the second qubit, and finally re-initialize the first qubit. But now note that this is NOT actually a 'true' controlled gate because it cannot work for an arbitrary control qubit.

+ +

Hence, the actual nature of a conditional gate is non-local, which essentially implies that it cannot be factored as $A\otimes B$ over the sub-spaces. The intuition can be taken as the operation reads system $A$ and simultaneously changes system $B$ based on the state of system $A$. This is strictly non-local in nature. Physically how it is implemented in experiments is most often by a single exchange of quanta between the states, which is triggered by the state of one sub-system. Hence, this gives rise to entanglement between the sub-systems. It is most often called the 'entanglement generator'.

+ +

Also, you can think of $\operatorname{CNOT}$ gate to be the most simplified two-qubit gate which can generate the class of two-qubit non-local gates when combined with few other gates. This is already proved by the Universality of single-qubit gates and the $\operatorname{CNOT}$ gate.

+ +

About the Toffoli gate, the most obvious way to implement it (after taking in mind the universality) is to decompose it in parts of $\operatorname{CNOT}$ gates and single qubit gates. This is what is done. And because reversibility is a must requirement for a quantum operation, you cannot use any analogous irreversible gate like the $\operatorname{AND}$ gate in quantum circuits. To perform the $\operatorname{AND}$ analogous operation as you pointed out, this is further broken up in parts of the single qubit and $\operatorname{CNOT}$ gates (to ensure the reversibility and unitarity).

+ +

PS: One essential reason why this decomposition is done because in experiments all we can implement are these single qubit and $\operatorname{CNOT}$ gates only. Any such protocol must be decomposed in these gates to cope up with some experimental implementation. And these are intuitive as well, rather than using multi-qubit gates which are nothing but a series of the single qubit gates and $\operatorname{CNOT}$s.

+",4889,,4889,,2/8/2019 0:42,2/8/2019 0:42,,,,10,,,,CC BY-SA 4.0 +5415,1,,,2/7/2019 20:24,,3,570,"

After reading through Shor's algorithm, I have a few questions about the probability of factoring semiprime number out. Here is some background of the question.

+ +

To factor a semiprime number $N$ such that $N = pq$ (where $p$ and $q$ are prime numbers) efficiently, Shor's algorithm is employed with the following steps (roughly):

+ +
    +
  1. Register 2 sets of qubit $\overbrace{\vert00...0\rangle}^{\text{t qubits}}\overbrace{\vert00...0\rangle}^{\text{n qubits}}$ where $N^{2} < 2^{t} < 2N^{2}$ and $n = \log_{2}{N}$
  2. +
  3. Randomly choose $x$ such that $1 < x < N$ and check if $\gcd(x,N) = 1$ if not here is a factor
  4. +
  5. Finding a period $r$ (or order) of a modular exponentiation sequence, $f(x) = x^{a} \mod N$ where $a = 0,1,2,3,...$ with quantum fourier transform (QFT) (I have skip many details about operation after initialize a qubits, if interested then I suggest this Qiskit tutorial)
  6. +
  7. Measure the first set register which contain an information in form of
  8. +
+ +

$$\vert\psi\rangle = \frac{1}{2^{t}}\sum_{a=0}^{2^{t}-1}\sum_{z=0}^{2^{t}-1}e^{(2\pi i)(\frac{aj}{2^{t}})}\vert j \rangle \vert x^a \bmod N \rangle \hspace{0.2cm} ;\text{where} \hspace{0.3cm} \frac{j}{2^{t}} = \frac{k}{r} \hspace{0.3cm}, 0 < k < N$$

+ +
    +
  1. After obtaining $z$ by using continued fraction to approx $\frac{j}{2^t}$ close to $\frac{k}{r}$ which is irreducible, so the denominator is a period $r$
  2. +
  3. Check if $r$ is even and is period of $x$ by using $2^{r} = 1 \mod{N}$ if not then run 2.) again ,if yes then $r$ is period of $x$ and the prime factor can be compute by $\gcd(x^{r/2} \pm 1, N)$
  4. +
+ +

Now consider an example $N = 21$ and $x = 2$ follow this tutorial (which I follow from Qiskit tutorial).

+ +

By following the above step until 4, the probability density of state becomes:

+ +

$$\rm{Probability} \ (j) = \frac{1}{512 \times 86} \bigg\vert \sum_{a=0}^{85}e^{-2 \pi i \frac{6ja}{512}} \bigg\vert^2$$

+ +

Note: Normalization factor is different from 4 (which is more general) because the example does a measurement on the second register before QFT to simplify an expression.

+ +

So then consider the possible outcome $j$ corresponding probability and period compute from continued fraction approximation of a measurement which are

+ +
    +
  • $0$ $(16.66\%)$ ; algorithm fail, retry
  • +
  • $83 \leq j \leq 87$ $(16.66\%)$ $r = 6$
  • +
  • $168 \leq j \leq 172$ $(16.66\%)$ $r = 3$
  • +
  • $254 \leq j \leq 257$ $(16.66\%)$ $r = 2$
  • +
  • $339 \leq j \leq 343$ $(16.66\%)$ $r = 3$
  • +
  • $425 \leq j \leq 429$ $(16.66\%)$ $r = 6$
  • +
+ +

the expected result, period of $2^a \text{mod} N$ is $6$. From the above result, it is easily seen that a probability of obtaining the right answer is around $33\%$

+ +

Here is the beginning of the question from Shor's original paper, which says:

+ +
+

when applied to a random $x \ (\text{mod} \hspace{0.1cm}n)$, + yields a factor of n with probability at least $1 - \frac{1}{2^k}$ + , where k is the number of distinct + odd prime factors of $n$

+
+ +

After looking through other possible value $x$ there are $2, 8, 10, 11, 13, 19$ that return an even period such that I can use them to successfully compute prime factors of $N$. And for $3, 6, 7, 12, 14, 15, 18$ that returns a prime factor in step 2 above.

+ +

So the question is if we consider $x = 2$ (follow the above example) then the consecutive probability is $\frac{1}{19}\times\frac{1}{3}$ which is less than $\frac{1}{2}$. So what about such a probability that is stated in Shor's original paper? Does it just mean the probability of encountered $x$ that ""may return the right answer"" does not include its consecutive probability?

+ +

Or in Shor's original paper it is mentioned that the outcome that may be a factor of $r$, namely $r = r_{1}r_{2}$ and suggests a tactic: to check $r' = 2r, 3r, ...$ (stop before $r' > N$). Then how can I speak about the probability of obtaining the right answer in this aspect?

+ +

Alternatively, if one can obtain a factor of $r$, namely $r_{1}$ (i.e. above example third to fifth a outcome) in tutorial that suggests one to run the quantum part again with $x' = x^{r} \text{mod} N$ which will return $r_{2}$ with some probability again.

+ +

There are so many ways to do it. So I am now wondering which way is the most efficient way to perform Shor's algorithm:

+ +
    +
  • Not deal with the $x$ such that return odd $r$ or trivial solution.
  • +
  • Extracting the period from measured information using continued fraction method which might not return the right period even if it is $x$ that should (i.e. the above example with to say $\frac{256}{512} = \frac{1}{2}$ then return $r = 2$).
  • +
  • Retry with a new $x$ every time?
  • +
  • Use a tactic that Shor suggests?
  • +
  • Retry again with $x'$ to obtain another factor of $r$.
  • +
  • Another way that I don't know.
  • +
+ +

Also, how many times do we need to repeat the algorithm if we want to factor like say 232 digits numbers (or maybe say an order like 10 times is enough. Or 100? 1,000?).

+ +

I get that it is still worth run Shor's algorithm again and again. It is still more efficient than the classical factoring algorithm. But with the above statement from Shor's original paper an example in tutorial makes me confused. Did I misunderstand or miscalculate something in the above process?

+ +

I have read a similar question, but still not getting it and want to ask for my understanding.

+",4729,,26,,2/8/2019 10:32,2/8/2019 10:32,Possible results from Shor's algorithm in practice,,0,0,,,,CC BY-SA 4.0 +5416,2,,5413,2/7/2019 21:01,,4,,"
    +
  1. Any quantum operation is basically a Hamiltonian $H$ acting on an isolated Hilbert space states. Now, the requirements for a Hamiltonian is to a matrix which is Unitary and Hermitian. This intrinsically implies it has an inverse, which means it is reversible because you can always find a matrix $H^{-1}$ and apply it on the state. This is where reversibility comes from.

    +

    Physics behind: To perform quantum computation, we need an isolated Hilbert space (2 dimensional for a qubit) which means there must be no dissipation outside the Hilbert space. This implies unitarity to be a must requirement as it conserves the inner product (and hence the probability). Now, there is a principle - "Landauer's Principle" which implies for every bit of the information loss there is an energy loss of $k_BT$, where $T$ is the temperature of the system. And because we need an isolated system (in principle), we cannot allow dissipation and hence reversibility is a must requirement from Physics point of view.

    +
  2. +
  3. Any $4\times 4$ unitary has an inverse that exists. But this does not mean you can make it a separable operation as answered in the Composing the CNOT gate as a tensor product of two level matrices. We can reverse the process by simply applying the inverse gate. That single operation does the job. Control has nothing to do with the reversibility or unitarity in specific, these two are basic requirements of every quantum operation on qubits. You need control gates to perform the control operations which basically form the part of connecting different qubits, most fundamental in its way.

    +
  4. +
  5. We don't need "control" or "conditional" nature of gates to guarantee the reversibility. This is a misconception. Reversibility comes from Unitarity, Hermicity and Landauer's principle for quantum computation.

    +
  6. +
+",4889,,-1,,6/18/2020 8:31,2/7/2019 21:06,,,,3,,,,CC BY-SA 4.0 +5417,2,,5413,2/7/2019 21:38,,4,,"

Controlled gates are used to create entanglement. They don't have anything to do with reversibility; all unitary gates are reversible by definition, since all unitary operators have inverses.

+ +

You could come up with an alternative choice of gates that you used to write algorithms in that didn't include controlled gates. For instance, for quantum computers based on ion traps, it is common to use Mølmer-Sørensen gates instead of controlled gates. It is possible to convert between different choices of primitive gates, as long as each set is universal; that is, as long as each set is capable of expressing all possible quantum operations.

+ +

To your question 1, if I apply CNOT to qubits 1 (control) and 2 (target), and then apply the same CNOT operation a second time, I will return the system to its original state. CNOT is unitary and self-adjoint, which implies that it is its own inverse; there are other gates that are unitary but not self-adjoint, but these gates all have inverses, and so by applying the inverse gate I can get back to where I started.

+ +

To question 2, if I apply a single-qubit unitary gate to qubit 1 and apply another unitary gate to qubit 2, then applying the inverse of each unitary gate to the same respective qubits will undo the original pair of gates.

+",4265,,,,,2/7/2019 21:38,,,,5,,,,CC BY-SA 4.0 +5418,2,,5363,2/7/2019 21:45,,2,,"

CNOT in ion traps is not implemented in one go. It is decomposed in terms of SWAP gate. The general decomposition they use is:

+ +

\begin{equation} +\operatorname{CNOT}_{jk}=H_k \operatorname{SWAP}^{-1}_k C_j(Z) \operatorname{SWAP}_kH_k +\end{equation} +where $j,k$ are the labels for the control and target ion (qubit) respectively, in the array. $H$ is Hadamard gate and $C(Z)$ is the control-Z operation.

+ +

Hadamard is just rotations, so we can ignore that for a while and focus on the middle three gates, they are the three crucial steps of the algorithm of Cirac-Zoller implementation in the right order.

+ +

The circuit is as shown (Source: Nielsen and Chuang, pg.323) +

+ +

The Control-Z is what the $2\pi$ pulse is in the second step.

+ +

If you follow this scheme of Nielsen and Chuang (sec-7.6.4), the $2\pi$ pulse implements this operation as follows: +

+ +

We need to switch $|01\rangle \leftrightarrow |10\rangle$ for the control-Z. This is done as follows. We need a way to swap qubits between the atom’s internal spin state and the +phonon state (little perturbation over the spin states). This can be done by tuning a laser to the frequency $\omega_0-\omega_z$, and arranging for the phase (which can always be done by the laser) to be such that we perform the rotation $R_y(\pi)$ on the subspace spanned by +$|01\rangle$ and $|10\rangle$, which is just the unitary transform

+ +

\begin{equation} +C_{SWAP}=|00\rangle \langle 00|+|01\rangle \langle 10|-|10\rangle \langle 01|+|11\rangle \langle 11| +\end{equation} +on the $|00\rangle, |01\rangle, |10\rangle, |11\rangle$ space. If the initial state is $a|00\rangle + b|10\rangle$ (that is, the phonon is initially $|0\rangle$), then the state after the swap is $a|00\rangle + b|01\rangle$, so this accomplishes the desired swap operation, which is the second step in Cirac-Zoller. Note here that $2\pi$ pulse is just the $R_y(\pi)$ here which is equivalent by just a convention.

+ +

The frequency notation is explained in the last image.

+ +

I would suggest to read thoroughly the section 7.6 of Nielsen and Chuang to make a complete understanding. +

+",4889,,,,,2/7/2019 21:45,,,,0,,,,CC BY-SA 4.0 +5419,2,,5413,2/7/2019 21:48,,3,,"

Siddhant's answer should suffice, but as you said you are new to quantum computing (QC), I am not sure whether you are new to quantum mechanics (QM) as well. I will assume you are new to QM, and if that is not the case please excuse my ignorance.

+ +
+

Is it correct to say that we need controlled gates because unitary matrices are reversible?

+
+ +

No, controlled gates have nothing to do with guaranteeing the reversibility of unitary matrices. I hope it becomes clear after reading the following

+ +
+

First of all, I don't understand what is exactly meant by 'reversible'.

+
+ +

In QC, the operations(gates) are reversible. Suppose you have a unitary operation(gate) $U$, it can always be inverted, i.e. $U^{-1}$ exists. You can think of it like this, whatever $U$ does, $U^{-1}$ does reverse of that, since $U U^{-1} = \mathbb{I} $. +This is independent of the input/output basis as queried in the last part of your first question.

+ +

Now the reason for why they are operations are unitary matrices, is pointed out by @siddhant in his first point.

+ +
+

... How can you reverse the process? I am not seeing how just being 'unitary' helps you? Can you tell what came in?

+
+ +

Yes, just being unitary helps. Since an inverse of a unitary matrix always exists.

+ +
+

...if all the point of control gates is because of unitary matrices have to be reversible, then again why would we need control in first place?

+
+ +

No, that is not the point of control gates. Control gates are a subset of all the gates, and all gates are unitary.

+ +
+

If you are correct then, take the XOR gate which is unitary, provided you have + an output can you say what were the inputs?

+
+ +

Depends, the XOR gate you are referring to is with two inputs one outputs? then no and it is not unitary. The CNOT gate, on the other hand, is unitary.

+ +

Now you may be wondering only thing that differentiates them is the output of the control and just adding the output of the control makes the gate unitary(thus reversible).

+ +

And you would be correct. But that is not the question you asked, although, after reading the second comment you copy/pasted in every answer, now I think this the question you intended to ask: Is it correct to say that we need output of the control bit because unitary matrices are reversible?

+ +

And the answer is Yes. Think of it this way (read it as a flow chart)

+ +
    +
  • QM required the gates/operation to be unitary (in a closed system)
  • +
  • XOR gate with two input one output is not unitary
  • +
  • What can we do to perform a task which XOR gate does in QM?
  • +
  • If we know the state of control bit as well, it is!
  • +
  • Bingo!
  • +
+ +
+

your answer implying that a universal system must include an entanglement? Is this a correct phrasing? Since you say controlled gates are for entanglement and it's a gate inside universal set.

+
+ +

No, entanglement is not necessary for quantum computation, it helps but it is not necessary.

+",5746,,26,,2/8/2019 3:22,2/8/2019 3:22,,,,4,,,,CC BY-SA 4.0 +5420,2,,5384,2/7/2019 21:52,,1,,"

Which of these transitions will occur will be governed by the operation regime of the apparatus and laser. It might happen, for example, that state 3 is unfavorable due to selection rules or it only acts as an auxiliary state. The very first step according to the D.Vincenzo's criteria is to identify and isolate the Hilbert space of the system to work with. This already implies that your operations are restricted and the energy domains too. You only perform certain operations that contribute to the q.computation and does not affect parts of the system to interfere and decohere the operating state. This is all a matter of experimental conditions.

+",4889,,,,,2/7/2019 21:52,,,,0,,,,CC BY-SA 4.0 +5421,1,,,2/7/2019 21:54,,2,372,"

Is there a polynomial time and polynomial space quantum algorithm for finding a 4 colouring of any loopless planar graph?

+",5737,,26,,2/8/2019 3:14,2/10/2019 19:35,Is there a polynomial quantum algorithm for graph coloring?,,1,0,,,,CC BY-SA 4.0 +5422,1,,,2/7/2019 22:06,,4,1027,"

I am able to apply multiple measurements (2) to the same qubit system. However, I would like to get the counts right after each measurement is executed. I realize that the counts should be the same after every measurement of the same system. I would just like to see empirical proof of the so-called ""repeated measurement principle"" without any evolution of the system. I attempted to write a program which would achieve this, but had no success:

+ +
import time 
+from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister 
+from qiskit import execute, IBMQ, Aer 
+from qiskit.backends.ibmq import least_busy 
+from qiskit import compile as q_compile
+
+counter = 0
+
+def generate_circuits(num_q):
+    # Create a Quantum Register with 1 qubits.
+    q = QuantumRegister(num_q, 'q')
+    # Create a Classical Register with 1 bits.
+    c = ClassicalRegister(num_q, 'c')
+    # Create a Quantum Circuit
+    qc = QuantumCircuit(q, c)
+
+    if counter == 0:
+        # Add a H gate on qubit 0, putting this qubit in superposition.
+        qc.h(q[0])
+        # Add a Measure gate to see the state.
+        qc.measure(q, c)
+        qc.barrier(q)
+        return qc
+    else:
+        qc.measure(q, c)
+        return qc
+
+backend = Aer.get_backend('qasm_simulator')
+
+qc_gen = generate_circuits(1)
+
+qobj = q_compile(qc_gen, backend, shots=1000)
+
+job = backend.run(qobj)
+
+result = job.result()
+
+data = result.get_counts(qc_gen)
+
+print(data)
+
+counter += 1
+
+qobj = q_compile(qc_gen, backend, shots=1000)
+
+job = backend.run(qobj)
+
+result = job.result()
+
+data = result.get_counts(qc_gen)
+
+print(data)
+
+ +

which returned:

+ +
{'0': 489, '1': 511} 
+{'0': 491, '1': 509}
+
+ +

Any ideas?

+",5747,,26,,2/8/2019 15:32,2/8/2019 15:32,Qiskit - How do we measure the same single qubit system multiple times while also getting the counts/results after each measurement?,,1,1,,,,CC BY-SA 4.0 +5424,2,,23,2/8/2019 2:40,,2,,"

Yes, it can because quantum computing is a generalization of classical computing. So the procedure you ask for exists.

+ +

We can take a universal classical logic gate such as NOR gate, generalize to a reversible quantum version of that NOR gate. Thus a procedure can be as follows:

+ +
    +
  • Design classical circuit
  • +
  • Rewrite classical circuit using only the chosen universal classical gate (e.g. NOR)
  • +
  • Convert the classical circuit above using quantum the quantum version of the classical universal gate
  • +
+ +

We pick a set of basis states, to represent the two binary classical states, and we ignore complex amplitudes as the other answer, by jknappen, implies.

+",5737,,26,,2/8/2019 3:43,2/8/2019 3:43,,,,0,,,,CC BY-SA 4.0 +5430,2,,4368,2/8/2019 8:53,,4,,"
    +
  1. Grover focuses on gate costs, while Ambainis focuses on queries. Ambainis solves element distinctness in $O(N^{2/3})$ queries, using $O(N^{2/3})$ memory. If you used that memory to run $O(N^{2/3})$ copies of Grover's algorithm (since each copy needs poly-log space, and I'm being imprecise about logarithmic factors) then each one would search a space of size $N^2/N^{2/3}=N^{4/3}$, and with the square-root speed up, would take time $O(N^{2/3})$. But, each copy is making simultaneous queries, so parallel Grover makes $O(N^{4/3})$ queries in total. So in query complexity, it's not a trivial result.

    + +

    Is query complexity a good measure? It depends on your model of computation, and in this case: Do you have a quantum random access gate? If you only have Clifford+T gates (or any other finite set with bounded fanin) then quantum random memory access to $M$ elements needs $\Omega(M)$ gates. This is because the gates you use cannot be ""dynamically generated"" by the input, which is quantum. When I think about this, I always envision a classical control computer that applies gates somehow. The classical control cannot measure the input (which is quantum) so it must apply the necessary gates for any possible memory access. If you had given a superposition of addresses for the memory access, then it would definitely need to apply all the gates!

    + +

    Ambainis explicitly adds a random access gate to the usual gate set. Once he does this, the query complexity he derives will be roughly equal to the total gate cost. If you don't add a random access gate, and you need to ""build"" one out of Clifford+T, then a single memory access would use $O(N^{2/3})$ gates itself. Then Ambainis' algorithm will end up with an $O(N^{4/3})$ total gate cost - the same as Grover's algorithm (up to poly-log factors).

  2. +
  3. For other algorithms, I've looked a lot (this is the subject of my master's thesis, essentially) and I haven't seen much. The algorithms at the end of ""Efficient Distributed Quantum Computing"" do slightly better, though they focus on depth, not gate cost, and they rely on hypercube connectivity in their qubits.

  4. +
+",4517,,,,,2/8/2019 8:53,,,,0,,,,CC BY-SA 4.0 +5431,1,5433,,2/8/2019 10:41,,7,362,"

I'm curious about how to form arbitrary-sized uniform superpositions, i.e., +$$\frac{1}{\sqrt{N}}\sum_{x=0}^{N-1}\vert x\rangle$$ +for $N$ that is not a power of 2.

+ +

If this is possible, then one can use the inverse of such a circuit to produce $\sqrt{p}\vert 0\rangle+\sqrt{1-p}\vert 1\rangle$ (up to some precision). Kitaev offers a method for the reverse procedure, but as far as I can tell there is no known method to do one without the other.

+ +

Clearly such a circuit is possible, and there are lots of general results on how to asymptotically make any unitary I want, but it seems like a massive headache to distill those results into this one simple, specific problem.

+ +

Is there a known, efficient, Clifford+T circuit that can either produce arbitrary uniform superpositions or states like $\sqrt{p}\vert 0\rangle+\sqrt{1-p}\vert 1\rangle$?

+",4517,,26,,2/8/2019 14:34,4/13/2021 8:43,Forming states of the form $\sqrt{p}\vert 0\rangle+\sqrt{1-p}\vert 1\rangle$,,3,8,,,,CC BY-SA 4.0 +5432,1,,,2/8/2019 12:39,,5,383,"

I saw an example which takes a 2 level matrix. Which is a $8\times8$ matrix that acts non trivially only on 2 levels of only states $|000\rangle$ and $|111\rangle$. The way they do it is by using a gray code from $|000\rangle$ to $|111\rangle$ and then shifting $|000\rangle$ to $|011\rangle$ and performing the $U$ operation only on the most left qubit conditional on the two $|11\rangle$ qubits to the right.

+ +

The thing I am trying to do, is to show that in the end this is equivalent to the original $U$ operation of $8\times 8$ matrix. How can I show their equivalency?

+ +

What I was trying to do is, to take the $U$ acting on the left hand side qubit and tensor product it with two identity matrices acting on the two other qubits. But this doesn't yeild the original $U$ ($8\times 8$ matrix). What did I get wrong here?

+ +

And how do you actually prove that the original $8\times 8$ matrix operation $U$ acting only on states $|000\rangle$ and $|011\rangle$ can be translated by a small $U$ matrix acting only on the most left qubit plus CNOT gates. How can I show it? It would be even preferred to show it by using matrix manipulation of sorts to get the original $8\times 8$ matrix. Or even some intuition would be good as well. Thanks!

+",5742,,26,,2/8/2019 12:53,10/23/2020 23:38,Decomposition of any 2-level matrix into single qubit and CNOT gates,,1,0,,,,CC BY-SA 4.0 +5433,2,,5431,2/8/2019 13:29,,6,,"

As long as you want to set arbitrary states for a single qubit, like in your example, the solution is straightforward and it makes use of standard 2x2 $R_y$ gate. In there if you set

+ +

$\theta = 2\arctan(\sqrt{1-p}/\sqrt{p})$

+ +

and apply $R_y(\theta)$ in the form +$$ +\begin{pmatrix} +\cos(\theta/2) & -\sin(\theta/2)\\ +\sin(\theta/2) & \cos(\theta/2) +\end{pmatrix} +$$

+ +

to an input qubit in superimposed state (i.e. passed through a H gate), you get what you're looking for.

+ +

Of course things get more complicated in case you want to set an arbitrary state over a qubit register of size > 1. In that case there are algorithms like Ventura's one (Initializing the Amplitude Distribution of a Quantum State) which can do it with polynomial complexity.

+",4927,,26,,2/8/2019 14:22,2/8/2019 14:22,,,,6,,,,CC BY-SA 4.0 +5434,1,5439,,2/8/2019 13:43,,3,549,"

I'm using the SWAP test circuit for implementing a qubit registers comparison +

+ +

From the documentation I could find I've understood it can be applied to input qubits |$\alpha\rangle$ and |$\beta\rangle$ of the same size.

+ +

Is that really a constraint? Or it can be also applied to general cases of qubits of different size?

+",4927,,55,,5/22/2021 12:03,5/22/2021 12:03,Can the SWAP test only compare registers with the same number of qubits?,,2,1,,,,CC BY-SA 4.0 +5436,2,,5434,2/8/2019 14:09,,6,,"

Yes they should be the same size. Otherwise, if you use it for getting the inner product between them, it would not make sense they aren't.

+",4127,,,,,2/8/2019 14:09,,,,1,,,,CC BY-SA 4.0 +5438,1,,,2/8/2019 14:36,,5,82,"

In this paper Quantum Circuit Learning they say that the ability of a quantum circuit to approximate a function can be enhanced by terms like $x\sqrt{1-x^2}$ ($x\in[-1,1])$. +Given inputs $\{x,f(x)\}$, it aims to approximate an analytical function by a polynomial with higher terms up to the $N$th order. the steps are similar to the following:

+
    +
  1. Encoding $x$ by constructing a state $\frac{1}{2^N}\bigotimes_{i=1}^N \left[I+xX_i+\sqrt{1-x^2}Z_i\right]$

    +
  2. +
  3. Apply a parameterized unitary transformation $U(\theta)$.

    +
  4. +
  5. Minimize the cost function by tuning the parameters $\theta$ iteratively.

    +
  6. +
+

I am a little confused about how can terms like $x\sqrt{1-x^2}$ in the polynomial represented by the quantum state can enhance its ability to approximate the function. Maybe it's implemented by introducing nonlinear terms, but I can't find the exact mathematical representation.

+

Thanks for any help in advance!

+",4178,,1939,,7/21/2022 3:44,8/20/2022 15:41,Why does $x\sqrt{1-x^2}$ enhance the ability to approximate analytical functions in quantum circuit learning?,,1,0,,,,CC BY-SA 4.0 +5439,2,,5434,2/8/2019 14:45,,3,,"

Qubits can be only with a size of 2, which means a dimensionality of 2.

+ +

For $|\alpha \rangle,|\beta\rangle$ here, for the SWAP gate to make sense, they must be of the same dimensionality (in the operating Hilbert space), then only there is a meaningful correspondence for the SWAP to work.

+ +

In case if it happens that they are not (suppose one qubit and other qtrit), then the extra degrees of freedom of the qtrit would not take part in the algorithm governed by the Hamiltonian which mimics the SWAP gate.

+",4889,,,,,2/8/2019 14:45,,,,0,,,,CC BY-SA 4.0 +5440,2,,5422,2/8/2019 15:28,,3,,"

The two quantum circuits generated and submitted to the IBMQ system by your code are the same. So ideally, the result should be both {'0':500,'1':500}, but since those circuits are run on an experimental platform, a little fluctuation is tolerable.

+",4178,,26,,2/8/2019 15:31,2/8/2019 15:31,,,,0,,,,CC BY-SA 4.0 +5442,2,,5380,2/8/2019 16:40,,1,,"

Answering what the ""actual mechanism"" is, is a very difficult question. I don't think there is any widespread consensus as to exactly which aspect of quantum mechanics leads to quantum speed-ups. Or said differently, the answer to ""what is the actual mechanism behind quantum computing"" is arguably ""quantum mechanics"", although this is obviously not a very satisfactory answer.

+ +

Nonetheless, there are a few tricks that quantum computers exploit which can be considered among the main tricks at play in many quantum algorithms.

+ +

In particular, one of the main characteristics of quantum computers is that they can operate on a space that is much larger than the space of the possible classical states.

+ +

By this I mean that if, for example, you consider a computation on $n$ qubits, then the corresponding (pure) states correspond to unit vectors in a $2^n$-dimensional vector space, and quantum computers operate by rotating and moving around these vectors in this huge vector space. +Whenever you actually get an output, you will still only get one of the possible ""classical"" outputs (a bit string in this case), but still to get to that output from the given input, the quantum computer is allowed to explore a vastly larger space of possibilities.

+ +

A case in which this is nicely seen is for example Grover's algorithm. +Each step of Grover's algorithm can be directly visualized as a rotation of the initial state towards the target state (see e.g. this answer). Such rotations exist in a space that is quite simply not accessible to classical devices.

+ +

Another common argument is that quantum computers allow you to somehow probe the output of a function on many different inputs at the same time (assuming to be able to implement that function coherently as a unitary operation). This does not quite mean that one can ""check many possibilities at the same time"", but it does mean that one can use a function a single time and get an output which depends on the way that function operates on a whole lot of inputs.

+ +

Again, Grover's algorithm is a good example of this, but in this case Deutsch-Jozsa is probably an even better one, as it shows how one can use a function a single time and yet deterministically figure out how that function operates on different inputs (while classically there is simply no way to know how a function operates on two inputs without trying them both).

+",55,,55,,2/8/2019 16:51,2/8/2019 16:51,,,,0,,,,CC BY-SA 4.0 +5443,2,,5395,2/9/2019 0:13,,2,,"

As to ""who discovered/invented the quantum phase estimation algorithm,"" in his 2011 lecture at Keio University describing the linear equations algorithm, at about the 18 minute mark Lloyd claims that it was inherent in the works of Von Neumann.

+ +

That reminds me of the argument that ""Gauss discovered the Fast Fourier Transform 160 years before Cooley and Tukey.""

+",2927,,,,,2/9/2019 0:13,,,,0,,,,CC BY-SA 4.0 +5444,1,5585,,2/9/2019 7:44,,6,1167,"

Consider the modular exponentiation part of Shor's algorithm which in many works is just referred to as +$$U_{f}\sum^{N-1}_{x = 0}\vert x\rangle\vert 0\rangle = \vert x\rangle\vert a^{x}\text{ mod }N\rangle$$ +where $a$ is random number between $1 < a < N.$

+ +

$U_{f}$ is frequently left as a black box, but sometimes when I look in papers that write about it and see the actual circuit I don't really understand. More so when I trying to connect it with the algorithm.

+ +

So, here is my understanding: Shor's algorithm begins with the initialization of 2 registers of qubits. First set to hold the superposition of number from $0$ to $N$ ($N$ is the number that needs to be factored) and the second register to hold the function $f(x) = a^{x} \text{ mod } N$. Then with or without measuring the second register, the result is the same. So does measurement matter or not? Then one obtains the result after applying quantum Fourier transform on the first register (leave the matter of extract period).

+ +

Now I am confused about how the second register holds $f(x)$. I mean the algorithm computes $f(x)$ with repeated squaring (classically) right? Then how does the second register of qubits hold the value in a superposition of sequence (modular exponentiation sequence)? Did I misunderstand something?

+",4729,,26,,2/9/2019 8:32,3/1/2019 15:15,How exactly does modular exponentiation in Shor's algorithm work?,,1,0,,,,CC BY-SA 4.0 +5445,1,,,2/9/2019 9:06,,9,341,"

I was wondering why till date Grover search has been implemented only till 3 qubits (corresponding to size of database = 8). Refer this paper

+ +

The reason why I ask is that we have much larger sized quantum computers today. For eg IBM has 50 qubits, Google has announced 72. Why can't we run a larger sized Grover algorithm on these computers ? Some of my guesses (based on theoretical issues) are as follows :

+ +
    +
  1. Circuit architecture restrictions : Perhaps the gate set and the underlying architecture of the circuits provided by these computers puts a restriction.

  2. +
  3. Error corrections : Additional qubits are required for correcting errors.

  4. +
+ +

I would like to know if there are any additional practical/physics issues that is limiting the use of Grover search currently.

+",5761,,,,,2/9/2019 12:48,Current limits on Grover search space,,1,0,,,,CC BY-SA 4.0 +5446,2,,5445,2/9/2019 12:48,,4,,"

I am going to try to give guesses that can make sense:

+
    +
  1. More qubits does not mean better machines. They may be less noise-tolerant and with less connectivity between qubits. That is why, when you benchmark them (with or without error-correction), you look first at the simplest implementations of state of art algorithms. Plus, you may change some calibrations parameters of the machine based on these results.

    +
  2. +
  3. Implementing a multi-controlled NOT gate (for example as the oracle) can require a lot of quantum operations like Toffolis (which has a quite deep decomposation into 2-qubit and 1-qubit set of gates), meaning you have deeper circuits, which are more difficult to apply given the (depth) limit of these quantum computers.

    +
  4. +
  5. The example circuit you refer to is a very toy example. So it is not very useful other than benchmarking so far.

    +

    Please, bear in mind these are guesses. There may be many things going on and this is a research playground with a few people involved in the field.

    +
  6. +
+",4127,,-1,,6/18/2020 8:31,2/9/2019 12:48,,,,0,,,,CC BY-SA 4.0 +5447,1,,,2/9/2019 14:21,,1,233,"

I have updated qiskit module but unfortunately, it doesn't work it says

+ +
C:\Users\Aman\AppData\Local\Programs\Python\Python36-32
+\lib\site-packages\marshmallow\schema.py:364: 
+ChangedInMarshmallow3Warning: strict=False is not recommended. 
+
+In marshmallow 3.0, schemas will always be strict. See 
+https://marshmallow.readthedocs.io/en/latest/upgrading.html
+#schemas-are-always-strict ChangedInMarshmallow3Warning
+
+ +

What shall I do?

+",4206,,26,,2/9/2019 14:57,2/11/2019 5:35,QISKit warrning on marshmallow,,1,0,,,,CC BY-SA 4.0 +5448,1,,,2/10/2019 0:55,,2,71,"

There is a vast amount of new notations which would be new even to Ph.D. in math. How on Earth can I catch up with all of this? Is there a place online which is devoted to the QC syntax? +I would like to show a few examples, if someone can explain even just them, it would be of much help!

+ +
    +
  1. $\langle\psi|U^{\dagger}MU|\psi\rangle$

  2. +
  3. $|0\rangle\langle0|$ or $|0\rangle |0\rangle$

  4. +
  5. $ {\oplus}$

  6. +
  7. $|0\rangle^{\otimes n}$

  8. +
  9. I have no clue it looks like some sort of inner product. I saw somewhere this equals the probability of $U$. (Where M is a measurement matrix?) Have no idea!

  10. +
  11. The first I saw something like it's a projection of any vector on zero. So this is an operator, not a vector. On the other hand, not sure about $|0\rangle |0\rangle$. Thought saw them somewhere.

  12. +
  13. Is it a NOT gate? XOR gate? Or denoting any possible operation?

  14. +
  15. Vector zero, and composition of subscript n appearing above like a 'power'.

  16. +
+ +

Can someone clear up the confusion? Or offering a place to look them all and their definitions up?

+",5742,,26,,2/10/2019 7:22,2/10/2019 7:30,Is there a place online where I can catch up with all the notational syntax associated with quantum computing?,,1,1,,,,CC BY-SA 4.0 +5449,2,,5448,2/10/2019 7:30,,2,,"

Get hold of a copy of the Nielsen and Chuang textbook and read the first few chapters. If you google it you'll find the PDF version easily, although, of course, I'd recommend buying it. Almost all the notation you mention is explained in chapters 1 and 2 of the textbook. Catching up with notation is no big deal if you have studied linear algebra before. Even if you haven't, the book has a whole chapter dedicated to linear algebra, which you can learn from scratch.

+",26,,,,,2/10/2019 7:30,,,,0,,,,CC BY-SA 4.0 +5450,1,5453,,2/10/2019 15:44,,2,202,"

Is there a way to create a rotation gate which has half the angle of some implementable gate?

+ +

I am looking to implement a gate on Quirk which allows for standard time-dependent rotations

+ +

$$R_x(\theta=t)=e^{iXt}$$

+ +

but I'd like to construct the same gate but with $\theta=\frac{t}{2}$ so I can have two different oscillation frequencies.

+ +

Is there some standard way to do this?

+",5594,,26,,3/30/2019 7:45,3/30/2019 7:45,How to implement a $\frac{\theta}{2}$ rotation from $\theta$ rotation?,,1,0,,,,CC BY-SA 4.0 +5451,2,,5421,2/10/2019 19:35,,7,,"

There is evidently a classical polynomial-time algorithm for finding a four-coloring of a given planar graph, so the answer to the question is ""yes"" for the trivial reason that every polynomial-time classical algorithm can be implemented as a polynomial-time quantum algorithm. (Also, polynomial time implies polynomial space, for both quantum and classical algorithms, so that part is trivially satisfied.)

+ +

An important aspect of the problem that the question describes is that we are asked to find a four-coloring, as opposed to deciding whether or not a four-coloring exists. Deciding the existence of a four-coloring for a planar graph would be trivial: the correct answer is always ""yes"" by the four-color theorem. This theorem was proved in 1976 by Appel and Haken's famous computer-assisted proof, and it is my understanding that Appel and Haken's proof can in principle be turned into a quartic-time algorithm for finding a four-coloring of a planar graph.

+ +

The proof of the four-color theorem was simplified somewhat in this paper:

+ +
+

Neil Robertson, Daniel Sanders, Paul Seymour, and Robin Thomas. The four-colour theorem. Journal of Combinatorial Theory, Series B 70: 2-44, 1997.

+ +

(Available from CiteSeerX.)

+
+ +

In this paper, the authors claim explicitly (see Section 6) that their proof yields a quadratic-time classical algorithm for finding a four-coloring of a planar graph.

+",1764,,,,,2/10/2019 19:35,,,,0,,,,CC BY-SA 4.0 +5452,1,,,2/10/2019 20:16,,9,271,"

I have questions regarding quantum teleportation, which keep confusing me.

+ +
    +
  1. Suppose Alice and Bob are in the same inertial frame $K$, and at time $t$ (in $K$) Alice teleports a quantum state to Bob. What I always hear is that this means that at time $t$, Bob has then got one of four states, although he does not yet know exactly which one of the four. Is this true?

  2. +
  3. Now, what if Alice and Bob are both moving along the $x$-axis of $K$, in the same direction, both with the same speed $v$? If Alice does her part of the protocol at time $t$ (again, as seen in $K$), then if Bob is behind Alice (w.r.t. their common direction of movement in $K$), he must get the quantum state before $t$ in $K$, due to special relativity (as calculated by the Lorentz transformation, assuming his quantum state ""arrives"" at the same time as Alice sends it, in the inertial frame where both of them are at rest). This sounds weird as if the cause had happened after the effect.

  4. +
  5. And what if Alice and Bob are not in the same inertial frame? Then the point in time Alice executes her part in her inertial frame does not correspond to any single point in time in Bob’s inertial frame. So what can we say about the arrival time of the quantum state to Bob?

  6. +
+ +

Note: Cross-posted to Physics. I've accepted this answer there.

+",5767,,55,,10/19/2021 15:28,11/20/2021 4:33,Quantum teleportation with moving Alice and Bob,,1,3,,,,CC BY-SA 4.0 +5453,2,,5450,2/10/2019 20:29,,3,,"

(This answer is specific to the context of the question, which is about doing this construction out of Quirk's time dependent gates.)

+ +

It's not possible to have proper half-speed time-dependent rotations in Quirk. Behind the scenes there is actually a value $t$ that is varying from 0 to 1 and then cycling. If you managed to find a construction to cut the angle in half, your rotation would jump from 180 degrees to 0 degrees when $t$ went from 1 to 0.

+ +

If that's acceptable, then the simplest way to achieve it is by using the parameterized rotation gates and a counting gate:

+ +

+ +

An alternative trade-off do is define double-speed rotations by using pairs of time-dependent rotation gates, and then work in units of $2t$ instead of $t$. You can use custom circuit gates to fuse them into a single block. If custom gates annoy you (they are by far the weakest part of the UX), the time-dependent gradient gate gives you a series of faster and faster rotations:

+ +

+",119,,,,,2/10/2019 20:29,,,,0,,,,CC BY-SA 4.0 +5454,1,5537,,2/10/2019 23:06,,10,618,"

In other words, will factoring research remain solely in the classical world or are there interesting research on-going in the quantum world related to factoring?

+",1589,,1589,,2/21/2019 13:51,5/5/2019 14:01,Does Shor's algorithm end the search for factoring algorithms in the quantum world of computation?,,3,4,,,,CC BY-SA 4.0 +5455,1,,,2/10/2019 23:17,,8,280,"

I'm looking for fast code, or a fast algorithm, for checking if a given state vector $A$ can be transformed into another state vector $B$ using only the Pauli operations $X$, $Y$, $Z$.

+ +

The naive strategy is to simply iterate through all $4^n$ ways to apply a Pauli operation (or no operation) to each of the $n$ qubits, actually simulate applying the operations ($2^n$ cost for each qubit for each case) to one of the states, and check if the resulting state vector is equivalent to the other state. Surely it's possible to do this in better than worst case $n 8^n$ time?

+ +

[Update] I am specifically interested in worst case performance. Heuristics are interesting and useful answers, but won't become the accepted answer.

+",119,,119,,2/11/2019 19:13,2/11/2019 19:13,Fast way to check if two state vectors are equivalent up to Pauli operations,,2,0,,,,CC BY-SA 4.0 +5456,2,,5447,2/11/2019 5:35,,3,,"

This is a Just a Python warning about deprecated usage. It will be fixed in the next release. It should not prevent you from upgrading Qiskit or writing any code today.

+",5771,,,,,2/11/2019 5:35,,,,3,,,,CC BY-SA 4.0 +5458,2,,5455,2/11/2019 8:05,,2,,"

The way that I thought to start was to look at the reduced density matrices of the individual qubits. If they cannot be interconverted using Pauli matrices, then the whole thing can't.

+ +

The only problem is that this idea breaks down as soon any of the reduced density matrices are maximally mixed. At that point, you could ask ""are the two states equivalent under local unitaries?"". If you derive the unitaries as a result of that question, then it's easy to test if they're Pauli or not. This was studied here. I think there are still cases where the scaling is problematic, but I don't remember the bit with maximally mixed reduced density matrices well enough.

+",1837,,,,,2/11/2019 8:05,,,,2,,,,CC BY-SA 4.0 +5459,1,,,2/11/2019 9:52,,6,377,"

Since quantum computer with $n$ qubits is described by a $2^{n}\times2^{n}$ unitary matrix is it equivalent to an oracle that can do multiplication of large matrix and return $n$ numbers computed from it in a time polynomial by $n$.

+ +

And if yes how precise the number representation in the oracle should be, should the precision increase exponentially with $n$?

+ +

Edit: as pointed out the oracle should not simply multiply, but should expand $n$ bit string into $2^n$ corresponding to a pure state, work only for unitary matrices, and return n bits corresponding to measurement, and not arbitrary numbers. Are there some other such corrections to make a representation with oracle possible?

+",5768,,5768,,2/13/2019 19:48,2/14/2019 16:53,Is quantum computer equivalent to Turing machine with matrix multiplication oracle?,,1,6,,,,CC BY-SA 4.0 +5460,1,,,2/11/2019 12:37,,3,144,"

I don't really know the difference between projective measurement and regular measurement or POVM. Until now, wherever I read about the subject I saw that the amplitude describes the probability of obtaining corresponding state when measuring it. I am not sure if this said measure is what you call a projective or regular. +Can someone clear up the confusion? What's the about projective vs regular.

+ +

I saw somewhere that there is such a measurement M associated with POVM (corresponding to P??), but I am not sure what it says intuitively as well as mathematically. Which may as well help make clear the difference between the above mentioned ones.

+",5742,,5742,,2/12/2019 0:40,2/12/2019 0:40,Do the probability amplitudes describe the probability of projective measurement?,,1,0,,,,CC BY-SA 4.0 +5461,2,,5455,2/11/2019 15:37,,2,,"

Pick an element $a_i$ of A and find its position in B, disregarding changes in phase. +The shift in position uniquely identifies the series of $X$ or $Y$ applications needed for the transformation.

+ +

The relative phase of $(a_0, b_0)$ tells you, in steps of $-i$ rotations, how many $Y$ gates you need for the transformation. The relative phase of $(a_1,b_1)$ to $(a_0,b_0)$ tells you have many $Y$ or $Z$ gates act on the first qubit; and so on for the relative phase of $(a_{2^{k-1}},b_{2^{k-1}})$ to $(a_0,b_0)$ for $Y$ or $Z$ gates acting on qubit $k$.

+ +

If $a_i$ does not appear in B then the transformation is not possible.

+ +

I believe the above can be done in $O(n)$-sh.

+",2214,,,,,2/11/2019 15:37,,,,11,,,,CC BY-SA 4.0 +5462,1,5463,,2/11/2019 18:37,,4,426,"

When faced with exercises like these, I find it hard to know how to construct the circuits due to the amount of input one needs to account for. +I have seen the solution provided here however, I don't think I would have been able to solve this exercise my self.

+ +

Does anyone have any tips on a systematic way to construct a circuit like this? I start out with a circuit which solves one specific input (for example for $x = |00\rangle, y = |01\rangle$), but after this I get stuck. I appreciate any help!

+",5632,,26,,3/30/2019 8:31,1/24/2020 22:06,"Constructing a circuit which performs the transformation $|x,y\rangle \to |x, x + y \bmod 4\rangle$",,3,1,,,,CC BY-SA 4.0 +5463,2,,5462,2/11/2019 19:32,,6,,"

Here are some strategies.

+ +
    +
  1. Start from a classical circuit, and do a naive transformation into a quantum circuit (e.g. AND gate becomes Toffoli onto a clean ancilla). Find ways to uncompute intermediate values and other garbage. Then optimize optimize optimize until it's compact. It helps to know a lot of trivial circuit identities when optimizing.

  2. +
  3. Decompose into simpler problems. For example, separate the two-bit addition into two controlled increments then figure out how to do a controlled increment.

  4. +
  5. Get inspiration from algebraic boolean expressions for the output values. For example, if you are incrementing a register $x_0, x_1, x_2, ..., x_k$ then qubit $i$ transitions from $x_i$ to $x_i \oplus \prod_{j<i} x_j$ and this form suggests a simple circuit that you can create.

  6. +
  7. Brute force one output bit at a time. This only works for smaller circuits. Figure out every situation where each bit should be ON, and for each of those cases output a multi-controlled NOT targeting a clean ancilla to represent the output. Then do the same strategy in reverse to uncompute the input. Then optimize optimize optimize.

  8. +
  9. Diagonalize the problem. Is there a simple unitary $U$ that maps your problem's eigenstates to the computational basis states? Apply it, then phase the appropriate states using many-controlled Z rotations, then un-apply $U$. In the case of addition, the operation that does this is the QFT and you won't even need the Z rotations to be controlled.

  10. +
  11. Find a loop invariant that breaks the problem into constant-sized pieces. In the case of adders, the invariant is packaged up into the carry bit that propagates through ripple-carry adders. Can you find an equivalent of a carry bit for your problem?

  12. +
  13. Pay attention to data dependencies. Start by getting the value of qubits with no dependents correct. Then remove those qubits from the dependency graph and iterate. Two-bit addition has a very simple dependency graph, and so this approach works well on it. If the dependency graph has cycles, the problem will be much harder.

  14. +
  15. Apply generic problem solving (i.e. read How to Solve It). For example, get a foothold by dropping constraints. What if you were allowed to get the phases wrong, or to create junk? What if you only have to get some of the qubits correct, and are allowed to trash the others? What if you had more workspace? What if one of the input qubits was promised to be in the 0 state? The 1 state? The + state? What if you only had to do 1 bit addition, or 1-bit-register-into-2-bit-register addition?

  16. +
+",119,,26,,2/11/2019 19:46,2/11/2019 19:46,,,,0,,,,CC BY-SA 4.0 +5464,2,,5462,2/11/2019 20:02,,4,,"

For simplicity let's assume $x, y \in \mathbb{N}$, since worrying about two's complement representation for negative numbers is just annoying.

+ +

First, this function must be reversible. That means $y$ is restricted to the range $0 \dots 3$, since $(x + 0) \bmod 4 = (x + 4) \bmod 4$, so if we allow $y$ values outside of $0 \dots 3$ we cannot reverse the function (uniquely identify $y$ given the values of $x$ and $(x + y) \bmod 4$). This means the $y$ input can be at most two qbits in size.

+ +

We then consider that $(x + y) \bmod 4 = (x \bmod 4) + (y \bmod 4)$. This means that we only have to care about the two least-significant qbits of $x$ when calculating $(x + y) \bmod 4$. Thus, given $n$ input qbits for $x$ and $2$ input qbits for $y$, our circuit will only ""touch"" the two least-significant qbits of $x$ (probably as input to a CNOT) and leave the other $n-2$ qbits of $x$ alone.

+ +

For simplicity, let's build our circuit assuming $n = 2$. We can of course construct our circuit by just calculating the desired action on all $2^4$ possible input values then writing a matrix corresponding to that, but that's boring. Let's simplify it even more; let $x = |ab\rangle$ and $y = |cd\rangle$ where $a,b,c,d \in \{0, 1\}$; $c$ and $d$ are also our output qbits. We have the following observations:

+ +
    +
  • When $b = d = 1$, we want to flip $c$ (since addition of $b$ and $d$ overflows). This is clearly the action of a Toffoli gate.
  • +
  • When $b = 1$, we want to flip $d$. For this we use a CNOT.
  • +
  • When $a = 1$, we want to flip $c$. For this we again use a CNOT.
  • +
+ +

This means for $n=2$, our circuit is as follows:

+ +

+ +

For higher values of $n$, we just ignore the $n-2$ most-significant qbits.

+ +

In general, problems like these are just that: problems. They require some amount of mathematical trickiness, reasoning, and breaking down the problem to work through. Hopefully when reading the above you can see how each step followed from the last until we can use our intuition to solve the problem. For quantum computing problems specifically, they'll become easier as you learn the valid ""moves"" you can make around the problem space.

+",4153,,4153,,2/11/2019 20:17,2/11/2019 20:17,,,,3,,,,CC BY-SA 4.0 +5465,2,,5460,2/11/2019 20:52,,4,,"

What you call ""regular"" measurement is probably projective measurement onto the computational basis, $|0\rangle$ and $|1\rangle$. Most introductory quantum computing resources define a qbit as follows:

+ +

$|\psi\rangle = \begin{bmatrix} \alpha \\ \beta \end{bmatrix} = \alpha|0\rangle + \beta|1\rangle$

+ +

Where $|\alpha|^2$ gives you the probability of collapse to $|0\rangle$, and $|\beta|^2$ gives you the probability of collapse to $|1\rangle$. If this is what you know as ""regular"" measurement, then yes it's just projective measurement.

+ +

In addition to measuring in the computational basis, you can do a projective measurement onto any pair of orthogonal unit vectors. You do this by rewriting your quantum state in that basis. Here is a good video tutorial on how to do change-of-basis. For example, we can measure in the $X$ basis:

+ +

$|+\rangle = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix}$, $|-\rangle = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{-1}{\sqrt{2}} \end{bmatrix}$

+ +

Consider the following qbit value:

+ +

$|\phi\rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix} = 1|0\rangle + 0|1\rangle$

+ +

This qbit value has a 100% chance of collapsing to $|0\rangle$ when measured in the computational basis. What if we were to measure it in the $X$ basis? First we have to do a change-of-basis to the $X$ basis, where it is written as:

+ +

$|\phi\rangle = \frac{1}{\sqrt{2}}|+\rangle + \frac{1}{\sqrt{2}}|-\rangle$

+ +

Note we did not change the value of the qbit at all, we are just writing it a different way (in a different basis). Now we see that if we measure $|\phi\rangle$ in the $X$ basis, it has a 50% chance of collapsing to $|+\rangle$ and a 50% chance of collapsing to $|-\rangle$.

+ +

It's called projective measurement because geometrically you're ""projecting"" your quantum state vector onto the measurement basis vectors, and the length of the projection on a basis vector gives you the probability of collapsing to that basis vector.

+",4153,,,,,2/11/2019 20:52,,,,8,,,,CC BY-SA 4.0 +5466,1,5467,,2/12/2019 12:33,,6,78,"

Assume that we know a quantum state and the result of applying an unknown unitary $U$ on it. For example, if the quantum states are pure qubits, we know $|\psi\rangle=\alpha|0\rangle+\beta|1\rangle$ and $U|\psi\rangle=\gamma|0\rangle+\delta|1\rangle$. Then how can we compute the unknown operator $U$?

+",4178,,26,,3/30/2019 7:49,3/30/2019 7:49,"If $|\psi\rangle, U|\psi\rangle$ are known, how many pairs of such qubits are required to find the operator $U$?",,1,0,,,,CC BY-SA 4.0 +5467,2,,5466,2/12/2019 12:44,,7,,"

If $U$ acts on a $d$-dimensional Hilbert space, then you need the result $U|\psi\rangle$ for a set of $d$ linearly independent vectors $|\psi\rangle$.

+ +

So, if you're talking about a single qubit unitary, you need two different states $|\psi\rangle$. If you have these, then by linearity you can find out +$$ +U|0\rangle=\alpha|0\rangle+\beta|1\rangle\qquad U|1\rangle=\gamma|0\rangle+\delta|1\rangle. +$$ +Then, your $U$ is just +$$ +U=\left(\begin{array}{cc} \alpha & \gamma \\ \beta & \delta \end{array}\right) +$$ +(the columns are just the individual outcomes for the computational basis states.)

+ +

You might wonder if you can get away with fewer. For example, we know that $U|0\rangle$ and $U|1\rangle$ must be orthogonal. However, there is still some freedom of parameters (such as a global phase) that you cannot determine, and hence you need to know both outcomes.

+",1837,,,,,2/12/2019 12:44,,,,0,,,,CC BY-SA 4.0 +5468,1,,,2/12/2019 13:10,,7,55,"

In Wiseman et al. (2007), in the process of deriving necessary and sufficient conditions for the steerability of some classes of states, the authors show (lemma 1, page 3) how to construct an optimal ensemble $F^\star=\{\rho_\xi^\star\mathscr P_\xi^\star\}$ such that, if this ensemble cannot explain Bob's state via a local hidden state, then no other ensemble can.

+ +
+ +

More precisely, the context is that of Alice trying to convince Bob that she can steer his state by means of her performing measurements on her part of the system. In other words, we assume that Alice and Bob share some state $W$, and that Alice performs measurements $A\in\mathscr M$ ($\mathscr M$ denoting here the measurements that Alice can choose to perform) on her part of the system. +If Alice performs measurement $A$ and gets result $a$, then Bob's state becomes +$$\tilde\rho_a^A=\operatorname{Tr}_\alpha[W(\Pi_a^A\otimes I)],$$ +where $\operatorname{Tr}_\alpha$ denotes the partial trace with respect to Alice's part of the system, and the tilde is used to remember that this is an unnormalised state.

+ +

If Bob can describe this state by means of some prior local hidden state $\rho=\sum_\xi p_\xi\rho_\xi$ as +$$\tilde\rho_a^A=\sum_\xi\mathscr P(a|A,\xi)p_\xi\rho_\xi,\tag5$$ +then he is not convinced that Alice can steer his system, as it would mean that he can describe his observations by simply assuming that what he is measuring is some local state $\rho$ that is not affected by Alice.

+ +
+ +

My question is about the aforementioned lemma that is proved in the paper: why is the ensemble $F^\star$ optimal?

+ +

The lemma is as follows:

+ +
+

Consider a group $G$ with unitary representation $U_{\alpha\beta}(g)=U_\alpha(g)\otimes U_\beta(g)$. Suppose that for every measurement $A\in\mathscr M$, outcome (that is, eigenvalue) $a\in\lambda(A)$, and group element $g\in G$, we have $U_\alpha^\dagger(g)A U_\alpha(g)\in\mathscr M$, and moreover + $$\tilde\rho_a^{U_\alpha^\dagger(g)AU_\alpha(g)}=U_\beta(g)\tilde\rho_a^A U^\dagger_\beta(g).$$ + Then there exists a $G$-covariant optimal ensemble, that is, one such that $\forall g\in G$ + $$\{\rho_\xi^\star\mathscr P_\xi^\star\}=\{U_\beta(g)\rho_\xi^\star U_\beta^\dagger(g)\mathscr P_\xi^\star\}.$$

+
+ +

They then proceed to give an ensemble that they prove (not that I understand this proof, but that is another matter) does satisfy (5). +Why is this then proving that if this ensemble does not satisfy (5) then no other ensemble can? I find this quite confusing, given that we just proved that it does satisfy (5).

+",55,,55,,12/20/2020 22:22,12/20/2020 22:22,Construction of optimal ensemble to show quantum steerability,,0,0,,,,CC BY-SA 4.0 +5471,1,5475,,2/12/2019 13:54,,2,223,"

I just started programming in Q# and I wonder if the coding for Q# in classical computer would be the same as coding in a quantum computer. Obviously, these 2 kinds of computers work differently, so I guess the language must be working differently as well. Does this affect the coding part in any way (syntax, dealing with operations and variables etc.)?

+",2559,,26,,2/12/2019 15:37,2/12/2019 17:48,Is programming in quantum computer same as programming in quantum simulator in classical computer?,,2,0,,,,CC BY-SA 4.0 +5472,1,5478,,2/12/2019 15:04,,0,168,"

In QC and QI by Chuang and Nielsen, they state that the $P_U$ of operation $U$ acting on $\psi$ can be reached by $\langle \psi |U^{\dagger} M U |\psi\rangle$.

+ +

Where $P_U$ (or $P_V$) is the probability of obtaining the corresponding measurement outcome if the operation $U$ (or $V$). And $M$ is a POVM measurement element.

+ +

Then

+ +

$$|P_U − P_V | = \langle \psi |U^{\dagger} M U|\psi\rangle −\langle \psi |V^{\dagger} M V |\psi\rangle.$$

+ +

This equality appears in the book on page 195 (Box 4.1: Approximating quantum circuits; equation 4.64).

+ +

I don't understand it. Can anyone explain it? And why do they equal each other?

+",5742,,26,,2/12/2019 22:55,2/13/2019 8:42,Why does $|P_U − P_V |$ equal $\langle \psi |U^{\dagger} M U|\psi\rangle −\langle \psi |V^{\dagger} M V |\psi\rangle$?,,1,6,,,,CC BY-SA 4.0 +5473,2,,5471,2/12/2019 15:56,,2,,"

As far as working is concerned, you are right. A quantum computer works entirely differently than a classical simulator for the same. +Whether there will be any difference in the ""coding part"" depends on the specific cases. While you cannot get a real quantum computer yet, a lot of online tools are available for cloud Quantum Computation. IBM's Qiskit, for instance, would have no difference in the coding part in the cloud quantum and the classical simulation. All you change is you import another library for the API usage. You can check the same for Rigetti's pyQuil.

+",2951,,,,,2/12/2019 15:56,,,,0,,,,CC BY-SA 4.0 +5474,2,,5459,2/12/2019 17:31,,2,,"

The answer is no.

+ +

The reason for this is the exponential size of the Hilbert space. Consider a single-tape TM with a matrix multiplication (MM) oracle which calculates the action of any unitary matrix on a vector of complex numbers. We'll define its input format as follows:

+ +

$[U][x][\alpha_0 \ldots \alpha_{x-1}]$ where:

+ +
    +
  • $U$ is some symbol or series of symbols specifying the unitary transformation to perform (easily done in polynomial space)
  • +
  • $x$ is a binary encoding of the number of complex numbers in the input vector
  • +
  • $\alpha_0 \ldots \alpha_{x-1}$ is some encoding of $x$ complex numbers separated by a symbol
  • +
+ +

The MM oracle reads this input format, applies $U$ to $\alpha_0 \ldots \alpha_{x-1}$, then overwrites those numbers with the output $\alpha_0' \ldots \alpha'_{x-1}$ in a single step.

+ +

The key here is that for $n$ qbits, $x = 2^n$ because of entanglement. When the qbits become entangled, their product state cannot be factored into $n$ individual qbit states and thus the $2^n$-sized vector must be maintained in memory. This trivially means that our TM takes exponential time to write the input vector for the MM oracle, and would also take exponential time to calculate the effect of measuring the state vector.

+ +

Edit: to answer your revised question, if you have tensor expansion, unitary matrix multiplication, and measurement oracles, then yes you have a quantum computer. We know this because this is the exact model used by all quantum programming languages. We write a classical-looking algorithm with these three oracles and all the magic is done under the hood.

+",4153,,4153,,2/14/2019 16:53,2/14/2019 16:53,,,,6,,,,CC BY-SA 4.0 +5475,2,,5471,2/12/2019 17:48,,6,,"

Running programs on a quantum computer will indeed require some routines which are not required for running them on a classical simulation. Two easiest examples are error correction (a classical simulation is perfect but a quantum device will be noisy and will require error correction to produce useful results) and translating logical qubits and gates to physical ones (in a simulation you can do any gate on any pair of qubits, but a physical device will be limited to certain set of primitive gates and a certain connectivity scheme).

+ +

However, the person writing high-level quantum code is likely uninterested in such low-level routines (unless they are researching them specifically), same as a person writing this answer doesn't really want to care about the addresses of the bytes storing it on their computer. High-level programming languages (in particular Q#, since you asked about it) aim to provide a high-level abstraction for the programmer and delegate low-level routines to the compiler. This also allows to run the same code on the simulators (for debugging and resource estimation purposes) and then to take it to a quantum device without modifications.

+",2879,,,,,2/12/2019 17:48,,,,0,,,,CC BY-SA 4.0 +5476,1,5477,,2/12/2019 18:59,,3,314,"

For example, we can create a single qubit state with a polar angle of $\pi/2$ with the Hadamard gate. But, can we create a state such as this,

+ +

$$\Psi = \cos(\pi/8)|0\rangle + \sin(\pi/8)|1\rangle$$

+ +

where the polar angle does not equal $\pi/2$, in QISkit?

+",5747,,26,,3/30/2019 7:50,3/30/2019 7:50,Is it possible to create a superposition in IBMQ QISkit which has probability amplitudes $|a|\neq |b|$?,,1,0,,,,CC BY-SA 4.0 +5477,2,,5476,2/12/2019 19:24,,4,,"

You use the standard rotations. In this case, you're looking for the ry operator (rotation around the y-axis). To rotate the state vector counter-clockwise around the unit circle by $\theta$, call ry with $2\theta$ or in your case $\frac{2\pi}{8}$ applied to state $|0\rangle$.

+ +
from qiskit import *
+import numpy as np
+q = QuantumRegister(1)
+qc = QuantumCircuit(q)
+qc.ry(2*np.pi/8,q)
+
+",4153,,409,,2/13/2019 10:20,2/13/2019 10:20,,,,0,,,,CC BY-SA 4.0 +5478,2,,5472,2/12/2019 23:12,,2,,"

The probability that outcome $m$ associated with POVM measurement $M$ comes out after measuring state $|\psi\rangle$ can be calculated by:

+ +

$p(m)=\langle\psi|M|\psi\rangle$.

+ +

The box in the Isaac and Chuang book says that $P_U$ is the probability of such outcome if $U$ operation is applied, and $P_V$ if $V$ is applied. Consequently, we want to calculate such probabilities for states:

+ +
    +
  • $|\psi_U\rangle=U|\psi\rangle$
  • +
  • $|\psi_V\rangle= +V|\psi\rangle$
  • +
+ +

Applying the definition for calculating such probabilities that I presented at the beginning, then you can obtain what you need:

+ +
    +
  • $P_U=\langle\psi_U|M|\psi_U\rangle=(U|\psi\rangle)^\dagger MU|\psi\rangle=\langle\psi|U^\dagger MU|\psi\rangle$
  • +
  • $P_V=\langle\psi_V|M|\psi_V\rangle=(V|\psi\rangle)^\dagger MV|\psi\rangle=\langle\psi|V^\dagger MV|\psi\rangle$
  • +
+ +

EDIT:

+ +

To follow the question you gave in the comment to the answer. Postulate 3 of quantum mechanics states that those are described by a collection of measurement operators $\{M_m\}$ related with each of the outcomes $m$ that the quantum state $|\psi\rangle$ can have. Such postulate does also state that the probability to get outcome $m$ is given by

+ +

$p(m)=\langle\psi|M_m^\dagger M_m|\psi\rangle$.

+ +

POVM measurements are given by a collection of positive operators $E_m$ that fullfil that $\sum_m E_m=I$. Such operators can be related with the measument operators like

+ +

$E_m\equiv M_m^\dagger M_m$.

+ +

All this is stated in the Isaac and Chuang book on quantum computation and information that seems that you are using, so refer there for more complete details.

+",2371,,2371,,2/13/2019 8:42,2/13/2019 8:42,,,,10,,,,CC BY-SA 4.0 +5480,1,5559,,2/13/2019 19:58,,2,112,"

I've been trying to decompose the ProjectQ objects and I could manage to decompose non-controlled gates and daggered gates. But I noticed that +the object of a controlled version of a gate is the exact same as the object of that gate.

+ +

The code generating these objects:

+ +
  eng = MainEngine()
+  q = eng.allocate_qubit()
+  p = eng.allocate_qubit()
+  c = eng.allocate_qubit()
+  X | q
+  CNOT | (p,q)
+
+ +

This is the XGate object

+ +
{'_control_qubits': [],
+ '_engine': <__main__.MainEngine object at 0x7fc323e4d198>,
+ '_qubits': ([<projectq.types._qubit.WeakQubitRef object at 0x7fc30b0a3ef0>],),
+ 'gate': <projectq.ops._gates.XGate object at 0x7fc316778048>,
+ 'tags': []}
+
+ +

And this is the CNOT gate, which is the same as ControlledGate(XGate)

+ +
{'_control_qubits': [],
+ '_engine': <__main__.MainEngine object at 0x7fc323e4d198>,
+ '_qubits': ([<projectq.types._qubit.WeakQubitRef object at 0x7fc30b0b1080>],),
+ 'gate': <projectq.ops._gates.XGate object at 0x7fc316778048>,
+ 'tags': []}
+
+ +

Both have no control qubits and it seems like the control gates lost the control qubit.

+ +

Any idea on where the control qubit is stored?

+",5791,,26,,2/15/2019 9:14,2/26/2019 8:24,ProjectQ - In which part of the controlled gate object are the control bits scored,,1,0,,,,CC BY-SA 4.0 +5481,1,,,2/13/2019 22:21,,2,742,"

We often seek to decompose multi-qubit unitaries into single-qubit rotations and controlled-rotations, minimising the latter or restricting to gates like CNOTs.

+ +

I'm interested in expressing a general 2-qubit unitary in the minimum total number of gates, which can include controlled general unitaries. That is, express $U_{4}$ with as few as possible gates in $\{U_2,\; |0⟩⟨0|\mathbb{1} + |1⟩⟨1|U_2\}$. While I could simply take the shortest decomposition to CNOTs and rotations (Vatan et al) and bring some rotations into the CNOTs, I suspect another formulation could add more control-unitaries to achieve fewer total gates.

+ +

How can I go about performing this decomposition algorithmically for any 2-qubit unitary? +This decomposition could be useful for easily extending distributed quantum simulators with the ability to effect general 2-qubit unitaries, which otherwise ad-hoc communication code.

+",2591,,26,,2/13/2019 22:48,2/13/2019 23:07,Decompose a general two-qubit gate into general controlled-qubit gates,,1,0,,,,CC BY-SA 4.0 +5482,2,,5481,2/13/2019 22:33,,3,,"

A simple place to start would be to put all the controls on qubit #2, so that you can propagate all of the single-qubit operations on qubit #1 across the two-qubit operations and merge them together. That would give you a circuit with at most 8 gates:

+ +
--------C1-------C2-------C3---S5---
+        |        |        |
+---S1---*---S2---*---S3---*----S4---
+
+ +

This is probably not minimal.

+ +

A general 4x4 unitary has 7+5+3+1=16 real parameters. Every single-qubit gate has three real parameters (Euler angles), and every two-qubit gate has four real parameters (Euler angles + phase kickback). So the above construction has 4*3 + 4*4 = 28 real parameters.

+ +

It is provable that you need at least three different controlled gates for some two-qubit operations. So the absolute best you could hope for is three of those and one single-qubit operation. But some of the degrees of freedom overlap, so I suspect you need more single-qubit gates.

+",119,,119,,2/13/2019 23:07,2/13/2019 23:07,,,,3,,,,CC BY-SA 4.0 +5484,1,,,2/14/2019 3:46,,4,623,"

I ran the Grover's Algorithm for 3 Qubits on the IBM Q platform (ibmqx4) and the results of the simulation and the actual computer differ a lot. The screenshots of the circuit and the results are attached.

+",5796,,26,,2/14/2019 8:24,2/14/2019 18:30,Why is there a difference between the simulation results and the actual quantum computer results?,,3,0,,,,CC BY-SA 4.0 +5485,1,5513,,2/14/2019 10:01,,15,1790,"

I'm trying to figure out how to simulate the evolution of qubits under the interaction of Hamiltonians with terms written as a tensor product of Pauli matrices in a quantum computer. I have found the following trick in Nielsen and Chuang's book which is explained in this post for a Hamiltonian of the form

+ +

$$H = Z_1 \otimes Z_2 \otimes ... \otimes Z_n $$.

+ +

But it is not explained in detail how would the simulation for a Hamiltonian with terms including Pauli matrices $X$ or $Y$ would work. I understand that you can transform these Pauli's into Z's by considering that $HZH = X$ where $H$ is the Hadamard gate and also $S^{\dagger}HZHS =Y$ where $S$ is the phase $i$ gate. How exactly should I use this to implement for example +$$H= X \otimes Y$$

+ +

What if now the Hamiltonian contains the sum of terms with Pauli matrices? +For example

+ +

$$ H = X_1 \otimes Y_2 + Z_2 \otimes Y_3$$

+",1754,,26,,2/14/2019 12:29,9/12/2019 14:36,Simulate hamiltonian evolution,,3,0,,,,CC BY-SA 4.0 +5486,2,,5484,2/14/2019 10:36,,3,,"

This follows almost exclusively from noise and decoherence.

+ +

In simulations, the qubits are perfect and will not decohere. Furthermore, noise has no influence on the qubits.

+ +

In the actual hardware, the qubits are not perfect and hence are subject to decoherence and influences from the outside world. Therefore, measurement results might differ from what you expect.

+",2005,,,,,2/14/2019 10:36,,,,0,,,,CC BY-SA 4.0 +5487,2,,5484,2/14/2019 16:48,,7,,"

There isn't much of a difference. If you read the labels, the values are roughly the same but for some reason are presented in a different order. Any differences for a given value are due to noise and decoherence.

+",4153,,,,,2/14/2019 16:48,,,,0,,,,CC BY-SA 4.0 +5488,2,,5484,2/14/2019 18:30,,4,,"

The Run command on the IBMQ interface is for the actual run on the quantum architecture.

+ +

The command Simulate implements the quantum circuit on a normal classical architecture but randomizes it to make it look like the actual quantum runs. Note that this could be a perfect measurement if it were to report, but IBM uses the statistics based on its own quantum architecture and mimics those when we use the simulate command.

+ +

The point of the simulate operation is just for us to know what can we expect from the actual Run of the circuit.

+",4889,,,,,2/14/2019 18:30,,,,0,,,,CC BY-SA 4.0 +5489,1,,,2/14/2019 18:34,,5,278,"

I'm just wondering how one should go about using parametrised values and the Symbol object that gets resolved at runtime?

+ +

For example, if I would like to implement the gate +$R_x(\theta) = e^{-i\theta/2}$, but would like to leave $\theta$ as a Symbol to be resolved at the end of the simulation, what would be the best way to do this?

+ +

Thanks in advance for any answers :)

+",5804,,26,,2/14/2019 18:39,2/14/2019 23:02,Using parametrised values and 'Symbols' in Cirq,,1,0,,,,CC BY-SA 4.0 +5490,1,5492,,2/14/2019 20:34,,7,184,"

How can a pure two-qubit state $|\psi\rangle = a |00\rangle + b|01\rangle + c|10\rangle + d|11\rangle$, be written in the following form

+ +

\begin{equation} +|\psi_{\alpha}\rangle = \sqrt{\alpha}|01\rangle + \sqrt{1-\alpha} |10\rangle. +\end{equation} +How can one prove this. And what would be $\alpha$ in terms of $a,~b,~c,~d$?

+",5806,,55,,2/23/2019 17:46,2/23/2019 17:46,A two qubit state in a special form,,2,3,,,,CC BY-SA 4.0 +5491,2,,5489,2/14/2019 21:34,,2,,"

In the current release of Cirq (0.4.0) there is a strong limitation on symbols: you can't scale them or add them (Why? We were worried about being pulled down the rabbit hole of implementing a whole symbolic algebra system.). Making matters worse, Cirq internally works in radians divided by pi to avoid some minor sources of floating point error. So when you write cirq.Rx(cirq.Symbol(""θ"")) it internally attempts to scale the argument, and you get an error about multiplication/division not being supported for symbols.

+ +

There is an active pull request to fix this by delegating all symbolic work to sympy. Once that's merged, the next release will allow you to write cirq.Rx(sympy.Symbol(""θ"")) whereas currently you can only use symbols in exponents e.g. cirq.X**cirq.Symbol(""t"").

+ +

So, currently in 0.4.0, you can do this:

+ +
import cirq
+import matplotlib.pyplot as plt
+
+q = cirq.LineQubit(0)
+circuit = cirq.Circuit.from_ops(
+    cirq.X(q)**cirq.Symbol('angle_over_pi'),
+    cirq.measure(q),
+)
+results = cirq.Simulator().run_sweep(
+    circuit,
+    params=cirq.Linspace(key='angle_over_pi', start=0, stop=2, length=20),
+    repetitions=1000)
+
+plt.plot([r.histogram(key=str(q))[1] for r in results])
+plt.show()
+
+ +

+ +

But you'll need to wait until 0.5.0 to be able to do this extremely similar thing using Rx instead of X** and sympy.Symbol instead of cirq.Symbol (which will be gone):

+ +
import cirq
+import matplotlib.pyplot as plt
+import numpy as np
+
+q = cirq.LineQubit(0)
+circuit = cirq.Circuit.from_ops(
+    cirq.Rx(sympy.Symbol('rads')).on(q),
+    cirq.measure(q),
+)
+results = cirq.Simulator().run_sweep(
+    circuit,
+    params=cirq.Linspace(key='rads', start=0, stop=2*np.pi, length=20),
+    repetitions=1000)
+
+plt.plot([r.histogram(key=q)[1] for r in results])
+plt.show()
+
+",119,,119,,2/14/2019 23:02,2/14/2019 23:02,,,,1,,,,CC BY-SA 4.0 +5492,2,,5490,2/14/2019 22:50,,5,,"

The trick is in the Schmidt decomposition - Following the theorem proof, we have two qubits, so two Hilbert spaces $H_1$ and $H_2$, both with dimension 2, with the bases defined as $\left\lbrace\left|e_0\right> = \left|0\right>_1,\, \left|e_1\right>=\left|1\right>_1 \right\rbrace$ and $\left\lbrace\left|f_0\right> = \left|0\right>_2,\, \left|f_1\right>=\left|1\right>_2 \right\rbrace$.

+ +

This defines a tensor $w = \sum_{i, j=0}^1\beta_{i, j}\left|i\right>_1\otimes\left|j\right>_2$. That is, $\beta_{00} = a, \,\beta_{01} = b, \,\beta_{10} = c$ and $\beta_{11} = d$.

+ +

We then write this as an $n\times n$ matrix $$M_w = \begin{pmatrix}\beta_{00} && \beta_{01} \\ \beta_{10} && \beta_{11}\end{pmatrix} = \begin{pmatrix}a && b \\ c && d\end{pmatrix}.$$

+ +

Now that we've got a matrix, we want to diagonalise it, so we perform a Singular Value Decomposition (SVD). That is, we want to write $M_w = UDV^\dagger$, where $D$ is a diagonal matrix (with the elements known as the 'singular values') and $U$ and $V$ and unitary $n\times n$ matrices. Or rather, to save having to do a chunk of maths, we know that the columns (also, rows) of both $U$ and $V$ each form an orthonormal basis - I'll call these $\left\lbrace\left|u_0\right>,\, \left|u_1\right>\right\rbrace$ and $\left\lbrace\left|v_0\right>,\, \left|v_1\right>\right\rbrace$.

+ +

Helpfully, the expression for the singular values of a $2\times2$ matrix is analytic: $$\sigma_{\pm} = \sqrt{\left|z_0\right|^2 + \left|z_1\right|^2 + \left|z_2\right|^2 + \left|z_3\right|^2 \pm \sqrt{\left(\left|z_0\right|^2 + \left|z_1\right|^2 + \left|z_2\right|^2 + \left|z_3\right|^2\right)^2 - \left|z_0^2 - z_1^2 - z_2^2 - z_3^2\right|^2}},$$ where +\begin{align*}z_0 &= \frac{1}{2}\left(a+d\right) \\ +z_1 &= \frac{1}{2}\left(b+c\right) \\ +z_2 &= \frac{i}{2}\left(b-c\right) \\ +z_3 &= \frac{1}{2}\left(a-d\right). +\end{align*} This in turn gives +$$\sigma_\pm= \sqrt{\frac{1}{2}\pm\sqrt{\frac{1}{4}-\left|ad - bc\right|^2}},$$ as a result of the normalisation condition $\left|a\right|^2 + \left|b\right|^2 + \left|c\right|^2 + \left|d\right|^2 = 1$. As $\sigma_+^2 + \sigma_-^2 = 1$, I'll redefine $\sigma_+ = \sqrt{\alpha}$ and $\sigma_- = \sqrt{\left(1-\alpha\right)}$, for reasons that should become clear below.

+ +

We can now write $M_w = \sqrt\alpha\left|u_0\rangle\langle v_0\right| + \sqrt{1-\alpha}\left|u_1\rangle\langle v_1\right|$.

+ +

'Rewriting' this as a tensor (as at the beginning1) gives a state $$\left|\psi_\alpha\right> = \sqrt\alpha\left|u_0\right\rangle\otimes\left|v_0\right\rangle + \sqrt{1-\alpha}\left|u_1\right\rangle\otimes\left|v_1\right\rangle,$$ which is equivalent to what you have by defining $\left\lbrace\left|u_0\right> = \left|0\right>_u,\, \left|u_1\right>=\left|1\right>_u \right\rbrace$ and $\left\lbrace\left|v_0\right> = \left|1\right>_v,\, \left|v_1\right>=\left|0\right>_v \right\rbrace$, where $$\alpha= \frac{1}{2}+\sqrt{\frac{1}{4}-\left|ad - bc\right|^2}$$

+ +
+ +

Calculating $M_w$:

+ +

$\left|u_0\right>$ is the left column of $U$ and $\left|u_1\right>$, the right column. Similarly, for $V$, $\left|v_0\right>$ is the left column and $\left|v_1\right>$, the right. This means that I can write $$U = \begin{pmatrix}\left|u_0\right> && \left|u_1\right>\end{pmatrix}$$ and $$V^{\dagger} = \begin{pmatrix}\left<v_0\right| \\ \left<v_1\right|\end{pmatrix}$$ so that $$M_w = UDV^\dagger = \begin{pmatrix}\left|u_0\right> && \left|u_1\right>\end{pmatrix}\begin{pmatrix}\sqrt\alpha && 0 \\ 0 && \sqrt{1-\alpha}\end{pmatrix}\begin{pmatrix}\left<v_0\right| \\ \left<v_1\right|\end{pmatrix},$$ which can be simplified as $M_w = \sqrt\alpha\left|u_0\rangle\langle v_0\right| + \sqrt{1-\alpha}\left|u_1\rangle\langle v_1\right|$.

+ +
+ +

1 Even as a non-mathematician, I feel guilty just doing this

+",23,,23,,2/16/2019 23:20,2/16/2019 23:20,,,,7,,,,CC BY-SA 4.0 +5493,2,,5490,2/15/2019 9:05,,6,,"

Mithrandir's answer perfectly covers the functional details, but to state a clear response to the question...

+ +

It is not true that any two-qubit state $a|00\rangle+b|01\rangle+c|10\rangle+d|11\rangle$ can be written in the form $\sqrt{\alpha}|01\rangle+\sqrt{1-\alpha}|10\rangle$. Obviously, you can only get equality here if $a=0$ and $d=0$.

+ +

However, what you can do is a change of basis. An equivalent way of saying this is that there exists unitaries $U_A$ and $U_B$ such that +$$ +(U_A\otimes U_B)(a|00\rangle+b|01\rangle+c|10\rangle+d|11\rangle)=\sqrt{\alpha}|01\rangle+\sqrt{1-\alpha}|10\rangle +$$

+ +

With that clarification, you could now follow Mithrandir's proof. I think of it in a different way (where you don't need to know what the singular value decomposition is, but you do need to know about the reduced density matrix). Consider the reduced density matrix of each way of writing the state, where we restrict to just the first qubit. We have +$$ +\rho_1=U_A\left((a|0\rangle+c|1\rangle)(a^\star\langle 0|+c^\star\langle 1|)+(b|0\rangle+d|1\rangle)(b^\star\langle 0|+d^\star\langle 1|)\right)U_A^\dagger\\=\alpha|0\rangle\langle 0|+(1-\alpha)|1\rangle\langle 1|. +$$ +Clearly, the right-hand side is diagonal, so $U_A$ must be the unitary that diagonalises the left-hand side. In other words, $\alpha$ and $1-\alpha$ are the eigenvalues of the matrix +$$ +\left(\begin{array}{cc} +|a|^2+|b|^2 & ac^\star+bd^\star \\ +a^\star c+b^\star d & |c|^2+|d|^2 +\end{array}\right). +$$ +The $U_A$ always exists because that matrix is Hermitian. Similarly, $U_B$ is the unitary rotation that diagonalises the reduced density matrix on the second qubit.

+",1837,,,,,2/15/2019 9:05,,,,0,,,,CC BY-SA 4.0 +5494,1,5496,,2/15/2019 13:22,,4,1360,"

I'm learning how to use the cirq library. Every time I set up a circuit the starting state of the qubits is $|0000..0\rangle$. Is there any way to make the starting state different? I'm thinking of somehow giving as input some np.array (vector) to the circuit so that the system initializes with such state. I know I could build a circuit to prepare the state I want but I would like a shorter way to do this.

+ +

Thanks!

+",1754,,26,,2/15/2019 14:22,2/15/2019 18:13,How to set a starting state in cirq?,,1,0,,,,CC BY-SA 4.0 +5496,2,,5494,2/15/2019 17:42,,7,,"

Cirq distinguishes between ""running"" a circuit, which is generally supposed to act like hardware would (e.g. only getting samples), and ""simulating"" a circuit, which has more freedom.

+ +

Most ""simulate"" methods, like cirq.Simulator().simulate(...) have a parameter initial_state which can either be a computational basis state (specified as an integer e.g. initial_state=0b000111000) or a state vector (specified as a numpy array e.g. initial_state=np.array([0.5, -0.5, 0.5j, 0.5])).

+ +

For ""run"" methods, like cirq.Simulator().run(...), there is no way to specify the initial state because that's how it works in hardware. If you want a specific state, you have to make it with gates.

+",119,,119,,2/15/2019 18:13,2/15/2019 18:13,,,,1,,,,CC BY-SA 4.0 +5497,1,5499,,2/15/2019 21:59,,6,363,"

When an RF pulse is interacting on resonance with a transmon qubit, it leads to rotation of the qubit around an axis in the XY plane (in a reference frame rotating in the transition frequency of the qubit). What is the exact relation between the pulse amplitude and phase to the rotation of the qubit? Can you give a proof?

+",5811,,26,,2/16/2019 8:15,2/17/2019 3:56,Interaction of an RF pulse with transmon qubit,,1,0,,,,CC BY-SA 4.0 +5498,2,,2082,2/16/2019 0:58,,9,,"

I will answer this question in two ways: one, I will tell you how I learned, and two I will tell you how I would have liked to have learned with the benefit of hindsight. Different people will value one more than the other, but both are more valuable than a giant list of resources with zero guidance where to start.

+ +

How I learned

+ +

I started out like you, in possession of an undergraduate education in computer science. I began reading Quantum Computer Science: An Introduction by N. David Mermin. This is a very good textbook, but I absolutely could not skim it. I had to ensure I understood every single line before moving onto the next. I had the impression I wasn't learning very quickly, when in fact (due to the textbook's density) I was taking in a huge amount of information.

+ +

After a few weeks with the Mermin textbook, I bought Quantum Computing for Computer Scientists by Yanofsky & Mannucci. This is a much softer introduction than Mermin, almost too soft: I skipped the first few chapters on linear algebra and complex numbers. However, in combination with the Mermin textbook, I acquired a good understanding of quantum computing basics. It was at this point I reached my own personal threshold for feeling I ""understood"" quantum computing.

+ +

People often recommend Quantum Computation and Quantum Information by Nielsen & Chuang (also called ""Mike & Ike"") for beginners. I believe this is not good advice. Had I tried to learn from that textbook, I would have failed. However, it is an excellent textbook after you already understand the basics. Anecdotally, I knew two people who tried to learn quantum computing at the same time as me: one used Mike & Ike, and the other used a book called Quantum Computing: A Gentle Introduction. Neither of those people understand quantum computing today.

+ +

How I wish I had learned

+ +

My experience learning quantum computing required a huge amount of mental effort, and in the end what I learned wasn't actually complicated! So, I created a lecture called Quantum Computing for Computer Scientists (slides) which is the lecture I wish I'd had access to before trying to read any textbooks. The lecture is popular and well-received, and I think it covers all the stuff that's really conceptually tricky; once you're over those conceptual hurdles, you can apply your regular computer science skills to learn everything else about quantum computing you need (how specific algorithms work, etc.) Thus my ""hindsight"" study guide is as follows:

+ +
    +
  1. Watch the lecture I created.
  2. +
  3. Watch Professor Umesh Vazirani's lectures on quantum computing; they flesh out my lecture and he is a tremendously effective explainer of concepts (these are scattered around YouTube but you can find a full playlist here)
  4. +
  5. Concurrently, work through the first few chapters of either the Mermin or Yanofsky textbooks
  6. +
  7. After you feel you understand the quantum computing basics, pick topics which interest you from the Nielsen & Chuang textbook
  8. +
  9. Stick around quantumcomputing.stackexchange, reading questions & answers, asking your own, and maybe eventually answering your own!
  10. +
+ +

Good luck!

+",4153,,,,,2/16/2019 0:58,,,,1,,,,CC BY-SA 4.0 +5499,2,,5497,2/16/2019 9:17,,7,,"

Kirchhoff to Lagrangian

+ +

Let's approximate the transmon as a parallel LC resonant circuit. +Suppose we connect a voltage source through a coupling capacitor $C_d$ (d for ""drive"") to a transmon qubit. +If the voltage of the source is $V_d(t)$, then Kirchhoff's equations for the circuit are +$$\frac{1}{C/C_d} \dot{V}_d(t) = \ddot{\Phi}(t) + \frac{\omega_0^2}{1 + C_d / C} \Phi(t)$$ +where $C$ is the capacitance of the transmon, $\Phi(t)$ is the flux of the transmon, and $\omega_0 \equiv 1 / \sqrt{LC}$. +This differential equation is reproduced by the following Lagrangian +\begin{align} +\mathcal{L} +&= \frac{1}{2}C \dot{\Phi}^2 - \frac{1}{2L}\Phi^2 + \frac{1}{2} C_d (\dot{\Phi} - V_d(t))^2 \\ +&= \underbrace{\frac{1}{2}(C + C_d) \dot{\Phi}^2 - \frac{1}{2L}\Phi^2}_{\mathcal{L}_0} + \underbrace{\frac{1}{2} C_d V_d(t)^2 - C_d V_d(t) \dot{\Phi}}_{\mathcal{L}_d} +\end{align} +as you can check yourself.

+ +

Lagrangian to Hamiltonian

+ +

The first part of $\mathcal{L}$ corresponds to the free oscillation of the qubit and we call it $\mathcal{L}_0$. +Analyzing $\mathcal{L}_0$, we find that the canonical position and momentum are +$$\text{position} = \Phi \qquad \text{and} \qquad \text{momentum} \equiv \frac{\partial \mathcal{L}_0}{\partial \dot{\Phi}} = (C + C_d)\dot{\Phi} \equiv Q\, .$$ +Denoting the canonical momentum $\partial \mathcal{L}_0 / \partial \dot{\Phi}$ as $Q$ is justified by the following reasoning. +When $C_d \rightarrow 0$, we have $\partial \mathcal{L}_0 / \partial \dot{\Phi} = C \dot{\Phi}$. +But $\dot{\Phi}$ is just the voltage on the qubit, so using the definition of capacitance $C = Q / V$ we see that $\partial \mathcal{L}_0 / \partial \dot{\Phi} = Q$ where $Q$ is the charge on the qubit. +It's then clear that adding the drive capacitor just shifts the capacitance associated with the canonical momentum, which makes sense because the drive capacitor simply adds to the qubit's own capacitance since they're connected in parallel. +Of course, in practical systems $C_d \ll C$.

+ +

Now let's look at $\mathcal{L}_d$. +The first term in $\mathcal{L}_d$ doesn't involve the dynamical variables at all, so we can ignore it. +If we convert the second term to a Hamiltonian through the usual procedure, we find that the drive Hamiltonian $H_d$ is +$$H_d = C_d \dot{\Phi}V_d = \frac{1}{1 + C/C_d} Q V_d \approx \frac{C_d}{C} Q V_d \, .$$ +Using the theory of the quantum harmonic oscillator, the $Q$ operator can be written in terms of raising and lowering operators as +$$Q = -i Q_\text{zpf} (a - a^\dagger) $$ +where $Q_\text{zpf} = \sqrt{\hbar / 2 Z_{LC}}$ is the zero point fluctuation of the circuit's charge, and $Z_{LC} \equiv \sqrt{L/C}$ is the characteristic impedance of the oscillator. +If we restrict to the lowest two levels, then $-i(a - a^\dagger) = \sigma_y$ so we get +$$H_d(t) = \frac{C_d}{C} Q_\text{zpf} V_d(t) \, \sigma_y \, .$$

+ +

Interaction picture (a.k.a. rotating frame)

+ +

Of course, there's still the free oscillation part of the Hamiltonian $H_0$, which in the two-level approximation is +$$H_0 = -\hbar \frac{\omega_0}{2} \sigma_z \, .$$ +Because $H_0$ and $H_d$ don't commute, in order to make progress we have to go into the interaction picture. +When you do that, if we assume that the drive voltage has the form $V_d(t) = V_0 \cos(\omega_0 t + \phi)$, then we get [2] +$$H_d^\text{interaction} = \frac{1}{2} \frac{C_d}{C} Q_\text{zpf} V_0 \left( \cos(\phi) \sigma_x - \sin(\phi) \sigma_y \right) \, .$$

+ +

Final result

+ +

Without loss of generality, we can pick $\phi = 0$ and compute the unitary time evolution operator +$$U(t) += \exp \left( - \frac{i}{\hbar} \int_0^t H_d^\text{interaction}(t') dt' \right) += - \frac{i}{\hbar} \frac{1}{2} \frac{C_d}{C} Q_\text{zpf} V_0 \sigma_x t \, .$$ +When you have an exponent of a Pauli matrix like $\exp(-i \theta \sigma_x)$, the angle of rotation on the Bloch sphere is $2 \theta$ [1]. +Therefore, in our case the Bloch sphere rotation angle (in radians) is +$$\text{rotation angle} = \frac{C_d}{C} \frac{Q_\text{zpf}}{\hbar} V_0 t \, .$$ +Now that we found the Bloch sphere rotation angle when $\phi=0$, it's clear from symmetry and the form of $H_d^\text{interaction}$ that changing $\phi$ keeps the same rotation angle on the Bloch sphere but changes the azimuth.

+ +
+ +

A form that I particularly like can be found by for the case of a pi-pulse where the Bloch sphere rotation angle is $\pi$. +In that case, we can rewrite the result we found above as +$$(\text{condition for pi-pulse)} \quad +1 = \frac{1}{\pi \sqrt{2}} \left( \frac{C_d}{C} \right) \sqrt{\frac{R_K / 8 \pi}{Z_{LC}}} \frac{V_0 t}{\Phi_0 / 2\pi}$$ +where here $R_K \equiv h / e^2$ is the resistance quantum and $\Phi_0 \equiv h / 2e$ is the flux quantum.

+ +

Notes:

+ +

[1] You can check this by Taylor expanding the exponential function and grouping even and odd terms.

+ +

[2] Here we are using the so-called rotating wave approximation.

+",32,,32,,2/17/2019 3:56,2/17/2019 3:56,,,,0,,,,CC BY-SA 4.0 +5500,1,5501,,2/16/2019 10:29,,2,1100,"

What does quantum teleportation mean? Is it something that will allow us to send information faster than the light? Can we teleport a human with it?

+",5813,,55,,12/15/2021 20:31,12/15/2021 20:31,Can we teleport a human or send information faster than light using quantum teleportation?,,1,1,,,,CC BY-SA 4.0 +5501,2,,5500,2/16/2019 10:54,,5,,"

In conclusion, NO and NO, respectively.

+ +

Quantum teleportation does not mean instantaneous disappearance and reappearance of information at another spatial point. Quantum teleportation in plain English means moving a quantum state from one place to another using quantum operations and quantum measurement, which are connected by classical as well as quantum channels or both. This does not exceed the speed of light in any sense and does not violate the theory of special relativity. There is no faster than light (FTL) communication in the basic Teleportation protocol because it is restricted by the speed of light as it uses an ordinary classical channel as a necessary requirement to attain its perfection in probability.

+ +

Teleporting a human is a very subjective question today. Because it is not a quantum object to be described by a quantum state. A human is a macroscopic object which is completely classical. To this date, the biggest size of objects that are teleported (to about $2\ \mathrm{km}$ range) is the size of buckyballs or similar objects (this means teleporting their quantum states - in the sense of information). Teleporting anything classical would be quite metaphysical at this point, it would also bring the questions of consciousness and other hypotheses into the framework which are not yet modeled or accepted by the science community. One way may be to scramble - teleport - re-assemble such objects, but do they retain their macroscopic properties then? It is a question which is more philosophical to this point.

+ +

Check out some of these links to catch up with the latest breakthrough in quantum teleportation regarding range, loop-holes, security, etc:

+ + +",4889,,4889,,2/16/2019 18:51,2/16/2019 18:51,,,,0,,,,CC BY-SA 4.0 +5502,2,,2282,2/16/2019 12:16,,2,,"

In 1996, David DiVincenzo listed five key criteria to build a quantum computer:

+ +
    +
  1. A quantum computer must be scalable,
  2. +
  3. It must be possible to initialise the qubits,
  4. +
  5. Good qubits are needed, the quantum state cannot be lost,
  6. +
  7. We need to have a universal set of quantum gates,
  8. +
  9. We need to be able to measure all qubits.
  10. +
+ +

Two additional criteria:

+ +
    +
  1. The ability to interconvert stationary and flying qubits,
  2. +
  3. The ability to transmit flying qubits between distant locations.
  4. +
+ +

Long Explanation

+",5813,,5813,,2/16/2019 13:05,2/16/2019 13:05,,,,0,,,,CC BY-SA 4.0 +5503,1,5505,,2/16/2019 13:06,,9,622,"

Suppose $x \in \{0,1\}^n$. The standard way to make a query is with an oracle $O_x$ that given an input $|i,b \rangle $ returns $|i,b \oplus x_i \rangle$. Via the phase kick-back trick, this can be used to make another type of query $O_{x}^{''}$ such that $O_{x}^{''}|i\rangle=(-1)^{x_i}|i\rangle$. This is easily seen by passing to the $|+\rangle, |- \rangle$ basis. How can it be seen that the converse is true i.e. that with a query of the latter type (and perhaps some ancillary qubit or transformation) one can implement a query of the former type?

+",5816,,55,,12/3/2019 10:51,6/16/2020 13:28,Show that these two expressions for the oracle transformation are equivalent,,2,1,,,,CC BY-SA 4.0 +5504,1,5536,,2/16/2019 13:39,,4,301,"

I understand in Shor's algorithm we use quantum computers to find the period of a function which can then be used to find N, and we increase the probability of observing the state with the correct period with a Fourier transform. However, why can't we have a superposition of every possible factor and use a Fourier transform to increase the probability of observing the correct factor?

+ +

Hopefully someone can help answer (I'm trying to understand this for my EPQ).

+",4773,,26,,2/16/2019 13:40,2/21/2019 15:40,Why do we use the quantum superposition for a period instead of factors in Shor's algorithm?,,1,2,,,,CC BY-SA 4.0 +5505,2,,5503,2/16/2019 18:22,,1,,"

If we express the action of $O_x$ on the basis $\mid i, \pm \rangle$ instead of $\mid i , b \rangle$

+ +

\begin{eqnarray*} +O_x \mid i , + \rangle = \mid i , + \rangle\\ +O_x \mid i , - \rangle = (-1)^{x_i} \mid i , - \rangle\\ +\end{eqnarray*}

+ +

Because we say auxiliary qubits must be started and ended with $0$,

+ +

\begin{eqnarray*} +O_x'' &=& (1 \otimes S_x H) O_x (1 \otimes H S_x) +\end{eqnarray*}

+ +

where the $1 \otimes H S_x$ conjugation takes care of turning the auxiliary from $0$ to $-$ and back.

+ +

Be careful about what $O_x''$ does. It does the desired $(-1)^{x_i}$ only when the ancilla is in $0$ as it is supposed to be. If the auxiliary is in $1$ instead, $O_x''$ acts like the identity.

+ +

\begin{eqnarray*} +O_x'' \mid i , 0 \rangle &=& (-1)^{x_i} \mid i, 0 \rangle\\ +O_x'' \mid i , 1 \rangle &=& \mid i, 1 \rangle\\ +\end{eqnarray*}

+ +

Solve for $O_x$

+ +

\begin{eqnarray*} +O_x &=& (1 \otimes H S_x) O_x'' (1 \otimes S_x H) +\end{eqnarray*}

+ +

See what it does on $\mid i , + \rangle$ and $\mid i, - \rangle$

+ +

\begin{eqnarray*} +(1 \otimes H S_x) O_x'' (1 \otimes S_x H) \mid i, + \rangle &=& (1 \otimes H S_x) O_x'' \mid i, 1 \rangle\\ +&=& (1 \otimes H S_x) \mid i, 1 \rangle\\ +&=& \mid i, + \rangle\\ +(1 \otimes H S_x) O_x'' (1 \otimes S_x H) \mid i, - \rangle &=& (1 \otimes H S_x) O_x'' \mid i, 0 \rangle\\ +&=& (1 \otimes H S_x) (-1)^{x_i} \mid i, 0 \rangle\\ +&=& (-1)^{x_i} \mid i , - \rangle\\ +\end{eqnarray*}

+ +

This matches with what we wanted for $O_x$ in the first two lines.

+ +

Edit:

+ +

\begin{eqnarray*} +O_x \mid i, + \rangle &=& O_x \frac{1}{\sqrt{2}} (\mid i, 0 \rangle + \mid i, 1 \rangle)\\ +&=& \frac{1}{\sqrt{2}} (O_x \mid i, 0 \rangle + O_x \mid i, 1 \rangle)\\ +&=& \frac{1}{\sqrt{2}} (\mid i, 0+x_i \rangle + O_x \mid i, 1+x_i \rangle)\\ +&=& \mid i, + \rangle +\end{eqnarray*}

+ +

For the last equality, the two summands either swap or they don't depending on $x_i$. Similarly with -

+ +

\begin{eqnarray*} +O_x \mid i, - \rangle &=& O_x \frac{1}{\sqrt{2}} (\mid i, 0 \rangle - \mid i, 1 \rangle)\\ +&=& \frac{1}{\sqrt{2}} (O_x \mid i, 0 \rangle - O_x \mid i, 1 \rangle)\\ +&=& \frac{1}{\sqrt{2}} (\mid i, 0+x_i \rangle - O_x \mid i, 1+x_i \rangle)\\ +\end{eqnarray*}

+ +

so if $x_i=0$ there is no swap of terms and the result is $\mid i, - \rangle$. If $x_i=1$, there is a swap of terms and the result is $- \mid i, - \rangle$. This can be put together by saying $O_x \mid i, - \rangle = (-1)^{x_i} \mid i , - \rangle$

+",434,,434,,6/16/2020 13:28,6/16/2020 13:28,,,,5,,,,CC BY-SA 4.0 +5506,2,,5503,2/16/2019 18:32,,2,,"

You are given a quantum circuit for $U$ compiled into the H/CNOT/T gateset. Derive a controlled version of $U$ by adding a control qubit $q$, replacing every H with a controlled H, every CNOT with a CCNOT, and every T with a controlled T. In all cases the new control goes on the $q$.

+ +

Recompile the modified gates down into the H/CNOT/T gate set. Prepend and append the circuit with a Hadamard on $q$. You now have a circuit that toggles $q$ when a -1 eigenstate of $U$ is input and leaves $q$ alone when a +1 eigenstate of $U$ is input.

+ +

In short:

+ +
    +
  • Circuit $C$ implements $(-1)^{f(x)}$
  • +
  • Derive controlled $C$ implementing $(-1)^{q \cdot f(x)}$
  • +
  • Switch control basis from Z to X, achieving $q \mathrel{\oplus} = f(x)$
  • +
+",119,,,,,2/16/2019 18:32,,,,3,,,,CC BY-SA 4.0 +5507,1,5510,,2/17/2019 11:59,,4,91,"

Craig Gidney's blog has some .gifs which directly link to the corresponding simulation on Quirk. For example:

+ +

Grover Search

+ +

+ +

Delayed Eraser

+ +

+ +

Is it possible to create these .gifs from within Quirk? Or does one need to use some third-party software?

+",26,,26,,2/17/2019 20:56,2/17/2019 21:23,Creating .gifs corresponding to Quirk simulations,,1,0,,,,CC BY-SA 4.0 +5508,2,,5485,2/17/2019 13:49,,0,,"

In general, this problem is not very simple, ultimately it comes down to taking a Hamiltonian as you've written and somehow forming the appropriate sequence of gates that implements $e^{-\Delta t H}$. From my understanding, this is usually accomplished by using the Trotter-Suzuki approximation and gate decompositions.

+",,user2318,26,,2/17/2019 13:52,2/17/2019 13:52,,,,0,,,,CC BY-SA 4.0 +5509,1,,,2/17/2019 16:10,,2,362,"

In the book by Chuang and Nielsen they prove that controlled U operations can be made out of CNOTs and single qubit gates. But then they go on to prove that they are universal by showing that every n by n matrix can be decomposed into two level matrices and then to CNOTs and single qubit gates. But if so, then why can't we prove this way that controlled U can be too, decomposed to them. Since a controlled U is after all an n by n matrix. Why is there a separate proof for them?

+",5742,,5742,,2/17/2019 16:47,2/18/2019 11:49,If CNOTs and single qubit gates are universal then why do we need to prove that controlled U operations can be composed by them as well?,,1,5,,,,CC BY-SA 4.0 +5510,2,,5507,2/17/2019 21:23,,4,,"

I made those GIFs using the screen recorder ScreenToGif.

+ +

ScreenToGif is not very good at compressing while maintaing quality, so I found it worked better to disable all optimizations while recording, try to preserve all detail, then post-process using GIMP's ""Optimize (for GIF)"" filter. GIMP is also handy for e.g. adding the text labels you see in the images.

+ +

(There was an old dev version of Quirk that had a ""record cycle"" button, but it was incredibly slow and didn't produce decent results [you have to find javascript code to encode the GIF data, and you often want to vary the framerate because some things look fine at low rates but some don't] so I dropped it.)

+",119,,,,,2/17/2019 21:23,,,,1,,,,CC BY-SA 4.0 +5511,1,,,2/18/2019 3:38,,3,280,"

I am attempting to run the following on a remote backend through QISkit:

+ +
+
try:
+    import math
+    from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
+    from qiskit import execute, IBMQ, Aer
+    from qiskit.backends.ibmq import least_busy
+
+    q = QuantumRegister(1, 'q')
+    c1 = ClassicalRegister(1, 'c1')
+    c2 = ClassicalRegister(1, 'c2')
+    qc1 = QuantumCircuit(q, c1)
+    qc2 = QuantumCircuit(q, c2)
+    qc1.ry(math.pi*0.25, q[0])
+    qc2.ry(math.pi*0.25, q[0])
+
+    qc1.measure(q, c1)
+    qc2.measure(q, c2)
+
+    backend_sim = Aer.get_backend('qasm_simulator')
+
+    job_sim1 = execute(qc1, backend_sim)
+    result_sim1 = job_sim1.result()
+
+    job_sim2 = execute(qc2, backend_sim)
+    result_sim2 = job_sim2.result()
+
+    print(""simulation one: "", result_sim1)
+    print(result_sim1.get_counts(qc1))
+    print(""simulation two: "", result_sim2)
+    print(result_sim2.get_counts(qc2))
+
+    ibmq_backends = IBMQ.backends()
+
+    print(""Remote backends: "", ibmq_backends)
+    try:
+        least_busy_device = least_busy(IBMQ.backends(simulator=False))
+        print(""Running on current least busy device: "", least_busy_device)
+
+        job_exp = execute(qc, least_busy_device, shots=1024, max_credits=10)
+        result_exp = job_exp.result()
+
+        print(""experiment: "", result_exp)
+        print(result_exp.get_counts(qc))
+    except:
+        print(""all devices are unavailable."")
+except QiskitError as ex:
+    print('an error occurred. Error = {}'.format(ex))
+
+
+ +

After the local qasm simulator runs, I receive:

+ +
+
Remote backends: []
+All devices are currently unavailable
+
+
+ +

However, if I run the ""hello_quantum.py"" example given through IBMQ, I am able to access multiple backends and use the ibm_16_melbourne computer. Interestingly, there seems to be an error in this program specifically.

+ +

Any ideas on what could be going wrong here?

+",5747,,26,,2/18/2019 3:51,2/20/2019 8:35,"Consistent QISkit error: ""All devices are currently unavailable""",,1,0,,,,CC BY-SA 4.0 +5512,2,,5509,2/18/2019 7:41,,2,,"

Constructing controlled-U out of single qubit rotations and cNOT is part of the proof of universality of single qubit rotations and cNOT.

+ +

The bit of Nielsen & Chuang that you're referring to decomposes an arbitrary unitary in terms of gates such as controlled-controlled-....-controlled-U. See, for example, Fig 4.16 (P. 193 of 2002 printing). But that gate is built out of controlled-U. See, for example, Fig. 4.10 (P. 184). (although Exercise 4.28 gives you a different construction without work qubits). So, you need to construction of controlled-U for the whole thing to work.

+",1837,,1837,,2/18/2019 11:49,2/18/2019 11:49,,,,7,,,,CC BY-SA 4.0 +5513,2,,5485,2/18/2019 8:24,,5,,"

Let's say you have a Hamiltonian of the form +$$ +H=\sigma_1\otimes\sigma_2\otimes\sigma_2\otimes\ldots\otimes\sigma_n +$$ +There's a straightforward circuit construction that lets you implement its time evolution $e^{-iHt}$. The trick is basically to decompose the state that you're evolving into the components that are in the $\pm 1$ eigenspaces of $H$. Then, you apply the phase $e^{-it}$ to the $+1$ eigenspace, and the phase $e^{-it}$ to the $-1$ eigenspace. The following circuit does that job (and uncomputes the decomposition at the end). + +I'm assuming the phase gate element in the middle to be applying the unitary +$$ +\left(\begin{array}{cc} e^{it} & 0 \\ 0 & e^{-it} \end{array}\right). +$$

+ +
+ +

In general, if you want to evolve some Hamiltonian $H=H_1+H_2$ where $H_1$ and $H_2$ are of the previous form, then by far the easiest is to decompose the evolution as +$$ +e^{-iHt}\approx \left(e^{-iH_1t/M}e^{-iH_2t/M}\right)^M +$$ +for some large $M$ (although there are algorithms with much better scaling behaviour), and each of those small steps $e^{-iH_1t/M}$ can be implemented with the previous circuit.

+ +
+ +

That said, sometimes there are smarter things that you can do. Your extra example, +$$ +H=X\otimes Y\otimes\mathbb{I}+Z\otimes\mathbb{I}\otimes Y +$$ +is one such case. I'd start by apply the unitary rotation $U=\frac{Z+Y}{\sqrt{2}}$ to qubits 2 and 3. This is the equivalent to the Hadamard gate, but converts $Y$ into $Z$ instead of $X$. Now stop for a moment and think. If qubits 2 and 3 are in 00, then we're applying $(X+Z)$ to qubit 1. For 01, it's $(X-Z)$, for 10 it's $(Z-X)$, and for 11 it's $-(X+Z)$. Next, let's apply controlled-not from qubit 2 to qubit 3. This just permutes the basis elements slightly. It now says that we have to apply the Hamiltonian +$$ +(-1)^{x_2}(X+(-1)^{x_3}Z) +$$ +to the state of qubit 1, if qubits 2 and 3 are in the states $x_2x_3$. Next, remember that $X+Z=\sqrt{2}H$ (Hadamard, not Hamiltonian), and that $X\sqrt{2}HX=X-Z$. So, that gives us an easy way to convert between the two bits of Hamiltonian. We'll just replace those two $X$s with controlled-nots controlled by qubit 3. Similarly, we can use a circuit identity + +where this time we'll replace the $X$s with controlled-nots controlled off qubit 2.

+ +

Overall, I believe the simulation looks like + +It might look complicated, but there's none of the splitting up into little time steps that accumulate errors as you go along. It won't apply very often, but it's worth being aware of these sorts of possibilities.

+",1837,,,,,2/18/2019 8:24,,,,5,,,,CC BY-SA 4.0 +5514,1,,,2/18/2019 10:43,,3,33,"

Can one replace Nitrogen with Phosphorus and Carbon with Silicon and so on? +What would be the conditions that would preclude such a realisation? Are there any implemenations so far?

+",462,,26,,2/18/2019 12:36,2/18/2019 12:36,Can one make NV centred type qubits from analogus materials in the periodic table?,,0,0,,,,CC BY-SA 4.0 +5516,1,5517,,2/18/2019 11:43,,5,560,"

The concurrence for a state $\rho$ as defined here is +\begin{equation} +C(\rho) = {\rm max}\{0, \lambda_1-\lambda_2-\lambda_3-\lambda_4\}. +\end{equation} +Where $\lambda_i$ are the eigenvalues of matrix $ \sqrt{\sqrt{\rho} \tilde{\rho} \sqrt{\rho}}$, with $\tilde{\rho} = (\sigma_y \otimes \sigma_y) \rho^* (\sigma_y \otimes \sigma_y)$, $\sigma_y$ being the Pauli matrix and $\rho^*$ is the complex conjugate of state $\rho$.

+ +

In the case of Bell diagonal states of the form $\sum_{k=1}^{4} \lambda_k |\beta_k\rangle\langle\beta_k|$, where $|\beta_k\rangle$ is the Bell state. In this case, the concurrence, as defined here (Eq. B11), is given by

+ +

\begin{equation} +C = 2~ {\rm max}[0, \Lambda-\frac{1}{2}] +\end{equation} +where $\Lambda = {\rm max}_k\{ \lambda_k\}$.

+ +

How are these two definitions connected?

+ +

Edit: Thanks for clearing the above doubts. Just found one more definition here (below Eq. 10). Here +\begin{equation} +C(\rho) = {\rm max}\{0, \lambda_1-\lambda_2-\lambda_3-\lambda_4\}. +\end{equation} +But this time $\lambda_k$ are $\textit{square root}$ o the eigenvalues of the matrix $\rho \tilde{\rho}$, rather than eigenvalue of the $\textit{square root}$ of matrix $ \sqrt{\sqrt{\rho} \tilde{\rho} \sqrt{\rho}}$. Even if we agree that $\sqrt{\rho} \tilde{\rho} \sqrt{\rho} = \rho$, in the Bell basis, then $\lambda_k$ should be +$\textit{the eigenvalues of the square root of $\rho$, rather than square root of the eigenvalues of $\rho$}$.

+",5806,,55,,12/3/2021 9:05,12/3/2021 9:05,Connection between the definitions of concurrence for a two-qubit states,,1,0,,,,CC BY-SA 4.0 +5517,2,,5516,2/18/2019 13:05,,3,,"

The Bell states $|\beta_k\rangle$ all satisfy $Y\otimes Y|\beta_k\rangle=\pm|\beta_k\rangle$. Hence, $\tilde\rho=\rho$. Thus, the matrix $\sqrt{\sqrt{\rho}\tilde\rho\sqrt{\rho}}=\rho$, given that all the $\lambda_k$ are real and non-negative. Hence, the set of eigenvalues $\lambda_i$ is the same as the set of the $\tilde \lambda_k$, the Bell-diagonal components (I've denoted these by $\tilde\lambda_k$ to avoid any confusion). However, the stated definition of the concurrence explicitly orders the eigenvalues, $\lambda_1\geq\lambda_2\geq\lambda_3\geq\lambda_4$. Hence, $\lambda_1=\max_k\tilde\lambda_k=\Lambda$.

+

Recall that $\sum_k\tilde\lambda_k=1$, so we have that $\lambda_2+\lambda_3+\lambda_4=1-\Lambda$. Using $C(\rho)=\max[0,\lambda_1-\lambda_2-\lambda_3-\lambda_4]$, we now have +$$ +C=\max[0,2\Lambda-1]=2\max[0,\Lambda-\frac12]. +$$

+
+

Given the edit to you question, it appears the following needs to be clarified. Recall that for a normal matrix $A$ (of which Hermitian is a special case), it has a spectral decomposition +$$ +A=\sum_i\lambda_i|\lambda_i\rangle\langle\lambda_i|. +$$ +For any function $f:\mathbb{C}\mapsto\mathbb{C}$, i.e. accepts a complex number as input and gives a complex number as output, we can define the action of $f$ on the matrix $A$ to be +$$ +f(A)=\sum_if(\lambda_i)|\lambda_i\rangle\langle\lambda_i|. +$$ +This means that the square root of the eigenvalues are equal to the eigenvalues of the square root. It also means that if you're trying to calculate +$$ +\sqrt{\sqrt{\rho}\rho\sqrt{\rho}}, +$$ +then you can start by writing this as +\begin{align} +\sqrt{\left(\sum_i\sqrt{\lambda_i}|\lambda_i\rangle\langle\lambda_i|\right)\left(\sum_i\lambda_i|\lambda_i\rangle\langle\lambda_i|\right)\left(\sum_i\sqrt{\lambda_i}|\lambda_i\rangle\langle\lambda_i|\right)}&=\sqrt{\sum_i\lambda_i^2|\lambda_i\rangle\langle\lambda_i|} \\ +&=\sum_i|\lambda_i||\lambda_i\rangle\langle\lambda_i| +\end{align} +Since the $\lambda_i$ are positive, this is the same as $\rho$.

+",1837,,12560,,7/6/2020 6:21,7/6/2020 6:21,,,,0,,,,CC BY-SA 4.0 +5518,1,5519,,2/18/2019 13:15,,3,224,"

Question: For 2x2 and 2x3 systems, is the partial transpose the only positive but not completely positive operation that is possible?

+ +

Why this came up: The criteria for detecting if a state $\rho$ is entangled is:

+ +

$\forall \Lambda $ such that $\Lambda$ is a positive but not completely positive operator, +if $$(I \otimes \Lambda ) \rho \geq 0 $$ +then the state is separable, otherwise it is entangled.

+ +

However, we know the Peres-Horodecki criteria for 2x2 and 2x3 systems says it is enough to check only for one positive operation, that is, the partial transpose. Hence I was wondering if this was true.

+",2832,,55,,3/9/2021 22:05,3/9/2021 22:05,"For 2x2 and 2x3 systems, is the partial transpose the only positive but not CP operation?",,1,0,,,,CC BY-SA 4.0 +5519,2,,5518,2/18/2019 14:55,,5,,"

The partial transpose is not the only positive but not completely positive operation that is possible on 2x2 and 2x3 systems. Trivially, any completely positive operation (such as a local unitary) combined with the partial transpose is a different positive operation.

+ +

The point is that, as wikipedia puts it

+ +
+

every such map $\Lambda$ can be written as

+ +

$\Lambda=\Lambda_1+\Lambda_2\circ T$

+ +

where $\Lambda _{1}$ and $\Lambda _{2}$ are completely positive and + T is the transposition map

+
+ +

so, somehow, the partial transpose is the only element that you need to describe all possible positive maps on 2x2 and 2x3 systems. That doesn't mean it's the only map.

+",1837,,,,,2/18/2019 14:55,,,,0,,,,CC BY-SA 4.0 +5520,1,,,2/18/2019 16:23,,3,1278,"

Bell’s inequality is $$S = P(a,b)-P(a,d)+P(c,b)+P(c,d) \leq 2,$$ which is calculated as $$S = ab – ad + cb + cd \leq 2.$$

+ +

The CHSH version is: +$$E = \frac{N_{11} + N_{00} - N_{10} -N_{01}} {N_{11} + N_{00} + N_{10} + N_{01}}$$ +$$S = {E_1 - E_2 + E_3 + E_4}$$ +$N_{11}$ is the number of correlations, etc. +$E$ is the correlation coefficient.

+ +

There appears to be a significant difference between Bell’s and CHSH’s inequalities. For comparison, converting the correlation coefficient to Probability makes it possible to enter the values directly into Bell’s Inequality. The conversion to probability is the correlation coefficient divided by $2$ then adding $.5$. Using the much mentioned values for $E$ of $-.707, +.707, +.707$ and $+.707$ as $a, b, c$ and $d$ respectively. Bell’s Inequality is calculated as $$S = (-.8535)(.8535) – (-.8535)(.8535) + (.8535)(.8535) + (.8535)(.8535)$$ $$= -.728 + .728 + .728 + .728 = 1.456.$$

+ +

So using the real Bell’s Inequality, there is no violation. Shouldn't the CHSH Inequality be calculated as $$S=E_1E_2-E_1E_4+E_3E_2+E_3E_4?$$

+ +

Update 1:

+ +

The essence of the problem with the CHSH experiment is that $E$ is calculated as a correlation coefficient, similar to probability, then inserted into the CHSH inequality as $E(a,b)$, which is a product of 2 independent values. That is a huge mistake. Either this is wrong or the fundamental “proof” of quantum theory is seriously flawed.

+ +

Update 2:

+ +

The $a$ and $b$ in the calculation of $S$ are the results of 2 runs of the experiment from run $a$ and run $b$. +The $a$ and $b$ in the calculation of $E$ are the results of 1 run of the experiment from detector a and detector b +The two $a$’s are completely different.

+ +

Update 3:

+ +

Please excuse my post that was too nebulous to point out an error. This is a solid description of my problem with the CHSH experiments.

+ +

The CHSH inequality is

+ +

$$S = E(a,b) - E(a,d) + E(c,b) + E(c,d) \leq 2.$$

+ +

It, like Bell’s inequality, is valid for all values from $–1$ to $+1$.

+ +
    +
  • To avoid having 2 $a$’s, separate letters are assigned to each item in the experiment, lower case for values and upper case for the rest.

  • +
  • The letters $a$, $b$, $c$ and $d$ are reserved for the CHSH Inequality.

  • +
  • X and Y are the 2 detectors.

  • +
  • $g$, $h$, $i$ and $j$ are the 4 angles of the detectors.

  • +
  • K, L, M, and N are the 4 runs.

  • +
  • $p$, $q$, $r$ and $t$ are results of K, L, M and N for detector X.

  • +
  • $u$, $v$, $w$ and $z$ are results of K, L, M and N for detector Y.

  • +
+ +

$E(p,u)$ is inserted into $S$ as $E(a,b)$ by CHSH. $E(q,v)$ is inserted into $S$ as $E(a,d)$. $E(r,w)$ is inserted into $S$ as $E(c,b)$. $E(t,z)$ is inserted into $S$ as $E(c,d)$.

+ +

That makes the calculation of $S$,

+ +

$$S = E(p,u) - E(q,v) + E(r,w) + E(t,z).$$

+ +

So CHSH puts 8 independent values into the inequality. Both Bell’s and CHSH’s inequalities require exactly 4 values. This makes the inequality invalid. What is the error in this description of the CHSH experiment?

+ +

Update 4:

+ +

The last comment said:

+ +

“We can also calculate the correlations so, if both choose to measure setting 1, we'd have the value $ab$ being the product of the two answers. +If we run this many times, we build up expectation values for each of these entities, eventually giving us things like $E(a,b)$. Then we can evaluate +$S=E(a,b)−E(a,d)+E(c,b)+E(c,d)$”.

+ +

That has isolated the problem.

+ +

The $E(a,b)$ from the runs is not the same as the $E(a,b)$ in the CHSH Inequality. In the runs $a$ is the setting of the ""a"" polarizer in degrees, i.e. 22.5°. Both Bell’s and CHSH’s inequalities are valid for all numbers from –1 to +1. They are not valid for 22.5. If you disagree, what is the value of $a$ in the $E(a,b)$ of the runs?

+ +

Update 5:

+ +

The reason the CHSH experiment has been able to get away with a fatal error for 50 years is because of clever but erroneous replies to objections like this typical one.

+ +

“In a single run of an experiment, there are two boxes. On each box, you can choose one of two settings, and you get an answer $±1$ +If Alice (first box) chose setting 1, she would record her answer in the random variable $a$. If she chose setting 2, she records her answer in random variable $c$. Similarly, Bob uses random variables $b$ and $d$. We can also calculate the correlations so, if both choose to measure setting 1, we'd have the value $ab$

+ +

Look what that says, set $a$ and $b$ to the same value and correlate them. The result of the correlation of $a$ and $b$ has to be 1. That is definitely not a justification for the CHSH calculations.

+",5829,,10480,,4/16/2021 20:45,4/16/2021 20:45,How is Bell’s Inequality converted to the CHSH inequality?,,2,9,,,,CC BY-SA 4.0 +5521,1,5522,,2/18/2019 19:50,,3,1361,"

My question is very simple. I know there is a method to add a control to previously defined gates. I saw in the API of cirq that there is a command Controlled gate (here). I'm not understanding though how would this work. Suppose for example I want to add a control to an XPowGate from cirq. How would I write this in a program and how would I define the control qubit and the qubit over which I want to act?

+",1754,,26,,2/18/2019 19:55,12/9/2019 5:38,How to add control to gates in Cirq?,,1,0,,,,CC BY-SA 4.0 +5522,2,,5521,2/18/2019 22:45,,7,,"

You can use the controlled_by method on any Operation:

+ +
op = cirq.X(target_qubit).controlled_by(control_qubit)
+
+ +

You can also use controlled before specifying the target qubits:

+ +
op = cirq.X.controlled().on(control_qubit, target_qubit)
+
+ +

There are also built-in controlled operations such as cirq.CNOT, cirq.CZ, and cirq.CSWAP. The built-in operations are generally preferable because they have hand-tuned gate decompositions and simulation methods. The general controlled_by has to fall back to more general methods.

+ +

Note that the controlled versions of gates support things like raising to a power. The following three expressions produce equivalent operations:

+ +
(cirq.X(q)**0.5).controlled_by(c)
+
+(cirq.X**0.5).on(q).controlled_by(c)
+
+cirq.X(q).controlled_by(c)**0.5
+
+",119,,119,,12/9/2019 5:38,12/9/2019 5:38,,,,2,,,,CC BY-SA 4.0 +5524,2,,4178,2/19/2019 10:55,,3,,"

First of all, you inverted $a,b$ with $x,y$ when trying to draw the analogy.

+ +

In Bell's original paper, $\vec a,\vec b$ are used to denote the measurement directions, so the underlying probability distribution should be written as +$$p(x,y|\vec a,\vec b,\lambda)=p(x|\vec a,\lambda)p(y|\vec b,\lambda).$$ +The expectation values $A(\vec a,\lambda)$ and $B(\vec b,\lambda)$ used in Bell's paper would then be given by +$$A(\vec a,\lambda)=\sum_x x p(x|\vec a,\lambda)$$ +and similarly for $B$. The sum is here extended over the possible values that can correspond to the measurement choice $\vec a$. In the case of Bell's paper, this amounts to $x=\pm 1$.

+ +

To get the expectation value $E(\vec a,\vec b)$ you now simply need to take the average over the possible values of the hidden variable $\lambda$.

+ +
+ +

This answer was also posted on the duplicate question on physics.SE.

+",55,,55,,2/19/2019 11:46,2/19/2019 11:46,,,,0,,,,CC BY-SA 4.0 +5525,1,15998,,2/19/2019 14:21,,39,1481,"

Recently, a series of research papers have been released (this, this and this, also this) that provide classical algorithms with the same runtime as quantum machine learning algorithms for the same purpose. From my understanding, the key to all the algorithms that have been dequantized is the same: the state preparation routine has been substituted by $\ell^2$-norm sampling.

+ +

A few questions arise: after these results, what are the expectations from the field? Since any quantum algorithm will need of state preparation at some point (in every algorithm we will have, at some point, to encode some classical data in a quantum state), can any quantum machine learning algorithm be dequantized using Tang's method? If not, which algorithms are expected to / do resist this dequantization?

+",1917,,55,,9/1/2020 22:27,9/1/2022 9:42,Quantum machine learning after Ewin Tang,,1,8,,,,CC BY-SA 4.0 +5526,1,5527,,2/19/2019 17:56,,4,361,"

In designing reversible circuits one of the useful circuits is the decoder.

+ +

The operation of a decoder is naturally reversible, so it makes sense to be able to create one with no garbage outputs.

+ +

For 1-to-2 and 2-to-4 decoders this is easy.

+ +

However, when I look up reversible decoder implementations for n greater than 2, I can't find any that reduce the garbage outputs to 0. Is there a reason for this? Has it been proven impossible, or has a solution just eluded research?

+ +

In particular this paper seems to show that many attempts to create 3-to-8 decoders seem to get stuck at 1 garbage output. I did notice that most papers seem to focus on general quantum cost, not just on garbage output. I suspect that if quantum cost is ignored it should be possible to create a 3-to-8 decoder with no garbage output lines.

+ +

I have tried with pen and paper to come up with such a design, to no avail, but haven't performed any kind of exhaustive search.

+",5843,,5843,,2/20/2019 17:06,2/21/2019 1:25,Garbage-Free Reversible Binary-To-Unary Decoder Construction,,1,1,,,,CC BY-SA 4.0 +5527,2,,5526,2/20/2019 4:27,,4,,"

I'm assuming that by ""decoder"" you mean ""binary to unary conversion"".

+ +

There is a very simple way to produce the unary output from the binary input, by using a series of swap gates in a descending pattern. This even works when you know your input has a maximum value that's not a power of 2:

+ +

+ +

Once you have the unary output, you can use a series of CNOTs to clear the binary input. For example, for unary output qubit #6 you toggle binary bits #1 and #2 because 6 = 2^1 + 2^2.

+ +

+ +

A ""garbage free decoder"" is just these two circuits in sequence. An encoder is the same thing but in the reverse order.

+ +

Once you have that circuit, it's not too hard to get rid of the workspace. For example, here's a no-workspace 3-to-8 decoder circuit:

+ +

+ +

Also, the number of non-Clifford operations in this circuit (n-lg2(n)-1) is provably optimal because every output (there are n) is linearly independent w.r.t. xoring and you start with only lg2(n) + 1 linearly independent components (lg(n) address bits + 1 for the ON state).

+",119,,119,,2/21/2019 1:25,2/21/2019 1:25,,,,6,,,,CC BY-SA 4.0 +5528,2,,5511,2/20/2019 8:35,,3,,"

To use the remote backends, you need to sign into the IBM Q Experience. This is done with

+ +
IBMQ.load_accounts()
+
+ +

(after IBMQ has been imported, of course). Since IBMQ.backends() returns the list of backends that your account allows you to use, it will return an empty list when you are not signed in.

+ +

An additional note: If you update to the most recent Qiskit version (as of 2019-02-20) you'll need to use from qiskit.providers.ibmq import least_busy to import least_busy.

+",409,,,,,2/20/2019 8:35,,,,3,,,,CC BY-SA 4.0 +5529,1,,,2/20/2019 15:00,,1,110,"

I started working in Qiskit, and here is an example of how gates of a circuit are represented graphically in LaTeX format:

+ +

+ +

Obviously, $R_y(\theta)$, is a y rotation by a certain angle. But all the other gates look like $U_i(x,y,z)$, and I don't know how what they actually do. What is their matrix representation? What do the numbers $i,x,y$ and $z$ mean?

+",5600,,26,,2/20/2019 23:49,2/20/2019 23:49,Qiskit gates in LaTeX representation: notation meaning,,0,1,,2/20/2019 17:44,,CC BY-SA 4.0 +5530,1,5531,,2/20/2019 20:44,,3,477,"

I don't understand it. But suppose you have a state of two qubits in superposition and it looks like $|10\rangle-|11\rangle$. +Now you have in your circuits two gates one is a controlled-NOT from the first qubit to the second and the other gate following is the Hadamard gate on the first qubit.

+ +

If I applied first the CNOT I got, $|11\rangle-|10\rangle$, right? +(I am not entirely sure why it's allowed to work like this but ok.)

+ +

Now I was trying two approaches yielding different results but I am actually not sure about what is the meaning of the first qubit.

+ +
    +
  1. So one approach was to take the original state $|10\rangle-|11\rangle$ and apply to it $\operatorname{H}$ gate multiplied by CNOT gate.

  2. +
  3. The second approach is to take the state after the CNOT $|11\rangle-|10\rangle$ and just as I did with the CNOT I would apply $\operatorname{H}$ gate only on the first qubit which is $|1\rangle-|1\rangle$, right? (Could be there is some coefficient there like $\frac{1}{\sqrt{2}}$ but I don't care about it now). But the thing I don't understand is how do I apply $\operatorname{H}$ gate on $|1\rangle-|1\rangle$? It isn't even clear to me what it means. Doesn't $|1\rangle-|1\rangle$ equal nothing? I mean, it isn't even a state, no?

  4. +
+ +

Anyways it is strange, the first approach would yead a vector like $(-1,1,1,-1)$ I am not sure what it means. But it looks like I can never get such a state in the second approach, simply because I can't get more than two states combined because the Hadamard is acting only on the first qubit while the second qubit should remain unchanged. But mainly I am not sure what's $|1\rangle-|1\rangle$?

+",5742,,26,,3/30/2019 7:51,9/26/2021 3:05,What is the meaning of the state $|1\rangle-|1\rangle$?,,2,3,,,,CC BY-SA 4.0 +5531,2,,5530,2/20/2019 21:38,,12,,"
+

The second approach is to take the state after the CNOT $|11\rangle-|10\rangle$ and just as I did with the CNOT I would apply $\operatorname{H}$ gate only on the first qubit which is $|1\rangle-|1\rangle$, right?

+
+ +

The state of the first qubit is not $|1\rangle-|1\rangle$. It is simply $|1\rangle$.

+ +

The tensor product follows a distributive law. See this for a proof.

+ +

In your case, the composite state of two qubits (let's call them $A$ and $B$) is $|10\rangle-|11\rangle$. It may be more explicitly written as $$|1\rangle_A\otimes |0\rangle_B - |1\rangle_A \otimes|1\rangle_B$$ +$$=|1\rangle_A\otimes (|0\rangle_B - |1\rangle_B).$$ +This follows from the distributive law I linked. From here it should be clear that the state of the first qubit A is $|1\rangle_A$ and not $|1\rangle_A - |1\rangle_A$. And the state of the second qubit B is $|0\rangle_B-|1\rangle_B$. Can you take it from here?

+",26,,26,,2/20/2019 22:04,2/20/2019 22:04,,,,1,,,,CC BY-SA 4.0 +5532,1,,,2/21/2019 6:24,,2,1758,"

I just got started with Qiskit. When I tried to save my account with the API token from IBMQ website, I got the error: warnings.warn('Credentials already present. Set overwrite=True to overwrite.'). Then I set overwrite = True but the warning was still raised and I cannot save the account and connect to the server.

+",5859,,26,,3/12/2019 9:13,7/4/2020 12:46,Cannot load account with Qiskit,,2,1,,,,CC BY-SA 4.0 +5533,2,,5532,2/21/2019 10:31,,1,,"

Here's some general info, which will hopefully help you find and fix your issue.

+ +

You can try using

+ +
print(IBMQ.stored_accounts())
+
+ +

to see what accounts you have stored on disk, and maybe see why they aren't working.

+ +

To simultaneously sign into all accounts on this list, use

+ +
IBMQ.load_accounts()
+
+ +

To only sign into the first, use

+ +
token = IBMQ.stored_accounts()[0]['token']
+url = IBMQ.stored_accounts()[0]['url']
+IBMQ.enable_account(token,url)
+
+ +

To only sign into the second, replace the [0] above with [1], and so on.

+ +

To see which accounts you are currently logged into, use

+ +
print(IBMQ.active_accounts())
+
+ +

If you want to start afresh by removing all accounts from disk, use

+ +
IBMQ.delete_accounts()
+
+ +

Adding new accounts is then done with

+ +
IBMQ.save_account(token,url)
+
+ +

Where token is a string that represents your API token, and

+ +
url = 'https://quantumexperience.ng.bluemix.net/api'
+
+ +

for those using the public level access.

+",409,,,,,2/21/2019 10:31,,,,0,,,,CC BY-SA 4.0 +5534,1,,,2/21/2019 13:37,,1,226,"

For example in grover search algorithm, +assuming that the amplified amplitude is $\alpha$ , is it possible to perform this operation :

+ +

$\alpha |0...\rangle + \beta |1...\rangle \longmapsto \beta|0...\rangle + \alpha|1...\rangle$

+ +

It seems that the operation may be reversible

+ +

Is it possible to apply inverse : $\frac{1}{\alpha},\frac{1}{\beta}$ then how normalize to get the sum of probabilities to 1?

+",5862,,5862,,2/25/2019 9:05,2/25/2019 16:05,Is there a way to reverse the amplitudes of a quantum system?,,2,4,,,,CC BY-SA 4.0 +5535,2,,5534,2/21/2019 14:19,,4,,"

The reversing of the amplitudes is a pretty easy operation by using the Pauli $X$ operator. The result of applying such operation to a qubit $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$ is:

+ +

$X|\psi\rangle=X(\alpha|0\rangle + \beta|1\rangle)=\alpha X|0\rangle + \beta X|1\rangle=\alpha|1\rangle+\beta|0\rangle=\beta|0\rangle+\alpha|1\rangle$,

+ +

and so it performs the amplitude swap you are looking for, and that is why this operation receives the name of bit flip as it flips the bits of the state. If you want to apply an operation like that to a multiple qubit state, that is what I think you are asking for, as it would for example be $|\psi\rangle=\alpha|0010\rangle+\beta|0111\rangle$ then you should apply $X$ gates to the qubits you need to change so that the resultant state is what you are looking for. For the example I gave, it would be

+ +

$(I\otimes X\otimes I\otimes X)|\psi\rangle = (I\otimes X\otimes I\otimes X) (\alpha|0010\rangle+\beta|0111\rangle) =\alpha(I|0\rangle X|0\rangle I|1\rangle X|0\rangle)+\beta(I|0\rangle X|1\rangle I|1\rangle X|1\rangle)=\alpha|0111\rangle+\beta|0010\rangle = \beta|0010\rangle+\alpha|0111\rangle$

+ +

and the swapped amplitude state that you are looking for is obtained.

+",2371,,,,,2/21/2019 14:19,,,,0,,,,CC BY-SA 4.0 +5536,2,,5504,2/21/2019 15:40,,6,,"

A QFT can't arbitrarily raise the probability of any state you want to any value you want. Once you create a superposition, you need to find some way to make destructive interference occur between the states you don't want, and construct interference between the states you do want. Finding ways to do this is essentially the entire field of quantum algorithms.

+ +

If you don't find some way to use the structure of a specific problem, the best you can do is Grover's algorithm. For factoring, Grover's algorithm would run in time $O(N^{1/4})$ (for a number $N$) which is worse than the classical number field sieve! So you can use a superposition of factors, but a) you don't really need the QFT, and b) it's not efficient.

+ +

The QFT is well-suited to period finding for abelian groups because the phases it produces, $\{e^{2\pi i j/N}\}_{j=0}^{N-1}$, are themselves an abelian group. There is a perspective where the QFT is seen as an application of representation theory, transforming elements of a group into their representations. This is where I recommend you look if you want a deep understanding on why the QFT works well. Otherwise, I would just say that period-finding for abelian groups simply happens to be a problem for which it is relatively easy to create the necessary interference, and a QFT is an important component of that process.

+",4517,,,,,2/21/2019 15:40,,,,0,,,,CC BY-SA 4.0 +5537,2,,5454,2/22/2019 9:09,,10,,"

Asymptotically, Shor's algorithm is really efficient. Basically it's just: superposition, modular exponentiation (the slowest step), and a fourier transform. Modular exponentiation is what you do to actually use the RSA cryptosystem. That means to a quantum computer, encrypting/decrypting RSA legitimately would be about the same speed as using Shor's algorithm to break the system. So I'm skeptical that there will be any improvements on the basic idea.

+ +

That said, any improvement to integer addition, integer multiplication, or the quantum fourier transform would improve Shor's algorithm, and those are all very general subroutines that people will almost certainly work on. A short search on Google Scholar shows lots of research on improving quantum arithmetic circuits.

+ +

I think there will be more research on classical/quantum trade-offs in Shor's algorithm. That is, if you have a small or noisy quantum computer, can you modify Shor's algorithm so that it still works, but maybe needs a lot more pre- and post-processing on a classical computer, or maybe has a lower probability of success, etc.? In this area there's Quantum Algorithms for Computing Short Discrete Logarithms and Factoring RSA Integers. There's also the Quantum Number Field Sieve, an approach where a ""small"" quantum computer (too small to use Shor's algorithm directly) is used as a subroutine of the classical number field sieve, slightly improving the time complexity (though I am personally convinced that error correction for this will require more physical qubits than vanilla Shor's algorithm).

+ +

In short, I don't expect any radical new quantum factoring algorithms and I don't think anyone's working on it. But there are a lot of interesting tweaks to be made to fit specific use cases.

+",4517,,,,,2/22/2019 9:09,,,,1,,,,CC BY-SA 4.0 +5539,1,,,2/22/2019 11:59,,1,191,"

I know how polarization filters work using EM waves. Can somebody help me in understanding how they work using photons?

+",5410,,5410,,2/25/2019 14:04,2/28/2019 1:18,How to explain polarization using photon spin?,,1,2,,,,CC BY-SA 4.0 +5541,2,,5454,2/22/2019 17:23,,2,,"

As addition to the answer of Sam:

+ +

No, partly because Shor's approach is not the only way of factorizing numbers.

+ +

Factorization can also be written as an optimization problem.

+ +

This can be solved using the D-Wave machine, but also using a gate-based quantum computer.

+",2005,,,,,2/22/2019 17:23,,,,0,,,,CC BY-SA 4.0 +5542,1,,,2/22/2019 19:42,,5,981,"

I want to make my quantum machine learning algorithms. As far as I understand I must learn: basics of quantum physics, quantum computing (and algorithms), classical machine learning, quantum information; anything else?

+ +

And from where would you advise me to start studying?

+ +

Do I really need to learn quantum computing or do you have some books or helpful sources?

+ +

I will be very grateful!

+",5876,,26,,2/22/2019 20:01,2/22/2019 22:46,How to study quantum machine learning?,,1,3,,,,CC BY-SA 4.0 +5543,2,,5542,2/22/2019 22:46,,4,,"

There are different review overviews about Quantum Machine Learning (see the question referenced in comments to find a few) but it is an evolving field so you will have to keep updated. There is also an EDX online course about the subject made by Wittek recently released if you would like a little more hands-on format.

+ +

I would advise to start with basics of quantum computing (like the basic linear algebra, notions of measurement...), check in parallel classical Machine Learning and cross-ref with what quantum versions of ML algorithms have been proposed so far.

+",4127,,,,,2/22/2019 22:46,,,,3,,,,CC BY-SA 4.0 +5544,2,,4720,2/23/2019 7:04,,2,,"

If two qubits are in state $|\psi_1\rangle$ and $|\psi_2\rangle$ then the combined quantum state of the two qubits is already in the state $|\psi_1\rangle \otimes |\psi_2\rangle$, without requiring any gates. We would need to calculate the tensor product classically. If one wants to measure (by sampling) $n$ qubits, there are two ways of doing it.

+ +
    +
  1. Measure each qubit say $M$ times and sample the qubit as $|\psi_i\rangle = \alpha_i|0\rangle + \beta_i|1\rangle$, for $i=1,2,\dots n$. Hence, to obtain the quantum state of all the qubits we require $n\cdot M$ measurements. And to obtain the composite quantum state of the $n$ qubits, we need to carry out the tensor product $|\psi_1\rangle \otimes |\psi_2\rangle \otimes |\psi_3\rangle \dots |\psi_n\rangle$, ourselves.

  2. +
  3. Measure all qubits simultaneously and after each measurement we would get a state $a_k |k\rangle$, where $k=0,1,2,\dots 2^n - 1$ (the decimal format of the orthogonal basis vectors with $n$ qubits) and $\sum_k a_k^2 = 1$. However, to sample the complete quantum state we would need some $2^n\cdot M$ measurements ($M$ being some large number).

  4. +
+ +

As you can see, with only $n\cdot M$ measurements we get the independent quantum state of each qubit (without the tensor product of the qubit states). But with $2^n \cdot M$ measurements we get the complete quantum state of $n$ qubits (tensor producted for us).

+",4954,,4954,,2/24/2019 7:49,2/24/2019 7:49,,,,0,,,,CC BY-SA 4.0 +5545,1,5550,,2/24/2019 14:56,,4,180,"

Measuring is clearly not the answer here. Is there some trick to prove it is $|1\rangle$ state?

+",5887,,26,,3/30/2019 7:57,3/30/2019 7:57,"If a qubit is in $|1\rangle$ state, is it possible to prove that it is in $|1\rangle$ state?",,2,2,,,,CC BY-SA 4.0 +5547,1,,,2/24/2019 21:26,,2,373,"

I don't understand something which is I believe pretty fundamental. It's said that an operation represented by a matrix A is an entanglement if A can't be written as a tensor product of other matrices. On the other hand, I just learned lately that a vector state too can be determined by these criteria. That is, it's entangled if and only if it can't be written as a tensor product of other vector states.

+ +

Here comes the confusion. Suppose you take a CNOT for example. This obviously can't be written as a tensor product of other matrices as it's known to be entangled. What're the consequences of applying a CNOT on a vector? I don't understand it, if you take a vector like (1,0,0,0) or (0,0,10) you will get after CNOT (1,0,0,0) or (0,0,0,1) respectively. Which obviously can be written as the tensor product of other vectors. So what's going on here? Is CNOT supposed to entangle the vector state or not?

+ +

Why is it that the gate itself can't be decomposed but the vector which it acted upon can? Or if it isn't necessary then, what's the definition or requirements for entanglement which I am missing?

+",5742,,26,,2/24/2019 22:06,2/26/2019 4:34,The relationship between entanglement of vector states to matrix operations,,2,0,,,,CC BY-SA 4.0 +5548,2,,5547,2/24/2019 21:50,,4,,"

There are 3 different questions you need to ask yourself. First is the operator a tensor product of smaller matrices. Then is your input state a tensor product of smaller vectors. Finally is the result a tensor product of smaller vectors.

+ +

Stick with the two qubit example and CNOT that you had.

+ +

First question: CNOT is not able to be written as $A \otimes B$ with $A$ and $B$ operating on 1 qubit each. +Second question: The examples you gave were $(1,0,0,0)=|0 0 \rangle$ which can be broken up as $|0 \rangle \otimes |0 \rangle$. The other example can as well. It is $|1 \rangle \otimes |0 \rangle$. +Third question: The result states were $(1,0,0,0)$ which was not entangled again. The other was $(0,0,0,1)$ which is $|1 \rangle \otimes |1 \rangle$ also not entangled.

+ +

The implication goes differently than you seem to think.

+ +

If the operator was not entangled and written as $A \otimes B$ and the input state was not entangled and written as $v \otimes w$ with the same dimensions as the operator, then you would get $Av \otimes Bw$ as the output. So not entangled operator AND not entangled input vector with the same dimensionality imply not entangled on the output.

+ +

So the example shows if you only have operator entangled but input not, the output can still be not entangled.

+ +

As another example, take the identity operator. It can be written as $I \otimes I$ so it is not entangled. Apply it to an entangled input, you get the same state out. That gives the case of unentangled operator and entangled input giving entangled output.

+ +

Edit to respond to comment:

+ +

CNOT applied to $(H \mid 0 \rangle) \otimes \mid 0 \rangle$ gives $\frac{1}{\sqrt{2}} \mid 0 \rangle \otimes \mid 0 \rangle + \frac{1}{\sqrt{2}} \mid 1 \rangle \otimes \mid 1 \rangle$. So the initial state is not entangled, but the output state is a Bell state.

+",434,,434,,2/26/2019 4:34,2/26/2019 4:34,,,,1,,,,CC BY-SA 4.0 +5549,1,5553,,2/24/2019 23:53,,2,131,"

Besides the 'continuous' which I don't fully understand the term. It's all the time said that arbitrary gates can only be estimated but not necessarily be accurate. I don't understand the claim. So what if it's continuous? So do I have, uncountable many points on the Bloch sphere and I could certainly get from one to any other point using just two rotation gates.

+ +

So my question is basically, simply why aren't two rotation matrices enough not just to approximate but even to accurately calculate any arbitrary transformation so they could be described as a 'universal set' (If you need control you can add CNOT but that's it!). I mean, all you gotta do is playing around with the rotations so you switch a vector state on the surface sphere from one to another. That's enough, why not?

+ +

(I know there you may be required to use CNOT for some control qubits, but we usually define the universal set to be a bigger one, why? And why we just approximate and don't get exact or arbitrarily close to the answer?)

+",5742,,26,,2/25/2019 4:23,2/25/2019 10:25,What's the point of quantum gates being 'continuous'?,,1,3,,,,CC BY-SA 4.0 +5550,2,,5545,2/25/2019 6:26,,5,,"

No, no trick. You can’t prove it.

+ +

One way to think about this is what if you had either the 1 state, or something that is arbitrarily close to the 1 state with a tiny amount of 0. You’re essentially asking if it’s possible to perfectly distinguish them. But if you could, you could copy them, and you’d have perfect cloning of a pair of non-orthogonal states, and that’s impossible.

+",1837,,,,,2/25/2019 6:26,,,,0,,,,CC BY-SA 4.0 +5551,2,,5547,2/25/2019 6:32,,7,,"

We don’t use the terminology in the way you’re trying to use it.

+ +

Entanglement is a property of states. For pure states shared between two parties, if they can be written in the form +$$ +|\psi\rangle\otimes|\phi\rangle, +$$ +they are separable. If they are not separable, they are entangled. Something like cnot is said to be “an entangling operation” meaning that when it acts on some separable states (but not an arbitrary separable state), it can produce an entangled state vector. We only say that something is entangled in reference to the state vector.

+ +

For example, as you say cnot acting on a state such as $|11\rangle$ simply produces $|10\rangle$, and no entanglement is produced. But, cnot acting on $(|0\rangle+|1\rangle)\otimes|1\rangle$ produces $|01\rangle+|10\rangle$, which is entangled. Hence, cnot is capable of turning a separable state into an entangled state, so it is entangling.

+ +

I should also mention that a matrix not being of the form $A\otimes B$ is necessary for it to be entangling but not sufficient. There are operations not of this form which are not entangling, such as swap.

+",1837,,1837,,2/25/2019 10:32,2/25/2019 10:32,,,,11,,,,CC BY-SA 4.0 +5552,2,,5545,2/25/2019 6:41,,3,,"

I assume that you mean to say that initially we are not aware of the quantum state of the qubit. The answer to your question is then, No.

+ +

Say, the qubit was in some state $\alpha |0\rangle + \beta |1\rangle$. Now, if by any way we are able to prove that $\alpha =0$ (or $\beta =0$, for that matter), with a single shot experiment, then in a sense we are able to 'know' the quantum state of the qubit and hence we can clone it. This is impossible.

+",4954,,4954,,2/25/2019 6:49,2/25/2019 6:49,,,,0,,,,CC BY-SA 4.0 +5553,2,,5549,2/25/2019 10:25,,2,,"

It's not clear what the exact question is, but here is how I interpret it

+ +
+

States can be represented on the Bloch sphere, and unitary gates correspond to rotations in the Bloch sphere. Two rotations are enough to move from any point of a sphere to another point. So why is it not enough to consider two fixed gates instead of the whole continuous set of gates?

+
+ +

First of all, while it is true that ""two rotations"" with appropriate angles are enough to send a point to any other point on the sphere, even in this case you are still using a continuous set of rotation matrices to do it. Given a pair of initial and final points on the sphere, you can find two specific rotation matrices that send one into the other. Given an initial state, you will then need a continuum of rotation matrices to send that point to all other possible points on the sphere, as every output point will correspond to different rotation angles (even though the rotation axes might be fixed).

+ +

So more precisely, given an initial state, you need a (continuous) family of rotations of the form $\{R_{\boldsymbol v}(\alpha)R_{\boldsymbol w}(\beta)\}_{\alpha,\beta\in\mathbb R}$ to describe all possibilities.

+ +

This said, you don't want to describe how a specific initial state evolves, but rather how an operation acts on each possible input. In other words, a gate is characterised by the way it transforms the whole Bloch sphere, not just one point on it. As it turns out, in this case you need three consecutive rotations to describe arbitrary rotations.

+",55,,,,,2/25/2019 10:25,,,,2,,,,CC BY-SA 4.0 +5555,2,,5534,2/25/2019 16:05,,2,,"

As I understand the question, you're asking if it's possible to produce a transform that looks something like +$$ +\alpha|000\rangle+\beta|010\rangle+\gamma|011\rangle\mapsto\frac{1}{\alpha}|000\rangle+\frac{1}{\beta}|010\rangle+\frac{1}{\gamma}|011\rangle +$$ +up to normalisation.

+ +

Without further knowledge, this is impossible. To see this, consider the problem where I give you either +$$ +|0\rangle\qquad\text{or}\qquad \sqrt{1-\epsilon^2}|0\rangle+\epsilon|1\rangle, +$$ +where $\epsilon$ is small. You don't know which I've given you, but you're tasked with transforming these two into +$$ +|0\rangle\qquad\text{or}\qquad\sqrt{1-\epsilon^2}|1\rangle+\epsilon|0\rangle +$$ +respectively. +In the case of small $\epsilon$, after the transformation you are almost guaranteed to be able to distinguish between which of the two you were given, which you certainly shouldn't be able to do given the starting position of two practically indistinguishable states. (This violates no-cloning bounds, and similar.)

+ +
+ +

However, your question mentioned that your state was the output of a Grover Search. In that specific context, you surely can. This is because Grover's Search lets you explore a particular space of the form +$$ +\cos\theta|\psi_g\rangle+\sin\theta|\psi_b\rangle. +$$ +So, at a particular point in the algorithm you've produced $M$ terms (the $M$ items you're searching for) with amplitudes $\cos\theta_0/\sqrt{M}$, and another $N-M$ with amplitudes $\sin\theta_0/\sqrt{N-M}$. You just have to find a value of $\theta_1$ such that +$$ +\cos\theta_1=\frac{\tan\theta_0}{\sqrt{\tan^2\theta_0+(N/M-1)^2}} +$$ +assuming you know $N,M,\theta_0$. Then you just use your Grover Search to produce that (or, at least, a good approximation. The larger $N$, the better the approximation you can make.). Since the ""bad"" states now have greater amplitudes, this presumably takes less time than the search itself.

+",1837,,,,,2/25/2019 16:05,,,,0,,,,CC BY-SA 4.0 +5557,1,5571,,2/25/2019 23:08,,3,161,"

My Quantum circuit contains ""Wait"" Gate. When I try to execute it (qasm_simulator or unitary-simulator), it throws an error . NotImplementedError: ('No decomposition rules defined for ', 'wait').

+ +

Question +1.How to resolve the error? +2.What is the unit of t specified in ""wait"" gate arguments?

+ +

Dev Env

+ +

Anaconda (python 3.6) +qiskit 0.7.3 +qiskit-aer 0.1.1 +qiskit-terra 0.7.0

+ +

OS +Mac v10.14

+ +

Qiskit installation by pip install qiskit

+ +

Minimal Example

+ + + +
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
+from qiskit.extensions.standard import RXGate, RYGate, RZGate, U3Gate
+from qiskit.extensions.simulator import wait
+
+
+from qiskit import execute, BasicAer, Aer
+
+qubit = QuantumRegister(1, 'qubit')
+circuit = QuantumCircuit(qubit)
+
+circuit.x(qubit)
+circuit.wait(1e-6, qubit)
+circuit.rx(3.1416, qubit)
+
+backend = Aer.get_backend('statevector_simulator')
+job = execute(circuit, backend)
+result = job.result()
+outputstate = result.get_statevector(circuit, decimals=3)
+print(outputstate)
+
+ +

If I comment the line circuit.wait(...) it runs fine. I tried the qasm_simulator with counts/measurements (same error)

+",5900,,5900,,2/27/2019 0:10,2/27/2019 22:08,"""Wait"" gate throws an error ""NotImplementedError: ('No decomposition rules defined for ', 'wait')""",,1,2,,,,CC BY-SA 4.0 +5559,2,,5480,2/26/2019 8:24,,1,,"

The control qubits are only added to the command after it is received by the ControlEngine further down the chain after the MainEngine. For implementation details see ""3.2.1 Implementation of meta instructions"" here.

+ +

To implement a testing engine such as this one, that can be used to check that indeed control qubits are added right after the MainEngine, you could do the following:

+ + + +
test_eng = Testing(BasicEngine) # Or CommandPrinter
+eng = projectq.MainEngine(engine_list=[test_eng])
+
+",5791,,,,,2/26/2019 8:24,,,,0,,,,CC BY-SA 4.0 +5560,1,,,2/26/2019 13:57,,1,98,"

As part of a course, I've been asked to write a map $C\rightarrow H,z \rightarrow zv$ for $v \in H=C^3\otimes C^2$, $v=[1, 0, 0, 1, 0, 1]$ in bra-ket notation.

+ +

However, I never written such a map before, and must have missed the lecture. I would very much appreciate if someone show me some example of how to write this kind of thing.

+",5893,,55,,9/10/2019 15:44,9/10/2019 15:44,How to write the map $\mathbb C\ni z\mapsto zv$ in bra-ket notation?,,1,1,,,,CC BY-SA 4.0 +5561,2,,5539,2/27/2019 2:04,,1,,"

A photon can be thought of as a tiny piece of a circularly polarized wave.

+ +

In this sense, all polarization states of EM waves are a superposition of photons, each with a circular (left or right) polarization. Linearly polarized light could then be constructed as a pair of photons with left and right polarization (or spin). Maybe your question is whether the Jones matrix for a linear polarizer can be represented as a spin operator?

+ +

I hope this is what you where asking.

+",5912,,5912,,2/28/2019 1:18,2/28/2019 1:18,,,,2,,,,CC BY-SA 4.0 +5562,1,5563,,2/27/2019 7:02,,2,658,"

I've been beating my head against this problem for three days now and I just can't seem to crack it. To construct an N-qubit controlled Unitary gate, I can do something like this (note I'm using Qiskit syntax here):

+ +
q_upper = QuantumRegister(n - 1)
+q_lower = QuantumRegister(1)
+q_out = QuantumRegister(1)
+circ = QuantumCircuit(q_upper, q_lower, q_out)
+
+# Setup u on the output line: |((1 << (n - 1)) - 1) 01> * u/2, |n0 11> * u/2, |((1 << n) - 1) 1> * u
+circ.cnv(q_upper, q_out)
+circ.cv(q_lower, q_out)
+
+# Cancel out the terms that aren't all ones
+circ.cnx(q_upper, q_lower)
+circ.vdg(q_lower, q_out)
+circ.cnx(q_upper, q_lower)
+
+ +

This circuit requires a little explanation. Here, I'm attempting to build an n-qubit u-gate using an (n-1)-qubit controlled v-gate (which will be half the rotation of u) and a a controlled v-gate. Then I use an (n-1)-qubit controlled x-gate in conjunction with another controlled v-gate to cancel out the terms that aren't all one.

+ +

As an example of the implementation, consider the Controlled-S (CS) gate:

+ +
q_lower = QuantumRegister(1)
+q_out = QuantumRegister(1)
+circ = QuantumCircuit(q_lower, q_out)
+
+# Add a pi/2 rotation for 11, pi/4 for 01 and 10
+circ.t(q_lower)
+circ.t(q_out)
+
+# Cancel out the pi/4 for 01 and 10
+circ.cx(q_lower, q_out)
+circ.tdg(q_out)
+circ.cx(q_lower, q_out)
+
+ +

I can expand on this to produce a Toffoli-S (CCS) gate:

+ +
q_upper = QuantumRegister(1)
+q_lower = QuantumRegister(1)
+q_out = QuantumRegister(1)
+circ = QuantumCircuit(q_upper, q_lower, q_out)
+
+# Construct a pi/2 rotation for 111 and pi/4 rotations for 011 and 101
+circ.cu1(pi / 4, q_upper, q_out)
+circ.cu1(pi / 4, q_lower, q_out)
+
+# Cancel out the pi/4 rotations on 011 and 101
+circ.cx(q_upper, q_lower)
+circ.cu1(pi / -4, q_lower, q_out)
+circ.cx(q_upper, q_lower)
+
+ +

I can expand it again to produce a CCCS gate:

+ +
q_upper = QuantumRegister(2)
+q_lower = QuantumRegister(1)
+q_out = QuantumRegister(1)
+circ = QuantumCircuit(q_upper, q_lower, q_out)
+
+# Construct a pi/2 rotation for 1111 and pi/4 rotations for 1101 and 0011
+circ.ccu1(pi / 4, q_upper[0], q_upper[1], q_out[0])
+circ.cu1(pi / 4, q_lower, q_out)
+
+# Cancel out the pi/4 rotations for 1101 and 0011
+circ.ccx(q_upper[0], q_upper[1], q_lower[0])
+circ.cu1(pi / -4, q_lower, q_out)
+circ.ccx(q_upper[0], q_upper[1], q_lower[0])
+
+ +

Now, this circuit presents a problem: there is no ccu1 gate. Now, I could construct one that looks like this:

+ +
circ.cu1(pi / 8, q_upper[0], q_out)
+circ.cu1(pi / 8, q_upper[1], q_out)
+circ.cx(q_upper[0], q_upper[1])
+circ.cu1(pi / -8, q_upper[1], q_out)
+circ.cx(q_upper[0], q_upper[1])
+
+ +

But this means that an N-qubit Controlled-S gate would require an (N-1)-qubit Controlled-T gate which would require an (N-2)-qubit Controlled pi / 8 gate and so on and so forth, resulting in increasingly small rotations. Given the current state of quantum hardware (and probably the future of quantum hardware), this implementation doesn't seem practical but I haven't been able to find a better one.

+ +

Could anyone suggest a way to break this recursion at either the S-gate or T-gate level or will I have to just deal with the recursion?

+",5472,,26,,3/12/2019 9:13,3/12/2019 9:13,Building an N-qubit Controlled S Gate,,1,0,,,,CC BY-SA 4.0 +5563,2,,5562,2/27/2019 7:42,,4,,"

The angles getting smaller is not a problem. The actual problem is that you are generating a ton of gates. To produce one gate with N controls, you're recursing on the producing of 3 gates with N-1 controls. Follow the logic to the end, and you'll see that you end up with $3^N$ gates!

+ +

It is possible to reduce the number of gates from exponential to linear. In the ideal case, you have $N$ ancillae available and can use Toffoli gates to compute the AND of your control qubits. You apply the S gate to the qubit storing the AND, then uncompute.

+ +

+ +

If you don't have any workspace, it gets a lot more complicated. You have to do stuff like this:

+ +

+ +

and this

+ +

+",119,,,,,2/27/2019 7:42,,,,1,,,,CC BY-SA 4.0 +5564,1,5565,,2/27/2019 9:23,,4,147,"

The state +$$ \frac{1}{2}\left(| \phi^+ \rangle \langle \phi^+ | + | \psi^+ \rangle \langle \psi^+ | \right) $$

+ +

where +$$ | \phi^+ \rangle = \frac{1}{\sqrt2} \left(|00 \rangle + | 11 \rangle \right) $$ +$$ | \psi^+ \rangle = \frac{1}{\sqrt2} \left(|01 \rangle + | 10 \rangle \right) $$

+ +

By PPT criteria, we know this is a separable state. If I wanted to find what is the mixture of separable states that form this, how would I go about it?

+",2832,,55,,10/15/2021 16:35,10/15/2021 16:35,How to find a separable decomposition for $|\Psi^+\rangle\!\langle\Psi^+|+|\Phi^+\rangle\!\langle\Phi^+|$?,,1,0,,,,CC BY-SA 4.0 +5565,2,,5564,2/27/2019 9:30,,3,,"

I would start by writing this as a matrix, and recognising how it can be written in terms of Pauli matrices: +$$ +\frac14\left(\begin{array}{cccc} 1 & 0 & 0 & 1 \\ 0 & 1 & 1 & 0 \\ 0 & 1 & 1 & 0 \\ 1 & 0 & 0 & 1 \end{array}\right)=\frac14(\mathbb{I}\otimes\mathbb{I}+X\otimes X) +$$ +From here, I don't have a completely formulaic approach for how you do it. But, in this instance, I wrote +$$ +=\frac{1}{2}\left(\frac{\mathbb{I}+X}{2}\otimes \frac{\mathbb{I}+X}{2}+\frac{\mathbb{I}-X}{2}\otimes \frac{\mathbb{I}-X}{2}\right). +$$ +Now you can see that each of the terms in the tensor product is a separable state. Specifically, +$$ +(|++\rangle\langle ++|+|--\rangle\langle --|)/2 +$$

+ +

One approach that I suppose I might have taken is to recognise the separable, diagonal basis of $X\otimes X$, and decompose $\mathbb{I}\otimes\mathbb{I}$ in the same basis: +$$ +\frac{1}{4}(|++\rangle\langle ++|+|+-\rangle\langle +-|+|-+\rangle\langle -+|+|--\rangle\langle --|)+\frac{1}{4}(|++\rangle\langle ++|-|+-\rangle\langle +-|-|-+\rangle\langle -+|+|--\rangle\langle --|), +$$ +which inevitably leads to that result.

+",1837,,1837,,2/27/2019 11:06,2/27/2019 11:06,,,,3,,,,CC BY-SA 4.0 +5566,1,5568,,2/27/2019 13:15,,4,429,"

I've seen in google cirq that a $X^q$ gate is converted in openqasm to $RX(\pi q)$, why is that?

+ +

Same for $S^q$ into $RZ(\pi q/2)$.

+",5791,,26,,2/27/2019 13:30,2/27/2019 21:47,How is $X^q$ equal to $RX(\pi q)$?,,2,1,,,,CC BY-SA 4.0 +5567,1,,,2/27/2019 16:34,,21,3725,"

I would like to know how to design a quantum circuit that given a Hermitian matrix $\hat{H}$ and time $t$, maps $|\psi\rangle$ to $e^{i\hat{H}t} |\psi\rangle$. +Thank you for your answer.

+",5569,,26,,2/28/2019 6:13,7/1/2020 17:34,Circuit construction for Hamiltonian simulation,,2,1,,,,CC BY-SA 4.0 +5568,2,,5566,2/27/2019 17:38,,2,,"

Note that +$$RX(\phi) = \begin{pmatrix} \cos(\phi/2) & -i\sin(\phi/2) \\-isin(\phi/2) & \cos(\phi/2)\end{pmatrix}$$

+ +

Then $$RX(\pi q) = \begin{pmatrix} \cos(\pi q/2) & -i\sin(\pi q/2) \\-isin(\pi q/2) & \cos(\pi q/2)\end{pmatrix}.$$

+ +

Now, using that $\cos(\pi k + \pi/2) = 0 = \sin(\pi k)$ and $\cos(\pi k) = 1 = \sin(\pi k + \pi/2)$ for $k\in \mathbb{Z}$ and that a global phase does not physically affect the quantum state, we see that for odd $q$ we get $X$ and for even $q$ we get the identity matrix.

+ +

We can prove the other equation similarly using +$$RZ(\phi) = \begin{pmatrix} e^{-\phi/2} & 0 \\ 0 & e^{\phi/2} \end{pmatrix}$$

+",2005,,,,,2/27/2019 17:38,,,,0,,,,CC BY-SA 4.0 +5569,2,,5566,2/27/2019 18:05,,4,,"

This is the matrix for $Z^t$:

+ +

$$Z^t = \begin{bmatrix} +1&0\\0&(-1)^t +\end{bmatrix} = \begin{bmatrix} +1&0\\0&e^{i \pi t} +\end{bmatrix}$$

+ +

This is the matrix for $R_Z(\pi t)$:

+ +

$$R_Z(\pi t) = e^{-iZt/2} = \begin{bmatrix} +e^{-i \pi t / 2}&0\\0&e^{+i \pi t / 2} +\end{bmatrix} = e^{-i \pi t/2} Z^t +$$

+ +

Which means that

+ +

$$Z^t \equiv R_Z(\pi t) \pmod{\text{global phase}}$$

+ +

Qiskit doesn't have a concept like $Z^t$, but it does have $R_Z$, so Cirq relies on this equality-up-to-global-phase and converts from one to the other when producing QASM. The exact same situation repeats with powers of $X$ and $Y$.

+",119,,119,,2/27/2019 21:47,2/27/2019 21:47,,,,4,,,,CC BY-SA 4.0 +5570,1,5572,,2/27/2019 20:10,,4,730,"

I was recently reading through the tutorial on the Cirq documentation about creating variational quantum algorithms, and I came to the section on ansatz preparation. The way that the ansatz is constructed in the tutorial is:

+ +
    +
  1. Apply an XPowGate for the same parameter for all qubits. This is the method we have written above.
  2. +
  3. Apply a ZPowGate for the same parameter for all qubits where the transverse field term h is +1.
  4. +
  5. Apply a CZPowGate for the same parameter between all qubits where the coupling field term J is +1. If the field is -1 apply CZPowGate conjugated by X gates on all qubits.
  6. +
+ +

Now, I know that there is no single, consistent way to construct an ansatz, but I was wondering, how exactly was this ansatz arrived at, and how do we know that it is correct? The reason I ask this is because I was curious, and I changed the ZPow gate to an XPow gate, and got radically different results for the minimized energy.

+",4907,,,,,4/14/2019 19:26,Creating an ansatz for variational quantum algorithms?,,1,0,0,,,CC BY-SA 4.0 +5571,2,,5557,2/27/2019 22:08,,1,,"

The wait command has now been deprecated, which is probably why it's causing you problems.

+ +

Instead you can use the identity gate iden. You should also use barriers either side so that the compiler doesn't remove it.

+ +
circuit.x(qubit)
+circuit.barrier(qubit)
+circuit.iden(qubit)
+circuit.barrier(qubit)
+circuit.rx(3.1416, qubit)
+
+ +

This causes a delay for a the same time as a single u2 gate, which is the time needed for a single $\pi/2$-pulse (see here).

+",409,,,,,2/27/2019 22:08,,,,1,,,,CC BY-SA 4.0 +5572,2,,5570,2/28/2019 1:44,,7,,"

Take a look again at the Hamiltonian, which is +$$ +H = \sum_{\langle i, j \rangle} J_{i j} Z_i Z_j + \sum_{i} h_i Z_i +$$ +Then notice that ZPowGate is generated by the the Pauli Z operator, and CZPowGate is equivalent to an operator generated by $Z \otimes Z$ up to single-qubit rotations. The idea is that Step 2 of the ansatz corresponds to applying a pulse generated by the term on the right-hand side, and Step 3 corresponds to applying a pulse generated by the term on the left-hand side. Applying pulse sequences generated by terms of the Hamiltonian of interest is a common motivation for ansatz choice (see here, here, or here for papers that use this principle).

+ +

Step 1 of the ansatz is included as a gate generated by a term which does not commute with the other terms. Without such a gate, multiple steps of the ansatz could just be collapsed together and the ansatz would not be very interesting.

+ +

An alternative view of why it makes sense to include Step 1, and this kind of ansatz more generally, is explained in Section VI of the QAOA paper. The idea is motivated by quantum computation by adiabatic evolution. In such a computation, one prepares the ground state of an easy Hamiltonian, which in this case would be +$$ +B = \sum_{i} X_i +$$ +and evolve under the time-dependent Hamiltonian +$$ +G(t) = (1 - \frac{t}{T} B) + \frac{t}{T} H +$$ +for some total evolution time $T$. It turns out that a large enough evolution time $T$ will guarantee that the system ends up in the ground state of $H$. If you discretize this time evolution, you will get a bunch of time-steps which are like the ansatz: each time step has a gate generated by X on each qubit, and then gates generated by terms of the Hamiltonian. The idea then is to fix the number of time steps and then take the angles of the individual gates to be variational parameters. For a large enough number of ansatz steps, there will certainly be some choice of angles that gives the ground state, but the hope is that a small number of ansatz steps will suffice.

+",5919,,5919,,2/28/2019 1:54,2/28/2019 1:54,,,,4,,,,CC BY-SA 4.0 +5573,1,5575,,2/28/2019 2:26,,2,214,"

One of the postulates of QC is, that measurements in every circuit can be postponed or never performed in a circuit while achieving the same functionality of the circuit (at least this the way I understand it). +Given this, why does Alice have to do any measurement at all? Isn't a much better / simpler circuit is, not sending any classical / quantum information to Bob at all and nevertheless Bob can achieve the original vector state.

+ +

What's the point at all of sending any classical bits? +I mean, imagine today I show you an option that we can communicate with other without a need of sending anything at all (provided we got some prior entangled qubit), just by working remotely, isn't it much better? Than requiring the transformation of either qubits or bits.

+",5742,,26,,2/28/2019 5:39,2/28/2019 19:27,Why is measurement needed in teleportation?,,2,1,,,,CC BY-SA 4.0 +5574,1,5584,,2/28/2019 3:34,,3,1859,"

The Bloch sphere isn't so intuitive for me. But I am not sure how you are supposed to manipulate it using vectors and matrices.

+ +

How do you actually represent a vector on it? Is it +$(\cos(a) , e^i\sin(b))$, $(\alpha, \theta)$ or $(1,0)$ +In which format do we work with?

+ +

On one hand why we would use $(\cos(a), e^i\sin(b))$ if we can simply use $(\alpha, \theta)$ which covers the whole sphere. So what do we use? I saw $(\cos(a), e^i\sin(b))$ mentioned but I don't understand then, why do we all the time manipulate vectors like $|1\rangle, |0\rangle$? Is the idea that $|1\rangle$, for example, is just $\cos a$? But what is then the basis? $|1\rangle$, $|0\rangle$ or $(\cos(a) , e^i\sin(b))$? What do we manipulate using gates and matrices?

+ +

I also don't understand how do $|1\rangle$, $|0\rangle$ or $(\cos(a), e^i\sin(b))$ go together physically in the Bloch sphere itself. I mean, what does $|0\rangle$ mean? Is it really the vector vertical with $z=1$? Then how would that be represented by $(\cos(a) , e^i\sin(b))$? What would the angle values be for $|0\rangle$, $|1\rangle $? I guess a is zero and the $b$ is free.

+ +

The third question is, using the rotational matrices, I understand them only if we use vectors like $(1,0), (0,1)$ and the like because then it's easy to see how $R_z$ is simply a rotation acting on both $|0\rangle$, $|1\rangle$, $R_y$ is the regular two dimensional rotation, and $R_x$ is simply a rotation like the previous one but also taking into account imaginary of $Y$. But if we use something like $(\cos(a), e^i\sin(b))$ or +$(\alpha, \theta)$ as vectors, I wasn't able to see how $R_x$ or $R_y$ rotate. Maybe the claim is, that $1,0$ and $0,1$ are valid basis vectors so could be used to manipulate even if we use $(\cos(a), e^i\sin(b))$ or $(\alpha, \theta)$?

+",5742,,55,,10/3/2019 14:22,10/3/2019 14:22,What's a vector in the Bloch sphere representation?,,1,0,,,,CC BY-SA 4.0 +5575,2,,5573,2/28/2019 7:12,,3,,"

To answer this, contrast quantum teleportation with the swap gate. Ignoring everything in the middle, the effect of quantum teleportation is to get from state $|\phi00\rangle$ to $|00\phi\rangle$. This can obviously be accomplished with a simple application of the swap gate. So, why do we care about quantum teleportation?

+ +

You'd never run the quantum teleportation protocol on a single quantum computer, except as an academic exercise. Quantum teleportation is a way of getting from $|\phi00\rangle$ to $|00\phi\rangle$ when the first two qbits exist on one quantum computer, and the third exists on another. Any communication between the computers is classical, and all operations are local to the qbits on that computer (except for the initial process of entangling the qbits). Given these restrictions, quantum teleportation is the simplest protocol to get from $|\phi00\rangle$ to $|00\phi\rangle$. It enables us to transmit a qbit state with perfect fidelity using just two bits of classical information.

+",4153,,4153,,2/28/2019 19:27,2/28/2019 19:27,,,,6,,,,CC BY-SA 4.0 +5576,1,5577,,2/28/2019 7:25,,3,214,"

The Bloch sphere is a mainstay of introductions to quantum computing, but what utility does it actually provide? It can't usefully represent multiple qbits because of entanglement and requires a weird transformation to map to & from a state vector. Sure it's a visual representation but I've never seen it actually assist anyone's acquisition of the material. Is it just a holdover from earlier days of the field and the reason why we'll be calling Rx/Ry/Rz with doubled theta values until the stars die out?

+",4153,,,,,2/28/2019 10:14,What utility is provided by the Bloch sphere visualization?,,1,0,,,,CC BY-SA 4.0 +5577,2,,5576,2/28/2019 10:14,,5,,"

Some people really do visualise single qubit operations by thinking about the Bloch sphere, and they work out everything based on that picture. Those who like thinking in that way are often incredibly quick at these sorts of manipulations, and have more intuitive understandings for why things work.

+ +

But here's one concrete example where I use it: averaging over single qubit states. Let's say I've implemented some quantum operation on a single qubit state, and I want to compare it to the ideal, so perhaps I calculate a fidelity. (For instance, I might be trying to implement optimal cloning.) Perhaps that fidelity varies depending on what the input state is, and so I want to calculate the average fidelity. How do I average over all possible single-qubit states? It's the same as integrating over the surface of the Bloch sphere, and that conversion helps me to get the correct volume element, with the correct factors of 2.

+ +

Of course, I could memorise that function, just as everything that can be done with the Bloch sphere can be done another way. Personally, I don't usually use the Bloch sphere, but this is the most obvious instance where I have stuck with it.

+ +

There are other topics where I believe the Bloch sphere is particularly natural. For example, in the topic of magic states - single-qubit states that when combined with Clifford operations provide universal, fault-tolerant quantum computation. There's a lovely convexity argument that eliminates a particular geometric region of the Bloch sphere from consideration, and I think various subsequent results describe regions of the Bloch sphere that either can or can't act as magic states.

+",1837,,,,,2/28/2019 10:14,,,,3,,,,CC BY-SA 4.0 +5578,2,,5573,2/28/2019 14:53,,4,,"
+

measurements in every circuit can be postponed or never performed in a circuit while achieving the same functionality of the circuit

+
+ +

That's correct. But if the circuit involves two parties, this process will introduce quantum operations between the two parties. It will require a quantum communication channel, so that the qubits can be shuttled back and forth as needed in order to perform these operations.

+ +
+

Isn't a much better / simpler circuit is, not sending any classical / quantum information to Bob at all and nevertheless Bob can achieve the original vector state.

+
+ +

You're sending information either way. Teleportation allows you to send the quantum information at leisure ahead of time (while establishing entanglement), and then in the heat of the moment when time is sensitive you can use cheaper/faster/better classical communication instead of having to deal with expensive/brittle/slow quantum communication.

+",119,,,,,2/28/2019 14:53,,,,0,,,,CC BY-SA 4.0 +5579,1,,,2/28/2019 14:59,,3,153,"

I understand how to apply UCC to a problem formulated in a second-quantized (fermion) form: you start with some state and then create a unitary operator out of single-body (or double-, triple- and so on) excitations, and then variationally find the best coefficients:

+ +

$$ +T = T^{(1)} + T^{(2)} + \dots \\ +T^{(1)} = \sum c_i a_i^\dagger, T^{(2)} = \sum c_{ij} a_i^\dagger a_j^\dagger\\ +\Psi = e^{T - T^\dagger} \Psi_0. +$$

+ +

To implement a variational quantum eigensolver (VQE) using this ansatz, you need to apply the Jordan-Wigner or Bravyi-Kitaev transformation to the Hamiltonian and all of the excitation operators.

+ +

But what if you start with a Hamiltonian written in spin form already? Do you first transform the Hamiltonian into the second-quantized form and then back? Or do you do something simpler instead? I remember seeing an ansatz simply consisting of the single-qubit and double-qubit Pauli rotations:

+ +

$$ +U = \exp(i(\theta_1 X_1 + \theta_2 X_2 + \dots + \theta_k X_i Z_j + \dots)). +$$

+ +

However, I can't find any reference to that.

+ +

Any hints to the literature would be appreciated.

+",5103,,,,,2/28/2019 14:59,How to apply unitary coupled cluster to a spin problem?,,0,2,,,,CC BY-SA 4.0 +5580,1,5581,,3/1/2019 7:03,,4,185,"

Just like we have the PPT, NPT criteria for checking if states can be written in tensor form or not, is there any criteria, given the matrix of a unitary acting on 2 qubits, to check if it is local or global (can be factored or not)?

+",2832,,26,,3/3/2019 8:25,3/3/2019 8:25,Differentiate between local and global unitaries,,1,0,,,,CC BY-SA 4.0 +5581,2,,5580,3/1/2019 8:56,,6,,"

This is actually a much easier problem. In the case of states, you're trying to use the PPT criterion, or others, to distinguish if $\rho$ can be written in the form +$$ +\rho=\sum_ip_i\sigma^A_i\otimes\sigma^B_i, +$$ +where $\sum_ip_i=1$ and the $\sigma^A_i$ and $\sigma^B_i$ are valid states on single sites. The difficulty actually comes from the freedom that the summation over $i$ provides.

+ +

In the case of unitaries (or more general operations), you're only trying to ascertain if $U$ can be written in the form +$$ +U=U^A\otimes U^B +$$ +or not. This is something that you can do very mechanically. For example, if we make matrices +$$ +\sum_{k,l}U_{ik,jl}|k\rangle\langle l|, +$$ +then each of these ought to be of the form $U^A_{ij}U^B$, in other words, the same up to a constant. If they're not, it's not of tensor product form.

+",1837,,,,,3/1/2019 8:56,,,,0,,,,CC BY-SA 4.0 +5582,2,,5520,3/1/2019 9:12,,3,,"

... and the question changes again. Re Update 4:

+ +

I'm not sure what you intended the variable $a$ to be in the question (I think part of the problem is that you've got muddled between the chosen questions and the given answers), but I have used it very carefully, to always be the $\pm1$ answer given. In a quantum setting, $a$ is the answer, a value $\pm 1$ when Alice's qubit is measured in a particular basis (this basis is the 22.5 degrees you're talking about). A projective measurement on a qubit always gives you one of two answers which you can choose to label as $\pm 1$ no matter what the basis of that measurement is.

+ +
+ +

The question has entirely changed from previous versions (i.e. should really be a new question). Please find old responses below.

+ +

Bell and CHSH inequalities are nothing to do with detectors, measurement angles etc, because those are all things associated with a quantum experiment. These tests are nothing directly to do with a quantum experiment, requiring knowledge of experimental details. Instead, they are more generic than that and, in particular, tell us what properties the answers have to have if the world is classical. This is about proving that the world is not classical as opposed to proving that it is quantum.

+ +

In a single run of an experiment, there are two boxes. On each box, you can choose one of two settings, and you get an answer $\pm 1$. If Alice (first box) chose setting 1, she would record her answer in the random variable $a$. If she chose setting 2, she records her answer in random variable $c$. Similarly, Bob uses random variables $b$ and $d$ to record the answers from his box corresponding to his choice of setting. We can also calculate the correlations so, if both choose to measure setting 1, we'd have the value $ab$ being the product of the two answers.

+ +

If we run this many times, we build up expectation values for each of these entities, eventually giving us things like $E(a,b)$. Then we can evaluate +$$ +S=E(a,b)−E(a,d)+E(c,b)+E(c,d). +$$

+ +

If we assume that for each run of the experiment, all 4 of $a$, $b$, $c$ and $d$ have a value (even though we don't see all of them on a single run), then on each run $a(b-d)+c(b+d)$ is a value $\pm 2$, and hence $\langle S\rangle\leq 2$.

+ +

Then, we can do a quantum experiment. You don't actually need to know the details of the experiment, they can entirely be hidden away inside these boxes which act based on the questions asked, and give $\pm 1$ outputs. You do this, and find $\langle S\rangle=2\sqrt{2}$, and that proves that the assumption must be invalid. The 4 values are not predetermined, they must be chosen at random at the moment the question is asked.

+ +

With that philosophy out of the way, then you can get stuck into doing the actual quantum calculation, choosing an entangled state and measurement bases of particular angles (these do not need to be variables) and verifying that the $2\sqrt{2}$ answer should indeed come out.

+ +
+ +

Previous responses:

+ +

You've sort of answered your own question. You've stated that +$$ +S=E_1-E_2+E_3+E_4 +$$ +and then you've asked whether +$$ +S=E_1E_2-E_1E_4+E_3E_2+E_3E_4. +$$ +No, it's what you stated it was.

+ +

You then take the values of $E_i$ to be $\pm1/\sqrt{2}$. The only problem you have is that you've put the minus sign on the wrong one: +$$ +E_1=E_3=E_4=\frac1{\sqrt{2}}\qquad E_2=-\frac1{\sqrt{2}} +$$ +Subbing these in to your original statement about $S$, you simply get +$$ +S=\frac4{\sqrt{2}}=2\sqrt{2}, +$$ +as you'd expect for the quantum calculation.

+ +

For concreteness, let's be clear about the conversion: $P(a,b)$ is the probability of getting answers $a$ and $b$ the same, while $E_1$ is the correlation coefficient between answers $a$ and $b$ +$$ +E_1=P(a,b)-(1-P(a,b))=2(P(a,b)-1). +$$ +Hence, if we start from +$$ +P(a,b)-P(a,d)+P(c,b)+P(c,d)\leq2, +$$ +then we have +$$ +(E_1/2+1/2)-(E_2/2+1/2)+(E_3/2+1/2)+(E_4/2+1/2)\leq 2, +$$ +which is the same as +$$ +\frac12(E_1-E_2+E_3+E_4)\leq1, +$$ +or +$$ +E_1-E_2+E_3+E_4\leq2. +$$

+ +
+ +

As a final note, please observe that you cannot call both +$$ +S_1=P(a,b)-P(a,d)+P(c,b)+P(c,d) +$$ +and +$$ +S_2=E_1-E_2+E_3+E_4 +$$ +$S$ because they are actually different quantities ($2S_1-2=S_2$). It just happens that both definitions coincide when they have value 2. I think that conventionally you'd call $S_2$ $S$, and $S_1$ is often called $I$.

+",1837,,1837,,3/18/2019 8:26,3/18/2019 8:26,,,,2,,,,CC BY-SA 4.0 +5583,2,,5560,3/1/2019 9:28,,2,,"

This map takes a complex number and returns a ket vector. In your case, this would simply mean writing $f(z) = z | v \rangle$.

+ +

Maybe a part of the exercise is to decipher $v$, then I would also expand it in ket notation: $| v \rangle = |0 \rangle \otimes |0 \rangle + |1\rangle \otimes |0 \rangle + |2\rangle \otimes |1 \rangle$.

+ +

It is somewhat tricky at first to think about vectors as maps from complex numbers to the vector space. If you want to describe a linear map $\mathbb{C} \rightarrow H$, then it's sufficient to specify $f(1)$, which is $v$.

+",5103,,,,,3/1/2019 9:28,,,,0,,,,CC BY-SA 4.0 +5584,2,,5574,3/1/2019 13:08,,5,,"

The components of the Bloch vector of a state are the expectation values of the X,Y and Z Pauli matrices in that state and it has to be a full three-dimensional vector to capture the interior of the Bloch sphere as well, which represents mixed states.

+ +

In general a state with density matrix $\rho$ of a single Qbit has Bloch vector $\vec{r}$ when +$$ +\rho = \frac12(I+\vec r \cdot\vec\sigma) = \frac12(I+r_x\hat\sigma_x+r_y\hat\sigma_y+r_z\hat\sigma_z) +$$ +where $\vec\sigma$ is a vector containing the three Pauli matrices and $I$ is the identity matrix. +Looking at pure states for example the vector $(0,0,1)$ leads to: +$$ +\rho = \frac12(I+1\cdot\sigma_z) = \frac12\left(\begin{matrix}1 &0\\0 &1\end{matrix}\right) + \frac12\left(\begin{matrix}1 &0\\0 &-1\end{matrix}\right) = \left(\begin{matrix}1 &0\\0 &0\end{matrix}\right) = |0\rangle\langle0| +$$ +exactly as you would expect.

+ +

The utility it provides is a way to immediately visualize in an intuitive way how a state changes under various transformations. Unitary operators rotate the sphere around some axis (which leads to a very simple proof for the universal set of quantum gates) and decoherence channels shrink the sphere along some axis for example.

+ +

I hope that also clears up some of the confusion between the state vector and the Bloch vector which are two entirely different beasts.

+",5933,,5933,,3/1/2019 13:44,3/1/2019 13:44,,,,5,,,,CC BY-SA 4.0 +5585,2,,5444,3/1/2019 15:15,,4,,"

There are a number of questions here.

+ +

Regarding your first question:

+ +
+

So does measurement matter or not?

+
+ +

I learned a lot about quantum computing/quantum mechanics by figuring out why measuring the second register is optional. If it weren't optional, then we can send superluminal messages.

+ +

For example, suppose Alice runs Shor's algorithm. After applying a Hadarmard operation to $\vert x \rangle$, and then the repeating squaring operation $U_f$ to the second register, the state is in:

+ +

$$U_{f}\sum^{N-1}_{x = 0}\vert x\rangle\vert 0\rangle = \vert x\rangle\vert a^{x}\text{ mod }N\rangle$$

+ +

Alice will perform the QFT on the first register. But we have a couple of different things we can do to the second register.

+ +
    +
  • If Alice were to measure and obtain $y$ in the second register before performing the QFT on the first register, Alice will simply collapse the first register to a state consisting of all $\vert x \rangle$ such that $y=a^x\mod N$.
  • +
  • If Alice were to measure and obtain $y$ in the second register after performing the QFT, Alice will likewise collapse the first register into a state where the global phase depends on $y$
  • +
+ +

But suppose Alice gives the second register to her friend Bob.

+ +
    +
  • Bob can decide whether to measure the second register, or not measure the second register, or measure the second register after Alice performs the QFT on the first register, or measure the second register before Alice performs the QFT...
  • +
  • Bob can be very far away!
  • +
  • E.G. he can be on the other side of Earth, or on the other side of Alpha Centauri
  • +
  • More controversially he could jump into the event horizon of a black hole
  • +
+ +

If his course of action affected Alice's first register in such a way that Alice can figure out what he did, then he could send a message superluminally to Alice. Importantly there is no spooky action at a distance that he can do to affect Alice's QFT.

+ +

Regarding your second question:

+ +
+

I mean the algorithm computes $f(x)$ with repeated squaring (classically) right?

+
+ +

Shor's paper was rightfully light on details on how modular exponentiation would be implemented, but his argument was effectively ""because there's a classically fast solution to modular exponentiation - i.e. repeated squaring, there's a quantum mechanical sequence of unitaries that efficiently implements repeated squaring.""

+ +

That is, one of Shor's many insights is that because modular exponentiation can be easily implemented ""classically"" by means of repeated squaring, with a bunch of $\mathsf{NAND}$ gates, $\mathsf{NOR}$ gates, etc., modular exponentiation can also be implemented ""quantum mechanically"" with $\mathsf{CCNOT}$ gates, etc.

+ +

Regarding your third question:

+ +
+

Then how does the second register of qubits hold the value in a superposition of sequence (modular exponentiation sequence)?

+
+ +

The contents of the second register is dependent on the contents of the first register. The first and second register are entangled after applying $U_f$.

+",2927,,,,,3/1/2019 15:15,,,,8,,,,CC BY-SA 4.0 +5586,1,,,3/1/2019 15:51,,8,1384,"

Which quantum computing programming language should I learn? What are the benefits of said language? As of Wikipedia, there's quite a bit to choose from.

+ +

I'm looking to develop end-user applications (when quantum computers become end-user ready).

+",5889,,26,,3/1/2019 21:30,3/9/2019 13:07,Which quantum computing programming language should I learn?,,3,0,,,,CC BY-SA 4.0 +5587,2,,5586,3/1/2019 16:42,,3,,"

I would prefer to first learn Q-sharp if you want to quickly get into quantum computing programming, otherwise play with existing libraries and framework like Qiskit framework, Qutip python library or QETLAB matlab toolbox for feeling entanglement.

+ +

There is also a quantum computing interactive playground by Google.

+",5028,,26,,3/9/2019 13:07,3/9/2019 13:07,,,,0,,,,CC BY-SA 4.0 +5588,1,5595,,3/1/2019 17:52,,4,1326,"

There are other similar questions. But I don't understand the answers.

+ +

Suppose I express $a|0⟩+b|1⟩$ in the form $\frac{c}{\sqrt2}(|0⟩+|1⟩)+\frac{d}{\sqrt 2}(|0⟩−|1⟩)$ where $a,b,c,d∈\mathbb C$. Then in my new basis the vector $|0⟩$ is represented like $(1,1)$ . So what does that mean?

+ +

The vector $(1,0)$ in computational basis means, I 100% get $|0⟩$ in measurement. But what does it mean on other measurements? Does it mean I get $\frac{1}{\sqrt 2}(|0⟩+|1⟩), \frac{1}{\sqrt 2}(|0⟩−|1⟩)$ with equal chances? If so, then how is it possible that in one measurement you get $|0⟩$ for sure, but in new basis you could get, say $\frac{1}{\sqrt 2}(|0⟩+|1⟩)$ with 50% chance which doesn't mean you are guaranteed to get $|0\rangle$ on measurement but only half of the time.

+ +

Basically, I am asking, if in one basis I have a vector, say, $(1,0,0,0)$ and in a different basis the same vector appears to be $(1,0,1,0)$ does that mean I can collapse to $(0,0,1,0)$? Which in turn and in the end will collapse me to something different than the original $(1,0,0,0)$?

+",5742,,55,,3/3/2019 19:33,3/3/2019 19:33,The meaning of measurements in different bases,,1,0,,,,CC BY-SA 4.0 +5589,1,5591,,3/2/2019 0:25,,2,204,"

It's stated that the density operator is:

+ +

$$\displaystyle \rho =\sum _{j}p_{j}|\psi _{j}\rangle \langle \psi _{j}|.$$

+ +

But I don't understand why this is the way both in mixed state and pure state. What is the significance of each component in the density matrix besides the trace? And how different a pure state representation than the way a mixed one is represented in the operator?

+",5742,,26,,3/2/2019 5:08,3/2/2019 9:55,Why is a density operator defined the way it's defined?,,1,0,,,,CC BY-SA 4.0 +5590,2,,4707,3/2/2019 2:56,,2,,"

For question c,

+ +
+

c) What can go wrong in Shor’s algorithm if the integer $N$ to be factored is even (that is, one of the prime factors, $p$ and $q$, is equal to $2$)?

+
+ +

In order for the period-finding algorithm to work, there needs to be a period to find in the first place.

+ +

Let us do the modular exponentiation (repeated squaring) unitary $U_f$ on the second register:

+ +

$$U_{f}\sum^{N-1}_{x = 0}\vert x\rangle\vert 0\rangle = \vert x\rangle\vert a^{x}\text{ mod }N\rangle$$

+ +

Suppose we measure the second register and get a number, $y$. It may be the case that, if $N=2p$, because $p$ has to be large, the first register collapses to only one number $x$ such that $y=a^x \mod N$. Thus, there is no ""collision"" to which the QFT can find a period.

+ +

That is, doing a QFT on the pure state $\vert x\rangle$ with only one value, and then measuring, doesn't tell you anything.

+",2927,,,,,3/2/2019 2:56,,,,0,,,,CC BY-SA 4.0 +5591,2,,5589,3/2/2019 9:55,,5,,"

I'm not sure I entirely understand what you're asking, but let me start...

+ +

Let's say we have a quantum state $|\psi\rangle$. What is it we can actually find out about that state? Everything is the result of measurements. Each measurement result corresponds to a measurement operator $P$, and that outcome is given with probability $\langle\psi|P|\psi\rangle$. Essentially, those probabilities are everything we can access.

+ +

Now, note that we can rearrange that calculation +$$ +\langle\psi|P|\psi\rangle=\text{Tr}(P|\psi\rangle\langle\psi|), +$$ +so if we do the calculation in that way, we see that it's sufficient to always work with $|\psi\rangle\langle\psi|$. Although this is a matrix, it actually contains less information than the state vector because both $|\psi\rangle$ and $e^{i\phi}|\psi\rangle$ give the same density matrices. In fact, that's important - that's telling you that global phases have no observable consequences.

+ +

Moving on, let's say that we're given a quantum state, and we're promised that either it's state $|\psi_1\rangle$ with probability $p_1$, or $|\psi_2\rangle$ with probability $p_2$ (we say it's one of an ensemble). Now what's the probability of getting the measurement outcome corresponding to $P$? With probability $p_1$ it's $\text{Tr}(P|\psi_1\rangle\langle\psi_1|)$ and with probability $p_2$ it's $\text{Tr}(P|\psi_2\rangle\langle\psi_2|)$. Hence, overall, the calculation is +$$ +p_1\text{Tr}(P|\psi_1\rangle\langle\psi_1|)+p_2\text{Tr}(P|\psi_2\rangle\langle\psi_2|)=\text{Tr}(P(p_1|\psi_1\rangle\langle\psi_1|+p_2|\psi_2\rangle\langle\psi_2|)) +$$ +So, the great thing is that if we group together +$$ +\rho=p_1|\psi_1\rangle\langle\psi_1|+p_2|\psi_2\rangle\langle\psi_2|, +$$ +we just have to calculate $\text{Tr}(P\rho)$. This is true for any measurement, and the $\rho$ is independent of which measurement is being done, so that's the natural quantity to use. You could do the full calculation with an ensemble, but for large ensembles that's just creating extra work because the matrix $\rho$ has much less information (which you can see by the fact that many different ensembles give the same density matrix), and is therefore much less work to manipulate.

+",1837,,,,,3/2/2019 9:55,,,,2,,,,CC BY-SA 4.0 +5592,1,5593,,3/2/2019 10:19,,3,110,"

I'm doing some calculations with qutrits and I need a unitary matrix $U$ that does the following:

+ +

$$U|00\rangle = |12 \rangle - | 21\rangle $$

+ +

$$U|11\rangle = |20 \rangle - | 02\rangle $$

+ +

$$U|22\rangle = |01 \rangle - | 10\rangle $$

+ +

where $|0\rangle$,$|1\rangle$, $|2\rangle$ are the basis states. I don't care how it acts on the other states as long as it acts in the way prescribed earlier. Until now I've been using ad-hoc methods for finding such unitaries. In summary, I require two things: the unitary that fulfills the conditions mentioned above and if possible some general method to find unitaries that perform certain transformations over qutrits or qudits.

+",1754,,26,,3/2/2019 13:03,3/2/2019 13:03,Computing with qutrits,,1,0,,,,CC BY-SA 4.0 +5593,2,,5592,3/2/2019 12:37,,2,,"

Simply find any set of normalised vectors that are mutually orthogonal and orthogonal to all your target vectors. Then define these to be the outputs for all the basis states whose outputs are not already defined.

+ +

In practice, the easiest thing is probably to put the output vectors as rows on a non-square matrix and compute the null space. That’ll give you a suitable set of vectors. Not all code necessarily orthogonalises the vectors in the null space (depends what you’re using) but, if not Gram-Schmidt will do the job for you.

+ +

Of course this method makes no attempt for find a separable decomposition if one exists, but you suggested that you don’t care about that.

+",1837,,,,,3/2/2019 12:37,,,,0,,,,CC BY-SA 4.0 +5594,1,,,3/2/2019 16:13,,3,36,"

When we read books on quantum computing and information theory, specifically in entanglement we find some distinguishability between those who focus on entanglement as a resource or use it as an application to explain some phenomenons (teleportation, superdense coding,..), and others study its measure (how long/far the state is still entangled) such as controlling satellites by sending entangled particles, because in this case entanglement could be affected by electromagnetic interactions and other factors of disturbance.

+ +

Could you please clarify this idea?

+",5823,,5823,,3/2/2019 19:48,3/2/2019 19:48,How we can describe entanglement from measurement and resource perspectives?,,0,3,,,,CC BY-SA 4.0 +5595,2,,5588,3/2/2019 17:49,,3,,"

The state $\mid \psi \rangle$ is fixed. You can write it as $a |0 \rangle + b |1 \rangle$. If you write that in the other basis and get

+ +

$ +(a,b) = (1,0) \implies (c,d) = (\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}) +$

+ +

They are the same state so it is still true that if you do a measurement in the $|0 \rangle$, $|1 \rangle$ basis, you will surely get $\mid 0 \rangle$ if you start with $(a,b)=(1,0)$.

+ +

For shorthand let us call the states $\frac{1}{\sqrt{2}} (|0 \rangle \pm |1 \rangle$ as $\mid \pm \rangle$ respectively. That way don't have to keep rewriting.

+ +

So we are in state $\frac{\sqrt{2}}{2} \mid + \rangle + \frac{\sqrt{2}}{2} \mid - \rangle$. If we measure in the $\mid + \rangle$ and $\mid - \rangle$ basis, we have a a $(\frac{\sqrt{2}}{2})^2=\frac{1}{2}$ probability for measuring each of $\mid + \rangle$ and $\mid - \rangle$.

+ +

Your confusion is about measuring in $\mid 0 \rangle$, $\mid 1 \rangle$ basis vs measuring in the $\mid \pm \rangle$. You don't do them both at the same time. Either you pick the first, and surely get $\mid 0 \rangle$ or you do the second and get $\mid + \rangle$ or $\mid - \rangle$ with equal probabilities. They are different operations.

+ +

Your original $(1,0,0,0)$ is in basis 1, then your $(1,0,1,0)$ is in basis 2. The measurement in basis 2 collapses this to $(0,0,1,0)$. Conversely if you measure in basis 1 you get $(1,0,0,0)$ in basis 1. These are different states, but that is expected because you did different measurement operations on the starting state.

+ +

You might still be thinking too classically as being able to do lots of different passive measurements in whatever order.

+ +
+ +

Edit (clarifying the confusion in the comments):

+ +

The measurement is not simply reading the state as a vector. Rewriting the vector in different basis doesn't do anything. As in linear algebra, it doesn't matter at all.

+ +

The measurement in a basis is an operation you do. It is computed by doing the rewrite first, but that is the perspective of you as an omnipetent being when doing the math. You rewrite in the desired basis first because that way the projection operator in that basis is easy to write down.

+ +

The measurement changes the vector and different measurements change the vector in different ways. Measurement 0 in basis 1 will apply some projection operator $P_1$, measurement + in basis 2 will do some other projection operator $P_2$. They are different operators, so of course, you can't expect to get the same thing even if the input state was the same. If you write $P_1$ in basis 1 you get a matrix $M_1$, and if you write $P_2$ in basis 2 as $M_2$ you get those same matrix entries, but that doesn't mean that the operators were the same. If you write $P_2$ in basis 1 you will get something totally different from $M_1$. Doing the rewrite of the state into basis 2 was so you wouldn't have to write down that matrix and could just work with matrix $M_2$.

+",434,,26,,3/2/2019 23:19,3/2/2019 23:19,,,,4,,,,CC BY-SA 4.0 +5596,1,5610,,3/2/2019 19:08,,2,173,"

It is well known that entanglement is precisely the difference between the Cartesian product and the tensor product. The space where every point corresponds to a state is the projective Hilbert space, and the Segre embedding from the projective space of the Cartesian product to the projective space of the tensor product. The image of this embedding is the set of non-entangled states.

+ +

In the case of two-qubit systems, this is:

+ +

$$\sigma: \mathbb{C}P^1 \times \mathbb{C}P^1 \to \mathcal{P}(\mathcal{H}_1 \otimes \mathcal{H}_2) \cong \mathbb{C}P^3$$ $$([x_1 : y_1],[x_2 : y_2]) \mapsto [x_1x_2:x_1y_2:y_1x_2:y_1y_2].$$

+ +

The image of this embedding is the variety $$Z_0Z_3 - Z_1Z_2 = 0$$ where $$[Z_0:Z_1:Z_2:Z_3] \in \mathbb{C}P^3.$$

+ +

For two qubits systems, the solution set is the above quadric.

+ +

Question:

+ +

Is it possible to write down the general variety for $n$-qubit systems? If yes, what will it be?

+ +
+ +

Note: Folks may be interested in this thread on Physics SE: Should it be obvious that independent quantum states are composed by taking the tensor product? It took me quite some time to appreciate why exactly we choose the tensor product rather than the direct sum for composite quantum systems; it makes a lot more sense now. The tensor product space allows for the notion of entanglement whereas the direct product space does not!

+",26,,26,,3/2/2019 19:20,3/3/2019 19:56,What is the general variety corresponding to the Segre embedding for $n$-qubit systems?,,1,0,0,,,CC BY-SA 4.0 +5597,1,,,3/2/2019 20:22,,3,227,"

I have the following circuit in qiskit. It is a simple CNOT operation with the control qubit set to 1, by running the control qubit through an X-gate.

+ +

However, when I measure the 2nd qubit, I get the state $|00\rangle$, not $|11\rangle$.

+ +

If I add a measurement of the control qubit, I do see $|11\rangle$ as the final result.

+ +

I fully expected $|11\rangle$ as the outcome regardless of whether I measure a single or both qubits

+ +
from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit
+from qiskit import execute
+from qiskit import BasicAer
+from math import *
+q0 = QuantumRegister(2, ""q0"") # one ancilla qubit
+c0 = ClassicalRegister(2, ""c0"") # n classical bits for output
+qc = QuantumCircuit(q0,c0)
+qc.x(q0[0])
+qc.cx(q0[0], q0[1])
+  #qc.measure(q0[0],c0[0]) <= when commented out I measure |00>
+qc.measure(q0[1],c0[1])
+qc.draw()
+ job = execute(qc,backend=BasicAer.get_backend('qasm_simulator'))
+ job.result().get_counts()
+
+ +

+",5025,,26,,3/2/2019 20:26,3/3/2019 21:42,"For CNOT gate with control qubit set to 1, the measured state of the second qubit unexpectedly depends on the measurement",,1,1,,,,CC BY-SA 4.0 +5598,1,5602,,3/2/2019 22:03,,1,911,"

For a given teleportation process as depicted in the figure, how one can say that teleporting the qubit state $|q\rangle$ has not cloned at the end of Bob's measurement?

+ +

+",5823,,26,,3/3/2019 8:33,3/4/2019 16:11,How to prove teleportation does not violate no-cloning theorem?,,3,0,,,,CC BY-SA 4.0 +5599,2,,5598,3/2/2019 23:04,,3,,"

Firstly, carefully read through the formal presentation of the protocol as described on Wikipedia. Secondly, there's nothing to prove as such here. It is evident from the teleportation protocol itself.

+ +

Yes, at the conclusion of the teleportation protocol, Bob's qubit certainly will take on the same state as Alice's qubit's initial state i.e. $|q\rangle$. However, Alice's qubit will now exist as an inseparable part of an entangled Bell state. You haven't really been able to create a ""copy"" of Alice's qubit, in the sense that Alice's qubit's initial state is ""destroyed"" in the process and is no longer $|q\rangle$.

+ +

In (crude) analogical terms, in the quantum teleportation protocol you ""cut and paste"" the state $|q\rangle$ rather than ""copying and pasting"". So there's no violation of the No cloning theorem!

+",26,,26,,3/3/2019 8:18,3/3/2019 8:18,,,,0,,,,CC BY-SA 4.0 +5600,1,5601,,3/2/2019 23:39,,7,663,"

The Bloch sphere is homeomorphic to the Riemann sphere, and there exists a stereographic projection $\Bbb S^2\to \Bbb C_\infty$. But this only holds for pure states. To quote Wikipedia:

+ +
+

Quantum mechanics is mathematically formulated in Hilbert space or + projective Hilbert space. The space of pure states of a quantum system + is given by the one-dimensional subspaces of the corresponding Hilbert + space (or the ""points"" of the projective Hilbert space). For a + two-dimensional Hilbert space, this is simply the complex projective + line $\Bbb C P^1$. This is the Bloch sphere.

+
+ +

Essentially the set of all possible pure states of a qubit is homeomorphic to $\Bbb C P^1$.

+ +

+ +

Questions:

+ +
    +
  1. Is the set of mixed states homeomorphic to any geometrical structure (or complex projective space) in particular? Is there any similar stereographic projection corresponding to the mixed states?

  2. +
  3. Can we assign a manifold structure to the set of mixed states? For instance, $\Bbb C P^1$ is basically the manifold constructed by quotient as Lie group ($\Bbb C^\times$) action on $\Bbb C^2 \setminus \{0\}$. But that only corresponds to pure states.

  4. +
+ +
+ +

Edit:

+ +

Moretti says in his Physics SE answer that:

+ +
+

In finite dimension, barring the trivial case $\text{dim}({\cal H})=2$ where + the structure of the space of the states is pictured by the + Poincaré-Bloch ball as a manifold with boundary, $S(\cal H)$ has a structure which generalizes that of a manifold with boundary.

+
+ +

So, I suppose, in this context of qubits, the boundary is $\Bbb C P^1$, and the manifold without the boundary is the set of mixed states with some additional structure (?).

+ +

How do we describe this manifold without boundary in mathematical terms? I guess it would trivially be a 3-ball.

+",26,,55,,6/4/2019 22:53,6/17/2022 9:25,Homeomorphism or stereographic projection corresponding to the set of mixed states within the Bloch sphere,,2,0,,,,CC BY-SA 4.0 +5601,2,,5600,3/3/2019 0:17,,4,,"

Almost. You get a manifold with boundary with the Bloch ball. The radius from the origin parameterizing how pure it is. The origin being maximally mixed. This isn't a manifold because a point on the boundary has a neighborhood that is homeomorphic to a half space but not one homeomorphic to $\Bbb R^n$.

+",434,,26,,3/3/2019 0:19,3/3/2019 0:19,,,,2,,,,CC BY-SA 4.0 +5602,2,,5598,3/3/2019 0:21,,2,,"

I.e., if we have the entire initial state is written as follows

+

$$| q \rangle \otimes | \beta_{00} \rangle =(\alpha | 0\rangle+\beta | 1 \rangle ) \otimes \frac{1}{\sqrt{2}}( |00\rangle+| 11 \rangle)$$ $$= \frac{1}{\sqrt{2}}(\alpha | 000\rangle+\alpha | 011 \rangle+\beta | 100 \rangle+\beta | 111 \rangle ),$$

+

then, in step three, we obtain the state (the system state collapses to one of four possible result after measurement),

+

$$|\psi \rangle \equiv\{ |00\rangle \frac{\alpha | 0 \rangle+\beta | 1\rangle}{2}+| 01 \rangle \frac{\alpha | 1 \rangle+\beta | 0\rangle}{2}+| 10 \rangle \frac{\alpha | 0 \rangle-\beta | 1\rangle}{2}+| 11 \rangle \frac{\alpha | 1 \rangle-\beta | 0\rangle}{2} \},$$

+

where the right two-qubit is for Alice and the superposed qubits with corresponding probabilities $\alpha$ and $\beta$ are for Bob

+

hence we can no longer write

+

$$| q \rangle_A \otimes | \text{something} \rangle_B,$$

+

namely, Alice's $| q \rangle_A$ dissapeared.

+

+",5823,,-1,,6/18/2020 8:31,3/4/2019 9:52,,,,11,,,,CC BY-SA 4.0 +5603,1,5604,,3/3/2019 0:43,,3,800,"

@AHusain mentions here that the purity of a qubit state can be expressed as a function of the radius from the center of a Bloch sphere. The state corresponding to the origin is maximally mixed whereas the states corresponding to the boundary points are pure. So far, I haven't seen this fact written anywhere explicitly. What would be the mathematical proof for this claim?

+",26,,55,,6/4/2019 22:52,6/4/2019 22:52,Purity of mixed states as a function of radial distance from origin of Bloch ball,,3,0,,,,CC BY-SA 4.0 +5604,2,,5603,3/3/2019 7:18,,7,,"

A density matrix $\rho$ has the properties of being Hermitian, non-negative and has trace 1.

+ +

Any $2\times 2$ matrix can be written in the form +$$ +\rho=\frac{n_0\mathbb{I}+\vec{n}\cdot\vec{\sigma}}{2}. +$$ +The trace being 1 fixes that $n_0=1$, while the Hermitian property imposes that $\vec{n}\in\mathbb{R}^3$, where $\vec{\sigma}$ is the vector of the 3 Pauli matrices. The eigenvalues are +$$ +\frac12(1\pm\sqrt{\vec{n}\cdot\vec{n}}), +$$ +so it's non-negative iff $|\vec{n}|\leq 1$. In the case where the length is 1, the eigenvalues are 0,1 so $\rho$ is a projector onto a pure state.

+ +

Now let's consider the purity, $\text{Tr}(\rho^2)$. In this way of writing, we have +$$ +\text{Tr}(\rho^2)=\frac12(1+\vec{n}\cdot\vec{n}) +$$ +Clearly, the largest value of the purity is 1, for pure states, and the smallest value corresponds to $\vec{n}\cdot\vec{n}=0$, i.e. the maximally mixed state.

+ +

Now, how do we depict a state on the Bloch Sphere? We simply plot $\vec{n}$, so the distance from the centre of the sphere is given by $|\vec{n}|=\sqrt{2\text{Tr}(\rho^2)-1}$.

+ +
+ +

Proof of the basic properties

+ +

Let's say we have a density matrix of the form +$$ +\rho=\sum_ip_i|\psi_i\rangle\langle\psi_i|, +$$ +where $\sum_ip_i=1$. Trivially, $\rho$ has trace 1 and is Hermitian. Non-negative matrices satisfy the property +$$ +\langle\phi|\rho|\phi\rangle\geq 0\qquad\forall|\phi\rangle. +$$ +So, consider a state $|\phi\rangle$: +$$ +\langle\phi|\rho|\phi\rangle=\sum_ip_i|\langle\phi|\psi_i\rangle|^2. +$$ +Every term on the right-hand side must be non-negative, and hence $\rho$ is non-negative.

+",1837,,,,,3/3/2019 7:18,,,,2,,,,CC BY-SA 4.0 +5605,1,5606,,3/3/2019 10:11,,4,1211,"

Nielsen and Chuang (on page 188 exercise 4.33) says that the circuit including CNOT and Hadamard is performing a measurement in the Bell basis. But I can't see how.

+ +

+ +

The matrix representing the circuit functionality is:

+ +

$$\begin{bmatrix} 1 & 0 & 0 & 1 \\ 0 & 1 & 1 & 0 \\ 1 & 0 & 0 & -1 \\ 0 & 1 &-1 & 0 \end{bmatrix}$$

+ +

Now, what I have found out is, that instead of measuring in the Bell state, it is actually simply converting $|00\rangle$ to $\beta_{00}$, $|01\rangle$ to $\beta_{01}$ and vice versa and so on. So it's actually transforming from one basis to another. But how is it a measurement in the Bell state?

+ +

Suppose you take the vector $(1,0,0,0)$ in the Bell state it's written $(1,0,1,0)$ then when measuring in Bell state I would expect you get either $(1,0,0,0)$ which is $|00\rangle + |11\rangle$ or $(0,0,1,0)$ which is $|00\rangle-|11\rangle$. But why isn't it doing the measurement but just converting from basis to basis and yet Wikipedia says it's a measurement?

+",5742,,26,,3/3/2019 13:13,3/4/2019 7:58,Why isn't the circuit performing a measurement in the Bell basis?,,2,0,,,,CC BY-SA 4.0 +5606,2,,5605,3/3/2019 11:01,,6,,"
    +
  1. You're correct that unitary gates like the Hadamard and CNOT do not perform any measurement. In fact, measurement isn't a unitary operation at all! There are separate measurements gates to measure the individual qubit states. The basis which the measurement gates will use is implementation dependent. However, in your specific circuit (N&C p. 188, Ex. 4.33) they're using the $\{|0\rangle, |1\rangle\}$ basis. Notice the meter type gates in your circuit. Those are the measurement gates. That circuit is essentially the one used to distinguish between the four orthogonal Bell states. They're mapped to $|00\rangle$, $|01\rangle$, $|10\rangle$ and $|11\rangle$ respectively. The mappings are (notations explained here):
  2. +
+ +

$$|\Phi^+\rangle \to |00\rangle$$ +$$|\Phi^-\rangle \to |10\rangle$$ +$$|\Psi^+\rangle \to |01\rangle$$ +$$|\Psi^-\rangle \to |11\rangle$$

+ +
    +
  1. As for how we can distinguish the four Bell states using two measurement gates, read Craig Gidney's answer to Distinguishing between orthogonal bell states.
  2. +
+ +
+

Typically, a Bell basis measurement is done with a CNOT and a + Hadamard like + so:

+ +

+ +

It's exactly the reverse of making a Bell pair.

+ +

You can also simply do parity measurements along the X and Z + axes:

+ +

+
+ +
+ +

Further Reading:

+ +
    +
  1. If all quantum gates must be unitary, what about measurement?

  2. +
  3. What does “measurement in a certain basis” mean?

  4. +
  5. How to measure relative phases of quantum states?

  6. +
+",26,,26,,3/3/2019 13:53,3/3/2019 13:53,,,,10,,,,CC BY-SA 4.0 +5607,1,,,3/3/2019 17:01,,1,747,"

In QCQI by Chuang and Nielsen (page 201), they prove that $\mathsf{BQP} \subseteq \mathsf{PSPACE}$. I can't understand what they say.

+ +

They write ""Supposing the quantum circuit starts in the state $|0\rangle$ we will explain how to evaluate in polynomial space on a classical computer the probability that it ends up in the state $|y\rangle$""

+ +

How does that prove anything? If I can calculate the probability of the algorithm in poly time does that prove I can calculate in poly time the algorithm itself as well? I don't see how.

+",5742,,26,,3/14/2019 16:04,3/14/2019 16:04,Clarification needed for the N&C proof that BQP ⊆ PSPACE,,1,4,,,,CC BY-SA 4.0 +5608,1,,,3/3/2019 17:22,,3,470,"

So when you have an observable which is the measurement operator acting on the state you get a different result than in a different basis. +What does it mean in physical terms? Does that mean writing your space operation in different style could collapse your state to something different?

+ +

Again, we can understand it mathematically but what's in physical terms?

+",5742,,26,,3/4/2019 14:27,3/4/2019 14:56,What does an observable in a different basis mean physically?,,2,2,,,,CC BY-SA 4.0 +5609,2,,5608,3/3/2019 19:22,,4,,"

One way to think about it is that ""measuring in a given basis"" is how we describe mathematically the act of interacting with the system in different ways.

+ +

Taking as an example a qubit, ""measuring in the $\{\lvert0\rangle,\lvert1\rangle\}$ basis"" is mathematese for ""interacting with the system in a way that reveals to the experimenter whether the system is in the physical state which we are thinking of as corresponding to $\lvert0\rangle$ or $\lvert1\rangle$"". In general, the system will not be in a state that can be directly associated with one of these basis states, in which case the act of measurement ""forces"" the system to collapse to one of the two states, and this happens with a probability that depends on the actual state of the system, and induces a physical change in the state of the system. +Measuring in a different basis then simply corresponds to another type of physical interaction with the system.

+ +

Another, slightly more informal way to think about it is to say that each measurement basis corresponds to a different ""question"" being asked to the system. ""Measuring in $\{\lvert0\rangle,\lvert1\rangle\}$"" means to be asking the system whether it's in the $\lvert0\rangle$ or $\lvert1\rangle$ state, while ""measuring in $\{\lvert+\rangle,\lvert-\rangle\}$"" means to be asking the system whether it is in the $\lvert+\rangle$ or $\lvert-\rangle$ state. As it happens, in quantum mechanics the act of ""asking a question"" to the system - that is, of collecting some classical information out of the system - will in general result in a perturbation of the system itself, which in quantum mechanics is captured by means of the noncommutativity of different observables.

+",55,,55,,3/3/2019 19:31,3/3/2019 19:31,,,,0,,,,CC BY-SA 4.0 +5610,2,,5596,3/3/2019 19:44,,2,,"

It is possible, but a bit annoying.

+ +

For each subset S of $[1\cdots n]$ containing 1 that isn't all of $[1 \cdots n]$. We get a Segre embedding $\mathbb{CP}^{2^{\mid S \mid} - 1} \times \mathbb{CP}^{2^{\mid S^c \mid} - 1} \to \mathbb{CP}^{2^n-1}$. $S^c$ stands for the complementary subset of $n$

+ +

The reason we restrict so that $S$ contains 1 is so that we don't repeat between $(S,S^c)$ and another term which is the same as $(S^c,S)$. That is we don't want to repeat when $S=[1,2]$ giving $(S,S^c)=([1,2],[3])$ and $S=[3]$ giving $([3],[1,2])$

+ +

The equations that cut out a Segre embedding are similar to the 2 qubit example you state. They are still quadratic equations.

+ +

$$ +Z_{i,j} Z_{k,l} - Z_{i,l} Z_{k,j} +$$

+ +

where $Z_{i,j}$ means you write the $2^n$ homogenous coordinates of the $CP^{2^n-1}$ in a rectangular matrix which is $2^{\mid S \mid}$ by $2^{\mid S^c \mid}$. $i$ runs 1 through $2^{\mid S \mid}$ and $j$ runs 1 through $2^{\mid S^c \mid}$. You have to be careful keeping track of these indices because we have to do this many times for each $S$.

+ +

Once you do that, that takes care of each possible bipartitioning. If you want the states on n qubits that have no way to break up into two or more factors. That is no way to write $|\psi \rangle = R_\sigma (|\phi \rangle \otimes | \alpha \rangle)$ with $R_\sigma$ the action of a permutation of $n$. I did that because the way the state broke up could be like a bell state with 1 and 3 tensored with 0 for qubit 2. Just needed to straighten everything out.

+ +

So it can't be in the image of any of those Segre embeddings above. So take the union of all the Segre embeddings and avoid that subspace. Call the space of these genuinely entangled states $X$, the complement of all these Segre embeddings.

+ +

We have one of the embeddings cut out by some polynomial $f$ and another embedding cut out by $g$. So if you look at the zeros of $fg$, both of those will be included as well. Naturally, this generalizes to the many embeddings you are trying to avoid with this example. Don't want to use too much of the algebraic geometry vocabulary here, because I don't know how much others are familiar with it, but that is what is happening here so keeping it a little vague for future readers.

+ +

I can send something else I wrote up that used this to calculate certain combinations of cohomology groups of $X$. It's basically the procedure I describe here, but followed by only remembering the spaces as elements of a certain ring instead of as varieties/complements thereof. It means you don't have to do as much tedious work of writing those quadratic equations for each embedding, but you still get some information out. But that is a different question.

+",434,,26,,3/3/2019 19:56,3/3/2019 19:56,,,,0,,,,CC BY-SA 4.0 +5612,2,,5597,3/3/2019 21:42,,3,,"

Thanks for pointing this out. This is a bug that occurs when only a subset of the qubits are measured.

+ +

It's being fixed. Until then, workarounds are:

+ +
    +
  • Use Aer instead of BasicAer (always the best thing to do when possible).

  • +
  • Use LegacySimulators instead of BasicAer (this will give a deprecation warning).

  • +
  • Install Qiskit from the master branch, where the issue has been fixed (here be dragons!).

  • +
+",409,,,,,3/3/2019 21:42,,,,0,,,,CC BY-SA 4.0 +5613,2,,5605,3/4/2019 7:58,,1,,"

Just to supplement the given answer, if you want to know what the effective measurement is, you start from the measurement operators and work backwards. So, the two measurements mean that you're projecting on the states $|00\rangle,|01\rangle,|10\rangle,|11\rangle$. How do these transform under the preceding gates? Immediately before the measurement, we have a Hadamard on the first quibt. Incorporating that into the measurement basis means measuring in $|+0\rangle,|+1\rangle,|-0\rangle,|-1\rangle$. Finally, we incorporate the controlled-not, and we see that the overall thing corresponds to measurement in the Bell basis.

+",1837,,,,,3/4/2019 7:58,,,,0,,,,CC BY-SA 4.0 +5614,2,,5607,3/4/2019 8:22,,4,,"

Basic Definitions:

+ +

If you don't know the definitions of the basic computational complexity classes well, I strongly recommend going through Watrous' lecture. We won't be using the quantum Turing machine formulation here, unlike the formal rigorous proof by Berstein and Vazirani. Anyway, I'm including a brief discussion on the definitions here.

+ +
+

Polynomial-time quantum algorithms: In the quantum circuit model, a quantum algorithm $Q$ is described by a family of quantum circuits $$Q = \{Q_n:n\in \Bbb N\}.$$ Such a family is polynomial-time uniform if there exists a classical algorithm that produces a description of $Q_n$ for each input $n\in \Bbb N$, in time polynomial in $n$.

+ +

To run this algorithm on an input $x$ of length $n$, we apply $Q_n$ to $|x\rangle$, and measure the output in the standard basis:

+ +

+ +

Shorthand: Write $Q(x)$ to denote the outcome, which is a random variable in general.

+ +

Promise Problem : It is a pair $$\mathcal{A}=\{\mathcal{A}_{\text{yes}},\mathcal{A}_{\text{no}}\}$$ + where $\mathcal{A}_{\text{yes}}$ and $\mathcal{A}_{\text{no}}$ are + disjoint sets of inputs (yes inputs and no inputs). Strings + not contained in $\mathcal{A}_{\text{yes}} \cup + \mathcal{A}_{\text{no}}$ are ""don't care"" inputs.

+ +

$\mathsf{BQP}$: The class of promise problems $\mathcal{A} = (\mathcal{A}_{\text{yes}}, \mathcal{A}_{\text{no}})$ for which there exists a polynomial time-uniform family

+ +

$$\mathrm{Q} = \{\mathrm{Q}_n: n\in \Bbb N\}$$

+ +

of quantum circuits such that, for all input strings $x$, we have:

+ +

$$x\in\mathcal{A}_{\text{yes}} \implies \text{Pr}[\mathrm{Q}(x)=1]\geq \frac{2}{3}$$

+ +

$$x\in\mathcal{A}_{\text{no}} \implies \text{Pr}[\mathrm{Q}(x)=0]\geq \frac{2}{3}$$

+ +

$\mathsf{PSPACE}$: The class of promise problems solvable in polynomial space on a deterministic Turing machine.

+ +

Source: John Watrous - Quantum Complexity Theory (Part 1) - CSSQI 2012

+
+ +

Note: In the gate model, a quantum algorithm is essentially a set of unitary gate operations followed by measurement. Think of $Q(x)$ as a sequence of gate operations performed on an $n$-qubit state $|x\rangle$, with measurement performed on one specific qubit at the end. As a qubit can only collapse to the state $|0\rangle$ or $|1\rangle$ when measured in the standard basis, you'll get either $0$ or $1$ as the output i.e. either $Q(x) = 1$ or $Q(x) = 0$.

+ +
+ +

Explanation:

+ +
+

Why is it that $\mathsf{BQP}\subseteq \mathsf{PSPACE}$? Here's an intuitive outline of the proof (a rigorous proof is left to the references in 'History and further reading'). Suppose we have an $n$ qubit quantum computer, and do a computation involving a set of $p(n)$ gates, where $p(n)$ is some polynomial in $n$. Supposing the quantum circuit starts in the state $|0\rangle$ we will explain how to evaluate in polynomial space on a classical computer the probability that it ends in the state $|y\rangle$. Suppose the gates that are executed on the quantum computer, are in the order $U_1, U_2, ..., U_{p(n)}$. Then the probability of ending up in the state $|y\rangle$ is the modulus squared of $$\langle y|U_{p(n)} ... U_2U_1|0\rangle. \tag{4.86}$$

+ +

This quantity may be estimated in polynomial space on a classical computer. The basic idea is to insert the completeness relation $\sum_x|x\rangle\langle x|=I$ between each term in $(4.86)$ obtaining

+ +

$$\langle y| U_{p(n)}...U_2U_1 |0\rangle = \sum_{x_1,...,x_{p(n)-1}} \langle y |U_{p(n)}|x_{p(n)-1}\rangle \langle x_{p(n)-1}|U_{p_{n-1}}... U_2|x_1\rangle \langle x_1|U_1|0\rangle.$$

+
+ +

Nielsen and Chuang prove that if your quantum circuit begins with all qubits initialized in the state $|0\dots\rangle$ (all qubits in state $|0\rangle$; N&C has labeled that state as $|0\rangle$ so don't get confused), you can evaluate in polynomial space (i.e. the memory space required on a classical computer can be written down as a polynomial in $n$) the probability that the final would be any arbitrary state $|y\rangle$.

+ +

In other words, given a certain composite quantum state $|x\rangle$, you can calculate in polynomial space the probability of a specific qubit returning $|0\rangle$ (or $|1\rangle$), upon the final measurement. You may be thinking that even the generating the description of $Q_n$'s, the $Q_n$'s themselves, and storing the results of their operations on the composite quantum state would occupy space. Yes, that is true. However, that too will only be a polynomial amount of space, as in polynomial time only polynomial space can be accessed. C.f. Polynomial-time algorithm with exponential space is eligible?

+ +

In the background, it's really similar to the path integral approach (you may skip this and jump to the exercise at the end of answer, in the first reading).

+ +
+

In terms of computational complexity, the Schrodinger picture + $\alpha_x|x\rangle$ and Heisenberg's density matrix $\rho$, both lead + to exponential-space simulation since we need to calculate whole + evolution of state vectors. On the other hand, the Feynman's path + integral, summing up all the histories, leads to a polynomial-space + simulation. By writing each final amplitude as a sum of contributions + from all possible paths, we can calculate the sum in + $\mathsf{PSPACE}$.

+ +

For example, the calculation of $H\otimes H|0\rangle$ can be viewed as + follows in Feynman's path integral. We calculate amplitude for each + path separately which needs polynomial space only.

+
+ +

+ +

In short, the point is that you can evaluate the result of your decision problem in polynomial space by summing over the desired paths instead of having to carry out those exponential size matrix multiplications. For arbitrary inputs $|x\rangle$, you'd have to decompose it into the individual standard basis vectors and carry out the calculation for each $2^n$ basis vector separately (erasing previous data as you proceed). Note the emphasized part in the following paragraph (from N&C) carefully, in case you're worried that there could be exponentially many paths to sum over.

+ +
+

Given that the individual unitary gates appearing in this sum are operations such as the Hadamard gate, CNOT, and so on, it is clear that each term in the sum can be calculated to high accuracy using only polynomial space on a classical computer, and thus the sum as a whole can be calculated using polynomial space, since individual terms in the sum can be erased after being added to the running total. Of course, this algorithm is rather slow, since there are exponentially many terms in the sum which need to be calculated and added to the total; however, only polynomially much space is consumed, and thus $\mathsf{BQP} \subseteq \mathsf{PSPACE}$, as we set out to show.

+
+ +
+ +

Exercise:

+ +

Calculate the probability of obtaining $|0\rangle$ (upon measurement), in the first (top) qubit, for this circuit using the summation over paths methods explained above (and in N&C page 202).

+ +

+ +

Here's a hint. To get $|0\rangle$ on the top qubit you'd need either $|00\rangle$ or $|01\rangle$ as the final composite state of the two qubits upon measurement. You can now calculate $\langle 00|U_2U_1|00\rangle$ and $\langle 01|U_2U_1|00\rangle$, where $U_1=H$ and $U_2 = \operatorname{CNOT}$ using the method desribed in the first paragraph of N&C page 202 i.e.

+ +

$$\langle y| U_{p(n)}...U_2U_1 |0\rangle = \sum_{x_1,...,x_{p(n)-1}} \langle y |U_{p(n)}|x_{p(n)-1}\rangle \langle x_{p(n)-1}|U_{p_{n-1}}... U_2|x_1\rangle \langle x_1|U_1|0\rangle.$$

+ +

Then $|\langle 00|U_2U_1|00\rangle|^2+ |\langle 01|U_2U_1|00\rangle|^2$ gives you the necessary probability. Luckily here we began in the state $|00\rangle$ rather than any arbitrary quantum state $|x\rangle$. Otherwise you'd have to repeat this calculation for all the basis states: $|00\rangle$, $|01\rangle$, $|10\rangle$ and $|11\rangle$.

+ +

That is, if $|x\rangle$ was $\alpha|00\rangle+\beta|01\rangle+\gamma|10\rangle + \delta |11\rangle$ rather than $|00\rangle$, the final answer would have been

+ +

$|\alpha\langle 00|U_2U_1|00\rangle|^2+ |\alpha\langle 01|U_2U_1|00\rangle|^2 + |\beta\langle 00|U_2U_1|01\rangle|^2+ |\beta\langle 01|U_2U_1|01\rangle|^2 + +|\gamma\langle 00|U_2U_1|10\rangle|^2+ |\gamma\langle 01|U_2U_1|10\rangle|^2 + +|\delta\langle 00|U_2U_1|11\rangle|^2+ |\delta\langle 01|U_2U_1|11\rangle|^2 $

+ +

This probability should be $\geq \frac{2}{3}$ for any $x\in\mathcal{A}_{\text{no}}$. Note that you don't have to do any full-fledged matrix multiplication here, as you would have to do in case you wanted to calculate $\operatorname{CNOT}.H|00\rangle$. No unnecessary usage of exponential amount of space!

+",26,,26,,3/4/2019 22:01,3/4/2019 22:01,,,,5,,,,CC BY-SA 4.0 +5615,2,,5586,3/4/2019 9:14,,3,,"

Q-sharp is a nice starting point.

+ +

Also I would suggest some general purpose mathematical language.
+Julia is really awesome.

+",5870,,,,,3/4/2019 9:14,,,,0,,,,CC BY-SA 4.0 +5616,2,,5598,3/4/2019 9:32,,3,,"

Cloning means the generation of $|q\rangle|q\rangle$ from $|q\rangle|0\rangle$. This is not what happens in teleportation. Teleportation is kind of a swap operation, i.e. something like $|q\rangle|0\rangle \to |0\rangle|q\rangle$.

+",5870,,26,,3/4/2019 16:11,3/4/2019 16:11,,,,0,,,,CC BY-SA 4.0 +5617,2,,5608,3/4/2019 12:19,,1,,"
+

So when you have an observable which is the measurement operator + acting on the state you get a different result than in a different + basis. What does it mean in physical terms?

+
+ +

@glS has already explained the physics. I'll give an example of an observable: photon polarization. You'll find an elaborate description here. Measurements in this context would simply mean passing the photons through linear polarizers (in various orientations). If you can write the out the quantum state, using any appropriate orthogonal basis (one basis vector would be in the direction of the slit of linear polarizer and another would be in a direction orthogonal to it) you can predict the percentage of photons that will come out of the polarizers. You can compare the results with Malus' law.

+ +
+

Does that mean writing your space operation in different style could collapse your state to something different?

+
+ +

Not exactly sure what you mean by ""space operation"" (measurement is not an operator!), but I think you're on the right track. If you measure the observable in a certain basis (say, pass any arbitrary linearly polarized light through a horizontal-vertical dual polarizer), the photons which will pass through the polarizer will either be horizontally polarized or vertically polarized. Similarly, if you pass any arbitrary linearly polarized light through a diagonal-antidiagonal dual polarizer the photons which will pass through will either be diagonally polarized or anti-diagonally polarized. Does this help with the intuition?

+",26,,26,,3/4/2019 14:56,3/4/2019 14:56,,,,0,,,,CC BY-SA 4.0 +5618,1,5658,,3/4/2019 14:15,,3,155,"

I am interested in showing the validity of the Grover operator. Now there are several ways to show it. One way is with complete induction. +It has to be shown that the following relationship applies: $D_N=-H_n\cdot R_N \cdot H_n $

+ +

For induction proof I have already formulated the induction assumption and the induction condition.

+ +

Induction hypothesis: $N=2$ +$$ D_N=-H_n\cdot R_N \cdot H_n, \quad D_N\text{ see Eq. 1 and } R_N \text{ see Eq. 2}$$ +$$N=2$$ +$$D_2 = -H\cdot R_2 \cdot H = -\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix}\cdot \begin{pmatrix}-1&0\\0&1\end{pmatrix}\cdot\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix} = \begin{pmatrix}0&1\\1&0\end{pmatrix}$$ +Thus: +$$D_2=\begin{pmatrix}0&1\\1&0\end{pmatrix}=\begin{pmatrix}0&1\\1&0\end{pmatrix}$$

+ +

Induction Prerequisite: +For an arbitrary but fixed $N \in \mathbb N $ the statement applies

+ +

At the induction step, I'm not sure if that's right. Here I need some support. +In the induction step we show the assertion for an $N + 1$. I am not sure if I have to show both $n + 1$ and $N + 1$. +At least this is the first idea for an induction step:

+ +

$$D_{N+1}=-H_{n+1}R_{N+1}H_{n+1}$$ +This is an important statement that you probably need for the induction step: +$H_{n+1}$ is equal to $H_1\otimes H_n=\frac{1}{\sqrt{2}}\begin{pmatrix}H_n&H_n\\H_n&-H_n\end{pmatrix}$ +then you would have first: +$$D_{N+1}=-\frac{1}{\sqrt{2}}\begin{pmatrix}H_n&H_n\\H_n&-H_n\end{pmatrix}\cdot R_{N+1}\cdot \frac{1}{\sqrt{2}}\begin{pmatrix}H_n&H_n\\H_n&-H_n\end{pmatrix}$$

+ +

I'm stuck with this step. I am grateful for the answers and hope that the question is clear and understandable.

+ +
+ +

Appendix:

+ +

Equation 1: +$$D_N = \begin{pmatrix}-1+\frac{2}{N}&\frac{2}{N}&...&\frac{2}{N}\\\frac{2}{N}&-1+\frac{2}{N}&...&\frac{2}{N}\\\vdots&\vdots&\ddots&\vdots\\\frac{2}{N}&\frac{2}{N}&...&-1+\frac{2}{N}\end{pmatrix}$$

+ +

Equation 2: +$$R_N=\begin{pmatrix}-1&0&...&0\\0&1&\ddots&\vdots\\\cdots&\ddots&\ddots&0\\0&...&0&1\end{pmatrix}$$

+ +

Equation 3: +$$N=2^n$$

+",,user4961,55,,4/14/2019 14:45,4/14/2019 14:45,Proof that Grover's operator can be written as $D_N=-H_n R_N H_n$,,1,5,,,,CC BY-SA 4.0 +5619,1,5621,,3/4/2019 14:38,,4,83,"

Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer (Shor, 1995) [p. 15]

+ +
+

To find a factor of an odd number $n$, given a method for computing the order $r$ of $x$, choose a random $x \pmod n$, find its order, and compute $\text{gcd}(x^{\frac{r}{2}}-1,n)$. Here $\text{gcd}(a,b)$ is the greatest common divisor of $a$ and $b$, i.e., the largest integer that divides both $a$ and $b$. The Euclidean algorithm [Knuth 1981] can be used to compute $\text{gcd}(a,b)$ in polynomial time. Since $$(x^{\frac{r}{2}}+1)(x^{\frac{r}{2}}-1) \equiv 0 \pmod n,$$ then $\text{gcd}(x^{\frac{r}{2}}-1, n)$ fails to be a non-trivial divisor of $n$ only if $r$ is odd or if $x^{\frac{r}{2}} \equiv -1 \pmod n$. Using this criterion, it can be shown that this procedure, when applied to a random $x \pmod n$, yeilds a factor of $n$ with probability $1-2^{k-1}$, where $k$ is the number of distinct odd prime factors of $n$. A brief sketch of the proof of this result follows. Suppose that $n = \prod_{i=1}^{k} p_i^{a_i}$. Let $r_i$ be the order of $x \pmod {p_i^{a_i}}$. Then $r$ is the least common multiple of all $r_i$. Consider the largest power of $2$ dividing each $r_i$. The algorithm only fails if all these powers of $2$ agree: if they are all $1$, then $r$ is $1$, then $r$ is odd and $\frac{r}{2}$ does not exist; if they are all equal and larger than $1$, then $x^{\frac{r}{2}} \equiv -1 \pmod n$ since $x^{\frac{r}{2}} \equiv -1 \pmod {p_i^{a_i}}$ for every $i$.

+
+ +

I know that in factoring algorithms the general idea is that if we can obtain $b^2\equiv c^2 \pmod n$ and $b\not\equiv \pm c\pmod n$, then $\gcd(b+c,n)$ will be a non-trivial factor of $n$. So far so good.

+ +

But then it is not clear to me why $x^{\frac{r}{2}} \equiv -1 \pmod {p_i^{a_i}}$ for every $i$, in this context. It doesn't seem to logically follow from ""all these powers of $2$ (i.e. the highest powers of $2$ that divide each $r_i$) agree"" and ""if they are all equal and larger than $1$"".

+ +

I'm probably missing something. Could someone clarify?

+ +
+ +

Related: Shor's algorithm caveats when $a^{r/2} =-1 \mod N$

+",26,,26,,3/4/2019 21:21,3/4/2019 21:21,"How does $x^{\frac{r}{2}} \equiv -1 \pmod {p_i^{a_i}}$ follow from ""if all these powers of $2$ agree""?",,1,0,,,,CC BY-SA 4.0 +5620,1,,,3/4/2019 15:09,,4,195,"

I have been reading this paper but don't yet understand how to implement a circuit to determine in which state the qubit is not for a cyclic POVM. More specifically, I want to implement a cyclic POVM with $m=3$;

+

Update: I came across having to implement this unitary matrix: +$$ + M= + \frac{1}{\sqrt{2}}\left[ {\begin{array}{cc} + 1 & 1 \\ + 1 & w \\ + \end{array} } \right] +$$ +Where $w$ is a third root of unity using rotations, after which I am stuck.

+",5954,,55,,8/22/2020 5:54,8/22/2020 5:54,POVM three-qubit circuit for symmetric quantum states,,2,1,,,,CC BY-SA 4.0 +5621,2,,5619,3/4/2019 15:35,,3,,"

If $r$ is the least common multiple of the $r_i$, then for each $r_i$ there is an integer $s_i$ such that $r=r_is_i$. If at least one of the $r_i$ is even, then so is $r$, which we need.

+ +

Moreover, if all the $r_i$ agree on the powers of 2 dividing the $r_i$, then $r$ contains the same number of powers of 2, and $s_i$ must be odd. Hence, for each $i$, +$$ +x^{r/2}\text{ mod }p_i^{a_i}=(x^{r_i/2})^{s_i}\text{ mod }p_i^{a_i} +$$ +Now, we know that +$$ +x^{r_i}-1=(x^{r_i/2}+1)(x^{r_i/2}-1)\equiv 0\text{ mod }p_i^{a_i} +$$ +but $x^{r_i/2}-1$ is not 0 modulo $p_i^{a_i}$ because otherwise the order would be $r_i/2$, not $r_i$. So, +$$ +x^{r/2}\text{ mod }p_i^{a_i}=(-1)^{s_i}\text{ mod }p_i^{a_i}=(-1)\text{ mod }p_i^{a_i}. +$$

+",1837,,,,,3/4/2019 15:35,,,,0,,,,CC BY-SA 4.0 +5622,2,,5620,3/4/2019 16:00,,5,,"

This is not the unitary that you have to implement: you need a two-qubit unitary +$$ +\frac{1}{\sqrt{3}}\left(\begin{array}{cccc} +1 & 1 & 1 & 0 \\ +1 & \omega & \omega^2 & 0 \\ +1 & \omega^2 & \omega & 0 \\ +0 & 0 & 0 & \sqrt{3} +\end{array}\right), +$$ +where $\omega=e^{2i\pi/3}$, the point being that if you introduce an ancilla qubit in the state 0, apply this unitary, and then measure in the computational basis, the 3 measurement outcomes 00, 01 and 10 correspond to the 3 POVM elements.

+ +

I don't (yet) have a circuit implementation for this. You'll see the paper you cite carefully avoids talking about the Fourier transform in non-power of 2 dimensions. You certainly could use the standard constructions based on Givens rotations, but the result is going to be fairly horrible.

+ +

Here's an attempt at a circuit. I've made a few tweaks since I last ran it through a computer to check, so it's always possible that a slight error has crept in, but broadly... + +Here, I'm using $Z^r$ to denote +$$ +\left(\begin{array}{cc} 1 & 0 \\ 0 & e^{i\pi r} \end{array}\right), +$$ +and +$$ +V=\frac{1}{\sqrt{3}}\left(\begin{array}{cc} +1 & \sqrt{2} \\ -\sqrt{2} & 1 +\end{array}\right). +$$

+",1837,,1837,,3/4/2019 19:46,3/4/2019 19:46,,,,6,,,,CC BY-SA 4.0 +5623,1,5643,,3/4/2019 19:40,,1,124,"

This is a sequel to How does $x^{\frac{r}{2}} \equiv -1 \pmod {p_i^{a_i}}$ follow from "if all these powers of $2$ agree"?

+ +
+ +

Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer (Shor, 1995) [p. 16]

+ +
+

The multiplicative group (mod $p^\alpha$) for any odd prime power $p^\alpha$ is cyclic [Knuth 1981], so for any odd prime power $p_i^{a_i}$, the probability is at most 1/2 of choosing an $x_i$ having any + particular power of two as the largest divisor of its order $r_i$. Thus each of these powers of 2 has at most a 50% probability of agreeing with the previous ones, so all k of them agree with probability at most $1/2^{k−1}$, and there is at least a $1 - 1/2^{k-1}$ chance that the $x$ we choose is good. This scheme will thus work as long as $n$ is odd and not a prime power; finding factors of prime powers can be done efficiently with classical methods.

+
+ +
    +
  1. Why is the probability of choosing an $x_i$ having any particular power of two as the largest divisor of its order $r_i$ at most $\frac{1}{2}$?

  2. +
  3. Why is the probability of each of these powers of 2 agreeing with the previous at most 50%?

  4. +
+ +
+ +

Related: Expected repetitions of the quantum part of Shor's algorithm

+",26,,,,,3/8/2019 18:09,Confusion regarding probability of period resulting in factoring,,1,0,,,,CC BY-SA 4.0 +5624,1,5625,,3/4/2019 21:43,,0,121,"

In the quadratic sieve algorithm, the idea is to find $a$ and $a$ such that $a^2 \equiv b^2 \bmod n$. We need that $a\not\equiv \pm b \bmod n$. However, there the $c$ is not necessarily $1$. $\gcd(b \pm c,n)$ returns non-trivial factors.

+ +

However, in Shor's algorithm, we specifically need to find square roots of $1$ (in modulo $n$) i.e. we look for $a$ such that $a^2 \equiv 1 \bmod n$. That is, $b$ is specifically $1$. Why is this choice necessary?

+ +
+ +

Related: Math SE: Chinese Remainder Theorem: four square roots of 1 modulo N

+",26,,16606,,5/25/2022 16:51,5/25/2022 16:51,Why do we search for square roots of 1 in Shor's algorithm unlike the quadratic sieve?,,1,0,,,,CC BY-SA 4.0 +5625,2,,5624,3/4/2019 23:12,,1,,"

The two problems are equivalent.

+ +

If you give me a pair $a, b$ such that $a^2 = b^2$ with $a \neq \pm b$ then $c = a b^{-1}$ satisfies $c \neq \pm 1$ and $c^2 = 1$.

+ +

If you give me a $c$ such that $c^2 = 1$ and $c \neq \pm 1$, and some target value $a$, then $b = a \cdot c$ satisfies $a^2 = b^2$ and $a \neq \pm b$.

+ +

You can derive a square root of 1 from an $a,b$ pair. You can derive an $a,b$ pair with desired $a$ from a square root of 1. They're reducible to each other.

+",119,,,,,3/4/2019 23:12,,,,0,,,,CC BY-SA 4.0 +5626,1,5627,,3/5/2019 5:43,,2,178,"

Define a quantum algorithm that computes the maximum of two n-qubit registers.

+ +
+

From Quantum Computing: A Gentle Introduction (Eleanor Rieffle & Wolfgang Polak), exercise 6.4.a (page 121).

+
+ +

I know how to do this classically using bit logic and a signed bit, but I don’t think there are signed bits in quantum computing. I think the answer should be pretty straight forward but I have no idea what to do.

+",5961,,26,,3/30/2019 7:45,3/30/2019 7:45,"Computing max of 2, length n bit registries",,2,0,,,,CC BY-SA 4.0 +5627,2,,5626,3/5/2019 8:41,,2,,"

I will not give you the exact answer but here are some hints:

+
    +
  • You already know how to perform the addition (mod $2^n$) of 2 $n$-qubit quantum registers (section 6.4.3).

    +
  • +
  • Let's say you want to compare $a$ and $b$ stored in binary in registers, if the most significant bit of $a$ is 0, then the most significant bit of $a-b (\text{mod} \ 2^n)$ is $1$ if and only if $a < b$ (the subtraction is done with unsigned integer, the result should be interpreted as a unsigned integer in the previous sentence).

    +
  • +
  • Exercise 6.4.b statement may help you understand. For those who do not have the book:

    +
    +

    Exercise 6.4.b: Explain why such an algorithm requires one additional qubit that cannot be reused; that is, the algorithm will have to have $2n+1$ input and output qubits.

    +
    +
  • +
+",1386,,-1,,6/18/2020 8:31,3/5/2019 8:41,,,,0,,,,CC BY-SA 4.0 +5628,2,,5626,3/5/2019 8:42,,1,,"

A simple solution I can think of is use a comparator circuit. If $a<b$, this will output 1 in another qubit register. You can then put $b$ in another register using Toffolis with this qubit as control if you want the result in another register.

+",4127,,4127,,3/5/2019 10:13,3/5/2019 10:13,,,,0,,,,CC BY-SA 4.0 +5629,1,,,3/5/2019 10:41,,7,653,"

I'm working on solving a linear system with the quantum algorithm HHL. I don't understand how I can recover my vector $|x\rangle$ of real solution of the system starting from the states measured with ancilla qubit in $|1\rangle$. +I found something about using tomography but I don't know how to apply it successfully to my circuit with Qiskit.

+ +

Can someone help me? Many thanks.

+",5963,,26,,3/30/2019 7:51,3/30/2019 7:51,Quantum algorithm for linear system of equations (HHL) - Final Step: How can I find my vector of solution $|x\rangle$?,,1,0,0,,,CC BY-SA 4.0 +5630,2,,5629,3/5/2019 12:37,,4,,"

Quick answer: You will not be able to fully recover $x$.

+ +

Explanations:

+ +
    +
  1. By design, the HHL algorithm stores $x$ in the amplitudes of a quantum state. Because of how quantum mechanics works, the vector representing the quantum state (i.e. containing all the amplitudes of the quantum state) needs to be of unit-norm (according to the Euclidean norm). Because of this, the result stored in the amplitudes of your quantum state is (most of the time) not $\vec{x}$ but rather $\vert x \rangle = \frac{\vec{x}}{\vert\vert\vec{x}\vert\vert}$. Also because quantum states are defined up to a global-phase, the most general expression of the ""solution"" of the linear system stored in the amplitudes is +$$\vert x \rangle = e^{i\phi}\frac{\vec{x}}{\vert\vert\vec{x}\vert\vert}.$$

  2. +
  3. As said in point 1, the HHL algorithm stores the result of the linear system provided by the user in the amplitudes of a quantum state. The problem is that these amplitudes are not directly measurable. You can measure the value of your qubits and the measured value will depend (probabilistically) on the underlying amplitudes, but you can't measure the amplitudes.

    + +

    One way to approximate the amplitudes (up to a global phase) is to use quantum state tomography. Here are some links related to quantum state tomography in Qiskit:

    + +
  4. +
+",1386,,,,,3/5/2019 12:37,,,,4,,,,CC BY-SA 4.0 +5631,2,,5520,3/5/2019 13:02,,-5,,"

The original answer did not address the observation that CHSH calculates $a$ from 2 different scenarios, then uses them interchangeably. A technique that allows the generation of impossible results.

+ +

Bell’s Inequality is valid for Correlation Coefficients and the CHSH Inequality is computed the same way as Bell’s, that is $S = ab – ad + cb + cd$ where a, b, c and d are the results of 4 runs of the experiment. $E(a,b)$ is the correlation coefficient of 1 run of the experiment. The problem is that $E(a,b)$ should become “$a$” in the S calculation, not $ab$

+",5829,,5829,,3/7/2019 20:35,3/7/2019 20:35,,,,0,,,,CC BY-SA 4.0 +5632,1,5633,,3/5/2019 13:11,,3,120,"

I need to implement a quantum comparator that, given a quantum register $a$ and a real number $b$ known at generation time (i.e. when the quantum circuit is generated), set a qubit $r$ to the boolean value $(a < b)$.

+ +

I successfully implemented a comparator using 2 quantum registers as input by following A new quantum ripple-carry addition circuit (Steven A. Cuccaro and Thomas G. Draper and Samuel A. Kutin and David Petrie Moulton, 2004). This means that given two quantum registers $a$ and $b$, the circuit set a qubit $r$ to the boolean value $(a < b)$.

+ +

I could use an ancilla quantum register that will be initialised to the constant value $b$ I am interested in and then use the implementation I already have, but this sounds quite inefficient.

+ +

The only gate that use the quantum register $b$ (the one fixed at generation time) is the following:

+ +

+ +

When this gate is used, the qubits of $b$ are given as the second input (i.e. the middle line in the circuit representation above) and the value of each of the qubit of $b$ is known at circuit generation.

+ +

My questions:

+ +
    +
  1. Is there a way to remove completely the quantum register $b$ by encoding the constants values of each $b_i$ in the quantum circuit generated?
  2. +
  3. Can the fact of knowing the value of the second entry of the gate at generation time be used to optimise the number of gates used (or their complexity)?
  4. +
+ +

I already have a partial answer for question n°2: the Toffoli gate may be simplified to one CX gate when $b_i = 1$ and to the identity (i.e. no gate) when $b_i = 0$. There is still a problem with the first CX gate that prevent this optimisation, but this may be a track to follow?

+",1386,,,,,3/5/2019 15:25,Optimise implementation of a quantum algorithm when an input is fixed,,1,0,,,,CC BY-SA 4.0 +5633,2,,5632,3/5/2019 15:25,,2,,"

Let's answer my own question: it is not possible.

+ +

After some research I ended up computing the ""truth table"" for the two possible cases:

+ +
    +
  1. $b = 0$: + +
      +
    • $\vert 00 \rangle\rightarrow\vert 00 \rangle$
    • +
    • $\vert 01 \rangle\rightarrow\vert 10 \rangle$
    • +
    • $\vert 10 \rangle\rightarrow\vert 10 \rangle$
    • +
    • $\vert 11 \rangle\rightarrow\vert 01 \rangle$
    • +
  2. +
  3. $b = 1$: + +
      +
    • $\vert 00 \rangle\rightarrow\vert 00 \rangle$
    • +
    • $\vert 01 \rangle\rightarrow\vert 11 \rangle$
    • +
    • $\vert 10 \rangle\rightarrow\vert 11 \rangle$
    • +
    • $\vert 11 \rangle\rightarrow\vert 01 \rangle$
    • +
  4. +
+ +

It is clearly visible in the above truth tables that the operation I want to produce is not reversible (two different input give the same output) and so not unitary.

+ +

I will have to find another algorithm to do what I am searching for. I am still open to suggestions on interesting algorithms.

+",1386,,,,,3/5/2019 15:25,,,,0,,,,CC BY-SA 4.0 +5634,1,5663,,3/5/2019 22:58,,4,201,"

So far what I have learned is that von-Neumann entropy is a tool to measure or quantify information and therefore entanglement for a given pure state system. However, similar concepts emerge from the task of measuring entanglement in general, which would be entanglement cost and distillable entanglement. +My question is what are the similarities and divergences of these concepts with von-Neumann entropy?

+ +

The reference from which I spotted this question is from this article.

+",5823,,5823,,3/8/2019 14:34,3/8/2019 14:34,What do entanglement cost and distillable entanglement have to do with measuring entanglement?,,1,1,,,,CC BY-SA 4.0 +5635,1,5636,,3/6/2019 2:27,,5,357,"

What language is more suitable for quantum machine learning algorithms? Is it right that it's Python + Pyquil? Or something else?

+ +

And do you know the sources where you can see the sample codes of different quantum ML algorithms if it exists? I didn't find anything.

+",5876,,26,,3/6/2019 5:07,11/19/2019 22:56,What language is more suitable for quantum machine learning algorithms?,,1,0,,,,CC BY-SA 4.0 +5636,2,,5635,3/6/2019 5:22,,8,,"

One can recommend PennyLane by Xanadu.AI. You can find complete examples of quantum machine learning algorithms (e.g. Iris Classification), using hybrid quantum-classical computations.

+ +

Additionally, they offer built-in plugins for IBM QisKit, Pyquil etc., to enable running Pennylane QML codes on IBM and Rigetti quantum hardwares.

+",4954,,9118,,11/19/2019 22:56,11/19/2019 22:56,,,,1,,,,CC BY-SA 4.0 +5637,1,5639,,3/6/2019 8:49,,1,102,"

When we expand the Ising model we have one component with 3 qbits like Q1Q2Q3. But in qubo file we can only set coupling for 2 qbit only. How should I set this 3-qbit element to qubo file?

+",5968,,26,,3/6/2019 15:13,3/6/2019 15:13,Q1Q2Q3 coupling in qubo file,,1,0,,,,CC BY-SA 4.0 +5638,1,5641,,3/6/2019 11:59,,3,164,"

In superconducting quantum computing resonators are typically an LC circuit. If L and C are fixed the resonator will have a fixed resonance frequency. However, I heard that in the group of Prof. John Martinis they are using a different type of resonators that their frequency is tunable. The tunability is somehow possible by applying a DC flux bias. Can anyone elaborate on the subject? How does it work? Usages?

+",5811,,55,,3/7/2019 13:07,3/7/2019 15:33,How do frequency-tunable microwave resonators work?,,1,0,,,,CC BY-SA 4.0 +5639,2,,5637,3/6/2019 12:06,,1,,"

You need to introduce ancillary variables and minimize over them; which would enable you to have a QUBO form with only pairing terms. For example, if your binary variables are called $ x,y,z $ and you have a $ a*xyz $ term with the coefficient $ a$, you can use a technique of reduction by minimum selection where you introduce another variable $w$ such that this becomes a QUBO again:

+ +

$$\begin{align}\begin{aligned}axyz = aw ( x+y+z -2) \quad a<0\\axyz = a \left\{ w ( x+y+z -1) + (xy+yz+zx) - (x+y+z) +1 \right\} \quad a>0\end{aligned}\end{align} +$$

+ +

This is explained in the D-Wave documentation.

+",4127,,,,,3/6/2019 12:06,,,,0,,,,CC BY-SA 4.0 +5640,1,,,3/6/2019 13:43,,4,145,"

In quantum physics, because of the no-cloning theorem, lots of classical proofs of cryptographic problems cannot be turned into quantum proofs (rewinding is usually not possible quantumly). A dream theorem would be the following:

+ +
+

Dream theorem: Let C be a circuit on $n$ qubits made of a polynomial (in $n$) number of 1-qubit and 2-qubits gates (say $H, T, Ctrl-X)$. Now, run this circuit on input $|0\rangle^{\otimes n}$, and measure the first $k$ qubits in computational basis, giving you the state $|y\rangle\otimes |\phi\rangle$, with $y \in \{0,1\}^k$. Then, there exists a circuit $C'$ with a polynomial number of gates such that $C' |0\rangle^{\otimes (n-k)} = |\phi\rangle$.

+
+ +

Do you have any argument to say that this theorem is true? Or wrong?

+ +

Note 1: it would also be great to have ""only"" an approximate version of this, with $C' |0\rangle^{\otimes n}$ being exponentially close to $|\phi\rangle$.

+ +

Note 2: Note that computing $C'$ given $U$ and $y$ should be very hard to do (as soon as PostBQP != BQP), because otherwise it would be more or less equivalent to perform post-selection. But I don't mind, I don't need a constructive proof.

+ +

Note 3: This does not directly contradict the theorem (coming from Harrow, Recht and Chuang?) that states that to produce any state $|\phi \rangle$ on $n-k$ qubits, up to precision $\varepsilon$, you need $O(2^{2(n-k)}\log(1/\varepsilon))$ gates"", as here $|\phi\rangle$ is quite specific and needs to be produced by a polynomial unitary + measurements.

+ +

My intuition on why of course it's true/wrong:

+ +

Note 4: One intuition to say that it's not true would be to take a pseudo-random function $h : \{0,1\}^{2l} \rightarrow \{0,1\}^{l}$ (say based on sha hash functions), and implement the unitary $U_h(H^{\otimes2l}|0\rangle^{\otimes 2l})\otimes|0\rangle^{\otimes l} = \sum_{x \in \{0,1\}^{2l}} |x\rangle |h(x)\rangle = \sum_{y \in \{0,1\}^{l}} (\sum_{x \in f^{-1}(y) }|x\rangle) |y\rangle$ and measure the second register, giving $(\sum_{x \in f^{-1}(y) }|x\rangle) |y\rangle$, and then see that if $f$ is truly random the left register seems impossible to generate in polynomial time as it contains an exponential number of elements. But the thing is that it's not even possible to have truly random functions in polynomial time, so the argument does not really work, as for polynomial $h$ an underlying simple representation may exist to efficiently reproduce this state.

+ +

Note 5: on the other hand, it seems plausible that the coefficient of the matrix of $C$ are ""simple enough"" as they are generated from a small circuit, and therefore could be reproduced. I tried to see how to ""backpropagate"" a measurement in the circuit, by trying to generate lots of possible sub-matrices, and for now I didn't reached a fixed point... but maybe I will at some point!

+",5969,,55,,3/7/2019 13:09,3/12/2019 12:36,Rewrite circuit with measurements with unitaries,,1,7,,,,CC BY-SA 4.0 +5641,2,,5638,3/6/2019 16:03,,3,,"

There's a superconducting circuit element called Josephson junction, which is roughly a nonlinear inductor. +The inductance of a Josephson junction depends on current via the relation +$$L(I) = \frac{L_0}{\sqrt{1 - (I/I_c)^2}}$$ +where $L_0$ is the inductance of the junction with no bias current and $I_c$ is the so-called ""critical current"" which is the maximum current that can pass through the junction before it stops being superconducting. +The resonance frequency of an LC resonator is $\omega_0 = 1 / \sqrt{LC}$, so if you change $L$ you change the resonance frequency. +Therefore, if you can include a Josephson junction into the resonator, you have a current-dependent resonance frequency.

+ +

Often, we use a dc SQUID, which is two junctions connected in parallel, instead of a single junction. +When you put some magnetic flux through the SQUID loop, it puts current through the two junctions and changes their inductance, therefore shifting the resonance frequency.

+ +

That's pretty much how most modern superconducting qubits are frequency tuned.

+",32,,32,,3/7/2019 15:33,3/7/2019 15:33,,,,2,,,,CC BY-SA 4.0 +5642,1,5649,,3/6/2019 17:13,,2,151,"

I saw that the Pauli matrices really work, that's rotating a state by 180 degrees, only if you take the density matrix for example with X it only works if first we take X $|\psi\rangle$ and multiply it by itself dagger. Then you can see it rotating around the X-axis. Same with Y and Z. +Also, in error correction, you use the R mapping only after you created a density matrix, but you don't use it on the vector state itself. Why is it?

+",5742,,1837,,3/7/2019 8:48,3/7/2019 8:48,Why is it that the Pauli matrices and error correction operator act only on $|\psi\rangle\langle \psi|$ and not on state vector $|\psi\rangle$ itself?,,2,0,,,,CC BY-SA 4.0 +5643,2,,5623,3/6/2019 17:46,,2,,"
    +
  1. Let $m = p_{i}^{a_i-1}(p_i-1)$ – the order of our multiplicative group. +Cyclic group means there is a primitive element $a$ with the order equals to the size of the group, that is $m$. Moreover, the cyclic group consists of the elements $a^1, a^2, ... , a^m=1$. The order of the element $a^k$ is exactly $m/\text{gcd}(m, k)$. If $m/\text{gcd}(m, k)$ has a particular power of $2$ as its largest divisor, then $k$ has corresponding particular power of $2$. All numbers $k$, i.e. numbers from $1$ to $m$, are split into sets by this power value. And the largest set can't have more than $m/2$ elements, because there is a set with all odd numbers $k$, with a size of $m/2$.

  2. +
  3. Because the probability of observing two same results in two experiments is $$P_1 \cdot P_1 + P_2\cdot P_2 + ... + P_j\cdot P_j,$$ where $(P_1,...,P_j)$ – is the probability distribution for events. Since every $P_i \leq 1/2$ and $P_1+..+P_j = 1$, that total expression is also $ \leq 1/2 $ (observe that $P_i\cdot P_i \leq P_i/2$).

  4. +
+",5870,,5870,,3/8/2019 18:09,3/8/2019 18:09,,,,0,,,,CC BY-SA 4.0 +5644,2,,5620,3/6/2019 18:37,,2,,"

Check this
+$$\frac{1}{\sqrt{3}}\left(\begin{array}{ccc} +1 & 1 & 1 \\ +1 & \omega & \omega^2 \\ +1 & \omega^2 & \omega \\ +\end{array}\right) = \left(\begin{array}{cc} +H & 0 \\ +0 & 1 \\ +\end{array}\right) \cdot \frac{1}{\sqrt{3}}\left(\begin{array}{ccc} +\sqrt{2} & 0 & 1 \\ +0 & \sqrt{3} & 0 \\ +1 & 0 & -\sqrt{2} \\ +\end{array}\right) \cdot +M_{3} +$$

+ +

$$M_{3} = \left(\begin{array}{ccc} +1 & 0 & 0 \\ +0 & \frac{1}{\sqrt{2}}i\omega^2 & \frac{1}{\sqrt{2}}i\omega \\ +0 & -\frac{1}{\sqrt{2}}\omega^2 & -\frac{1}{\sqrt{2}}\omega \\ +\end{array}\right) +$$

+ +

$$ +\frac{1}{\sqrt{2}}\left(\begin{array}{ccc} +i\omega^2 & i\omega \\ +-\omega^2 & -\omega \\ +\end{array}\right) = X \cdot S \cdot X \cdot Z \cdot H \cdot \left(\begin{array}{ccc} +\omega^2 & 0 \\ +0 & \omega \\ +\end{array}\right) \cdot Z +$$

+",5870,,5870,,3/6/2019 18:43,3/6/2019 18:43,,,,0,,,,CC BY-SA 4.0 +5645,2,,5642,3/6/2019 21:11,,2,,"

Most error correction schemes suppose that the transmitted vector state becomes mixed on the receiver end. For example, the transmitted state $|00\rangle$ can turn to $|11\rangle$ with probability $p^2$, to $|10\rangle$ with prob $p(1-p)$, to $|01\rangle$ with prob $(1-p)p$ and to $|00\rangle$ with prob $(1-p)^2$. So, the state in the end is a mixed state which can't be associated to a single vector state.
+You still can work with probability distributions of vector states instead of density matrices (and apply whatever rotations you like just on vectors), but generally this is not that fruitful. Density matrices capture the essence of the physical state.

+",5870,,,,,3/6/2019 21:11,,,,3,,,,CC BY-SA 4.0 +5646,1,5650,,3/7/2019 0:46,,4,77,"

Suppose I prepare following state consisting of (for example) three EPR pairs:

+ +

$$\lvert\Psi\rangle = \frac{\lvert00\rangle+\lvert11\rangle}{\sqrt{2}}\otimes\frac{\lvert00\rangle+\lvert11\rangle}{\sqrt{2}}\otimes\frac{\lvert00\rangle+\lvert11\rangle}{\sqrt{2}}$$

+ +

Then I shuffle the second qubits of all pairs before giving you the full (shuffled) state. You would not know which pairs of qubits form EPR pairs. Does this mean you would have a mixed stated over all possible permutations? How can I write such state?

+",5974,,55,,12/9/2021 14:42,12/9/2021 14:42,EPR states with permuted qubits,,1,2,,,,CC BY-SA 4.0 +5647,1,,,3/7/2019 1:22,,1,381,"

Why is it that copying an unknown qubit is impossible but creating a copy of the standard computational basis is possible by entangling it to existing qubits? And why one is possible and the other isn't?

+",5742,,26,,3/8/2019 16:19,3/8/2019 16:19,What does it mean that copying a state is impossible but creating a copy of by entangling is possible?,,1,1,,,,CC BY-SA 4.0 +5648,1,,,3/7/2019 4:36,,3,131,"

For example, if you ran the same program on the 'ibmqx2' and 'ibmqx4' computers, how much variance would there be between the results from both systems? There is the inherent presence of noise in each quantum computer, but this deals with the variance in results in a single computer. How can we compare the differences between each computer, if there is any variation?

+",5747,,26,,3/8/2019 16:16,4/4/2019 17:05,How much variation is there in the results between each quantum computer on the IBMQ Quantum Experience system?,,1,0,,,,CC BY-SA 4.0 +5649,2,,5642,3/7/2019 8:44,,3,,"

Describing the Pauli-$X$ matrix as a rotation by $\pi$ about a particular axis is specifically referring to how you would visualise the action of the gate with regards to the Bloch Sphere picture. This most naturally maps to the density matrix, which is why it's most apparent there. But you can apply it to the pure state picture as well. Note that you can parametrise any single-qubit pure state as +$$ +|\psi\rangle=\cos\frac{\theta}{2}|0\rangle+\sin\frac{\theta}{2}e^{i\phi}|1\rangle. +$$ +This has a Bloch vector of the form +$$ +\vec{n}=(\sin\theta\cos\phi,\sin\theta\sin\phi,\cos\theta). +$$

+ +

Now, let's consider $X|\psi\rangle=e^{i\phi}\left(\cos\frac{\theta}{2}e^{-i\phi}|1\rangle+\sin\frac{\theta}{2}|0\rangle\right)=e^{i\phi}\left(\sin\left(\frac{\pi}{2}-\frac{\theta}{2}\right)e^{-i\phi}|1\rangle+\cos\left(\frac{\pi}{2}-\frac{\theta}{2}\right)|0\rangle\right)$. By the same mapping, this has a Bloch vector +$$ +\vec{n}'=(\sin(\pi-\theta)\cos\phi,-\sin(\pi-\theta)\sin\phi,\cos(\pi-\theta))=(\sin\theta\cos\phi,-\sin\theta\sin\phi,-\cos(\theta)). +$$ +This is exactly a $\pi$ rotation (or reflection) about the x axis.

+ +

In error correction, it's a completely different reason for using the density matrix - you're trying to deal with possible errors, and that means you need an ensemble of states (one for each possible error), not just a pure state.

+",1837,,,,,3/7/2019 8:44,,,,0,,,,CC BY-SA 4.0 +5650,2,,5646,3/7/2019 8:47,,4,,"

Let $S_x$ be a permutation between qubits 2,4 and 6, and acts as identity on the other qubits. Use $x$ to index all possible permutations of that form, of which there are 6. Then you do indeed have a mixed state overall, and it's of the form +$$ +\rho=\frac{1}{6}\sum_{x=1}^6S|\Psi\rangle\langle\Psi|S^T +$$ +(Note that the $S$ matrix will be real so I can use the transpose in the place of the Hermitian conjugate).

+",1837,,,,,3/7/2019 8:47,,,,4,,,,CC BY-SA 4.0 +5651,2,,5647,3/7/2019 8:56,,3,,"

The no cloning theorem can be stated in the form:

+ +
+

If you are given an unknown state $|\psi\rangle$, which is promised to be one of a set of distinct states $\{|\phi_i\rangle\}$, it is impossible to create a second copy of $|\psi\rangle$ if there is a pair of $|\phi_i\rangle$ which are not orthogonal.

+
+ +

Computational basis states are orthogonal, so they're not covered by the theorem. Indeed, you want them to not be covered by the theorem because we can easily copy classical data.

+ +

There's a very obvious way that you can copy computational basis states. Start with your unknown qubit $|\psi\rangle$, introduce an extra qubit in the $|0\rangle$ state, and perform a controlled-not controlled off the first qubit. What do you get? +$$ +|0\rangle|0\rangle\mapsto|0\rangle|0\rangle\qquad|1\rangle|0\rangle\mapsto|1\rangle|1\rangle +$$ +The state of the first qubit has been cloned. There's no entanglement in this process itself. Of course, controlled-not is an entangling gate, and this is the essence of the proof of no cloning (the actual proof requires taking care of a few more details): if we wish to clone a state in superposition as well as the possibility of these two basis states, then we know by linearity that if the above two maps hold, it must be that +$$ +(\alpha|0\rangle+\beta|1\rangle)|0\rangle\mapsto\alpha|00\rangle+\beta|11\rangle. +$$ +This is an entangled state, and not the separable state that you want, $(\alpha|0\rangle+\beta|1\rangle)(\alpha|0\rangle+\beta|1\rangle)$.

+",1837,,,,,3/7/2019 8:56,,,,0,,,,CC BY-SA 4.0 +5652,1,5654,,3/7/2019 9:50,,3,283,"

I am reading the paper Restrictions on Transversal Encoded Quantum Gate Sets, Bryan Eastin, Emanuel Knill. I am unable to understand the following lines in the proof.

+ +
+

As the set of all unitary operators is a metric space, a finite number + of unitary operators cannot approximate infinitely many to arbitrary + precision

+
+ +

I need some references or hints as to understand how the above-quoted lines.

+",5977,,26,,3/8/2019 16:16,3/8/2019 16:16,A question on Eastin-Knill theorem,,2,0,,,,CC BY-SA 4.0 +5653,1,,,3/7/2019 9:50,,3,117,"

The QuEST code allows for simulation of quantum computers taking dephasing and depolarizing noise into account via one and two qubit dephasing and depolarization. What are realistic parameters for such noise representing the current state-of-the-art of super-conducting or ion-trap quantum computers? +Are there similar options as in qiskit.providers.aer.noise of the qiskit package (as explained here) to get parameters for other systems than IBM Q?

+",5909,,26,,3/8/2019 16:15,3/8/2019 16:15,What are reasonable noise/dephasing parameters for QuEST to emulate state-of-the-art quantum computers?,,0,0,,,,CC BY-SA 4.0 +5654,2,,5652,3/7/2019 10:27,,3,,"

In their case, their finite set of unitary operators is closed under composition. They even have footnote that emphasizes this.
+You can't approximate infinite set by some finite subset with the error that is less than half the minimum distance between elements in this finite subset. This is like trying to approximate every real number from $[0,1]$ by some finite subset with arbitrary precision. It's impossible.

+",5870,,,,,3/7/2019 10:27,,,,0,,,,CC BY-SA 4.0 +5655,2,,5652,3/7/2019 10:30,,1,,"

Probably the easiest way to think about this is to consider an equivalent statement for the real numbers. Consider the range $[0,1]$, for instance. You're given a finite set of real numbers within that range. If you think about these values on the number line, it should be fairly obvious that there are necessarily points that are a finite distance away, so I cannot use members of this set as arbitrarily accurate approximations for any real number in the range. (In this case, if your set contains $n$ elements, it would be best to have them at values $(2i-1)/(2n)$ for $i=1$ to $n$ so that all real numbers in the range are within $1/(2n)$ of some element in the set. But if you try to bunch some closer together, obviously other have to get further apart).

+ +

You can make the same argument for any continuous space for which there is a distance measure.

+",1837,,,,,3/7/2019 10:30,,,,0,,,,CC BY-SA 4.0 +5656,1,,,3/7/2019 10:47,,6,151,"

I have heard multiple times the claim that three rounds of syndrome measurement required for fault-tolerance in the surface code. I'm not sure what situation would require this, as I think less would suffice. Unfortunately, all these mentions were made in cases that I can't cite for you (like an off-hand comment), and I never followed up. But I wondered if anyone here might know what situation this is referring to.

+ +

In my claims that less would suffice, I am specifically imagining a surface code with standard $\sigma^z$ and $\sigma^x$ type stabilizers, and for which the logical $Z$ is composed of all $\sigma^z$s. I'm also assuming that it starts its life placing all physical qubits in the $|0\rangle$ state. This will result in the logical $|0\rangle$ state once stabilizer measurements are performed. For a logical $|0\rangle$, a string of physical $|1\rangle$s is placed across the code. Measurement of the logical $Z$ can be done at readout time by measuring all physical qubits in the $\sigma^z$s basis. This provides information that can infer the final $Z$ value, as well as a final state for the $\sigma^x$ stabilizers that can be used to correct it.

+ +

If we add in a single ancilla-assisted syndrome round between initialization and readout, we have something a bit more quantum. In the worst case, we could just ignore the results of these measurements. Then they just become an extra source of noise in the case described above. This extra noise wouldn't be enough to effect the fault-tolerance, even for distance 3. The case where we use the measurement results to decode should even be an improvement. And so on for the addition of more rounds.

+ +

From this, I see nothing special about the case of three rounds with regards to fault-tolerance. So I guess these claims referred to a slightly different situation.

+",409,,26,,3/8/2019 16:14,3/14/2019 12:47,In what situation are three rounds of syndrome measurement required for fault-tolerance in the surface code?,,0,1,,,,CC BY-SA 4.0 +5657,1,,,3/7/2019 12:24,,3,301,"

I have a set of numbers in a superposition state (example: 3,8,1,5) in a quantum register (of 3 qubits).

+ +

So I try to find the $n^{\text{th}}$ smallest number (example the $2^{\text{nd}}$ is 3).

+ +

I started by exploring the algorithm of Durr-Hoyer for finding the minimum, but I do not really see a way out, because I have to do a measurement to find the 1st minimum and other difficulties such as amplitudes changed by Grover algorithm

+ +

Can anyone help by telling me if it's possible to perform this computation in QC? And outline the procedure to follow to achieve it.

+ +

N.B: In Qiskit, I initialize the register with the function: initialization with the desired state, setting the amplitudes of other states (0,2,4,7) to 0.

+",5862,,26,,3/8/2019 16:28,3/8/2019 16:28,Finding the second smallest number. Is it achievable in QC?,,2,2,,,,CC BY-SA 4.0 +5658,2,,5618,3/7/2019 12:46,,1,,"

For the proof by induction there isn't really much more than doing some algebra from the equations you already laid out.

+ +

Let me write for simplicity $D_N\equiv -\mathbb 1_N + \frac{2}{N} \mathcal I_N$, where $\mathbb 1$ denotes the $N$-dimensional identity matrix, while $\mathcal I_N$ denotes the $N$-dimensional matrix whose every element is 1: $(\mathcal I_N)_{ij}=1\forall i,j$.

+ +

We therefore want to prove that +$$D_N\equiv-\mathbb 1_N + \frac{2}{N} \mathcal I_N=-H_n R_N H_n.\tag A$$

+ +

Proof by induction

+ +

Assume (A) to be true for some $N=2^n$, and try to prove it for $n\to n+1$ (note that $n\to n+1$ corresponds to $N\to 2N$): +$$ -\mathbb 1_{2N} + \frac{2}{2N} \mathcal I_{2N}=-H_{n+1} R_{2N} H_{n+1}.$$

+ +

Observe that +$$H_{n+1}=H_n\otimes H_1, \qquad +R_{2N}=\begin{pmatrix}R_N & 0\\ 0&\mathbb 1_N\end{pmatrix}.$$ +We therefore have +$$-H_{n+1} R_{2N} H_{n+1} += - \frac{1}{2}\begin{pmatrix}H_n & H_n\\ H_n& -H_n\end{pmatrix} +\begin{pmatrix}R_N & 0\\ 0&\mathbb 1_N\end{pmatrix} +\begin{pmatrix}H_n & H_n\\ H_n& -H_n\end{pmatrix} \\ += -\frac{1}{2}\begin{pmatrix}H_n & H_n\\ H_n& -H_n\end{pmatrix} +\begin{pmatrix}R_N H_n & R_N H_n\\ H_n& -H_n\end{pmatrix} +=-\frac{1}{2}\begin{pmatrix}H_n R_N H_n + \mathbb 1_N & H_n R_N H_n - \mathbb 1_N\\ H_n R_N H_n - \mathbb 1_N& H_n R_N H_n + \mathbb 1_N\end{pmatrix}. +$$ +By the induction hypothesis, $H_n R_N H_n=\mathbb 1_N-\frac{2}{N}\mathcal I_N$, therefore +$$ +-\frac{1}{2}\begin{pmatrix}H_n R_N H_n + \mathbb 1_N & H_n R_N H_n - \mathbb 1_N\\ H_n R_N H_n - \mathbb 1_N& H_n R_N H_n + \mathbb 1_N\end{pmatrix} = +\begin{pmatrix}-\mathbb 1_N + \mathcal I_N/N & \mathcal I_N/N \\ +\mathcal I_N/N & -\mathbb 1_N + \mathcal I_N/N\end{pmatrix}, +$$ +which is what you wanted to prove.

+ +

An alternative direct proof

+ +

Here is another way to prove this fact avoiding induction altogether.

+ +

We want to prove that $-\mathbb 1_N + \frac{2}{N} \mathcal I_N=-H_n R_N H_n$.

+ +

Observe that, by definition, the components of $H_n$ read +$$(H_n)_{ij}=\frac{1}{\sqrt{2^n}} (-1)^{i_B\odot j_B},$$ +where $i_B$ denotes the binary vector whose elements are the components of $i$ in its binary representation, and +$i_B\odot j_B\equiv \oplus_k i_k j_k$ (that is, the modulo-$2$ sum of the products of the binary components of $i$ and $j$).

+ +

On the other hand, $R_N$ is written componentwise as $(R_N)_{ij}=\delta_{ij} (-1)^{\delta_{i,0}}$.

+ +

The product $H_n R_N H_n$ thus gives +$$(H_n R_N H_n)_{ij} = \frac{1}{2^n} \sum_k (-1)^{k\odot(i_B\oplus j_B)} (-1)^{\delta_{k,0}},$$ +where $i_B\oplus j_B$ denotes the componentwise bitwise sum of the binary vectors $i_B$ and $j_B$.

+ +

Observe now that the $(-1)^{\delta_{k,0}}$ term only affects the $k=0$ element of the sum, and it does so by simply changing its sign from $+1$ to $-1$. In other words, it simply subtracts $2$ from the overall sum, so that we can rewrite the whole thing as +$$(H_n R_N H_n)_{ij} += \frac{1}{2^n} \left(\sum_k (-1)^{k\odot(i_B\oplus j_B)} - 2\right).$$ +To reach the conclusion you now only need to observe that +$$\sum_k (-1)^{k\odot(i_B\oplus j_B)}=N\delta_{i,j}.$$

+",55,,55,,3/7/2019 13:00,3/7/2019 13:00,,,,1,,,,CC BY-SA 4.0 +5659,2,,5657,3/7/2019 17:38,,4,,"

I don't think that's possible: Suppose your initial state is $\vert \phi\rangle$. Let $\vert \psi\rangle$ be a state with the numbers $1,4,8,13$ in superposition. Then $\langle \psi \vert \phi\rangle\neq 0$, since the states have $8$ and $13$ in common. But if we have some sort of $n$th minimum circuit $U_n$ with $U_2\vert \phi\rangle\vert 0\rangle=\vert\phi\rangle\vert 3\rangle$ and $U_2\vert \psi\rangle\vert 0\rangle=\vert \psi\rangle\vert 4\rangle$, the outputs are orthogonal. This is impossible if $U_2$ is a unitary.

+ +

I'm not sure exactly what you had in mind (a circuit, a channel,...?). In the most generality I can think of: Suppose $\vert \phi\rangle$ and $\vert\psi\rangle$ are uniform superpositions of the numbers $\{1,3,8,13\}$ and $\{1,4,8,13\}$, respectively. Then the fidelity between them is 0.75. Suppose we have some quantum channel $\Phi$ that is supposed to select the 2nd smallest element. We know the fidelity between $\Phi(\vert \phi\rangle\langle\phi\vert)$ and $\Phi(\vert \psi\rangle\langle\psi\vert)$ is at least 0.75 because channels increase fidelity. (I think) This implies that if the probability of measuring 3 in the first state is $p$, then the probability of measuring 3 in the second state is at least $0.75p$. So if we have a high probability of measuring 3 in the first state (which we should) then we also have a high probability of measuring 3 in the second state (which we should not).

+ +

Note that there is a big difference between what you asked, and the problem of finding the $n$th minimum given the state $\vert a_1\rangle\vert a_2\rangle\cdots \vert a_N\rangle$. In this case, if any of the numbers $a_1,\cdots, a_N$ are different, the states are orthogonal. The paper you linked provides a method to solve the problem in this case.

+",4517,,,,,3/7/2019 17:38,,,,0,,,,CC BY-SA 4.0 +5660,1,5665,,3/8/2019 1:41,,2,133,"

I was recently asked two questions concerning error in quantum computing:

+ +
    +
  1. Is it possible for quantum computers to exhibit behavior similar to flip errors in classical computers where a state $\vert0\rangle$ becomes $\vert1\rangle$ due to this error?
  2. +
  3. Is it possible for a quantum computer to decohere to $\vert1\rangle$ or some probability distribution between $\vert0\rangle$ and $\vert1\rangle$ based on the state the system is currently in.
  4. +
+ +

My own thoughts are that the first is possible depending on where in the Bloch sphere your qubits are and the operations you're trying to do. That's why we have quantum error-correction code.

+ +

The second question was more tricky. My explanation is that, if I have a density matrix representing the pure state $\begin{bmatrix}1 & 0 & 0 & 1\end{bmatrix} / \sqrt 2$: +$$\begin{bmatrix}0.5 & 0 & 0 & 0.5 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0.5& 0& 0& 0.5\end{bmatrix}$$

+ +

then I can see the probabilities of all given outcomes for the system. However, if I introduce some noise, I might get something like:

+ +

$$\begin{bmatrix}0.3 & 0 & 0 & 0.1 \\ 0 & 0.2 & 0 & 0 \\ 0 & 0 & 0.2 & 0 \\ 0.1& 0& 0& 0.3\end{bmatrix}$$

+ +

If I try to measure the state corresponding to this density matrix, I get the result 0.08, which is very close to 0. What I glean from this experiment is that, as the system interacts with the environment, information is lost, returning the system to the ground state, which is 0.

+ +

Is this interpretation correct? If not, can somebody provide more detail into what's going on?

+",5472,,26,,3/8/2019 16:09,3/8/2019 16:09,Decoherence in quantum systems always produces $\vert0\rangle$,,1,0,,,,CC BY-SA 4.0 +5661,1,,,3/8/2019 3:40,,7,251,"

Cross-posted on MO

+ +

The original ideas from the 70's/80's - that begat the [BB84] quantum key distribution - concerned quantum money that is unforgeable by virtue of the no-cloning theorem. A limitation was that the quantum money required the bank to verify each transaction. Quantum money based on knots and hidden subspaces have been explored to provide a ""public key"" quantum distribution.

+ +

I find the knots paper, aided by Farhi's exposition, to be quite accessible.

+ +

Enter the recent paper ""Quantum Money from Modular Forms,"" by Daniel Kane.

+ +

For me modular forms are much more intimidating than knots; my knowledge is mostly limited to an excellent series of lectures by Keith Conrad and friends. However, Kane's exposition is very good and I can see some general relation to the previous work on knots.

+ +

Nonetheless, I'm getting hung up on section 3.2 onward. I'm wondering how much of a dictionary we can have between the knots work and modular forms.

+ +

That is, I know we can say something like there are $d!\times[\frac{d!}{e}]$ grid diagrams of grid dimension $d$, and a uniform superposition of grid diagrams all with the same Alexander polynomial is an eigenstate of a Markov chain of Cromwell moves; not only that, the Markov chain can be made doubly stochastic and easy to apply, and the Alexander polynomial is efficient to calculate.

+ +
+

Does it even make sense to say something roughly as in ""there are $\lfloor N/12\rfloor$ cusp modular forms of weight $2$ and level $N$, and a uniform superposition of modular forms all with a same number of ideal classes is an eigenstate of a Hecke operator; not only that, the Hecke operator is Hermitian and easy to apply and the number of ideal classes is efficient to calculate?""

+
+ +

Have I gotten off track?

+",2927,,2927,,11/11/2019 1:50,2/11/2021 22:08,What role do Hecke operators and ideal classes perform in “Quantum Money from Modular Forms?”,,1,0,,,,CC BY-SA 4.0 +5662,1,5669,,3/8/2019 5:25,,5,191,"

As I understand it the Pauli-X, Y and Z gates are the same as their rotational gates with a rotation of $\pi$. But given the expression for those gates, I find that there is a factor of $-i$ in each of them. Can someone explain why?

+ +

For example the X-gate:

+ +

$R_X(\theta)=\begin{align}\begin{bmatrix} +\cos\frac{\theta}{2}&-i\;\sin\frac{\theta}{2}\\ +-i\;\sin\frac{\theta}{2}&\cos\frac{\theta}{2} +\end{bmatrix}\end{align}\\ +$ +$R_X(\pi)=\begin{align}\begin{bmatrix} +0&-i\\ +-i&0 +\end{bmatrix}\end{align}\\ +$ +$X=\begin{align}\begin{bmatrix} +0&1\\ +1&0 +\end{bmatrix}\end{align}\\ +$

+",5932,,26,,3/29/2019 19:52,3/29/2019 19:52,Where is the factor of $-i$ in rotation gates coming from?,,1,0,,,,CC BY-SA 4.0 +5663,2,,5634,3/8/2019 7:47,,2,,"

The entanglement entropy (what you call ""von Neumann entropy"") is a good measure for entanglement of pure states in the asymptotic setting, i.e. when one is dealing with many copies. However, it is not a good measure for mixed states.

+ +

Distillable entanglement and entanglement cost are entanglement measures which apply to both pure and mixed states. Moreover, for pure states, all three measures are equal, which is desirable due to the special status of the entanglement entropy. Finally, entanglement cost and distillable entanglement are the largest and smallest entanglement measure which coincides with entanglement entropy for pure states, and which is operationally meaningful in an asymptotic scenario.

+",491,,,,,3/8/2019 7:47,,,,5,,,,CC BY-SA 4.0 +5664,1,5666,,3/8/2019 8:41,,3,928,"

If we suppose that $XX$ is the tensor product of $X$ with $X$ such as $XX = X \otimes X$

+ +

How would we calculate the rotation operator of this $XX$ gate.

+ +

Does this work? If so why? +$$ +R(XX)_\theta = e^{-i\frac{\theta}{2}XX} = \cos\left(\frac{\theta}{2}\right)I - i\sin\left(\frac{\theta}{2}\right)XX $$

+",5791,,26,,3/30/2019 7:46,3/30/2019 7:46,"Rotation operator on Pauli parity gates $XX$, $YY$ and $ZZ$",,1,0,,,,CC BY-SA 4.0 +5665,2,,5660,3/8/2019 8:48,,2,,"
+

Is it possible for quantum computers to exhibit behavior similar to flip errors in classical computers where a state |0⟩ becomes |1⟩ due to this error?

+
+ +

Yes. It would be a very abrupt error if you're talking about errors on physical qubits. Usually, we'd think of an error as being a little bit of an X rotation (for example). However, the effect of performing an error correction step, and measuring the syndrome, divides that into two cases, ""no error"" and ""bit flip"", the latter occurring with small probability. Hence, in particular when you're talking about the effects of error correction/fault tolerance on an encoded qubit, the ultimate errors will generally be of this Pauli form.

+ +
+

Is it possible for a quantum computer to decohere to |1⟩ or some probability distribution between |0⟩ and |1⟩ based on the state the system is currently in.

+
+ +

That depends very much on your noise model. In the context of error correction, people often describe the errors as the action of Pauli operators (i.e. the depolarising channel on each qubit). The only stationary state of this channel is the maximally mixed state (NB Not $|0\rangle$), so the ultimate state after a long time is independent of the initial state. Perhaps you're thinking about the specific noise model that is relaxation/amplitude damping? In that case, anything in the excited state has a tendency to relax to the ground state, and so the only stationary state is $|0\rangle$.

+ +

However, I can easily give you noise models where the final state depends on the initial state. Dephasing noise (effectively, Pauli Z errors on each qubit) acting on several qubit is one such example. To see why, note that $Z$ never changes the number of qubits in the $|1\rangle$ state, so the final state must depend on how many $|1\rangle$s there were in the initial state. (Ultimately, you get a mixed state which is maximally mixed in each 'excitation subspace', but the weight on that subspace is determined by the initial state.)

+",1837,,,,,3/8/2019 8:48,,,,0,,,,CC BY-SA 4.0 +5666,2,,5664,3/8/2019 8:55,,6,,"

This does indeed work because this construction works for any matrix $H$ where $H^2=\mathbb{I}$. +$$ +R_\theta(H)=e^{-i\theta H/2}=\cos\frac{\theta}{2}\mathbb{I}-i\sin\frac{\theta}{2}H +$$

+ +

There are several ways that you could prove this. I think the easiest way is to realise that because $H^2=\mathbb{I}$, then the eigenvalues of $H^2$ are 1, and hence the eigenvalues of $H$ must be $\pm 1$. Let $P_{\pm}$ be projectors onto the eigenspaces of eigenvalue $\pm 1$ respectively. So, +$$ +\mathbb{I}=P_++P_-\qquad H=P_+-P_- +$$ +Furthermore, by definition of how a function can be applied to a matrix (you apply the function to each of the eigenvalues), +$$ +R_\theta(H)=e^{-i\theta/2}P_++e^{i\theta/2}P_-. +$$ +Now we can substitute for $P_{\pm}$: +$$ +R_\theta(H)=e^{-i\theta/2}(\mathbb{I}+H)/2+e^{i\theta/2}(\mathbb{I}-H)/2 +$$ +Group the terms of $\mathbb{I}$ and for $H$ and simplify.

+",1837,,,,,3/8/2019 8:55,,,,3,,,,CC BY-SA 4.0 +5667,2,,5657,3/8/2019 9:12,,1,,"

Sam Jaques' first paragraph is a very good explanation of why what you want to do is impossible.

+ +

I just wanted to add that your question seems to be implying that you can start with a state such as $(|1\rangle+|3\rangle+|5\rangle+|8\rangle)/2$ and return the minimum using the Durr-Hoyer paper that you cite. This is not the case either, by the same argument. The Durr-Hoyer algorithm simply doesn't apply to your setting. They use what is essentially a database function $f(n)$ where, in your case, $f(0)=3, f(1)=8, f(2)=1, f(3)=5$. They do not start with the state you're talking about, and they access their database function many times. If you did have their setting, you should be able to adapt it to find the 2nd smallest.

+",1837,,,,,3/8/2019 9:12,,,,5,,,,CC BY-SA 4.0 +5668,1,5739,,3/8/2019 10:27,,2,119,"

I am trying to figure out how to use the functions ""_make_pred_succ_maps"". Here is a description of the function from Github:

+ +
def _make_pred_succ_maps(self, n):
+    """"""Return predecessor and successor dictionaries.
+    Args:
+        n (int): reference to self.multi_graph node id
+    Returns:
+        tuple(dict): tuple(predecessor_map, successor_map)
+            These map from wire (Register, int) to predecessor (successor)
+            nodes of n.
+    """"""
+
+ +

Nevertheless, I do not understand how to interpret outputs like the following:

+ +
>>> circuit_name._make_pred_succ_maps(1)
+({}, {(QuantumRegister(3, 'a'), 0): 10})
+
+>>> circuit_name._make_pred_succ_maps(2)
+({(QuantumRegister(3, 'a'), 0): 41}, {})
+
+ +

What do the individual numbers mean?

+",5600,,26,,3/8/2019 15:59,3/19/2019 9:29,Qiskit predecessor and successor map of DAG circuits,,1,2,,,,CC BY-SA 4.0 +5669,2,,5662,3/8/2019 20:53,,4,,"

Let's start from the basics. Any arbitrary single qubit state can be written as

+ +

$$|\Psi\rangle = e^{i\gamma} \left(\cos \frac {\theta}{2} |0\rangle+ e^{i\phi} \sin \frac{\theta}{2}|1\rangle\right),$$ where $\theta, \phi, \gamma \in \Bbb R$. $0\leq \theta \leq \pi$ and $0\leq \phi\leq 2\pi$. $e^{i\gamma}$ is a global phase here. Qubit states with arbitrary values of $\gamma$ represent the same quantum state as global phases don't have any observable effects. So the standard notation for qubit states is

+ +

$$|\Psi\rangle = \cos \frac {\theta}{2} |0\rangle+ e^{i\phi} \sin \frac{\theta}{2}|1\rangle $$

+ +

where we neglect the global phase factor $e^{i\gamma}$.

+ +

Remember that you are working on a vector space structure where $|0\rangle$ and $|1\rangle$ are your basis elements. The rotation operators $R_X, R_Y$ and $R_Z$ are simply linear maps in this context (in the standard $\{|0\rangle, |1\rangle\}$ basis). And so are the Pauli $X, Y$ and $Z$.

+ +

Now, note that you can write $R_X(\pi)$ as $-iX$. When $X$ acts on an arbitrary state $|\Psi\rangle$ it will produce $X|\Psi\rangle$. If $-iX$ acts, it will produce $-iX|\Psi\rangle$ instead. However, the states $-iX|\Psi\rangle$ and $X|\Psi\rangle$ simply differ by a global phase of $-i$, or in other words by a factor of $e^{i\gamma}$ where $\gamma = (2n+1)\frac{\pi}{2}$ and $n\in \Bbb N$. So, as you can see, $R_X(\pi)$ and $X$ are equivalent mappings as global phases don't matter in quantum mechanics!

+ +

As for why the Pauli operators and rotation operators differ by a phase factor, you'll have to check out the derivations for the following. +You'll find an outline here.

+ +

$$R_X(\theta) = e^{-i \frac{\theta}{2}X},$$

+ +

$$R_Y(\theta) = e^{-i \frac{\theta}{2}Y},$$

+ +

$$R_Z(\theta) = e^{-i \frac{\theta}{2}Z}.$$

+",26,,26,,3/8/2019 22:21,3/8/2019 22:21,,,,0,,,,CC BY-SA 4.0 +5670,1,,,3/8/2019 21:26,,2,84,"

In a semiclassical treatment, the noise Hamiltonian of a quantum system can be treated as a summation over its noise channels in the following way: +$$\hat{H}_{\text{noise}}=\sum_{k}\beta_{k}\left(t\right)\hat{N}_{k}$$ +where $\hat{N}_k$ is an operator indicating the noise axis in Hilbert space, and $\beta_k(t)$ is a classical noise field. Considering the case of a single qubit that is not subjected to control fields, the trivial noise channel is $N_z = \sigma_z$ - fluctuations in the magnetic field in the environment of the qubit results in Zeeman splitting and therefore to an undesirable Z rotation. However, I would like to know what physical process can lead to a noise channel in an orthogonal direction to the quantization axis (XY rotations)? To make it clear, all I am asking for is an example.

+",5811,,5811,,3/12/2019 18:08,3/12/2019 18:08,What noise channel that is not coming from the control can lead to XY qubit rotations?,,0,4,,,,CC BY-SA 4.0 +5672,1,,,3/9/2019 2:03,,2,170,"

I don't understand how it's being proven that error correction can be applied only to X, Z noises and this solves all errors?

+ +

Does this have to be with this set being universal? (Z is exactly like phase matrix or rotation matrix.)

+ +

Bonus question: When recovering a state in Shors code does it matter if I apply X, Z or Z, X?

+",5742,,26,,3/9/2019 12:36,3/9/2019 12:36,"Why does phase flip correction error? Why could any error be written as a linear combination of I, X, Z and ZX matrices?",,1,2,,,,CC BY-SA 4.0 +5673,2,,5672,3/9/2019 2:24,,3,,"

The reason people focus on X and Z errors is because

+ +
    +
  1. X and Z are super simple. You can propagate the errors through common gates like CNOT and H without any trouble. A product of X and Z errors on various qubits before a series of Clifford gates is equivalent to a (different) product of X and Z errors on various qubits after the gates. And error correcting codes are almost all made up of Clifford gates.
  2. +
  3. You can still get upper bounds on how bad more flexible real quantum errors will be. An accidental 5 degree rotation around the Z axis of a qubit is no worse than a $\sin^2(5^\circ)$ chance of a Z error on that qubit.
  4. +
+",119,,,,,3/9/2019 2:24,,,,2,,,,CC BY-SA 4.0 +5674,1,,,3/9/2019 8:46,,3,182,"

I have read that quantum computers are not known to be able to solve NP-complete problems in polynomial time. However, if you consider a game of Battleship with grid size $X, Y$ and represent this by a binary string $01100\cdots$ of size $X \times Y$ where the $1$s represents ship locations, wouldn't Grover's algorithm be able to solve this in $\mathcal{O}(\sqrt{XY})$?

+ +

Battleship is considered NP-complete. Why isn't this considered polynomial time?

+",5632,,26,,3/9/2019 9:37,4/28/2019 14:43,Grover's algorithm and Battleship solution,,1,6,,,,CC BY-SA 4.0 +5675,2,,5586,3/9/2019 12:14,,4,,"

If you like Python and want to run jobs on a real device, your options are Qiskit, ProjectQ or Forest.

+ +

If you like Python and are happy to wait for access to a real device, you could additionally go for Cirq. In this case, you might also want to look into the features of the simulators provided by all the Python frameworks, to find the one that best suits your intended use cases.

+ +

All the Python frameworks use the same basic way of building up quantum circuits by laying down simple quantum gates. They differ in their fancy features. Since I work on Qiskit, I am most familiar with its fancy features. But the fancy features of the others may suit you better. It all depends on what you want to do. But your decision on which to learn is not irreversible: it should be quite easy to learn with one and then use that same experience in using the rest.

+ +

If you are familiar with Visual Studio, and especially if you work in C#, it may be that Q# would be easiest for you. I am not a Visual Studio kind of person, so I have no experience with this myself.

+",409,,26,,3/9/2019 12:59,3/9/2019 12:59,,,,0,,,,CC BY-SA 4.0 +5676,1,,,3/9/2019 15:27,,2,176,"

I know what the Hamming code is. But I don't understand how could this idea be applied in quantum computation since it's required to cover the case of superposition and entanglement. How could you decide parity in that case? And how is the measurement performed in this coding so that we get the information on where is the error while being able to not change the codeword? +Is it possible to know where is the error while not changing the state that was sent? Basically, how is it performed?

+ +

Is there a place to read about it which explains it in a concise way and explains it well?

+",5742,,26,,3/9/2019 15:31,4/15/2019 10:29,How does Steane code use the classical Hamming code for error correction?,,1,0,,,,CC BY-SA 4.0 +5677,1,,,3/9/2019 16:10,,3,161,"

I am new and I don't understand where I should give the input and where I should get the output. Please explain with an example of a circuit run on the Quirk simulator. How to add two numbers?

+",5991,,26,,3/9/2019 16:16,3/9/2019 16:16,How to simulate a simple circuit to add two numbers in Quirk?,,0,2,,,,CC BY-SA 4.0 +5680,1,5683,,3/10/2019 10:27,,1,134,"

In error correction, like the bit flip, you perform a measurement which corresponds to different projections so that the outcomes can teach you about the error. What does it mean? How do you actually do it? Do you have to do the measurement in different bases?

+ +

Same with arbitrary errors which are composed of $I, X, Y, Z$ matrices and you want to perform a measurement which will collapse the state to either one of them. How is it performed? Do you measure in different bases?

+ +

What's the difference between measurement in different bases to measurement with different projections?

+",5742,,26,,3/10/2019 12:07,3/11/2019 7:29,What does it mean to perform a measurement in correspondence with different projections?,,1,0,,,,CC BY-SA 4.0 +5681,1,,,3/10/2019 21:21,,3,146,"

Instead of the complicated Steane code, I don't understand why don't we use a much simpler and exact imitation of the classical Hamming code.

+ +

So here is my idea: Let's have 7 qubits, and we will encode our qubit in the last wire. Based on this we will create CNOTs gates which will fix the parity of the code. The control would be qubit 1, 2, 4 just like classical code. +This is all exactly like classical code.

+ +

Then to decode it, you can create 3 ancillas which simply read/copy the values of 1, 2, 4 qubits. So for now, just like classical qubits, you have the value specified in the three ancillas indicating where the error is.

+ +

All that remains to be done is performing a partial measurement of the three ancillas to just get the index of the error. The rest is unchanged.

+ +

So what's the problem with this? What is the point of creating categories of even codes and odd ones and collapsing into them like in Steane code?

+",5742,,26,,3/10/2019 23:32,3/31/2019 17:55,In error correction code why don't we imitate the Hamming code instead of the complicated Steane code?,,1,7,,,,CC BY-SA 4.0 +5683,2,,5680,3/11/2019 7:29,,2,,"

Let's get some terminology correct. A particular measurement basis corresponds to a set of projectors, $\{P_i\}$ (satisfying $\sum_iP_i=\mathbb{I}$), where each $P_i$ corresponds to a measurement outcome. Sometimes, measurements are specified by giving a Hermitian operator $H$ which is not a set of projectors. Most often, we'd be talking about something with eigenvalues $\pm 1$, so you'd have +$$ +H=P_1-P_2, +$$ +so that defines the corresponding projectors.

+ +

From a theorist's perspective you can 'just' measure in that particular basis. From a practical perspective, what you often want to do is convert the measurement into a measurement on the computational basis. You can find a unitary $U$ such that +$$ +\tilde P_i=UP_iU^\dagger +$$ +is diagonal. So, instead, you can apply unitary $U$ and then measure in the computational basis (although if the projectors are not rank 1, there would be some grouping of terms).

+ +

With regards to error correction, there is a particularly natural way to measure the $\pm 1$ eigenvalue of a stabilizer. + +You measure the top qubit in the computational basis, where the $\sigma_1\otimes\ldots\otimes\sigma_n$ is the stabilizer operator that you want to measure.

+",1837,,,,,3/11/2019 7:29,,,,0,,,,CC BY-SA 4.0 +5684,1,,,3/11/2019 14:54,,3,264,"

When considering quantum error correction over depolarizing channels, the depolarizing probability $p$ such that an error of the kind $X,Y,Z$ will happen is used as a priori information in order to use it for determining the most likely error coset to have affected the quantum information $|\psi\rangle$ sent through such channel.

+ +

In this context, it is logical to use such a priori information for decoding, as it gives the information needed about the channel to decode with high probability of success. However, in the reality, such knowledge about the depolarizing channel will be an estimate $\hat{p}$ that will be used as a priori inforamation, as perfect knowledge of the channel is not possible. I was wondering then how such estimation of the depolarizing probability might be performed, and so which would be the error that such estimates might present.

+",2371,,,,,3/12/2019 9:21,Estimating the depolarizing probability of depolarizing channels,,1,2,,,,CC BY-SA 4.0 +5685,2,,5684,3/12/2019 9:21,,1,,"

This probably only addresses half of your question...

+ +

Most of the time, estimates of the error probability are not so important. If you're using a non-degenerate error correcting code for a single logical qubit, all you need to know (effectively) is enough to resolve a choice between two different error corrections (i.e. you want to know that the number of errors is smaller than half the distance of the code with high probability). Small mistakes in estimation are not going to change that, unless you're right up at the boundary of whether it works or not (and then, whichever side of the boundary you're on, the 'with high probability' rider I just put on it is unlikely to hold. You want to know you're at least a few standard deviations away from that threshold).

+ +

The easiest example is the classical repetition code. At the time of decoding, if you see a bunch of 0s and 1s, which do you decode it to? You assume that the per-bit probability of error is less than 1/2, and you decode to whichever bit value you see more of. It doesn't matter if that error probability is 0.3 or 0.31, you proceed in the same way.

+ +

Where your estimate of the error probability does make a difference is if you're using error correcting codes out beyond the literal distance value of the code. The typical example of this is with the Toric Code. This is defined for $O(N^2)$ qubits on an $N\times N$ grid. The code has distance $N$, i.e. there are combinations of $N/2+1$ errors that would lead to a logical error when you do the syndrome measurement and correction. However, people still try to use the Toric Code when there are $\epsilon N^2$ errors, for some small enough $\epsilon$. That is based heavily on an assumption about the noise model and its parameters to determine which errors are most likely. I did some work at some point (not quite for depolarising noise) looking at the Toric code and how the error correction threshold changes depending on how good an estimate you have of the noise parameters. For example, if you have different rates of X and Z errors, but you assume they're the same rate, as compared to knowing what their rates are. See Figure 2 of that paper.

+",1837,,,,,3/12/2019 9:21,,,,1,,,,CC BY-SA 4.0 +5687,2,,5640,3/12/2019 12:36,,2,,"

Here's a silly method that works if you know $y$, you know the probability of measuring $y$, and you can efficiently generate arbitrary-size superpositions of the form +$$\frac{1}{\sqrt{N}}\sum_{b < N}\vert b\rangle.$$ +To do this, use a Grover-like search: You need two circuits $U_y$ and $U_0$, with the following action: +$$U_y\vert x\rangle \vert \psi\rangle = \begin{cases}\phantom{-}\vert x\rangle\vert\psi\rangle&,x\neq y\\-\vert x\rangle\vert \psi\rangle&,x=y\end{cases}$$

+ +

$$U_0\vert x\rangle= \begin{cases}\phantom{-}\vert x\rangle&,x=0\\-\vert x\rangle&,x\neq 0\end{cases}$$

+ +

Define a ""Grover Iteration"" $G:=CU_yC^{-1}U_0$ and just apply this repeatedly. If the probability of measuring $y$ is $p$, you will need $O(\sqrt{1/p})$ iterations to have a high probability that the final state is close to $\vert y\rangle \vert\phi\rangle$.

+ +

Why: If we define $\vert\psi\rangle=C^{-1}\vert y\rangle\vert \phi\rangle$, and decompose $\vert 0\rangle=\alpha_1\vert \psi\rangle+\alpha_2\vert \psi^\perp\rangle$, then this algorithm will rotate through the space spanned by $\vert \psi\rangle$ and $\vert \psi^\perp\rangle$, the same as Grover's algorithm. Each iteration will rotate by the angle $\theta:= \arccos(\vert\langle \psi^\perp\vert 0\rangle\vert)\approx \sqrt{p}$.

+ +

The problem is that we need $\pi/2$ to be near an integer multiple of $\theta$ to get an exact answer. Thus, we add some number $N$ of ancilla qubits, expand the circuit to $C'=C\otimes H^{\otimes N}$, and expand $U_y$ to be

+ +

$$U_y\vert x\rangle \vert \psi\rangle\vert n\rangle = \begin{cases}\phantom{-}\vert x\rangle\vert\psi\rangle\vert n\rangle&,x\neq y\text{ or }n>q\\-\vert x\rangle\vert \psi\rangle\vert n\rangle&,x=y\text{ and }n\leq q\end{cases}$$

+ +

We choose $q$ such that the probability of both getting $y$ in the first register and $n\leq q$ in the third register is precisely enough that an integer number of these ""Grover"" iterations will take us to the state +$$\frac{1}{\sqrt{q}}\sum_{n\leq q}\vert y\rangle\vert \phi\rangle\vert n\rangle$$

+ +

Then we use the arbitrary superposition circuit to clear the third register, and we use a series of $X$ gates to clear $y$ in the first register (since it is a bitstring that is known to us). All that's left is $\vert\phi\rangle$.

+ +

Ultimately, the complexity is roughly $O(1/\sqrt{p})$ times the complexity of $C$ itself, plus some number of ancilla (for the $\vert n\rangle$ register) that will be logarithmic in the desired precision of the final state (since we should be able to get $\epsilon$-close to an integer multiple of $\pi/2$ with $\Omega(\log(1/\epsilon))$ ancilla).

+ +

Hence: Not very efficient, requires a lot of knowledge of the circuit $C$, but doesn't need any measurements!

+",4517,,,,,3/12/2019 12:36,,,,3,,,,CC BY-SA 4.0 +5688,1,,,3/13/2019 1:24,,3,105,"

An error can be written as a linear combination of $\Bbb I$, $X$, $Z$, $XZ$ Pauli matrices. So when measuring an errand state we aim at collapsing the error into one of these four possibilities. How is it done in practice in terms of matrices of observables, projections, and measurements? Can you specify what are the observables that when measured collapse an error state to one of the four possibilities?

+",5742,,26,,3/13/2019 13:28,3/14/2019 18:38,How does the actual measurement collapsing an error to an orthogonal basis look like?,,1,0,,,,CC BY-SA 4.0 +5690,1,5693,,3/13/2019 12:28,,1,79,"

According to the question Q1Q2Q3 coupling in qubo file we can couple 3 qbits. When it comes with 4 qbits like q1q2q3q4, how should set this 4-qbit element to qubo file?

+",5968,,26,,3/13/2019 13:23,3/13/2019 21:20,Q1Q2Q3Q4 coupling in qubo file,,1,0,,,,CC BY-SA 4.0 +5692,1,,,3/13/2019 21:14,,6,700,"

I would like to implement a Fredkin gate based on square root of swap and one-qubit gates. In particular, I was hoping to find the exact gate named ""?"" in this circuit:

+ +

+ +

In addition, I want to avoid using C-SQSWAP. Otherwise, the solution would be trivial.

+ +

Any ideas?

+",6017,,6017,,3/13/2019 21:20,3/14/2019 10:17,Implement Fredkin gate with square root of swap,,2,0,,,,CC BY-SA 4.0 +5693,2,,5690,3/13/2019 21:20,,1,,"

You can use a technique of reduction by substitution. +Here we represent using ancilla representing a Boolean constraint $ z\Leftrightarrow x_1\wedge x_2 $ as a quadratic penalty function : +$$P(x_1,x_2;z) = x_1 x_2 - 2(x_1+x_2)z + 3z$$

+ +

For a triplet interaction, you use it to reduce to pairwise : +$$ x_1 x_2 x_3 = \min_z \bigl\{ z x_3 + M P(x_1,x_2;z) \bigr\}, M>1 $$

+ +

For higher degrees, you can sequentially define ancilla variables in order to reduce terms by one until you have pairwise interactions. Again, this is explained in the D-Wave documentation.

+",4127,,,,,3/13/2019 21:20,,,,0,,,,CC BY-SA 4.0 +5694,1,5697,,3/13/2019 22:12,,4,171,"

There was a problem at the Winter 2019 Q# codeforces contest (that is now over), which I cannot find a mathematical solution for.

+ +

The problem goes like this: +You are given 3 qubits that can be in one of the following states:

+ +

$$|ψ_0⟩=\frac{1}{\sqrt 3}\left(|100⟩+ω|010⟩+ω^2|001⟩\right)$$

+ +

or

+ +

$$|ψ_1⟩=\frac{1}{\sqrt 3}\left(|100⟩+ω^2|010⟩+ω|001⟩\right)$$

+ +

where $ω=e^{2iπ/3}$.

+ +

Build a function that determines in which of the 2 states are the 3 qubits.

+ +

My question is, how could you solve this problem in linear algebra (bra-kets notation) and the normal quantum logic gates? I figured out you have to somehow measure the coefficients, but I don't know quite how. If you could include a ""code algorithm proof of concept"" that would be great, but I am mainly interested in understanding the algebra part. After understanding it, implementing would be just a problem of translating the operations/gates.

+ +

If I got something wrong, please correct me. I am new-ish to the whole quantum computing scene.

+",6018,,26,,3/14/2019 15:20,5/10/2019 7:07,How to measure superposition coefficients to determine state?,,1,1,,,,CC BY-SA 4.0 +5695,2,,5692,3/13/2019 23:03,,3,,"

This is a square root of swap circuit:

+ +

+ +

You can get a CNOT operation by doing single-qubit rotations between two sqrt swaps. Here's the circuit:

+ +

+ +

There are standard decompositions of the Fredkin gate into the Toffoli gate and CNOTs, and standard decompositions of the Toffoli gate into CNOTs and single-qubit operations. For example, here is a Fredkin decomposition used by Cirq that only uses CNOTs between adjacent qubits:

+ +

+ +

Replace all the CNOTs with the CNOT decomposition and voila:

+ +

+ +

Of course, you would try to cancel as many of the single qubit operations as possible.

+ +

Are there better decompositions? Almost definitely. But this is one that's easy to find.

+",119,,,,,3/13/2019 23:03,,,,3,,,,CC BY-SA 4.0 +5696,1,,,3/14/2019 0:48,,15,1828,"

Question

+ +

I want to use the Grover-Algorithm to search an unsorted database for an element $x$. Now the question arises, how do I initialize index and value of the database with the qubits?

+ +

Example

+ +
    +
  • Let's say I have $4$ qubits. Thus, $2 ^ 4 = 16$ classical values can be mapped.
  • +
  • My unsorted database $d$ has the following elements: $d [\text{Value}] = [3,2,0,1]$.
  • +
  • I want to search for $x = 2_d = 10_b = |10\rangle$.
  • +
  • My approach: index the database $d$ with $d [(\text{Index, Value})] = [(0,3), (1,2), (2,0), (3,1)]$. Registers $0$ and $1$ for the index and registers $2$ and $3$ for the value. Then apply the Grover-Algorithm only to registers $2$ and $3 (\text{Value})$. Can this be realized? Is there another approach?
  • +
+ +

What I already implemented (on GitHub)

+ +

The ""Grover-Algorithm with 2-, 3-, 4-Qubits"", but what it does is simple: the bits are initialized with $|0\rangle$, the oracle will mark my solution $x$ (which is just a number like $2_d = 10_b$), the Grover part will increase the probability of the selected element $x$ and decrease all other probabilities and then the qubits are read out by being mapped to the classical bits. We let this process run several times in succession and thus obtain a probability distribution, where the highest probability has our sought element $x$.

+ +

The output is always the same as the one marked in the oracle. How can I generate more information from the output, that I do not know at the time when I constructed the oracle?

+",6021,,26,,3/14/2019 15:18,8/20/2022 0:27,How is the Grover-Algorithm applied to a database?,,4,0,,,,CC BY-SA 4.0 +5697,2,,5694,3/14/2019 5:55,,5,,"

The idea is to apply a unitary transformation which will map these states to a different pair of orthogonal states which are easy to distinguish by measuring in computational basis.

+ +
+ +

Let's construct a unitary $U$ which prepares $|\psi_0\rangle$ starting from $|000\rangle$ state.

+ +

The first step is to prepare a $W_3 = \frac{1}{\sqrt{3}}\left(|100\rangle + |010\rangle + |001\rangle\right)$ state, as described in this question.

+ +

After that you just have to apply the $\omega$ and $\omega^2$ phases to the states $|010\rangle$ and $|001\rangle$ - this can be done using rotation gates. Depending on the primitives you have, you can do it using R1 gate, like the authors' solution, using Rz gate if you're ok with some accumulating some global phase, or using zero-controlled Rz.

+ +
+ +

Now, what happens if you take the states $|\psi_0\rangle$ and $|\psi_1\rangle$ and apply the adjoint of the transformation $U$ to them? You know that the state $|\psi_0\rangle$ will be transformed to $|000\rangle$, and the state $|\psi_1\rangle$ will be transformed to some other state. It doesn't really matter what state it is, it's enough to know that it is orthogonal to $|000\rangle$. So to distinguish these states you can measure all qubits after applying $U^\dagger$ - if you get all zeroes, you know it was $|\psi_0\rangle$, otherwise it was $|\psi_1\rangle$.

+ +
+ +

You can find a more detailed explanation and the code for this problem in the contest editorial.

+",2879,,2879,,5/10/2019 7:07,5/10/2019 7:07,,,,3,,,,CC BY-SA 4.0 +5698,2,,5696,3/14/2019 7:43,,4,,"

When presenting Grover's algorithm as applied to search in a database, it is supposed that the Oracle has access to the elements of the classical list. Yet it is a very strong assumption and this is why we represent that by a controlled-selector using CNOT/Toffolis of an index representing simply this operation (like the Toffoli circuit in the case $n=4$).

+ +

You mention the approach of computing the values in another register : +$$ \sum_i | i\rangle | d(i)\rangle $$ +You assume again you are given an oracle for doing so and efficiently (a straightforward way is to control-NOT but you have to do this for every index/value so not very efficient). +In this case, the oracle would be the function $ f(i)= 2 $ in a quantum circuit format (again a controlled-selector), marking this state and continue with Grover iterations.

+ +

I think it is better to think of the quantum search algorithm as optimizing a function, instead of searching in a list/database. Here is an article I worked on where quantum search is used for solving a combinatorial maximization problem if you want to pursue further your understanding of the algorithm.

+",4127,,26,,3/14/2019 15:19,3/14/2019 15:19,,,,3,,,,CC BY-SA 4.0 +5699,1,5716,,3/14/2019 7:59,,3,854,"

I am currently working intensively on the Grover algorithm and have understood the individual ""building blocks"" of the algorithm so far. There are also references in the literature to Nielsen, e.g. an implementation example, but only for 4 elements.

+ +

My question is, of a more general nature. How would you actually implement a gate for more elements than just 4? Is there a general approach? The Grover operator G is composed of the n-fold Hadamard transformation and of the conditional phase change and a renewed H transformation. If I have a unitary matrix, eg. the one for the phase shift in the Grover operator, how can I convict this common unitary matrix?

+ +

I summarize briefly:

+ +
    +
  1. How do you convert the gates in the Grover algorithm for N bits? Is there a general derivation somewhere?

  2. +
  3. How can a unitary matrix e.g. the phase shift $ 2 |0\rangle \langle 0| -I $ realize as a gate? Are there any general phrases that might somehow express that?

  4. +
  5. What does a general construction procedure look like to create a gate from a unitary matrix?

  6. +
+",,user4961,55,,3/15/2019 10:59,3/15/2019 13:53,How do you implement the gates for Grover's algorithm for more than 4 elements?,,1,0,,,,CC BY-SA 4.0 +5700,1,,,3/14/2019 9:38,,4,265,"

I need some hint on how to adapt grover's algorithm to search the minimum in a database with $N=2^n$ elements in $O(\sqrt{N}\log(N))$ queries with probability of success $\geq 2/3$. I know I can do it by basically choosing randomly a ""pivot"" and then applying Grover to find a number smaller than that, then update my pivot. But is there something more to it?

+",5816,,55,,3/15/2019 19:51,3/15/2019 19:51,Adapting search algorithm to search the minimum in a database in $O(\sqrt{N}\log(N))$ queries,,1,0,,,,CC BY-SA 4.0 +5701,2,,5692,3/14/2019 10:17,,2,,"

For other readers who, like me, would otherwise have to go and check this, the Fredkin gate is the same thing as controlled-swap.

+ +

Some insight that you can get into the construction comes by focussing only on the elements $\{|01\rangle,|10\rangle\}$ on the two target qubits. The square root of swap looks like +$$ +e^{i\pi/4}\left(\begin{array}{cc} 1 & i \\ i & 1 \end{array}\right)/\sqrt{2} +$$ +on those two elements (at least, that's the definition that I'm taking). Let's all this $U$. This reminds me of the beam splitter matrix in the Mach-Zehnder interferometer, which inspired the following construction. We have that +$$ +UU=X\qquad UZUZ=\mathbb{I}. +$$ +So, what we want is a sequence of V, sqrt-SWAP, V, sqrt-SWAP where V does nothing if the control qubit is in 1 (so we get the sequence $UU$), and if the control qubit is 0, does the gate $\text{diag}(1,1,-1,1)$ on the target qubits. In other words, $V$ is a controlled-controlled-phase up to a couple of bit flips.

+ +

I believe the following does the job (but of course depends on what you allow your ""?"" to be constructed out of): +

+",1837,,,,,3/14/2019 10:17,,,,0,,,,CC BY-SA 4.0 +5702,1,5713,,3/14/2019 10:31,,3,285,"

I have installed a Python 3.7.2, download anaconda and visual studio code. Install Qiskit SDK 0.5.3. But when I launch my first test program from https://github.com/Qiskit/qiskit-terra I received a couple of messages like

+ +
{
+""message"": ""Instance of 'QuantumCircuit' has no 'h' member"",
+""message"": ""Instance of 'QuantumCircuit' has no 'cx' member"",
+""message"": ""Instance of 'QuantumCircuit' has no 'measure' member"",
+}
+
+ +

What I do wrong?

+ +

This is my code:

+ +
from qiskit import *
+q = QuantumRegister(2)
+c = ClassicalRegister(2)
+qc = QuantumCircuit(q, c)
+qc.h(q[0])
+qc.cx(q[0], q[1])
+qc.measure(q, c)
+backend_sim = BasicAer.get_backend('qasm_simulator')
+result = execute(qc, backend_sim).result()
+print(result.get_counts(qc))
+
+",6025,,55,,3/18/2019 12:38,3/19/2019 7:45,Problems with qiskit-terra: missing members of instance QuantumCircuit,,2,0,,,,CC BY-SA 4.0 +5703,2,,5700,3/14/2019 14:30,,5,,"

There is an algorithm by Dürr and Høyer that seems to solve your problem. This algorithm finds the correct answer in $\mathcal{O}(\sqrt{N})$ time with probability $1/2$.

+ +

The crux is that they have an oracle which flips the phase of all states with a smaller value than the currently selected one.

+",2005,,,,,3/14/2019 14:30,,,,2,,,,CC BY-SA 4.0 +5704,1,5712,,3/14/2019 15:00,,5,1328,"

I'm trying to understand this algorithm: arXiv:quant-ph/9607014 and I already have a problem on page 1, when they say that initializing the memory and ""marking the elements $j$ such that $T[j]<T[y]$"" can be achieved in $O(\log N)$ steps. How is checking every singe element and marking it run in less than $O(N)$ steps? And also: is this step meant to restrict the set of states to which we apply Grover's algorithm? Can we simply forget about some kets and run it on some others?

+",5816,,26,,3/14/2019 18:35,3/15/2019 7:53,Durr and Hoyer's: A Quantum Algorithm for Finding the Minimum,,1,0,,,,CC BY-SA 4.0 +5705,2,,5688,3/14/2019 15:44,,4,,"

This phenomenon is sometimes known as a discretization of errors. It is a property of certain error correcting codes that allows it to work. It is described (somewhat briefly) in Section 10.2 of Nielsen and Chuang.

+ +

Suppose that we have an arbitrary error that affects just one qubit, and suppose that we represent this error by a channel $\Phi$ mapping one qubit to one qubit. Such a channel can be expressed in Kraus form as +$$ +\Phi(\rho) = A_1 \rho A_1^{\dagger} + \cdots + A_m \rho A_m^{\dagger} +$$ +for some choice of Kraus operators $A_1,\ldots,A_m$. (For a qubit channel we can always take $m = 4$ if we want, but this doesn't matter for this answer.)

+ +

Each of the Kraus operators $A_k$ can be expressed as a linear combination of Pauli operators, because the Pauli operators form a basis for the space of 2 by 2 complex matrices: +$$ +A_k = a_k I + b_k X + c_k Y + d_k Z. +$$ +If you now expand out the Kraus representation of $\Phi$ above, you will obtain a messy expression where $\Phi(\rho)$ looks like a linear combination of operators of the form $P_i \rho P_j$ where $i,j\in\{1,2,3,4\}$ and $P_1 = I$, $P_2 = X$, $P_3 = Y$, and $P_4 = Z$.

+ +

Now imagine that you have a quantum error correcting code that protects against an $X$, $Y$, or $Z$ error on one qubit. The usual way this works is that some extra qubits in the 0 state are tacked on to the encoded data and a unitary operation is performed that reversibly computes into these extra qubits a syndrome describing which error occurred, if any, and which qubit was affected.

+ +

Supposing that the arbitrary error $\Phi$ happened on the first qubit for simplicity, after the syndrome computation you will end up with a state that looks like a linear combination of terms like this: +$$ +P_i |\psi\rangle \langle \psi| P_j \otimes |P_i\: \text{syndrome}\rangle\langle P_j\:\text{syndrome}|. +$$ +The assumption here is that $|\psi\rangle$ represents the encoded data without any noise, $P_i$ and $P_j$ act on the first qubit, and that ""$P_i$ syndrome"" and ""$P_j$ syndrome"" refer to the standard basis states that indicate that these errors have occurred on the first qubit. (The situation is similar for the error affecting any other qubit; I'm just trying to keep the notation simple by assuming the error happened to the first qubit.)

+ +

Now the key is that you measure (with respect to the standard basis) the syndrome to see what error occurred, and all of the cross terms disappear because of the measurement. You are left with a probabilistic mixture of states that look like +$$ +P_i |\psi\rangle \langle \psi| P_i \otimes |P_i\: \text{syndrome}\rangle\langle P_i\:\text{syndrome}|. +$$ +The error is corrected and the original state is recovered. In effect, by measuring the syndrome, you ""project"" or ""collapse"" the error to a Pauli operator.

+ +

Let me acknowledge that this answer was mostly cut-and-paste from one of my previous answers (where it seems that it did not actually answer the question).

+",1764,,1764,,3/14/2019 18:38,3/14/2019 18:38,,,,0,,,,CC BY-SA 4.0 +5706,1,5707,,3/14/2019 17:08,,3,68,"

I have created 10 qubits, where I have set 2 in superposition by applying Hadamard gate to each of the 2 qubits. So the 2 qubits state can be $|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle$. I need to assign values based on the values present in 2 superpositioned qubits. For eg, if the 2 qubits are in $|00\rangle$ I need to set the other qubits as $|00011110\rangle$, if the 2 qubits are in $|01\rangle$ states, I need to set the other qubits as $|10101010\rangle$ and if the 2 qubits are in $|11\rangle$ I need to set the other qubits as $|11110000\rangle$. So in the broad sense after applying H gate to 2 qubits when they have totally 4 states for each state I need to assign qubits other values. I saw I can apply the Toffoli gate if the state is |11⟩. However, if the state is $|01\rangle$ or $|00\rangle$ then what is the way?

+",6031,,26,,3/14/2019 18:32,5/10/2019 7:06,How to implement such a gate where one input bit is zero and the other is one and the output should be one?,,1,1,,,,CC BY-SA 4.0 +5707,2,,5706,3/14/2019 18:10,,3,,"

I believe the question boils down to ""How to apply a controlled version of the X gate if the control qubits should be in states other than $|11\rangle$?""

+ +

Toffoli gate CCNOT applies an X gate to the target qubit if both control qubits are in the $|1\rangle$ state. If you need to apply an X gate if the control qubits are in some different state, you can do the following:

+ +
    +
  1. Convert the control qubits to $|11\rangle$ state using X gates on qubits which have to be in $|0\rangle$ state.
  2. +
  3. Apply CCNOT gate.
  4. +
  5. Convert the control qubits back to their original state, using the same sequence of X gates as in step 1.
  6. +
+ +

For example, if you need to apply an X gate to target if control qubits are in $|01\rangle$ state, you can do

+ +
X(control[0]);
+CCNOT(control[0], control[1], target);
+X(control[0]);
+
+ +

You can use the same approach when implementing gates controlled on any pattern of control qubit states.

+ +
+ +

This question looks very similar to problem A2 from the recent Q# contest. If you're looking to implement this in Q#, check ControlledOnBitString library function which does exactly this. You can find the full code for the problem in the Superposition kata.

+",2879,,2879,,5/10/2019 7:06,5/10/2019 7:06,,,,0,,,,CC BY-SA 4.0 +5708,1,,,3/14/2019 18:18,,4,78,"

I am interested to know if models in quantum mechanics and techniques like superdense coding teleportation are just single cases where they were found to work. Or rather just a prototype of many other examples of similar things.

+ +

What I mean is, the Deutsch oracle is just a single algorithm that was found or they found many examples similar to this and it is just a prototype?

+ +

Superdense works only if you follow the exact protocol of applying $\Bbb I$, $X$, $Z$, $ZX$? Only two qubits? Or rather it's just an example of many other known things? It seems unreasonable that this is a single example. Aren't there other 3, 4 qubits with same techniques performed by applying other matrices?

+ +

Same for teleportation.

+",5742,,55,,3/15/2019 11:37,3/15/2019 11:37,Are superdense coding and teleportation just a prototype or the 'only' type?,,1,0,,,,CC BY-SA 4.0 +5709,2,,5708,3/14/2019 21:00,,2,,"

As for superdense coding, you can design different schemes for $n, m$ qubits, but they are not giving any advantage over a simple scheme $1 \text{qubit} + 1 \text{ebit} \rightarrow 2 \text{cbits}$. In general, if Alice has access to $n$ qubits and Bob has access to $m$ qubits and all $n+m$ qubits are entangled, then Alice can't transmit more than $n+\text{min}(n,m)$ classical bits by sending her qubits to Bob.

+ +

You can, of course, change the task. For example, there can be many parties instead of just two, or your task might be to transmit qubits with a lesser amount of qubits by consuming entangled qubits, etc. Those tasks have different answers and different optimal schemes.

+",5870,,26,,3/15/2019 7:50,3/15/2019 7:50,,,,0,,,,CC BY-SA 4.0 +5710,1,,,3/14/2019 22:02,,3,86,"

Say I have

+ +

$$\dfrac{1}{\sqrt{2}}\bigl(|1\rangle|221\rangle|0\rangle + |3\rangle|73\rangle|2\rangle\bigr).$$

+ +

How can I change that into

+ +

$$\dfrac{1}{\sqrt{2}}\bigl(|1\rangle|221\rangle|1\rangle + |3\rangle|73\rangle|2\rangle\bigr)?$$

+",1589,,26,,3/15/2019 7:43,3/15/2019 8:35,How can I invert the least significant bit of a certain term of a superposed state?,,2,1,,,,CC BY-SA 4.0 +5711,2,,5710,3/15/2019 6:46,,1,,"

The first register the way you write it is about two qubits if not more. In the state, it is either 01 (1) or 11 (3). Then I would just use a X/NOT controlled by the two qubits of the register and only applied when the control is 01. This is done by Toffoli where you use X gate in between the first qubit so the control is applied when it is 0.

+",4127,,4127,,3/15/2019 7:08,3/15/2019 7:08,,,,0,,,,CC BY-SA 4.0 +5712,2,,5704,3/15/2019 6:59,,2,,"

Well, the idea is simple. You have at first a superposition of N indexes where $N=2^n$. So basically you are doing your operations on $n $ qubits, so they are $\log_2(N)$ in complexity. The oracle used for marking the states is just called once and is applied on about $n $ qubits, which marks the states where the output of the oracle is 1 (the one whose values are greater in this case).

+ +

The last questions you asked, if you mean to apply it on a subset of states in the superposition (often because we have $N$ which is not a power of 2, it is possible indeed. You can keep the states and do your quantum search with an oracle that will not mark them.

+",4127,,26,,3/15/2019 7:53,3/15/2019 7:53,,,,6,,,,CC BY-SA 4.0 +5713,2,,5702,3/15/2019 7:29,,2,,"

The problem was at linter.

+ +

It's necessary to add

+ +
 ""python.linting.pylintArgs"": [
+        ""--disable=E1101""
+    ]
+
+ +

to the settings.json.

+",6025,,26,,3/15/2019 8:47,3/15/2019 8:47,,,,1,,,,CC BY-SA 4.0 +5714,2,,5710,3/15/2019 8:35,,2,,"

Assuming that your last spin is of dimension 3, why not just apply the unitary +$$ +\left(\begin{array}{ccc} +0 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 +\end{array}\right)? +$$

+",1837,,,,,3/15/2019 8:35,,,,2,,,,CC BY-SA 4.0 +5716,2,,5699,3/15/2019 13:44,,2,,"

Consider this paper where an implementation of Grover's algorithm is given for three qubits.

+ +

The only difficulty when extending to $n$ qubits is that you need a $C^n\operatorname{NOT}$ gate (bit flip oracle) or a $C^{n-1}Z$ gate (phase oracle). The phase oracle is made trivially by combining a $C^{n-1}\operatorname{NOT}$ gate with two Hadamard gates. The multiple controlled $\operatorname{NOT}$ gate is constructed from different Toffoli-gates.

+",2005,,26,,3/15/2019 13:53,3/15/2019 13:53,,,,4,,,,CC BY-SA 4.0 +5718,1,5721,,3/15/2019 19:10,,5,484,"

Given access to an oracle for a function $f:\{0,1\}^n\to\{0,1\}^n$ such that $f(x)=f(y)$ iff $x\oplus y\in\{0,s\}$, Simon's algorithm allows to recover $s$ in $\mathcal O(n)$ queries to the oracle.

+ +

The Wikipedia page also mentions how Simon's problem is a special case of the more general Abelian hidden subgroup problem, which concerns, given a function $f:G\to X$ with $G$ group, finding the normal subgroup $H\triangleleft G$ such that $f(x)=f(y)$ iff there is some $g\in G$ such that $x,y\in gH$ (with $gH$ denoting the left coset of $H$ by $g$).

+ +

While I can see the similarity between the two definitions, many online sources do not explicitly spell it out, hence my asking here: what is the normal subgroup that is hidden in Simon's problem?

+",55,,55,,3/17/2019 21:01,3/17/2019 21:01,What is the hidden subgroup in Simon's problem?,,1,0,,,,CC BY-SA 4.0 +5719,1,5720,,3/16/2019 11:46,,2,689,"

I'm working on a similar problem of that raised by Aman in Inner product of quantum states

+ +

Concerning the use of Swap Test for calculating the difference of two vectors. +An example of the original Lloyd formula is given in Quantum machine learning for data scientists.

+ +

And I got stuck at the same point, i.e. what mathematically means the inner product between the two qubits $\psi$ and $\phi$, which have different size. The explanation in the paper (eq. 133) which says

+ +

$$\langle \phi|\psi\rangle = \frac{1}{\sqrt{2Z}}(|a||a\rangle - |b||b\rangle)$$

+ +

looks incorrect because it equals an inner product (scalar value) with a qubit! Or am I missing something?

+ +

The suggestion of composing $\phi$ with tensor products of the identity matrices for matching $\psi$ and $\phi$ sizes looks a math trick because such composition is not an allowed quantum operation (identity matrix I should be supposed to be a qubit, and it's not of course). I share Aman's doubts on the demonstration of (132) i.e. $$|a-b|^2=2Z|\langle\phi|\psi\rangle|^2.$$

+",4927,,55,,5/22/2021 12:02,5/22/2021 12:02,Swap Test for vector difference - how are different sized inputs combined?,,3,6,,,,CC BY-SA 4.0 +5720,2,,5719,3/16/2019 16:53,,3,,"

The paper you refer is incomplete and not very right on this part. +First a minus sign should be present in : +$$ |\phi\rangle = \frac{1}{\sqrt{Z}} (|a||0\rangle - |b||1\rangle) $$

+ +

Secondly, if you look at the original reference of this procedure on a special case of algorithm but it can be generalized, what you swap is actually the ancilla qubit of $ |\psi\rangle $ with the qubit in state $ |\phi\rangle$.

+ +

I was mislead by this paper before but found out the trick recently. We should point out also that there is a step of estimation of $Z$ before using this algorithm.

+",4127,,,,,3/16/2019 16:53,,,,8,,,,CC BY-SA 4.0 +5721,2,,5718,3/17/2019 1:20,,4,,"

To see that Simon's program is an instance of an (abelian) hidden subgroup problem, we have to identify the group $G$, the subgroup $H$, the set $X$ and the function $f : G \rightarrow X$. Note first that the set $\{ 0,1 \}^n$ of all bit vectors of length $n$ naturally comes with a group structure given by the (component-wise) XOR between bit vectors: $(x_1, \ldots, x_n) \oplus (y_1, \ldots, y_n) := (x_1 \oplus y_1, \ldots, x_n \oplus y_n)$. Using this definition of the group law, $\{0,1\}^n$ becomes an abelian (i.e., commutative) group $G$. Any set $S$ of bit vectors generates a subgroup of $G$. If a set consists only of one element, i.e., $S=\{s\}$, then the group $H$ generated by $S$ consists of just the neutral element $0_G$ of $G$ (i.e., the all zero bit vector $(0, \ldots, 0)\in G$) and $s$ itself, i.e., $H=\{0_G, s\}$. Indeed, any other multiple of $s$ is either the zero vector or $s$ as the components are added modulo $2$.

+ +

Finally, the set $X$ is $\{0,1\}^n$ and the map $f$ is precisely the map as given in Simon's problem. Let's check that the defining property to make $(G, H, f)$ an instance of a hidden subgroup problem actually holds, namely that $f$ is constant on cosets $gH$ and takes different values for different cosets $gH \not= g'H$. We are promised that $f(x)=f(y)$ iff $x\oplus y \in \{0_G,s\}$. Pick an element $g \in G$. As $H = \{0_G,s\}$, the set $gH$ is equal to $\{0_G \oplus g, s \oplus g\} = \{g, s\oplus g\}$. We have that $g \oplus (s \oplus g) = s$ which implies that $f(g) = f(s \oplus g)$, i.e., the function is constant on the coset. By a similar argument we get that two different cosets get mapped to different values. This shows that Simon's problem is indeed an instance of an abelian hidden subgroup problem. Finally, note that in an abelian group every subgroup is a normal subgroup.

+ +

For more information about the abelian hidden subgroup problem, see for instance this paper by Brassard and Hoyer or this paper by Mosca and Ekert.

+",1828,,1828,,3/17/2019 1:25,3/17/2019 1:25,,,,1,,,,CC BY-SA 4.0 +5722,2,,5719,3/17/2019 13:17,,7,,"

You are not swapping the first register (one qubit) with the entire second register ($k$ qubits), but just with the first qubit of the second register.

+ +

What you need to know is what is meant by $\langle x | y \rangle$ when $x$ is one qubit and $y$ is $k$ qubits. The resulting state is the $k-1$ qubit state you get when you project one qubit (generally the first one, if it isn't specified) onto the vector $|x\rangle$.

+ +

So for example, suppose $$|x\rangle = \alpha |0\rangle + \beta |1\rangle.$$

+ +

and suppose $$|y\rangle = \frac{1}{\sqrt{2}}\left( |00\rangle + |11\rangle\right).$$

+ +

When we take the inner product of $|x\rangle$ and $|y\rangle$, we get +\begin{eqnarray*} +\langle x | y \rangle &=& \frac{1}{\sqrt{2}} \left(\alpha^* \langle 0 | + \beta^* \langle1 | \right) + \big( |0\rangle \otimes |0\rangle + |1\rangle \otimes |1\rangle\big) \\ +&=& \frac{1}{\sqrt{2}} \left( \alpha^* \langle 0| 0\rangle \otimes |0\rangle + \alpha^* \langle 0| 1\rangle \otimes |1\rangle + \beta^* \langle 1| 0\rangle \otimes | 0\rangle+\beta^* \langle 1| 1\rangle \otimes |1\rangle \right) \\ +&=& \frac{1}{\sqrt{2}} \left( \alpha^* |0\rangle +\beta^* | 1\rangle \right) +\end{eqnarray*}

+",1765,,1765,,3/17/2019 13:30,3/17/2019 13:30,,,,1,,,,CC BY-SA 4.0 +5723,1,5725,,3/17/2019 13:50,,4,327,"

Suppose $x$ is an $N=2^n$ elements database. Let's define a $2N$-bit database with $y \in \{0,1\}^{2N}$ indexed by $(n+1)$-bit strings $j=j_1\ldots j_n j_{n+1}$, where +\begin{align} +y_j=\begin{cases}1 & \text{if }x_{j_1 \ldots j_n}=1 \text{ and } j_{n+1}=0 \\ +0 & \text{otherwise} \end{cases} +\end{align}

+

How can one implement the oracle $|j \rangle \rightarrow (-1)^{y_j} |j\rangle$ using one query to the $x$ oracle $O_x: |i,b \rangle \rightarrow |i, b\oplus x_i \rangle $ and some elementary gates?

+

Edit: +Basically what would do the job on a high level would be to check if the the result of $O_x$ was 1 or 0. If it was 1 a controlled gate on $j_{n+1}$ that flips everything again if $j_{n+1}$ is 1 and do nothing otherwise, if it was 0 do nothing. At least this is my intuition but I cannot formalize it.

+",5816,,10480,,4/30/2021 0:59,4/30/2021 0:59,Implementing an oracle,,1,2,,,,CC BY-SA 4.0 +5724,1,,,3/17/2019 15:10,,4,243,"

I was trying to learn quantum memory and went through some papers, websites, etc.

+ +

The current understanding I have (which I'm not sure is right) is this: Two photons are prepared together which are said to be entangled, one of the photons will interact with an atom and the state of the atom changes according to the what state the photon was in (hence, storing the memory?)

+ +

Is that correct? If not, where did I go wrong? and what is correct?

+",6051,,55,,12/11/2021 10:42,12/11/2021 10:42,How does quantum memory work using atoms?,,1,2,,,,CC BY-SA 4.0 +5725,2,,5723,3/17/2019 19:47,,4,,"

You can implement a multiple controlled $\operatorname{Z}$ gate on $n+1$ qubits together with two $\operatorname{X}$-gates on the $n+1$-th qubit before and after the multiple controlled gate.

+ +

This gate can be made by constructing a multiple controlled $\operatorname{NOT}$ gate, that is a $C^n\operatorname{NOT}$ gate, and on the $n+1$-th qubit a $\operatorname{H}$-gate before and after the multiple controlled $\operatorname{NOT}$-gate.

+ +

The $\operatorname{X}$ gate before and after the multiple controlled gate make sure that the state is flipped for $j_{n+1}=0$ instead of for $j_{n+1}=1$.

+ +

Simple evaluation of the matrices shows that this works as desired.

+",2005,,,,,3/17/2019 19:47,,,,0,,,,CC BY-SA 4.0 +5727,1,,,3/18/2019 2:01,,1,2664,"

Let's say I have a pure state of the form: +$$\psi = \sqrt{\frac{3}{9}} \lvert 0 \rangle + \sqrt{\frac{6}{9}} \lvert 1 \rangle$$

+ +

Then the density matrix representation would be: +$$\rho = \psi \otimes \psi' = \begin{bmatrix}.3333&.4714\\4714&.6667\end{bmatrix}$$

+ +

Now, what would be the Von Neumann entropy of this matrix? I saw that the equation is:

+ +

$$S(\rho) = -\text{trace}(\rho \log \rho) = 1.3455.$$ But it's supposed to be 0, isn't it?

+",2403,,55,,3/3/2021 22:36,3/3/2021 22:36,How do I calculate the von Neumann entropy of a pure one-qubit density matrix?,,1,2,,,,CC BY-SA 4.0 +5728,2,,5719,3/18/2019 8:19,,-2,,"

Starting from the last index, just swap two qubits as long as you have them and then measure the ancilla qubit. This Works fine for me!!

+",4206,,4206,,3/21/2019 7:23,3/21/2019 7:23,,,,3,,,,CC BY-SA 4.0 +5729,1,5737,,3/18/2019 10:53,,3,936,"

I try to use Quantum SVM kernel algorithm: multiclass classifier extension. This is my code section with imports

+ +
import numpy as np
+import scipy
+from scipy.linalg import expm
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+from sklearn import datasets
+from sklearn.model_selection import train_test_split
+from sklearn.preprocessing import StandardScaler, MinMaxScaler
+from sklearn.decomposition import PCA
+
+
+from qiskit import BasicAer
+from qiskit_aqua import run_algorithm
+from qiskit_aqua.input import SVMInput
+import qsvm_datasets 
+
+ +

I have an error at import any library. I received the ImportError: DLL load failed: message. All libs are installed correctly. I found in my folders needed file at \Python\Libs\site-packages\qiskit_aqua\input\svminput.py.

+ +

That's my debug log:

+ +
Warning (from warnings module):
+  File ""D:\QASM\Python368\lib\site-packages\sklearn\externals\joblib\externals\cloudpickle\cloudpickle.py"", line 47
+    import imp
+DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
+Traceback (most recent call last):
+  File ""\1.py"", line 14, in <module>
+    from qiskit_aqua import run_algorithm
+  File ""D:\QASM\Python368\lib\site-packages\qiskit_aqua\__init__.py"", line 29, in <module>
+    from .utils.backend_utils import (get_aer_backend,
+  File ""D:\QASM\Python368\lib\site-packages\qiskit_aqua\utils\__init__.py"", line 31, in <module>
+    from .qpsolver import optimize_svm
+  File ""D:\QASM\Python368\lib\site-packages\qiskit_aqua\utils\qpsolver.py"", line 21, in <module>
+    from cvxopt import matrix, solvers
+  File ""D:\QASM\Python368\lib\site-packages\cvxopt\__init__.py"", line 50, in <module>
+    import cvxopt.base
+ImportError: DLL load failed
+
+",6025,,6025,,3/19/2019 7:43,6/26/2019 10:01,Import from qiskit-aqua error,,1,2,,,,CC BY-SA 4.0 +5730,1,,,3/18/2019 11:23,,2,169,"

In this paper there is a quantum algorithm that can estimate the distance between a given vector U and a set of vectors V (by taking the mean). In some part of the algorithm, we need to find the sum of the vectors norm squared or Z. With the assumption that we do have some given Blackbox that will tell us the norm of each vector. So we can estimate Z by applying $$ {e^{-iHt}}$$ to the state $$ \frac{1}{\sqrt{2}}\biggl(|0\rangle + \frac{1}{\sqrt{M}}\sum_{j=1}^M|j\rangle\biggr) \otimes |0\rangle $$ where $$H = \biggl(\frac{1}{\sqrt{M}}\sum_{j=0}^M |Vj| |j\rangle \langle j|\biggl) \otimes X $$

+

Assume U = V[0]

+What things do I need to know before I implement it? I really can't understand I tried phase rotations (around the Z axis) but it doesn't work. +

or

+

you can tell me a little bit about the preparation of the state $|\phi\rangle$ using quantum counting?

+",4206,,4206,,6/23/2020 11:24,6/30/2020 4:26,Estimation of Z in the quantum Euclidean algorithm,,2,0,,,,CC BY-SA 4.0 +5731,2,,5730,3/18/2019 14:38,,1,,"

Based on my understanding, the computation of Z in the quantum-ancilla based algorithm described in the above paper is basically using a post-processing vector U that amounts to estimating Z on the ancilla qubit, which is the same as observable measured in the swap test.

+ +

P.S.: In this paper, read the last sub-paragraph just before unsupervised quantum learning (p.4).

+",5028,,,,,3/18/2019 14:38,,,,1,,,,CC BY-SA 4.0 +5732,1,,,3/18/2019 22:19,,4,351,"

+ +

This is a quantum circuit. M represents the act of making a measurement on the first two qubits. The circuit is supposed to transfer the state $|\psi\rangle = a |0\rangle + b |1\rangle$ ($a, b \in \Bbb C$) from the first qubit to the third qubit, involving a classical operation to select a quantum gate. +Depending on the measurement outcome of the first two qubits, what quantum gate should be applied in place of ‘...’, such that the transfer is successful? +The measurement results of M and the quantum gate to be applied in each case.

+ +

For this circuit a purely classical and a purely quantum +circuit is possible or not?

+",,user6057,-1,,5/15/2019 15:47,5/15/2019 15:47,How to complete this teleportation circuit? How to create a copy of $|\psi〉$?,,1,1,0,,,CC BY-SA 4.0 +5733,1,,,3/18/2019 22:46,,7,254,"

Is there an instance of a quantum algorithm that is faster than its classical counterpart, but doesn't use entanglement, only superposition?

+",1867,,,,,3/19/2019 1:46,Quantum speedup without entanglement,,1,4,,,,CC BY-SA 4.0 +5734,2,,5727,3/18/2019 23:56,,3,,"

It turns out to be a novice mistake. I was using matlab and this log is elementwise, as @Ahusain pointed out. We must take the matrix logarithm in Matlab which is denoted by $logm$. Then the calculation becomes: +$$-\text{trace}(\rho \log m (\rho)) = \text{NaN}.$$ The reason is, we have to define $0 \times \log (0)$ as $0$ instead of $\text{NaN}$ which is the default behavior of Matlab. Another way to calculate it is the following:

+ +

As this density matrix is representing a pure state, it would have a diagonalization. I.e. it can be written as:

+ +

$$\rho = \sum_{j} \lambda_j \lvert \phi_j \rangle \langle \phi_j \lvert$$

+ +

Where, $\lambda_j$ are it's eigenvalues and $\lvert \phi_j \rangle$ are it's distinct eigenvectors. In which case, the von Neumann entropy is simply the shannon entropy of it's eigenvalues:

+ +

$$S(\rho) = H(\lambda_1, \lambda_2) = -0 \times \log(0) - 1 \times \log(1) = 0$$Using the above definition of $\log(0) = 0$.

+",2403,,26,,3/19/2019 17:29,3/19/2019 17:29,,,,1,,,,CC BY-SA 4.0 +5735,2,,5733,3/19/2019 1:36,,3,,"

No. Without entanglement we can always write the system as the product state of individual qbits, and those qbits are just a pair of complex numbers. We can thus simulate the quantum system on a classical computer in polynomial time & space, and would not gain any benefit from execution on a quantum computer.

+ +

There are methods of analysis by which a quantum computer outperforms a classical computer without entanglement such as query complexity (number of times the black box function is queried) in the Deutsch Oracle problem, but these do not translate into ""real world"" speedups and are mostly of interest to complexity theorists. When we talk about quantum speedups in the real world, it is usually a physical quantum computer compared to a classically-simulated quantum computer.

+",4153,,4153,,3/19/2019 1:46,3/19/2019 1:46,,,,7,,,,CC BY-SA 4.0 +5736,2,,5702,3/19/2019 7:45,,4,,"

These messages pop up in the linter due to the way gates are dynamically added as circuit attributes in Qiskit Terra. They can safely be ignored. In a future update of Terra these warnings will disappear.

+",332,,,,,3/19/2019 7:45,,,,0,,,,CC BY-SA 4.0 +5737,2,,5729,3/19/2019 7:50,,5,,"

You are probably running Python 3.7 on Windows. There is a known issue for the bug you are seeing: https://github.com/Qiskit/qiskit-aer/issues/80

+",332,,,,,3/19/2019 7:50,,,,3,,,,CC BY-SA 4.0 +5738,2,,4571,3/19/2019 7:57,,6,,"

When mapping a circuit to a quantum device using Qiskit, the choice of which virtual qubits (the ones in your circuit) get mapped onto which physical (device) qubits depends on whether you let qiskit decide or you implement your own initial_layout. By default, qiskit will pick the most connected subset of the device graph that fits your circuit. These qubits are usually not the lowest noise qubits. If you want to select specific qubits, you can pass a layout using the initial_layout keyword argument to either execute or compile. Note that there may be some additional permutation of the qubit labels during the swap mapping phase, in order to lower the number of swap gates needed, if any.

+",332,,,,,3/19/2019 7:57,,,,0,,,,CC BY-SA 4.0 +5739,2,,5668,3/19/2019 9:29,,6,,"

(QuantumRegister(3, 'a'), 0) + means the 0th qubit in a QuantumRegister called 'a' of size 3.

+ +

The other numbers (10 and 41) are node ids for the predecessors and successors of the node.

+ +

So what ({(QuantumRegister(3, 'a'), 0): 41}, {}) is saying is there is an edge from node 41 along wire (QuantumRegister(3, 'a'), 0) that ends at node 2 (the node you provided) and that this node has no successors as the second dict is empty.

+ +

It is also worth noting this is a private function and so should not really be used in this way.

+",5955,,,,,3/19/2019 9:29,,,,0,,,,CC BY-SA 4.0 +5740,1,22266,,3/19/2019 16:37,,3,62,"

It's a standard piece of quantum information theory that noise can be helpful in augmenting compatibility of quantum observables. For example given a qubit state $\rho$ and the two Pauli observables $\sigma_x$ and $\sigma_y$, it's known that they are incompatible meaning that there is no POVM $\lbrace M_{x, y} \rbrace$ giving two outcome $x, y$ that has $\sigma_x$ and $\sigma_y$ as marginals. This means that by calling $\lbrace E_x \rbrace$ and $\lbrace L_y \rbrace$ the effects of the measurement along $x$ and $y$ respectively we have: +$$E_x = \sum_{y} M_{x, y} \quad L_y = \sum_{x} M_{x, y}$$ +If a depolarizing noise is acting one the state: $\rho \rightarrow \Phi_{\lambda} \left( \rho \right)$ then the two measurement may become compatible. Indeed in the Heisenberg picture the POVMs are $\Phi^{\dagger} \left( \sigma_x \right)$ and $\Phi^{\dagger} \left( \sigma_y \right)$, this two admit realization as marginals of a joint POVM.

+

Now the question: what are the practical application of this trick? Noise is always present in any process and this says that this very level of noise that you cannot get rid of is at least acting to improve compatibility and you can find a measurement that is better suited to extract information about the system rather than measuring $\Phi^{\dagger} \left( \sigma_x \right)$ and $\Phi^{\dagger} \left( \sigma_y \right)$. But given that you can control the map $\Phi_{\lambda}$ why would you add noise just to improve compatibility (other than for proving it can be done).

+

If you had $N$ qubits you could just as well divide the sample in $\frac{N}{2}$ and $\frac{N}{2}$ and perform different noiseless measurement on the two bunches to extract information (of course this doesn't work if you had just 1 qubit, let alone this case). It doesn't seem to be convinient to spoil the state (and lose information) just to enhance compatibility. Is it so or am I missing something? Can added "noise" (a generic quantum map) be actually useful for retrieving information?

+",2490,,55,,12/13/2021 13:23,12/14/2021 13:43,Application of improved compatibility,,1,0,,,,CC BY-SA 4.0 +5741,1,,,3/19/2019 16:54,,5,210,"

Note: Cross-posted on Physics SE.

+ +
+ +

I am reading a research article based on quantum image watermarking (PDF here). The authors have defined some unitary transforms for the watermarking schemes, which is where I am having great difficulty in understanding. The operators defined as: +$$U_1=I^{\otimes 3q-1}\otimes U\otimes |yx\rangle\langle yx|+I^{\otimes3q}\otimes \left(\sum_{j=0}^{2^n-1}\sum_{i=0, ji\neq yx}^{2^n-1}|ji\rangle\langle ji|\right)$$This is the operator where $q=8$, $n=8$, $U=\begin{bmatrix} +0&1\\ +1&0\end{bmatrix}$. This is an operator acting on $$|I(\theta)\rangle=\dfrac{1}{2^n}\left(\sum_{j=0}^{2^n-1}\sum_{i=0}^{2^n-1}|C(j,i)\rangle\otimes |ji\rangle \right)$$ +Can somebody explain the operator and how does this act on $I(\theta)$. I have a sound linear algebra background but as soon as I see these quantum notations I have a hard time understanding them.

+",6063,,26,,4/6/2019 14:02,4/6/2019 14:02,How to understand the operators for watermarking schemes?,,2,0,,,,CC BY-SA 4.0 +5742,2,,5732,3/19/2019 18:44,,2,,"

A trick you can use, in order to figure out the necessary fixups, is to see what happens when you condition the output display on the measurement results. Like this:

+ +

+ +

See how the conditioned states are all pointing in different directions? Your goal is to fix that by, for each of the measurement cases, introducing controlled operations that make them all match. For example, if we decide that we want everything to match the 00 output, then the 11 output is fixed by introducing a Y fixup:

+ +

+ +

See how the first and last controlled displays now show an indicator pointing in the same direction? The CCY made them match. Find operations that do the same thing for the other two, and you have a valid teleportation circuit. Once you have that, try to simplify the fixups.

+ +

Some rules of thumb for finding these fixups, which continue to work in more complicated cases:

+ +
    +
  • Most fixups are Pauli operations (X, Y, Z). Try those first.
  • +
  • It is common for fixups to have one classical control instead of many classical controls. Do the cases with a single ON measurement result first, and see if controlling only on that one ON bit instead of the entire measurement result just happens to also work for all the other cases.
  • +
+",119,,119,,3/19/2019 18:49,3/19/2019 18:49,,,,0,,,,CC BY-SA 4.0 +5743,2,,5741,3/19/2019 23:46,,4,,"

$I^{\otimes 23} = I\otimes I\otimes I\otimes \cdots \otimes I$ (containing 23 identity operators, each presumably being $2\times 2$)

+ +

The $\otimes$ operator is just the Left Kronecker Product.

+ +

Assuming that $y$ and $x$ represent qubits, then $|yx\rangle\langle yx|$ is some $4\times 4$ matrix, which can be calculated as the outer product of the column vector $|yx\rangle$ and the row vector which is its transpose: $\langle yx|$ (this is called Dirac notation).

+ +

The first of two summands in your operator is, therefore, a $2^{26} \times 2^{26}$ matrix which you can calculate by applying the Left Kronecker Product to 3 matrices (the $2^{23} \times 2^{23}$ identity matrix, the $U$ operator, and the 4x4 matrix $|yx\rangle\langle yx|$.

+ +

The information I've given you above should also be sufficient for you to now figure out on your own how to get the matrix for the 2nd term of the summand.

+ +
+ +

As for the 2nd part of your question, which is about how to ""act on $I(\theta)$"" with the operator $U_1$. It just means the same thing (the $I(\theta)$ will be some $2^{26} \times 1$ column vector in Dirac notation, and it can be converted to matrix notation again using the Kronecker product, which is usually taught for matrices, but if you think of column vectors as matrices where the number of columns is 1, then you can apply the Kronecker product to vectors with no problems).

+ +

This is about all I can tell you without knowing more about the paper itself (such as what $C(i,j)$ means and what $x$ and $y$ mean. The article you referred to is not free.

+",6058,,26,,3/20/2019 5:34,3/20/2019 5:34,,,,9,,,,CC BY-SA 4.0 +5744,1,5748,,3/20/2019 2:13,,6,806,"

I came across the term ""diagonal to the computational basis"" in my reading recently. I'm not entirely sure what this term means. I know that a diagonal matrix is one with only non-zero elements on the diagonal and I know that the computational basis is $\alpha \left| 0 \right> + \beta \left| 1 \right>$ but I'm not sure how these terms relate to one another nor how a particular gate could be said to be diagonal to the computational basis.

+",5472,,19895,,5/19/2022 8:02,5/19/2022 8:02,"Meaning of ""diagonal to the computational basis""",,2,0,,,,CC BY-SA 4.0 +5745,2,,5744,3/20/2019 5:29,,3,,"

If the computational basis is the vectors $\{|0\rangle,|1\rangle\}$, then this means that $\rho$ is a diagonal matrix when written in this basis. In other words, $\rho=p|0\rangle\langle 0|+(1-p)|1\rangle\langle 1|$ for some real number $0<p<1$.

+",452,,,,,3/20/2019 5:29,,,,1,,,,CC BY-SA 4.0 +5746,1,,,3/20/2019 12:28,,4,172,"

I am reading the paper Duality of Quantum and Classical Error Correction +Codes: Design Principles & Examples and at the beginning of it, the authors describe how the general Pauli channel is related to more realistic channels such as amplitude/phase damping channels. The Pauli channel is defined as:

+

$\mathcal{N}_P(\rho)=(1-p_x-p_y-p_z)I\rho I + p_xX\rho X+p_y Y\rho Y + p_z Z\rho Z$

+

In order to describe how such probabilities of $X,Y,Z$ events happen depending on the relaxation ($T_1$) and dephasing ($T_2$) times of a qubit, they give the next set of equations:

+

$p_x=p_y=\frac{1}{4}(1-e^{-\frac{t}{T_1}})$

+

$p_z=\frac{1}{4}(1+e^{-\frac{t}{T_1}}+ 2e^{-\frac{t}{T_2}})$

+

However, my doubt comes from the fact that intuitively, when the time goes to infinity, the probability of no error in the qubits should go to $0$, that is, complete decoherence of the system. However, making an analysis of this, this is not what happens:

+

$\lim_{t\rightarrow\infty} 1 - p_x-p_y-p_z = \lim_{t\rightarrow\infty}\frac{1}{4}(1+e^{-\frac{t}{T_1}}+2e^{-\frac{t}{T_2}})=\frac{1}{4}$.

+

So my question here is to clarify why such probability should go to $1/4$ instead of going to $0$, or in the case that someone knows more about this kind of relationships, to give some useful reference about it.

+",2371,,-1,,6/18/2020 8:31,3/20/2019 20:23,Clarifying the relationship of the probabilities of depolarizing channel and relaxation/dephasing times,,1,0,,,,CC BY-SA 4.0 +5747,1,,,3/20/2019 19:29,,6,1339,"

I'm trying to implement a couple of algorithms on ibmq_16_melbourne, so I need to know if this device is able to handle with depth and size of my current circuit or not.

+ +

For example, the circuit size is 300 and depth is 99.

+",6071,,26,,3/21/2019 11:33,3/21/2019 13:43,What is maximum circuit depth and size IBM Q5 and Q16 could handle?,,2,0,,,,CC BY-SA 4.0 +5748,2,,5744,3/20/2019 19:47,,5,,"

Matrix just encodes linear operation that transforms basis vectors to some other vectors. For example, matrix $M$ can transform vector $|0\rangle$ to vector $m_{11}|0\rangle + m_{12}|1\rangle$ and vector $|1\rangle$ to $m_{21}|0\rangle + m_{22}|1\rangle$. In this case, this matrix is written as $\left(\begin{matrix} m_{11} & m_{21} \\ m_{12} & m_{22} \end{matrix}\right)$. And vectors $|0\rangle$, $|1\rangle$ are encoded as $\left(\begin{matrix} 1 \\ 0 \end{matrix}\right), \left(\begin{matrix} 0 \\ 1 \end{matrix}\right)$ respectively.

+ +

In a different basis the same linear operation has different matrix encoding, diagonality is not preserved under basis change.

+",5870,,,,,3/20/2019 19:47,,,,0,,,,CC BY-SA 4.0 +5749,2,,5747,3/20/2019 19:53,,6,,"

It depends on what you mean by ""able to handle"". You mention a circuit depth of 99, which might be possible, but what will be the fidelity of the final state with respect to the one it's supposed to be (assuming no decoherence)?

+ +

If your fidelity requirement is close to 100%, the maximum circuit depth that the IBM machines can handle, is zero (try just starting with $|0\rangle$, and then making a measurement ... you will not get back a pure zero, because the measurement fidelity in IBM machines, is an even bigger problem than gate fidelity).

+ +

The answer to your question could be ""circuit depth of 0"" or ""circuit depth of 99"" ... it all depends on how good you want your fidelity!

+",6058,,,,,3/20/2019 19:53,,,,2,,,,CC BY-SA 4.0 +5750,2,,5746,3/20/2019 20:16,,3,,"

Josu, +You might be mis-understanding something. +Your equation for the Pauli channel says that when $t\rightarrow \infty$, all operators ($X,Y,Z,I$) have an equal probability (1/4) of transforming the density matrix $\rho$. You seem to be suggesting that $t\rightarrow \infty$, the probability of the $I$ operator acting on $\rho$ whould go to 0. Keep in mind that $I$ is an operator just like $X,Y,Z$ and it makes sense that one might model it to be just as likely as $X,Y$ and $Z$.

+ +

Another way to think of it, is that as time goes to infinity, all sorts of things may have happened, such as the $X$ operator having acted twice, which would mean that the overall transformation on $\rho$ would be described by $I$.

+ +

There is no reason why there should be a 100% chance that $\rho$ would be transformed either by $X$, $Y$, or $Z$. You are saying that there should be a 100% chance that $\rho$ changes in some way, whereas I don't see any reason why there should not be an equal chance of it staying the same as there is chance for it to be transformed by $X$ or by $Y$ or by $Z$.

+ +

Finally, all of this is just some extremely simplified model of how decoherence really works. Therefore it is up to the authors how they want to model the decoherence, and up to the referees and the readers of the paper, whether they like the paper or not. In this case they chose a model where all four SU(2) operators have an equal probability (1/4) of acting on $\rho$ as $t\rightarrow \infty$. I personally would have modeled the qubit's bath with a Hamiltonian, and simulated the $\rho_{\textrm{qubit}}(t)$ using a quantum master equation or a numerically exact method rather than this extremely simplified model, but I do not blame them. The freedom of choice goes to the author, and we are given the freedom of whether or not we like their paper :)

+ +

There is a further point: I believe that in the real story (if everything follows the Schroedinger equation exactly, including system and bath), the limit is ""un-defined"". This is because decoherence will happen, then when you wait long enough, there will be a re-vival (Poincaré recurrence), then a decoherence again, then a re-vival, then a decoherence again, then a re-vival, and so on. Therefore what state $\rho$ will be in, will depend on what time you make the measurement. There is NO defined limit for sin(x) as x -> $\infty$. Likewise, there is no defined limit for $\rho$.

+",6058,,6058,,3/20/2019 20:23,3/20/2019 20:23,,,,6,,,,CC BY-SA 4.0 +5751,2,,5724,3/20/2019 20:33,,2,,"

You seem to be thinking about ""quantum memory"" like it is one specific thing and there is only one specific way it can happen.

+ +

In reality, what you describe is a valid notion of quantum memory.

+ +

Another popular one, involving the element Yb, is this one: https://arxiv.org/abs/1701.04195.

+",6058,,,,,3/20/2019 20:33,,,,0,,,,CC BY-SA 4.0 +5752,2,,5747,3/21/2019 13:43,,7,,"

From the public data given by IBM about IBM Q16 Melbourne (14 qubits available):

+ +
    +
  • Mean gate error: $2.14 \times 10^{-3}$ (probably higher for CX and lower for 1-qubit gates, but this information seems to be no longer available).
  • +
  • Mean measure error: $2.68\times 10^{-2}$.
  • +
+ +

If your circuit contains $300$ gates then the probability that at least one gate fails is +$$ +\begin{split} +P\left(\text{at least 1 gate fails}\right) &= 1 - P\left(\text{all gates succeed}\right) \\ +&= 1 - P\left( \text{1 gate succeed} \right)^{300} \\ +&= 1 - \left( 1 - 2.14 \times 10^{-3} \right)^{300} \\ +&\approx 0.474 +\end{split} +$$ +This means that, without accounting for decoherence errors, your circuit fails nearly one time over two (the $47$% computed above does not take into account errors cancelling each other out).

+ +

Speaking now of decoherence errors, let's compute the time needed to the Melbourne chip to finish the execution of your circuit.

+ +

From the decomposition of each gate in pulse and the corresponding pulses duration (taking a rough average of $360$ns for CX) we have:

+ +
    +
  1. Time needed for U1: $0$ns (U1 is ""free"" in the sense that it just change the phase of the next operation).
  2. +
  3. Time needed for U2: $100 + 20 = 120$ns (one GD followed by a buffer time of $20$ns).
  4. +
  5. Time needed for U3: $100 + 20 + 100 + 20 = 240$ns.
  6. +
  7. Rough average time needed for CX: $100 + 20 + 360 + 20 + 100 + 20 + 360 + 20 = 1000$ns.
  8. +
+ +

Depending on the number of gates in your circuit, you can compute the time needed with the function

+ + + +
def compute_rough_execution_time_melbourne_ns(number_of_U1: int, 
+                                              number_of_U2: int,
+                                              number_of_U3: int,
+                                              number_of_CX: int) -> int:
+    return (0*number_of_U1 + 120*number_of_U2 + 240*number_of_U3 + 1000*number_of_CX)
+
+ +

Say you have a circuit of depth $90$ with gates from qiskit (i.e. X, Y, CX, H, ...). We will consider that the qubit on which the $90$ gates are applied is the ""critical path"", i.e. the qubit that takes the most time to reach its final state. Most of the gates in qiskit are translated to one U2 or U3, so we can say that you have approximately 90 gates that are U2, U3 or CX.

+ +

Say that you have $80$% of CX, $15$% of U3 and $5$% of U2. This means that you have $72$ CX gates, $14$ U3 gates and $4$ U2 gates. By using compute_rough_execution_time_melbourne_ns with the appropriate parameters you find that your circuit will take approximately $75.84 \mu s$.

+ +

Computing the decoherence errors is not easy, but knowing that the coherence times for Melbourne are $T1 = 71.5\mu s$ and $T2 = 21.4\mu s$, I would say that you have a relatively low probability to execute the whole circuit without at least one error due to decoherence.

+ +

Conclusion: without accounting for decoherence errors, you have approximately a $50$% chance of executing successfully the circuit. With decoherence errors, the probability is much harder to compute but I would not be surprised to see it drop to less than $10$%.

+",1386,,,,,3/21/2019 13:43,,,,6,,,,CC BY-SA 4.0 +5754,2,,5741,3/21/2019 17:32,,2,,"

You can think of a pixel state as a combination of color ($3q$ qubits) and position ($2n$ qubits). Authors represent the whole image as a superposition of pixels. This is a lossy image encoding, since measurement in standard basis will give the value of 1 random pixel.

+ +

Operator $𝑈_1$ just flips the least significant qubit of color encoding for a particular pixel at a given $x,y$ location. +This is basically a multiply controlled $X$ operation, an extended version of the simple CNOT gate.

+ +
+ +

EDIT: after some research I must add, that authors of the original encoding scheme of this type (called NEQR, with grayscale encoding instead of RGB, see here) claim that you can ""retrieve digital images from quantum images accurately"".

+ +

From my point of view this is cheating, because to do this retrieval you need a lot of copies of the image state. The minimum number of copies must be at least the number of pixels in the image, but in general you need much bigger number of copies, infinite in the worst case.

+",5870,,5870,,3/21/2019 22:36,3/21/2019 22:36,,,,0,,,,CC BY-SA 4.0 +5755,1,,,3/22/2019 14:53,,0,41,"

Implementing a single-qubit gate in a multi-qubit register is relatively easy. For example, this gate:

+ +

+ +

This is equivalent to $I \otimes H \otimes I$. If the $H$ gate was on the first bit, it would be $H \otimes I^{\otimes 2}$ etc.

+ +

What about this gate?

+ +

+ +

There doesn't seem to be any Kronecker product of the CNOT matrix that will produce the correct matrix for this. Is there a simple way to calculate the matrix for the general case of a multi-qubit gate on a larger register?

+ +

I imagine it could be done by rearranging the qubits to put the gate on the first qubits of a register, and then reversing the rearrangement after the gate. This is a lot harder than the single-gate case though.

+",6078,,26,,3/23/2019 17:44,3/23/2019 17:44,How are multi-qubit gates extended into larger registers?,,0,3,,3/22/2019 15:11,,CC BY-SA 4.0 +5756,1,5757,,3/23/2019 3:38,,4,921,"

I'm trying to understand how the Deutsch–Jozsa algorithm works with the following circuit:

+ +

Circuit in Quirk

+ +

+ +

Since we have the top 2 wires measuring $|0\rangle$ with 100% probability, it means $U_f$ is constant. And that's what I'm having trouble understanding...what exactly is constant?

+ +

If I isolate $U_f$ I get this: +Oracle function

+ +

+ +

I understand the concept of balanced and constant functions, and that an n-bit binary string will have $2^n$ mappings, which gives $2^n$ possible functions. So how can I see that $f$ is constant in the isolated circuit above?

+",6083,,26,,3/29/2019 19:52,3/29/2019 19:52,Deutsch–Jozsa algorithm: why is $f$ constant?,,1,1,,,,CC BY-SA 4.0 +5757,2,,5756,3/23/2019 3:51,,3,,"

The circuit you gave implements an oracle for a function $f(x) = 0$, which is constant.

+ +

+ +

You can observe that there are no gates leading from the top two wires (inputs $|x\rangle$) to the bottom wire (output $|y\rangle$). Since the oracle is supposed to transform $|x\rangle|y\rangle$ into $|x\rangle|y \oplus f(x)\rangle$, and $|y\rangle$ always remains unaffected, you can see that $f(x) = 0$.

+",2879,,,,,3/23/2019 3:51,,,,3,,,,CC BY-SA 4.0 +5758,2,,1654,3/23/2019 13:37,,1,,"

Parallel computation of the sum of two qubits

+ +

I wanted to experience parallel computation of the sum of two qubits, a superposition of 0 and ""1 with phase -1"" added to 1; and I was inspired by Mithrandir24601's answer. The results are below. I hope my answer is within the context of what was asked. It shows how 1 is added 1, and to 0, at the same time, but whilst both answers are calculated, we can read out the answer to only one of the calculations each time the computation is run. You can see that out of 1000 runs, 417 times we read out the answer ""1"" (1=0+1), and 380 times and we read out the answer ""2"" (2=1+1).

+ +

(34 times we got nought when the 1 bit was flipped to nought, 54 times we got 0=0+1, 29 times we got 1=1+1, 28 times we got 2=0+1, 42 times we got 3=0+1, and 16 times we got 3=1+1; each of these errors arising no doubt from bit flips, phase flips, or both). +

+ +

I thought an initial $\pi$ phase (created in the 1st of 3 Hadamard gates) represented a negative digit, but it just represents a positive digit with a -1 phase factor.

+ +

A superposition of 0 and ""1 with phase -1"" in a one qubit register is added to 1 in a two-qubit register. With three qubits, the first two qubits left to right is the sum (or the 3rd and 4th of 5) and the right-most qubit shows whether the ground state (treated as 0) was added or the excited state (1 with an initial phase of -1) was added.

+",6086,,,,,3/23/2019 13:37,,,,0,,,,CC BY-SA 4.0 +5760,2,,5696,3/24/2019 1:36,,11,,"

I've been working on this problem as well. As a beginner and a classical programmer (i.e., I don't speak Quantum Mechanics), it is difficult to get an understanding of the concepts without complete examples. I've been working with the Microsoft Q# Database Search sample. It simply searches for a specific index/key in the database, which is not very useful. I have expanded upon that sample to search a list of values in a database and return the corresponding key.

+ +

As with your example, there is one two-qubit ""key register"" for the indexes, and a separate two-qubit register for the values. There is also a fifth ""marked qubit"" that comes from Microsoft's sample, to indicate when the desired value is found. The keys and values are associated via entanglement. That is best demonstrated with a circuit. Click here to see the actual Quirk circuit.

+ +

+ +

Note that this circuit contains only the oracle. It does not implement all of Grover's algorithm.

+ +
    +
  • The top two qubits are the key register, the next two are the value register, and the bottom qubit is the marked qubit.
  • +
  • The first section puts the key register in a uniform superposition using Haramard gates, as required by Grover's algorithm.
  • +
  • The second section is where the keys are associated with the values via entanglement. Each key is entangled with a corresponding value in the value register by applying (Anti-)Controlled X gates. So, when the key register is 0, then the value register will be set to 3. When the key is 1, the value is set to 2, and so on on.
  • +
  • The third section of the circuit is the search oracle. The value register is entangled with the marked qubit. In this example, the desired value is 2. When the value register contains 2, the marked qubit will be set to 1.
  • +
  • Grover's algorithm looks at the key register and marked qubit. The search oracle looks at the value register and sets the marked qubit. This will cause key 1 to be amplified when the value is 2.
  • +
+ +

It's interesting to note that the keys and values are not stored in the qubits, but rather in the circuit/program. You could say it's not really a database per se. It's more like a switch/case statement, but one that can run on a superposition of values.

+ +

For more details, caveats, and Q# code, see my GitHub repository.

+ +

EDIT: Something I understand better since answering... you have to reverse/undo the circuit as part of each iteration. In the Q# code, the Adjoint StatePreparationOracle() call within the ReflectStart() operation handles this, so I didn't have to do it explicitly. I don't know if Qiskit has a similar feature. If I've done the translation properly, here is a complete circuit for the example above.

+",6087,,6087,,4/6/2019 15:25,4/6/2019 15:25,,,,3,,,,CC BY-SA 4.0 +5761,1,,,3/24/2019 19:50,,3,992,"

How do I embed classical data into qubits? I have a classical data [0 1] and I want to encode it as quantum amplitude to a superposition? What are the gates used to achieve that? I am a beginner to quantum programming?

+",6098,,55,,3/26/2019 17:19,3/26/2019 17:19,How do I embed classical data into qubits?,,2,0,,,,CC BY-SA 4.0 +5762,2,,5761,3/25/2019 7:06,,3,,"

Depending on your data there are multiple ways of doing so.

+ +

Consider the case of normalized and standardized data (i.e. data on the unit circle). A data point can be given by $(a, b)$ with $|a|^2+|b|^2=1$.

+ +

Now we can choose an angle $\theta$ such that +$$R_Y(\theta)\lvert 0\rangle = a\lvert 0\rangle + b\lvert 1\rangle.$$ +In a similar fashion this can be done for data on the unit sphere.

+ +

If your data is more than two-dimensional, you have a similar trick. Suppose you have data given by $(a_1, a_2,\dots,a_{2^n})$, with $\sum_i |a_i|^2 = 1$.

+ +

Now choose angles $\vec{\theta}$ such that +$$U(\vec{\theta})\lvert 0\rangle = \sum_i a_i \lvert i\rangle,$$ +for a suitable $U$. The difficulty with this is that you have to decompose $U$ in a sequence of one- and two-qubit gates.

+",2005,,,,,3/25/2019 7:06,,,,2,,,,CC BY-SA 4.0 +5763,2,,5761,3/25/2019 8:19,,3,,"

To embed classical data, you don't need superpositions. Bit values 0 and 1 correspond directly to the quantum states of a qubit written as $|0\rangle$ and $|1\rangle$. From a theorist's perspective, we don't worry about making these; it's a fundamental assertion that you can prepare, say, the $|0\rangle$ state. Then one just has to apply the bit-flip gate (also known as Pauli-X) to convert the 0 into a 1.

+ +

It's also worth noting that if you only want to perform a classical computation on these bit values (OK, why would you go to the effort of using qubits? but for the sake of argument...), you just rewrite your classical circuit as a classical reversible circuit. This can be implemented directly on the qubits. Each step will work exactly the same as it did on bits, it's just that instead of a register of $n$ bit values $x\in\{0,1\}^n$, you have a state vector $|x\rangle$ of $n$ qubits.

+",1837,,,,,3/25/2019 8:19,,,,0,,,,CC BY-SA 4.0 +5764,1,5765,,3/25/2019 13:34,,1,74,"

I once experimented with the tool ""quirk"" and came to a gate, whose function I can not properly tap into. I'm working in the circuit with 4 bits, the last bit is negated, so from 0 to 1. On all 4 bits then I apply a Hadamard transformation. Then this special gate is used, whose function I can not explain.

+ +

+ +

Hence my question. Can someone explain what makes the gate? How does this work? I know so far the CNOT gate and the Toffoli gate, but this one seems to be something else?

+ +

I hope the question is understandable.

+",,user4961,26,,3/25/2019 15:57,3/25/2019 15:57,Explanation of the function of the circuit,,1,0,,,,CC BY-SA 4.0 +5765,2,,5764,3/25/2019 13:42,,2,,"

This gate is closely related to the CNOT gate that you've already learnt about. Where the CNOT gate says ""apply NOT to the target if the control is in the state $|1\rangle$"", this gate says ""apply NOT to the target if all 3 control qubits are in the state $|1\rangle$"". The three control qubits are the closed black circles, and the target qubit is the other one.

+ +

If you want to know more about this gate, it's probably worth starting with the ""Toffoli gate"", which is the same but with two control qubits.

+",1837,,,,,3/25/2019 13:42,,,,3,,,,CC BY-SA 4.0 +5766,2,,5696,3/25/2019 14:07,,6,,"

You need to convert the oracle to hold the database too, as a result, the general Oracle (Phase Inversion) will have two sub-oracles take a look the figure. +

+ +

The first sub-oracle that have to prepared is the memory circuit, in contrast to QRAM which stores quantum data (state) in its body, this memory (array) circuit is prepared to store only classical information in its frame. An example of such kind of circuit that stores an array of binaries [010, 110, 100, 011] is displayed below: + +For more read this paper.

+",4206,,26,,3/25/2019 15:56,3/25/2019 15:56,,,,0,,,,CC BY-SA 4.0 +5767,1,,,3/25/2019 17:08,,6,129,"

I'm addressing the implementation with gates of an algorithm where there is the need of creating a qubit register $|\Psi\rangle$ starting from two input qubit registers $|a\rangle$ and $|b\rangle$, obtaining +$$|\Psi\rangle = \frac{1}{k}(|0\rangle|a\rangle + |1\rangle|b\rangle)$$ +with $k$ being a normalisation factor $\sqrt 2$. +How that can be obtained using quantum gates starting from $|a\rangle$, $|b\rangle$ and ancilla qubits as needed?

+",4927,,26,,3/25/2019 17:31,3/26/2019 11:26,Summing states of two qubit registers,,3,6,,,,CC BY-SA 4.0 +5768,1,5783,,3/25/2019 18:29,,6,286,"

Note: Cross-posted on Physics SE.

+ +
+ +

Hi, I'm studying the quantum phase estimation algorithm from this book: M.A. Nielsen, I.L. Chuang, ""Quantum Computation and Quantum Information"", Cambridge Univ. Press (2000) [~p. 221].

+ +

He defines $b$ as the integer in the range $0$ to $2^t-1$ such that $\frac{b}{2^t} $ is the best t bit approximation to $\varphi$ (the phase that we want to estimate).

+ +

From the first part of the circuit we have this state:

+ +

$$\frac{1}{2^{t/2}} \sum\limits_{k=0}^{2^t-1} e^{2 \pi i \varphi k}|k\rangle$$

+ +

Applying the inverse quantum Fourier transform we have:

+ +

$$\frac{1}{2^t} \sum\limits_{k,l=0}^{2^t-1} e^{\frac{-2\pi i k l}{2^t}} e^{2 \pi i \varphi k} |l\rangle$$

+ +

Then he define $\alpha_l$ as the amplitude of $|(b+l) \bmod{2^t}\rangle$

+ +

Then we want to bound the probability of obtaining a value of $m$ such that $|m-b|>e $

+ +

$$\sum\limits_{-2^{t-1} < l \le -(e+1)} |\alpha_l|^2 + \sum\limits_{e+1 \le l \le 2^{t-1}} |\alpha_l|^2$$

+ +

I understand the end with $e$ but not the one with $2^{t-1}$

+",6107,,26,,3/29/2019 19:53,3/29/2019 19:53,Phase estimation algorithm: probability bound of obtaining $m$,,1,1,,,,CC BY-SA 4.0 +5769,1,5772,,3/25/2019 20:39,,21,7496,"

Is the circuit depth the longest sequence of gates applied on one of the qubits? +Or is it something more complicated?

+",6071,,9925,,9/20/2020 22:08,9/20/2020 22:08,How to calculate circuit depth properly?,,3,0,,,,CC BY-SA 4.0 +5770,2,,5767,3/25/2019 22:22,,-1,,"

I haven’t seen a simple way for preparing this new state, however it does not mean it is not achieveable.

+ +

Assuming $a$ and $b$ are both states corresponding classical $n$-bit binary integers, the end states will be a entangled state corresponding to two $n+1$ bit integers.

+ +

You will need to have $n+1$ qubits all in $|+\rangle$ states, then use Grover’s algorithm to search for the two states that matches the $n+1$ bit binary integers. Of couse this will take $\sqrt{N}$ steps to achieve the target state with desired accuracy.

+",6109,,6109,,3/25/2019 22:57,3/25/2019 22:57,,,,0,,,,CC BY-SA 4.0 +5771,2,,5769,3/25/2019 23:02,,9,,"

It is the maximum time from input to output assuming all gates take 1 unit of time. So in this example:

+ +

+ +

Register 3 has 5 gates, but the 2nd gate (controlled-$U$) cannot be done until the controlled-$U^4$ and controlled-$U^2$ are done, so that adds 2 time steps. The controlled-$T$ can be done at the same time as the $H$, so there's no added time steps there. In total we have a gate depth of 7. If you include the measurement as a ""gate"", then the gate depth is 8.

+",6099,,6099,,3/27/2019 21:43,3/27/2019 21:43,,,,4,,,,CC BY-SA 4.0 +5772,2,,5769,3/26/2019 0:35,,24,,"

The circuit depth is the length of the longest path from the input (or from a preparation) to the output (or a measurement gate), moving forward in time along qubit wires. +The stopping points on the path are the gates, the allowed paths that must be considered can enter and exit those gates on any input / output, and the length is the number of jumps from each gate to the next gates along the path.

+ +

(When considering a unitary circuit, there is often a convention among theorists to ignore the final measurement in the count of the depth, which I actually provided in my original answer to this question. While it might not be entirely appropriate in the context of quantum technologies, this is something you may see here and there.)

+ +

Put another way: the depth is the smallest amount of time steps required to perform the circuit, if every gate (including each measurement and preparation) is performed at some integer time-step, gates which act on no common qubits are allowed to be performed at the same time-step, and gates acting on at least one qubit in common must act at different time-steps (and in the correct order of course). With a bit of work, it's possible to show that determining this smallest number of time-steps amounts to the first description that I give.

+ +

Practically speaking, this is best computed with dynamic programming, taking the circuit gate by gate and computing how each gate contributes to the length of the longest path that ends at a given qubit.

+ +

Example

+ +

Using the example provided by Hastings:

+ +

     

+ +

Here is how you can compute the circuit depth, adding one gate at a time, to compute the length of the longest path that ends at a given qubit.

+ +
    +
  1. Initialise the depth ending at each qubit to 0.

    + +
    Init:       [0, 0, 0, 0, 0]
    +
  2. +
  3. For each gate in sequence (consistent with the input/output dependencies of the gates), take the maximum depth $d$ to that point on all of the qubits on which the gate acts, add one, and set the new max-depth on those qubits to that result. (If you are considering a unitary circuit with final measurements, and for some reason you want to use the convention of ignoring the depth-contribution of the measurements, then just don't count the measurements.) In the case of the circuit above, this yields:

    + +
    H 1:        [1, 0, 0, 0, 0]
    +H 2:        [1, 1, 0, 0, 0]
    +H 3:        [1, 1, 1, 0, 0]
    +CU^4 1 4 5: [2, 1, 1, 2, 2]
    +CU^2 2 4 5: [2, 3, 1, 3, 3]
    +CU^1 3 4 5: [2, 2, 4, 4, 4]
    +H 1:        [3, 2, 4, 4, 4]
    +CS 1 2:     [4, 4, 4, 4, 4]
    +H 2:        [4, 5, 4, 4, 4]
    +CT 1 3:     [5, 5, 5, 4, 4]
    +CS 2 3:     [5, 6, 6, 4, 4]
    +H 3:        [5, 6, 7, 4, 4]
    +Meas 1:     [6, 6, 7, 4, 4]
    +Meas 2:     [6, 7, 7, 4, 4]
    +Meas 3:     [6, 7, 8, 4, 4]
    +
  4. +
  5. Take the maximum of the depths ending at each qubit. In this case, it is qubit 3, with a depth of 8. With a little bit of work, by tracing how this depth arose, you can also find one or more particular paths through the circuit which yields this depth (e.g. H 1 ; CU^4 1 4 5 ; H 1; CS 1 2; H 2; CS 2 3; H 3; Meas 3).

  6. +
+",124,,124,,3/26/2019 10:27,3/26/2019 10:27,,,,3,,,,CC BY-SA 4.0 +5773,1,5774,,3/26/2019 3:09,,3,307,"

I've written a small quantum circuit simulator in python, so now I'm trying to evolve some circuits via genetic algorithms. My encoding is very simple, it's just a rectangular table of strings representing the gates. Here's a example of a random circuit:

+ +
+--------+--------+--------+-------+--------+-------+
+| qubit  | col_0  | col_1  | col_2 | col_3  | col_4 |
++--------+--------+--------+-------+--------+-------+
+| q0-->  |   I    | CNOT_2 |   S   |   Z    |   H   |
+| q1-->  | CNOT_0 |   T    |   S   |   I    |   T   |
+| q2-->  |   S    |   I    |   S   | CNOT_1 |   S   |
++--------+--------+--------+-------+--------+-------+
+
+ +

My first attempt is to generate the Toffoli gate, which input/output I encoded as follows:

+ +
inputs = [[0, 0, 0], [0, 1, 0], [1, 0, 0], [1, 1, 0]]
+output_zero_probs = [[1, 1, 1], [1, 0, 1], [0, 1, 1], [0, 0, 0]]
+
+ +

So there are 4 input tests, and for each one there is the correspondent output. The variable output_zero_probs is the probability of measuring 0 for each wire for each input. Note that the last qubit holds the answer.

+ +

So for example, if the input is [1, 1, 0], the output should be [1, 1, 1], which correspondes to output_zero_probs of [0, 0, 0].

+ +

The fitness functions is just some measure of similarity between the circuit output and the expected output probabilities. The circuit dimension was fixed to 3 x 17, ie, 3 qubits x 17 columns. The mutation operator just changes a random cell, and the crossover operator exchanges an entire 'column' between 2 circuits.

+ +

So far it was not able to find the correct solution, it seems to evolve a bit, then it get stuck. Is this a feasible problem for a GA? If so, how can I improve on this? I mean, how can I 'push' the circuit to the right direction?

+ +

Thanks for your attention!

+ +
+ +

EDIT:

+ +

Now I think it's better to compare the final state of the system with the expected final state, instead of using probabilities, because these may change depending on the measures (I'm not sure if this reasoning is correct).

+ +

Follow up question: Genetic algorithm does not converge to exact solution

+",6083,,6083,,4/1/2019 18:41,4/1/2019 18:41,Evolving a quantum circuit using a genetic algorithm,,1,0,,,,CC BY-SA 4.0 +5774,2,,5773,3/26/2019 8:04,,3,,"

So in your example, you try to find the quantum circuit representing the Toffoli operation. +I would then change my objective/fitness function and compare the unitary matrix representing the operation. You can use an minimization objective like : +$$ \mathcal{F} = 1-\frac{1}{2^n} |\operatorname{Tr}(U_aU_t^{\dagger})| $$

+ +

with $ U_a $ is the unitary of the generated solution and $ U_t $ the unitary you are trying to get. The trace part of this objective means try to get $ U_aU_t^{\dagger} $ to the identity matrix on $n$ qubits.

+ +

Also, when using a genetic algorithm, many strategies can be tried, and may generate better solutions than others. You can look at this question where a genetic algorithm is used for circuit decomposition.

+",4127,,,,,3/26/2019 8:04,,,,12,,,,CC BY-SA 4.0 +5775,1,,,3/26/2019 8:56,,3,250,"

In the chapter about the Grover algorithm, it is suggested that the gate which executes the phase shift is given in the following form:

+ +

+ +

Now I have looked at this gate in detail and come to the conclusion that this ""only"" negates the state $|00\rangle$, but not all others, this can be shown for different inputs $|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle$ (the gate changes only $|00\rangle$ to -$|00\rangle$) or see here. I'm sorry, because in the chapter it says a few pages earlier: $|x\rangle$ becomes $-|x\rangle$ and $|0\rangle$ remains to $|0\rangle$ (picture left section). But that does not correspond to the circuit (picture right section). +That's why I ask myself, what is right now? I want to do this a bit further, we say the Grover operator is:

+ +

$$H^{\otimes n}(2|0\rangle\langle 0|-I)H^{\otimes n}$$

+ +

That means I have several Hadamard transformations before and then do the phase shift, followed by Hadamard transformations. I think that you can see this in $(2|0\rangle\langle 0|-I)$ (matrix with 1 in the first row, all other rows -1), that $|x\rangle$ becomes $-|x\rangle$ and $|0\rangle$ stays $|0\rangle$. But that does not correspond to the circuit (picture right).

+",,user4961,26,,3/26/2019 12:28,12/20/2019 1:21,N&C quantum circuit for Grover's algorithm,,1,3,,,,CC BY-SA 4.0 +5776,2,,5767,3/26/2019 9:13,,4,,"

If I understand your question correctly, you're asking if it's possible to be given two unknown states $|a\rangle$ and $|b\rangle$, which may not be orthogonal, and you want to know if there's a transformation +$$ +|a\rangle|b\rangle\mapsto\frac{1}{\sqrt{2}}(|0a\rangle+|1b\rangle). +$$

+ +

In general, this is impossible to realise deterministically. Let me give a sketch of a proof (it's similar to a standard proof of no cloning).

+ +

If we want this to be a unitary evolution, then we need some ancilla states. Thus, we'd be after the transformation +$$ +|a\rangle|b\rangle|s\rangle\mapsto\frac{1}{\sqrt{2}}(|0a\rangle+|1b\rangle)|t_{ab}\rangle. +$$ +Now, let's consider two particular inputs, $a=0$ and $b=0$ or 1. We need +$$ +|0\rangle|0\rangle|s\rangle\mapsto\frac{1}{\sqrt{2}}(|00\rangle+|10\rangle)|t_{0}\rangle \\ +|0\rangle|1\rangle|s\rangle\mapsto\frac{1}{\sqrt{2}}(|00\rangle+|11\rangle)|t_{1}\rangle. +$$ +Using linearity, we can therefore infer what the evolution has to be for any input $|b\rangle$ when $a=0$: +$$ +|0\rangle(\alpha|0\rangle+\beta|1\rangle)|s\rangle\mapsto\frac{1}{\sqrt{2}}(\alpha|00\rangle|t_0\rangle+\alpha|10\rangle|t_0\rangle+\beta|00\rangle|t_1\rangle+\beta|11\rangle|t_1\rangle) +$$ +but it should be +$$ +\frac{1}{\sqrt{2}}(|00\rangle+\alpha|10\rangle+\beta|11\rangle)|\tilde t\rangle. +$$ +To achieve equality, we'd need $|\tilde t\rangle=|t_1\rangle=|t_0\rangle$ and $(\alpha|t_0\rangle+\beta|t_1\rangle)=|\tilde t\rangle$. This can only happen if $\alpha\beta=0$, i.e. for the two cases we fixed initially; no other case works, making the transformation impossible.

+ +

I'm sure one could improve the structure of this proof so that you don't have to make as many assumptions about what's included in the possible set of states to do this with.

+ +

If the two states $|a\rangle$ and $|b\rangle$ are guaranteed to be orthogonal, in a known basis, I believe that the transformation is achievable.

+",1837,,,,,3/26/2019 9:13,,,,0,,,,CC BY-SA 4.0 +5777,2,,5767,3/26/2019 11:26,,3,,"

It's impossible if $|a\rangle, |b\rangle$ are unknown, as DaftWullie proved in his answer.

+ +

Though, you can construct another operation, that might suit your needs +$$|0\rangle|a\rangle|b\rangle \mapsto \frac{1}{\sqrt{2}}(|0\rangle|a\rangle|b\rangle + |1\rangle |b\rangle|a\rangle)$$ +Just use $H$ on the first qubit, and then controlled swap of the two last registers.

+ +

If $|a\rangle,|b\rangle$ are known in advance, then you can construct whatever you want.

+",5870,,,,,3/26/2019 11:26,,,,0,,,,CC BY-SA 4.0 +5778,1,,,3/26/2019 11:59,,5,685,"

I have a quantum circuit which I would like to understand, which compares two standard basis states $|YX\rangle$ and $|AB\rangle$. +It operates on the corresponding bits in each of the two states: i.e., if $$ +\begin{align*} + &|YX\rangle=|y_{n-1}y_{n-2}...y_0x_{n-1}x_{n-2}..x_0\rangle \quad\text{and} +\\&|AB\rangle=|a_{n-1}a_{n-2}...a_0b_{n-1}b_{n-2}....b_0\rangle, +\end{align*} +$$ this operator or gate seems to act on the bits $y_j$ and $a_j$, and on the bits $x_j$ and $b_j$, for each $j$.

+ +

Here is the diagram of the circuitry involved: I understand the computations part of it, but can anybody explains the diagram: +

+",6070,,55,,12/3/2021 9:05,12/3/2021 9:05,Understanding quantum circuit diagrams: a circuit that compares two states $|YX\rangle$ and $|AB\rangle$,,1,0,,,,CC BY-SA 4.0 +5779,1,5782,,3/26/2019 12:11,,8,1264,"

The query oracle: $O_{x}|i\rangle|b\rangle = |i\rangle|b \oplus x_{i}\rangle$ used in algorithms like Deutsch Jozsa is unitary. How do I prove it is unitary?

+",5542,,10480,,4/30/2021 1:02,4/30/2021 1:02,How to prove that the query oracle is unitary?,,2,1,,,,CC BY-SA 4.0 +5780,2,,5779,3/26/2019 12:18,,10,,"

Apply it twice: +$$ +O_xO_x|i\rangle|b\rangle=O_x|i\rangle|b\oplus x_i\rangle=|i\rangle|b\oplus x_i\oplus x_i\rangle=|i\rangle|b\rangle +$$ +Hence, $O_x$ is its own inverse, and therefore reversible.

+ +

To prove unitarity, it makes more sense to prove that $O_x$ has eigenvectors +$$ +|i\rangle(|0\rangle+|1\rangle)\quad\text{and}\quad|i\rangle(|0\rangle-|1\rangle) +$$ +for all $i$ with eigenvalues $1$ and $(-1)^{x_i}$ respectively. These are all orthonormal, and span the full Hilbert space. Consequently, the eigenvalues of $O_x$ are all $\pm 1$, and therefore $O_x^\star=O_x$ (where $^\star$ represents the Hermitian conjugate). Thus, +$$ +O_xO_x^\star=\mathbb{I}, +$$ +as required for a unitary.

+",1837,,1837,,3/27/2019 8:51,3/27/2019 8:51,,,,5,,,,CC BY-SA 4.0 +5781,2,,5778,3/26/2019 17:08,,4,,"

How to read the circuit

+ +

You should think of this as a diagram describing a transformation of the qubits. +The input state of the qubits is on the left, and describes the state $|Y\rangle \otimes |X\rangle \otimes |A\rangle \otimes |B\rangle$, reading the qubits from top to bottom. Each qubit corresponds to a horizontal wire, which we trace from left to right.

+ +

The qubits are acted on by operations, which are represented by nodes, symbols, or boxes which interrupt the wires. We think of these (abstractly) as gates which happen at a specific moment in time, e.g. at integer time steps. These correspond to quantum gates.

+ +

The symbols in your upper circuit are different variations of controlled-not gates:

+ +
    +
  • A filled cdot on one wire, directly above (or below) an $\oplus$ symbol on another wire, represents a CNOT gate where the target is where the $\oplus$ symbol is put. These are connected by a vertical wire, which may pass over other qubit wires. (These qubits are not involved in the operation).

  • +
  • A hollow dot on one wire, directly above (or below) an $\oplus$ symbol on another wire, represents a CNOT gate where the target is where the $\oplus$ symbol is put, and where the operation is conditioned on the control being in the state $|0\rangle$ instead of $|1\rangle$.

  • +
  • A vertical wire which connects several filled (or empty) dots to an $\oplus$ symbol is a multiply-controlled NOT gate. In the case that all of the dots are filled, it performs the operation +$$ \mathrm{C^k NOT} = \mathbf 1^{\otimes k} \otimes \mathbf 1 + \Bigl(\lvert11\cdots1\rangle\!\langle11\cdots1\rvert \otimes \bigl(X - \mathbf 1\bigr)\Bigr)$$ +which performs an $X$ operation on the target provided that all of the $k$ control qubits (marked with filled dots) are all in the state $|1\rangle$. Variations in which some or all of the dots are hollow depend on those specific qubits being in the state $|0\rangle$ instead; and the gate acts on arbitrary states in linear superposition, according to how they decompose into standard basis states.

  • +
+ +

What the circuit does

+ +

Most of the gates in the circuit are CNOT gates, but conditioned on the control being 0 instead of 1:$\def\xCNOT{\overline{\textrm{CNOT}}}$ +$$ \xCNOT = \lvert 0 \rangle\!\langle 0 \rvert \otimes X + \lvert 1 \rangle\!\langle 1 \rvert \otimes \mathbf 1 $$ +(note that this is not standard notation). What happens if you take two standard basis states, and act on them with this opposite-CNOT, is that the target will have the value 1 if and only if the control and target had different values. +$$ +\begin{aligned} + \xCNOT \lvert a \rangle\lvert b \rangle + &= \lvert a \rangle \lvert b \oplus (\neg a)\rangle + \\&= \lvert a \rangle \lvert b \oplus (a \oplus 1)\rangle + \\&= \lvert a \rangle \lvert (b \oplus a) \oplus 1\rangle + \\&= \begin{cases} + \lvert a \rangle \lvert 0 \rangle, & \text{if $a = \neg b$}; + \\ \lvert a \rangle \lvert 1 \rangle, & \text{if $a = b$}. + \end{cases} +\end{aligned} +$$ +Your circuit is performing this, and then performing a multiply-controlled-NOT gate conditioned on those targets all being equal to 1 — that is, conditioned on all of those pairs of qubits being equal if they happen to be standard basis states. +If that is the case, then the pairs of inputs are indeed equal, so the target of that multiply-controlled-NOT gate is flipped. +The computation of whether the individual qubit-pairs are equal is then undone to restore the original standard basis inputs.

+ +

For general quantum states, this all occurs in coherent superposition, of course. But for standard basis states, this realises an equality test.

+",124,,124,,4/27/2019 19:37,4/27/2019 19:37,,,,9,,,,CC BY-SA 4.0 +5782,2,,5779,3/26/2019 17:49,,5,,"

Notice that $\mathcal O_x$ is a permutation matrix.

+ +

The matrix elements are +$$\langle j, c\rvert\mathcal O_x\lvert i,b\rangle +=\delta_{ij}\langle c\rvert b\oplus x_i\rangle +=\delta_{ij}\delta_{c,b\oplus x_i}.$$ +In other words, $\mathcal O_x$ is diagonal with respect to the first register, and, for each block corresponding to a given $i$, connects all and only the indices $b,c$ such that $b\oplus c=x_i$ (remember that here $b,c,x_i\in\mathbb Z_2^{\otimes n}$ are length-$n$ bit strings). +Also, notice that for a given $b$ there is no more than one $c$ such that $b\oplus c=x_i$ (more precisely, there isn't any such $c$ if $x_i=0$, and there is exactly one if $x_i\neq 0$).

+ +

It follows that $\mathcal O_x$ is a (real) permutation matrix, and such matrices are always unitarily diagonalizable with unit eigenvalues (and therefore unitary). +In this case, we have that the eigenvalues of $\mathcal O_x$ are $\pm1$, and the eigenvectors are, in the case $x_i\neq 0$, +$$\lvert i\rangle\otimes(\lvert b\rangle\pm\lvert b\oplus x_i\rangle)$$ +for all $i$ and $b$. If $x_i=0$ then $\mathcal O_x$ is the identity, and therefore its spectrum is trivial${}^\dagger$.

+ +

This shows explicitly that $\mathcal O_x$ is unitarily diagonalizable with unit eigenvalues, and therefore is unitary.

+ +
+ +

${}^\dagger$ I'm actually being a bit sloppy for the sake of simplicity here. This analysis holds for each different block of $\mathcal O_x$ corresponding to a given $i$. More precisely, I should say that $\mathcal O_x$ is block-diagonal as it doesn't connect spaces with $i\neq j$ on the first register, and each block is either the identity in the subspace in which it acts if $x_i=0$, or a permutation matrix that connects different pairs of basis states if $x_i\neq 0$.

+",55,,55,,3/26/2019 18:05,3/26/2019 18:05,,,,0,,,,CC BY-SA 4.0 +5783,2,,5768,3/27/2019 1:23,,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 that your confusion?

+ +

Continuing from there:

+ +

Change the indexing from 0 to $2^t$ as you have already by subtracting $2^{t-1}$ so you get $-2^{t-1}$ to $2^{t-1}$ instead.

+ +

l just has to be indexed by a fundamental domain of modulo $2^{t}$ so 0 to $2^t$ works just as well as $-2^{t-1}$ to $2^{t-1}$. The answer just looks symmetrical with the second.

+",434,,,,,3/27/2019 1:23,,,,0,,,,CC BY-SA 4.0 +5784,1,5786,,3/27/2019 1:47,,6,136,"

I'm watching Christian Schaffner's talk on quantum position-based cryptography (link here) and have a question about a particular application of teleportation.

+ +

At about the 16:40 mark, he seems to say something along these lines (notation is mine)

+ +

Alice receives a quantum state $|\psi\rangle$, which is an element of some basis $\mathcal{B}$. Alice teleports it to Bob, which gives him the state $|\psi^\prime\rangle = X^{M_1}Z^{M_2}|\psi\rangle$, for some values $M_1,M_2$ which Alice learns as a result of teleportation. What's next is the part that confuses me. He says that Bob can measure $|\psi^\prime\rangle$ in the $\mathcal{B}$ basis, and then when he receives the classical values $M_1,M_2$, he can apply the $Z^{M_2}X^{M_1}$ to recover $|\psi\rangle$.

+ +

My question is: Since $|\psi^\prime\rangle = X^{M_1}Z^{M_2}|\psi\rangle$, how can we be sure that Bob's measurement will always return the same value? Certainly if he measured $|\psi\rangle$ in the $\mathcal{B}$ basis, he would get result $|\psi\rangle$ with 100% certainty. But if $|\psi^\prime\rangle$ is some superposition of basis states, then Bob's answer will not always be the same.

+",6118,,55,,11/30/2021 22:27,11/30/2021 22:27,"Quantum teleportation of a state, from one of two bases",,1,1,,,,CC BY-SA 4.0 +5786,2,,5784,3/27/2019 15:17,,5,,"

Alice receives a quantum state $|\psi\rangle$, which is an element of some basis $\mathcal{B}$, though she does not know what $\mathcal B$ is. She then teleports this to Bob, who is told by someone else what $\mathcal B$ is. Furthermore, it seems that specifically either $\mathcal{B} = \{ \lvert 0 \rangle, \lvert 1 \rangle \}$ or $\mathcal{B} = \{ \lvert + \rangle, \lvert - \rangle \}$.

+ +

The last detail is important here. +It means that the basis is either the eigenbasis of the $Z$ operator, or the eigenbasis of the $X$ operator — which means that when Bob wants to do the corrections, one of the two corrections which he will perform will in principle have no effect, while the other will simply interchange the two possible basis elements.

+ +
    +
  • In a normal teleportation procedure, just after Alice's measurement, the state on Bob's side looks perfectly random to him. +If Bob didn't know whether Alice would be sending one of the states $\{ \lvert 0 \rangle, \lvert 1 \rangle \}$ or one of the states $\{ \lvert + \rangle, \lvert - \rangle \}$, there is very little that he can do with this qubit which would be of any use: he would have to wait to obtain Alice's measurement outcomes. +If he did wait for Alice's measurement outcomes, he could perform the necessary $X$ and/or $Z$ correction to obtain the state.

  • +
  • If someone (Alice or someone else) then came along and told him what +basis $\mathcal B$ his state was in, he could perform a +(non-demolition) measurement in the basis $\mathcal B$ to find out +which state it is without disturbing it. +But the outcome of this measurement is not affected by one of the corrections he did from Alice's measurement outcomes. If $\mathcal B = \{ \lvert 0 \rangle, \lvert 1 \rangle \}$, then the $Z$ correction from Alice's teleportation results didn't have any effect on the teleported state; and if $\mathcal B = \{ \lvert + \rangle, \lvert - \rangle \}$, then the $X$ correction from Alice's teleportation results didn't have any effect. +The effect of the other correction, on the other hand, would be just to interchange the two possible states of the $\mathcal B$ measurement, which could have been done before or after the measurement.

  • +
  • It follows that if someone told Bob what basis $\mathcal B$ Alice's state was going to be in, he could perform the $\mathcal B$ measurement first, and then wait for Alice's measurement results. +The measurement will disturb the state, but it will only collapse it to a state of the same basis $\mathcal B$ that Alice is sending; then Alice's teleportation results will give Bob enough information to correct the state.

  • +
+ +

Now, if Bob performs the measurement before Alice sends him the correction information, the result of his measurement will be random. But because the two bases are either the $X$ eigenbasis or the $Z$ eigenbases, the outcome of his measurement will either be the state he is meant to obtain or the orthogonal state; he will always know that the state he obtains is one of those two states, and what those two states are; and it will always be correctable using the information that Alice sends. (The same is also true if there is a third possibility, that the state is in the $Y$ eigenbasis, for essentially the same reason using the fact that $Y \propto XZ$.)

+",124,,,,,3/27/2019 15:17,,,,4,,,,CC BY-SA 4.0 +5787,1,6244,,3/27/2019 17:02,,7,859,"

I am currently working on the proof of Grover's algorithm, which states that the runtime is optimal.

+ +

In Nielsen they say, the idea is to check whether $D_k$ is restricted and does not grow faster than $O(k^2)$. Now in Nielsen, an inductive proof is given which I do not quite understand. The algorithm starts in $|\psi\rangle$ and applies $O_x$ $k$-times, with some unitary operators. We now define: +$$O_x=I-2|x\rangle\langle x|$$ +$$|\psi_k^x\rangle=U_kO_x...U_1 O_x|\psi\rangle$$ +$$|\psi_k\rangle=U_k...U_1|\psi\rangle$$

+ +

$D_k$ is defined as a deviation after $k$ steps:

+ +

$$D_{k}=\sum_x |||\psi_k^x\rangle-|\psi_k\rangle||^2$$

+ +

With a proof it should now be shown that $D_k$ is restricted and can not grow fatser than $O(k^2)$. Now we come to the actual problem.

+ +

I am interested in the proof of some points:

+ +
    +
  1. Why does it have to be shown that $D_k$ is limited?
  2. +
  3. Why must it be shown that $D_k$ does not grow faster than $O(k^2)$? What +is the idea behind it?
  4. +
  5. In the second proof it is to be assumed that $D_k=\Omega(N)$ holds, why exactly is that important? Which statement is behind it?
  6. +
+ +

If someone needs more information, I have a helpful PDF here. Otherwise, I can also give more information.

+ +

I hope that these are not too many questions at once, but I would be glad if someone could give me some clarity.

+",4974,,55,,5/27/2019 2:31,5/27/2019 2:40,Proof of the optimality of Grover's algorithm,,1,1,,,,CC BY-SA 4.0 +5789,1,5798,,3/27/2019 19:08,,4,208,"

I'm studying the quantum search algorithm on this book:

+ +

M.A. Nielsen, I.L. Chuang, ""Quantum Computation and Quantum Information"", Cambridge Univ. Press (2000) [~p. 252].

+ +

To sum up we have a state:

+ +

$$|\psi \rangle = \cos( \frac{\theta}{2}) |\alpha \rangle + \sin( \frac{\theta}{2})|\beta\rangle$$ with $\theta \in [0, \pi]$

+ +

Now we apply an operator called G that performs a rotation:

+ +

$$G |\psi \rangle = \cos( \frac{3\theta}{2}) |\alpha \rangle + \sin( \frac{3\theta}{2})|\beta\rangle$$

+ +

Continued application of $G$ takes the state to:

+ +

$$G^k |\psi \rangle = \cos( \frac{(2k+1)\theta}{2}) |\alpha \rangle + \sin( \frac{(2k+1)\theta}{2})|\beta\rangle$$

+ +

Now the book says: "" Repeated application of the Grover iteration rotates the state vector close to $| \beta \rangle $

+ +

Why? Probably it is a silly doubt but I can't figure out.

+",6107,,55,,3/28/2019 19:35,3/28/2019 19:45,In what sense do repeated applications of Grover's operator rotate the state closer to the target?,,2,0,0,,,CC BY-SA 4.0 +5790,2,,5789,3/27/2019 19:26,,3,,"

In the space of $\{|\alpha \rangle ,|\beta\rangle\}$ (where $|\beta \rangle$ is the solution vector) vectors, which are orthogonal, there is an initial angle of $\pi/2$. As you can see from the result that $\sin \frac{(2k+1)\theta}{2}$ increases when $k$ increases for the respective anglular range $\{0,\pi/2 \}$ while $\cos \frac{(2k+1)\theta}{2}$ decreases. So the probability of getting state $|\beta\rangle$ which is $|\sin \frac{(2k+1)\theta}{2}|^2$ increases, before it overshoots with repeated iterations the vector $|\beta\rangle$ at some iteration. The required value of approximate number of iterations can be caculated beforehands for a given problem. This is approximately equal to +\begin{equation} +R\leq \frac{\pi}{4}\sqrt{\frac{N}{M}} +\end{equation} +where $N$ is the number of total elements while $M$ is the number of solution elements in the basis.

+",4889,,,,,3/27/2019 19:26,,,,1,,,,CC BY-SA 4.0 +5791,1,5792,,3/27/2019 22:02,,5,1271,"

I have lately been studying quantum algorithms. I have gone through the Deutsch algorithm and Grover's algorithm. There's always a function in the oracle which somehow 'recognizes' the solution without 'knowing' it. I somehow understood what is meant by recognizing and knowing the solution but the fact that the function processes all the superposition of states in parallel and gives an output is confusing! What does the function actually do? Does it match integers or can it detect other things like an intersection of two lines? I am sick of taking it as a black box. Without knowing how the function works I am incapable of knowing it's potential. Please help me.

+ +

Bottom line: how does $f(x)$ find the searched item amongst the superpositioned states and evaluate to 1? How are the superpositioned states evaluated by the function?

+",6124,,55,,8/16/2019 18:57,3/25/2020 4:32,How does an oracle function in Grover's algorithm actually work?,,1,1,,,,CC BY-SA 4.0 +5792,2,,5791,3/28/2019 2:26,,3,,"
    +
  1. Let $f$ be your favorite $\mathrm{SAT}$ problem. For example, one that I like is:
  2. +
+ +
+

Are there integers $x_1, x_2, x_3$, each $-2^{50}\le x_1,x_2,x_3 \le 2^{50}$, with $x_1^3+x_2^3+x_3^3=42?$

+
+ +
    +
  1. Write $f$ as a sequence of irreversible $\mathsf{NAND}$ gates, etc., and convert them to a sequence of reversible $\mathsf{CCNOT}$ gates, etc. to determine a unitary $U_f$. In the example problem, this unitary will take the $103$ bits of $x_i$ to a single output $y$. Here $y$ is $1$ if and only if the $\mathrm{SAT}$ problem is solved.

  2. +
  3. Take a first register initially at $\vert 0\rangle$, and apply a Hadamard to put it in the uniform superposition of all states. In the example problem, the first register is $153$ qubits ($50$ plus $1$ sign bit each.)

  4. +
  5. Apply $U_f$ to the second register conditioned on the first register. Thus, in the sample problem, the system is in the state $\vert x_1,x_2,x_3\rangle \vert f(x_1,x_2,x_3)\rangle$, where $x_1,x_2,x_3$ are between $-2^{50}$ and $2^{50}$ and $f$ is $1$ if and only if $x_1^3+x_2^3+x_3^3=42$

  6. +
  7. Apply a phase shift to the first register conditioned on the value of the second register

  8. +
  9. Apply the Grover diffusion operator to the first register

  10. +
  11. Repeat steps 5 and 6 $O(\sqrt N)$ times. (With the sample problem, apply this $O(\sqrt {2^{153}})$ times.)

  12. +
  13. If there's only one solution, the first register should be in the state that satisfies $f(x)=1$. With the sample problem, it should be in the state $\vert x_1,x_2,x_3\rangle$ solving $x_1^3+x_2^3+x_3^3=42$.

  14. +
+ +

The heart of Grover is steps 5, 6, and 7. Steps 1-4 can be fiddled with.

+ +
+ +

EDIT

+ +

$f$ is applied to the second register based on the values of the first register. The first register is left unchanged upon the application of $f$ to the second register. If the first register is in a uniform superposition over all states initially, then after application of $U_f$, acting on both the first register and the second register, the first register will still be in a uniform superposition. $U_f$ relies on the contents of $x$ to determine the contents of $y$ but it leaves the contents of $x$ unchanged.

+ +

For example, from the questions in your comments, I can tell that you understand that $f$ can be written classically as a set of irreversible $\mathsf{NAND},\mathsf{NOR},\mathsf{AND}$, etc. gates. Classically if we were to apply $f$, then we may lose the value of $x$. But remember quantum-mechanically the states must be reversible. Thus from your questions I think you also recognize that $\mathsf{NAND}$ gates etc. need to be converted to $\mathsf{CCNOT}$ gates etc. It's no surprise that these gates tend to leave some inputs unchanged - the qubits that are left unchanged would correspond to $x$, and the qubits that are changed would correspond to $f(x)$.

+ +

After application of $U_f$, for each possible value of the first register, a different value is stored in the second register, but the first register is unchanged.

+ +

Shor's algorithm is a little different - initially a uniform superposition is applied to a first register, then a value of some function is calculated in the second register. In Shor, we can throw away the second register; in Grover, we need to save the second register for the repeated conditional rotations (this part I think you understand).

+",2927,,2927,,3/28/2019 12:09,3/28/2019 12:09,,,,2,,,,CC BY-SA 4.0 +5793,1,,,3/28/2019 7:30,,2,327,"

We can use OpenFermion to get the molecular Hamiltonian in the form of:
+$$H = \sum_{pq} h_{pq} a_p^\dagger a_q + \frac12 \sum_{pqrs} h_{pqrs} a_p^\dagger a_q^\dagger a_r a_s$$ +and we can also use the Jordan-Wigner transformation to get the spin Hamiltonian.

+ +

So in the molecular Hamiltonian such as the $\require{mhchem}\ce{H2}$ molecule we don't add any occupied or active indices limitation, there is a four-qubit Hamiltonian. What does every qubit represent?

+",6128,,6099,,3/30/2019 6:25,3/30/2019 8:54,What are the rules that map the second-quantized fermionic Hamiltonian into spin-form in OpenFermion?,,1,0,0,,,CC BY-SA 4.0 +5794,1,5797,,3/28/2019 8:49,,3,1329,"

I have a quantum map described by the following Kraus operators

+ +

$$A_0 = c_0 \begin{pmatrix} + 1 & 0\\ + 0 & 1 \end{pmatrix}, +\qquad A_1 = c_1 \begin{pmatrix} + 1 & 0\\ + 0 & -1 \end{pmatrix},$$

+ +

such that $c_0^2 + c_1^2 = 1$. I want to know what is a complementary map and how to construct the same for the above-mentioned channel?

+ +

Edit 1: Checked for some literature. Here is the definition of the complementary map equations 37 and 38.

+",5806,,55,,12/11/2021 19:02,3/21/2022 13:55,"What is the ""complementary map"" of a channel with given Kraus decomposition?",,2,4,,,,CC BY-SA 4.0 +5795,1,5800,,3/28/2019 11:03,,1,549,"

I need to work out a research project on quantum computing as a part of my curriculum. I was wondering how to implement something theoretically with the basic knowledge I have. I have learned about superposition, Deutsch Jozsa algorithm, and Grover's algorithm. Can I design something simple using these algorithms? Perhaps a way to solve a game, or solve a graph problem or anything? I can't go deep in research now as I have not much time left but would be rather happy to work on the existing knowledge I have. Please enlighten me!

+",6124,,26,,3/28/2019 16:53,3/28/2019 21:57,What can be a mini research project based on Grover's algorithm or the Deutsch Jozsa algorithm?,,1,1,,,,CC BY-SA 4.0 +5797,2,,5794,3/28/2019 18:06,,12,,"

Let's start by finding a complementary channel for any channel given by a Kraus representation +$$ +\Phi(X) = \sum_{k=1}^n A_k X A_k^{\dagger}. +$$ +To make the necessary equations clear, let us assume that the channel has the form $\Phi:\mathrm{L}(\mathcal{X})\rightarrow \mathrm{L}(\mathcal{Y})$ for finite-dimensional Hilbert spaces $\mathcal{X}$ and $\mathcal{Y}$. Let us also define $\mathcal{Z} = \mathbb{C}^n$; the complementary channel we will define will take the form $\Psi:\mathrm{L}(\mathcal{X})\rightarrow \mathrm{L}(\mathcal{Z})$. (For the channel in the question itself, we will have $\mathcal{X}$, $\mathcal{Y}$, and $\mathcal{Z}$ all equal to $\mathbb{C}^2$, but it helps nevertheless to assign different names to these spaces.)

+ +

Define an operator +$$ +A = \sum_{k=1}^n A_k \otimes | k\rangle, +$$ +which is a linear operator mapping $\mathcal{X}$ to $\mathcal{Y}\otimes\mathcal{Z}$. This gives us a Stinespring representation +$$ +\Phi(X) = \operatorname{Tr}_{\mathcal{Z}} \bigl( A X A^{\dagger}\bigr). +$$ +The channel +$$ +\Psi(X) = \operatorname{Tr}_{\mathcal{Y}} \bigl( A X A^{\dagger}\bigr) +$$ +is therefore complementary to $\Phi$. We can simplify this expression by observing that +$$ +A X A^{\dagger} = \sum_{j=1}^n \sum_{k=1}^n A_j X A_k^{\dagger} \otimes | j \rangle \langle k |, +$$ +so that +$$ +\Psi(X) = \sum_{j=1}^n \sum_{k=1}^n \operatorname{Tr}\bigl(A_j X A_k^{\dagger}\bigr) | j \rangle \langle k |. +$$ +There's not too much more we can do with this, except perhaps to use the cyclic property of the trace to obtain the expression +$$ +\Psi(X) = \sum_{j=1}^n \sum_{k=1}^n \operatorname{Tr}\bigl(A_k^{\dagger} A_j X\bigr) | j \rangle \langle k |. +$$

+ +

Now let's plug in the specific operators from the question to obtain +$$ +\Psi(X) = c_0^2 \operatorname{Tr}(X) | 0 \rangle \langle 0 | + c_1^2 \operatorname{Tr}(X) | 1 \rangle \langle 1 | + c_0 c_1 \operatorname{Tr}(\sigma_z X) | 0 \rangle \langle 1 | + c_0 c_1 \operatorname{Tr}(\sigma_z X) | 1 \rangle \langle 0 |. +$$ +Here $\sigma_z$ denotes the Pauli-Z operator, which we get because $A_0^{\dagger} A_1 = A_1^{\dagger}A_0 = c_0 c_1 \sigma_z$. (I am assuming $c_0$ and $c_1$ are real numbers.) The expression may look a bit nicer in matrix form: +$$ +\Psi\begin{pmatrix} \alpha & \beta\\ \gamma & \delta\end{pmatrix} = +\begin{pmatrix} c_0^2(\alpha + \delta) & c_0 c_1 (\alpha - \delta)\\ +c_0 c_1 (\alpha - \delta) & c_1^2 (\alpha + \delta) \end{pmatrix}. +$$

+ +

Finally, the question asks for Kraus operators of $\Psi$, which we can get by computing the Choi operator of $\Psi$. In general, this is the operator +$$ +J(\Psi) = \sum_{j=1}^n\sum_{k=1}^n \Psi(|j\rangle\langle k|) \otimes |j\rangle\langle k|, +$$ +and in this particular case we obtain +$$ +J(\Psi) = \begin{pmatrix} +c_0^2 & 0 & c_0 c_1 & 0\\ +0 & c_0^2 & 0 & -c_0 c_1 \\ +c_0 c_1 & 0 & c_1^2 & 0\\ +0 & -c_0 c_1 & 0 & c_1^2 +\end{pmatrix}. +$$ +This operator has rank 2, which means just 2 Kraus operators suffice. We can get them through a spectral decomposition of $J(\Psi)$. Specifically, we have +$$ +J(\Psi) = \begin{pmatrix} c_0\\ 0\\ c_1\\ 0 \end{pmatrix} +\begin{pmatrix} c_0 & 0 & c_1 & 0 \end{pmatrix} ++ \begin{pmatrix} 0\\ c_0\\ 0\\ -c_1 \end{pmatrix} +\begin{pmatrix} 0 & c_0 & 0 & -c_1 \end{pmatrix}, +$$ +and by ""folding up"" these vectors we get Kraus operators: +$$ +\Psi(X) = B_0 X B_0^{\dagger} + B_1 X B_1^{\dagger} +$$ +where +$$ +B_0 = \begin{pmatrix} c_0 & 0\\ c_1 & 0 \end{pmatrix} +\quad\text{and}\quad +B_1 = \begin{pmatrix} 0 & c_0 \\ 0 & -c_1 \end{pmatrix}. +$$

+",1764,,1764,,3/29/2019 12:43,3/29/2019 12:43,,,,8,,,,CC BY-SA 4.0 +5798,2,,5789,3/28/2019 19:25,,3,,"

As was also pointed out in another answer, repeated applications of the Grover operator rotate the state closer to the target $\lvert\beta\rangle$ in the sense that the probability of finding the state in $\lvert\beta\rangle$ increases up to a certain point (or equivalently, the fidelity between the state and $\lvert\beta\rangle$ gets closer to one).

+ +

More precisely, you can see that this probability is, after $k$ iterations, +$$p^{(k)}_\beta\equiv \lvert\langle \beta\rvert G^k\lvert\psi\rangle\rvert^2=\sin^2\left(\frac{(2k+1)\theta}{2}\right).$$ +Now, you start with the probability $p^{(0)}_\beta=\sin^2(\theta/2)$. This tells you how close the initial state is to the target. +In most basic introductions to Grover's algorithm, you have $\sin(\theta/2)=2^{-n/2}=1/\sqrt N$ with $n$ number of qubits or $N$ total dimension of the state space, so that $p_\beta^{(0)}=2^{-n}=1/N$. This is not really important for the discussion though so let us consider the general case with arbitrary $\theta$.

+ +

By definition, you know that $\sin(\theta/2)\le1$ (because the overlap of a state with another state can never exceed $1$), so that $\theta\le\pi$. +The question thus becomes: what is the smallest integer $k\ge0$ such that $(2k+1)\theta\sim\pi$?. More precisely, we are looking for the $k_0\in\mathbb N$ that minimises the difference between $(2k+1)\theta$ and $\pi$: +$$k_0=\operatorname{argmin}_k\{(2k+1)\theta-\pi\}.$$ +In other words, you are looking for the odd number $(2k+1)$ that is closer to $\pi/\theta$, which is the same as saying that you are looking for the non-negative integer $k_0$ that is closer to $\pi/2\theta-1/2$. +This number is +$$k_0=\left\lfloor\frac{\pi}{2\theta}\right\rfloor,$$ +that is, the integer part of $\pi/2\theta$ ${}^\dagger$.

+ +

In summary, $p_\beta^{(k)}$ will keep increasing with $k$ for all $k\le k_0$, after which it reaches its maximum and will start decreasing again (note that you might have $k_0=0$, in which case Grover's algorithm is useless). +You might notice that the smaller the initial $\theta$ is, the more Grover's algorithm brings you closer to the target, but also the more steps will be needed to do that.

+ +
+ +

${}^\dagger$ To see this, write $\frac{\pi}{2\theta}=\left\lfloor\frac{\pi}{2\theta}\right\rfloor+r$, where $0\le r\le1$ is the decimal part of $\pi/2\theta$.

+ +

If $0\le r\le 1/2$, then +$$\frac{\pi}{2\theta}-\frac{1}{2}=\left\lfloor\frac{\pi}{2\theta}\right\rfloor-r'$$ +where $0\le r'\le 1/2$, and thus $\left\lfloor\frac{\pi}{2\theta}\right\rfloor$ is the closer integer.

+ +

If on the other hand $1/2\le r\le1$, then +$$\frac{\pi}{2\theta}-\frac{1}{2}=\left\lfloor\frac{\pi}{2\theta}\right\rfloor+r''$$ +for some $0\le r''\le1/2$. It follows that, again, the integer closest to $\pi/2\theta-1/2$ is $\left\lfloor\frac{\pi}{2\theta}\right\rfloor$.

+",55,,55,,3/28/2019 19:45,3/28/2019 19:45,,,,0,,,,CC BY-SA 4.0 +5799,1,,,3/28/2019 20:38,,21,1453,"

(Classical) theoretical computer science (TCS) has a number of outstanding open problems that can easily be instantiated in a manner that is accessible to a wider general public.

+
    +
  • For example, questions about $\mathrm{P}$ vs. $\mathrm{NP}$ can easily be cast in an accessible manner by talking about Sudoku, or the traveling salesperson problem, etc.

    +
  • +
  • Similarly questions about the polynomial hierarchy $\mathrm{PH}$ can be instantiated as questions about games, such as "is there a mate-in-$n$ strategy for white?"

    +
  • +
+

Many open problems in QCS, at least initially, seem to require a good deal of a-priori knowledge to even begin to understand the questions being asked.

+

For example, even describing the initial rush to find $\mathrm{BQP}$ solutions to instances of the hidden-subgroup (HSP) problem seemed to expect the audience to not only have a good deal of knowledge of, or respect for, QM, but also a small amount of knowledge of (finite) group theory.

+

EDIT Upon further review I think this is an unfair dunk on the early researchers looking in to HSP solutions. Researches looked into the HSP precisely because HSP generalized a lot of problems that people cared about. /EDIT

+

I think the subject has matured so much from the mid-90's that I think there are some important outstanding problems that can be described quickly, to a wider audience. The descriptions might not demand much but a little patience and curiosity of the audience.

+

I'm looking for a kind of "big-list" of such accessible open problems. This may be helpful for perennial questions like "what's a good research topic for me?"

+

For example, some open problems that come to mind include:

+
    +
  • What can be said about whether graph isomorphism $\mathsf{GI}$ is in $\mathrm{BQP}$? Is it even a worthwhile question in light of Babai's breakthrough? I think this can be described to a curious-enough audience
  • +
  • Can a quantum computer distinguish various knots? I think the problem statement can be described to maybe even patient elementary-school students
  • +
  • One of my favorite problems is the "beltway problem" - determining the location of exits along a beltway (highway around a city) given only their inter-exit distances. This is related to Golomb rulers. I like to think about whether this is in $\mathrm{BQP}$
  • +
  • The existence of $\mathrm{QMA}$ certificates does not always seem to imply the existence of a $\mathrm{BQP}$ solution, but asking if there's a $\mathrm{QMA}$ certificate for problems that aren't even known to be in $\mathrm{NP}$ seems interesting, such as the $\mathrm{coNP}$ versions of some $\mathrm{NP}$ problems. If framed correctly, these might fit the bill.
  • +
+
+

Can a list of 'high-concept' open problems in Quantum Computing research be created?

+
+

Here, to keep the question narrow enough, by "high-concept" I mean:

+
    +
  • In order to understand the phrasing of the question, a school child might be able to understand at least the question being asked.
  • +
+

I would argue that "Can a quantum computer solve my problem $X$ faster than other regular computers?" is an accessible way to frame the question. Here $X$ is the problem that is accessible (Sudoku/TSP/mate-in-$n$ problems classically).

+",2927,,2927,,2/19/2021 23:30,3/8/2022 0:57,Is there a list of accessible open problems in quantum computing from a theoretical computer science perspective?,,1,4,,,,CC BY-SA 4.0 +5800,2,,5795,3/28/2019 21:57,,5,,"

(Based on the time limitation I assume we're talking about an undergraduate level project, and not something more advanced.)

+ +

If you look at the questions about Grover's algorithm, you'll notice that a lot of them ask about implementing oracles for interesting tasks - or at least tasks more satisfying than looking for the state $|111\rangle$ :-)

+ +

One project idea arising from this could be picking some interesting problem that can be solved with Grover's algorithm, implementing the oracle and actually solving it. To give just two examples, here are oracles for solving SAT problem and graph coloring problem. (Full disclosure: I wrote the first example myself, and the second one was done as a student project for our course in the University of Washington.)

+ +

It is usually possible to come up with a small version of an interesting problem to simulate the solution (the optimizations you have to do to squeeze things in the 30-ish qubits for simulation can be interesting on their own). After that you can estimate the resources it would take to solve a larger instance of the problem, compare different implementations (for example, if your problem requires arithmetic), etc.

+",2879,,,,,3/28/2019 21:57,,,,0,,,,CC BY-SA 4.0 +5801,1,5802,,3/29/2019 12:44,,3,223,"

Consider $n$ qubits and the $N=2^n$ states that I label +\begin{equation} +|k \rangle = \sum_{i=0}^{n-1} 2^i q_i, +\end{equation} +i.e. $|q_{n-1}\cdots q_0 \rangle \rightarrow |k\rangle$, where $q_j \in \{0,1\}$. That is I label the binary string of qubits by its decimal value.

+ +

I then want to find quantum circuits implementing three $N\times N$ matrices: +\begin{equation} +\begin{aligned} +H_0 &= -\frac{1}{2} \sum_{k=0}^{N-1} |2j\rangle \langle 2j+1| - |2j+1\rangle\langle 2j|, \\ +H_1 &= -\frac{1}{2} \sum_{k=0}^{N-1} |2j+1\rangle \langle 2j+2| - |2j+2\rangle\langle 2j+1|,\\ +H_2 &= -\frac{1}{2} \sum_{k=0}^{N-1} |2j\rangle \langle 2j+3| - |2j+3\rangle\langle 2j|, +\end{aligned} +\end{equation} +where the values are all modulo $N$. Pictorially this is: +

+ +

I want to find efficient implementations using only CNOTs and single qubit gates. By efficient I mean that I want the lowest CNOT gate count possible.

+ +

The first of these can be solved quite easily and is given by +\begin{equation} +H_0 = 1_{n-1} \otimes (iY_0), +\end{equation} +where $1_{n-1}$ is the identity on qubits 1 to $n-1$ and $Y_0$ is the Y-Pauli operator on qubit 0.

+ +

I can also find $H_1$ using the incrementer + +However, this uses gates with many controls. I am wondering, due to the symmetry, is it possible to significantly reduce the number of CNOTs to implement this circuit.

+ +

I currently have no idea how to tackle $H_2$. Any solution for these matrices, and or tips, references etc. would be greatly appreciated!

+",6076,,26,,3/29/2019 19:39,3/29/2019 19:39,Implementing these $N×N$ matrices on $\log N$ qubits,,1,0,,,,CC BY-SA 4.0 +5802,2,,5801,3/29/2019 14:04,,3,,"

Basically your three operations are, for each even $k$, do an interaction with $k+1+2j$ for some $j$. For $H_0$ the value of $j$ is $0$. For $H_1$ the value of $j$ is $-1$. For $H_2$ the value of $j$ is $1$. I'm going to define $G_{-1} = H_1$, $G_0 = H_0$, $G_1 = H_2$ so that the indices match the value of $j$.

+ +

The way to implement $G_k$ is by applying a $-k$ operation to all qubits except the least significant qubit, but using the least significant qubit as a control, then applying your mixing operation to the least significant qubit, then uncomputing the offset by applying a $+k$ operation to all qubits except the least significant qubit.

+ +

(You incremented the whole register instead of performing a controlled increment of part of the register. This just happens to be equivalent, modulo that last NOT gate on the control, because of how the increment circuit is built.)

+ +

In other words, $H_2$ is implemented in the same way as $H_1$ except you decrement instead of incrementing.

+ +
+ +

To optimize the circuit, you can use a more efficient linear-cost increment circuit such as the one explained in ""Factoring with n+2 clean qubits and n-1 dirty qubits"".

+ +

Alternatively, you can use the fact that $+k \equiv \text{QFT} \cdot \text{GRAD}^k \cdot \text{QFT}^\dagger$ where $\text{QFT}$ is the quantum fourier Transform and $\text{GRAD}_n^k = \sum_{j=0}^{2^n-1} |j\rangle\langle j| e^{i j \pi / 2^n} = \otimes_{j=0}^{n-1} Z_j^{k/2^j}$ is the phase gradient operation (see ""Addition on a Quantum Computer""). This allows you to rework $H_1$ and $H_2$ into the following sort of form:

+ +

+ +

Which is equivalent to this:

+ +

+ +

Which still has two increments, but they are slightly smaller. I suspect there is a way to merge these two increments into one single addition.

+",119,,26,,3/29/2019 14:14,3/29/2019 14:14,,,,5,,,,CC BY-SA 4.0 +5803,1,5806,,3/29/2019 16:06,,3,466,"

I want to look more closely at the consequences of the Grovers algorithm. As is well known, the algorithm provides a quadratic improvement compared to classical search algorithms.

+ +

Specifically, I would be interested in the implications of Grover's algorithm on modern cryptography. So how is the influence of grover's algorithm on cryptography. Maybe someone here has some good tips and sources where you can read something, or where something is discussed.

+ +

I would be very grateful if anyone knows scientific papers that investigate this influence. Also, I would be interested in the weaknesses of the algorithm, what are the practical implications? So if anyone knows of any scientific sources dealing with this problem I would be very happy if you can share this.

+",,user4961,26,,3/29/2019 17:21,3/30/2019 8:01,Consequences of Grover's algorithm,,1,0,,,,CC BY-SA 4.0 +5804,1,5816,,3/29/2019 17:19,,11,1556,"

I know that the Choi operator is a useful tool to construct the Kraus representation of a given map, and that the vectorization map plays an important role in such construction.

+ +

How exactly does the vectorization map work in this context, and how does it relate the Choi and Kraus representations of a given map?

+",5806,,55,,2/14/2021 18:58,2/14/2021 18:58,How does the vectorization map relate to the Choi and Kraus representations of a channel?,,1,0,,,,CC BY-SA 4.0 +5805,2,,5793,3/29/2019 22:18,,1,,"

You are correct.

+ +

There is a 1-1 mapping between the standard ""molecular Born-Oppenheimer Hamiltonian"" that you wrote down in 2nd quantized form, and the equivalent Jordan-Wigner spin Hamiltonian. That mapping is actually quite simple:

+ +

$$\Large{a_j \iff \mathbf{1}^{\otimes {j-1}}\otimes \sigma^{+}\otimes \sigma ^ {z\otimes {N-j-1}}}$$

+ +

$$\Large{a_j^{\dagger} \iff \mathbf{1}^{\otimes {j-1}}\otimes \sigma^{-}\otimes \sigma ^{z\otimes {N-j-1}}}$$

+ +

By turning each $a$ and $a^\dagger$ into an equivalent string of Pauli matrices, we don't add any occupied or active indices (which is exactly what you said).

+ +

The number of terms in the Hamiltonian you wrote down, will be exactly the number of terms in the Jordan-Wigner form.

+ +

The reason why $\require{mhchem}\ce{H2}$ has a 4-qubit Jordan-Wigner Hamiltonian in most quantum computing papers, is because they typically use the STO-3G basis set, which has exactly 4 spin orbitals.

+",6099,,26,,3/30/2019 8:54,3/30/2019 8:54,,,,3,,,,CC BY-SA 4.0 +5806,2,,5803,3/29/2019 22:23,,2,,"

In this survey article they discuss Grover's algorithm. In my opinion, the most important part:

+ +
+

Grover’s speed-up from $N$ to $\sqrt{N}$ is not as devastating as Shor’s + speed-up. Furthermore, each of Grover’s $\sqrt{N}$ quantum evaluations must + wait for the previous evaluation to finish. To quantify this issue, + define T as the number of serial evaluations that can be carried out + in the time available: for example, if the quantum computer can + evaluate f in a nanosecond, and if the attacker is prepared to run a + computation lasting for a year, then T≈$2^{55}$. If $\sqrt{N}$ exceeds T, then + Grover’s algorithm cannot use fewer than N/T evaluations spread across + $N/T^2$ parallel quantum processors. This is a factor T better than + pre-quantum techniques, but it is possible that this improvement will + be wiped out by the overhead of qubit operations being more expensive + than bit operations, making Grover’s algorithm useless—even if + scalable quantum computers are built and run Shor’s algorithm + successfully.

+
+ +

This is the main and oft-discussed issue, that Grover's algorithm parallelizes very badly (provably so: Zalka 1997). Bear in mind that our usual classical heuristics of security - $2^{80}$ operations, say - are based on extremely parallel architectures.

+ +

Here's another paper discussing the same issue and suggesting a fixed time limit for post-quantum security definitions. NIST included maximum depths in their definitions of quantum security for the post-quantum cryptography standardization process (See Section 4A).

+ +

Some other issues: Grassl et al. give circuits for AES, showing that reversibility also adds some noticeable overhead.

+ +

Also, Grover's algorithm has a very high depth compared to Shor's algorithm, meaning the qubits and circuit need to have very, very low errors. This will, in turn, create large (though poly-logarithmic) overheads for error correction.

+ +

So:

+ +
    +
  1. As far as I know, no one is trying to build any ""quantum-safe"" symmetric cryptography, because modern symmetric cryptography is already quantum-safe (Grover's algorithm is still exponential)

  2. +
  3. Because of the practical issues I mentioned, the key sizes may not even not to increase

  4. +
  5. Sill, it's not too hard to eliminate even what little risk there is; from the same survey article:

  6. +
+ +
+

On the other hand, if qubit operations are small enough + and fast enough, then Grover’s algorithm will threaten many + cryptographic systems that aim for $2^{128}$ security, such as 128-bit AES + keys. We recommend simply switching to 256-bit AES keys: the extra + costs are rarely noticeable. ‘Information-theoretic’ MACs such as GMAC + and Poly1305 already protect against quantum computers without any + modifications: their security analysis already assumes an attacker + with unlimited computing power.

+
+",4517,,26,,3/30/2019 8:01,3/30/2019 8:01,,,,0,,,,CC BY-SA 4.0 +5811,1,,,3/30/2019 21:55,,8,2572,"

I've consulted Nielsen and Chuang to understand the Stinespring Dilation, but wasn't able to find anything useful. How does this operation relate to partial trace, Kraus operators, and purification?

+",6147,,55,,1/26/2022 12:46,1/22/2023 0:12,"What is the ""Stinespring Dilation""?",,3,0,,,,CC BY-SA 4.0 +5813,1,,,3/31/2019 8:05,,1,70,"

When I read about computing using gate based methods, I mainly read about the difficulties with error rates, circuit depth (and connectivity) and not enough qubits.

+ +

With computing using quantum annealing, discussion mainly seems to focus on number of qubits and connectivity. It seems error correction is less of an issue here.

+ +

Question: Is there an inherent difference in need for error correction between quantum annealing systems (D-Wave etc) and quantum gate based systems?

+",2794,,26,,3/31/2019 10:57,3/31/2019 17:03,Is there an inherent difference in need for error correction between quantum annealing and gate based methods?,,1,0,,,,CC BY-SA 4.0 +5815,1,5830,,3/31/2019 11:14,,6,375,"

We can strongly simulate a quantum circuit if we can estimate the probability of measuring $|0^n\rangle$, say, at the end to within some fixed relative error.

+ +

Now, by measurement, a quantum computer can certainly weakly simulate itself, i.e. sample from its own output distribution. Naively, I had also thought quantum computers to be able to strongly simulate itself.

+ +

However, I watched this talk recently by David Gosset: Classical simulation of quantum circuits via stabilizer rank where he claims this is not true (see 1 minute onwards). In particular, he seems to be saying strong simulation is $P^{\#}$-hard which implies quantum computers can't do it. Could someone please provide me with some reference to what he is saying?

+",2375,,26,,4/1/2019 12:56,4/1/2019 23:49,Why can't a quantum computer strongly simulate itself?,,2,0,,,,CC BY-SA 4.0 +5816,2,,5804,3/31/2019 14:34,,21,,"

One way to understand the relationship between the Choi representation of a channel and its possible Kraus representations is to use the vectorization map.

+ +

Suppose that we have two finite-dimensional Hilbert spaces $\mathcal{X}$ and $\mathcal{Y}$, and that we have fixed a standard basis $\{|1\rangle,\ldots,|n\rangle\}$ of $\mathcal{X}$ and a standard basis $\{|1\rangle,\ldots,|m\rangle\}$ of $\mathcal{Y}$. The vectorization map is the linear map of the form +$$ +\text{vec}:\text{L}(\mathcal{X},\mathcal{Y})\rightarrow\mathcal{Y}\otimes\mathcal{X}, +$$ +where $\text{L}(\mathcal{X},\mathcal{Y})$ is the space of all linear maps from $\mathcal{X}$ to $\mathcal{Y}$, that is defined by the following action on standard basis elements: +$$ +\text{vec}\bigl( | j\rangle \langle k |\bigr) = |j\rangle |k\rangle. +$$ +For other elements of $\text{L}(\mathcal{X},\mathcal{Y})$ the action of the mapping is determined by linearity.

+ +

If we view elements of $\text{L}(\mathcal{X},\mathcal{Y})$ as $m\times n$ matrices that act by left-multiplication on column vectors of dimension $n$, the action of the vectorization mapping is to take the rows of the matrix, turn them into column vectors, and then stack them on top of one another like this (in the case $n=m=2$): +$$ +\text{vec}\begin{pmatrix} +\alpha & \beta\\ +\gamma & \delta +\end{pmatrix} += \begin{pmatrix} +\alpha\\ +\beta\\ +\gamma\\ +\delta +\end{pmatrix}. +$$

+ +

Now the relationship between all of the possible Kraus representations and the Choi representation of a channel $\Phi$ having the form $\Phi:\text{L}(\mathcal{X}) \rightarrow \text{L}(\mathcal{Y})$ can be easily stated: for any choice of a positive integer $N$ and operators $A_1,\ldots,A_N\in\text{L}(\mathcal{X},\mathcal{Y})$, it is the case that +$$ +\Phi(X) = \sum_{k=1}^N A_k X A_k^{\dagger} +$$ +is a Kraus representation of $\Phi$ if and only if the Choi representation of $\Phi$ satisfies the equality +$$ +J(\Phi) = \sum_{k=1}^N \text{vec}(A_k) \text{vec}(A_k)^{\dagger}. +$$

+ +

This relationship allows you to convert between the two relationships pretty easily. To get the Choi representation from a Kraus representation, it is just a matter of computing. To go from a Choi representation to a Kraus representation, you can use the spectral theorem to write +$$ +J(\Phi) = \sum_{k=1}^r v_k v_k^{\dagger} +$$ +for vectors $v_1,\ldots,v_r\in\mathcal{Y}\otimes\mathcal{X}$, where $r=\text{rank}(J(\Phi))$, then take your Kraus operators to be the operators $A_1,\ldots,A_r\in\text{L}(\mathcal{X},\mathcal{Y})$ that satisfy $\text{vec}(A_k) = v_k$ for each $k\in\{1,\ldots,r\}$. This is why $\text{rank}(J(\Phi))$ is always the minimum possible number of Kraus operators you need to specify a given channel.

+ +

One warning about this relationship: I am assuming that the Choi representation of a channel $\Phi$ of the form described above is defined as +$$ +J(\Phi) = +\sum_{1\leq j,k \leq n} \Phi\bigl(|j\rangle \langle k|\bigr) \otimes |j\rangle \langle k|. +$$ +Some people choose to define the Choi representation with the tensor factors in the reverse order, like this: +$$ +J'(\Phi) = +\sum_{1\leq j,k \leq n} |j\rangle \langle k| \otimes +\Phi\bigl(|j\rangle \langle k|\bigr). +$$ +If you do that, you can still get a similar relationship, but you will have to define your vectorization mapping in a different way, as $\text{vec}'(|j\rangle\langle k|) = |k\rangle|j\rangle$. (You will find the vectorization map defined in these two different ways by different authors, so you just need to be aware of which definition is being used whenever you see this mapping.)

+ +

Concerning references, you can find this relationship in Choi's 1975 paper:

+ +
+

Man-Duen Choi. Completely positive linear maps on complex matrices. Linear Algebra and Its Applications 10: 285-290, 1975.

+
+ +

Choi's proof of this relationship is terse, but certainly comprehensible. You can also find more detail in Section 4.4 of Mark Wilde's book:

+ +
+

Mark Wilde. Quantum Information Theory, second edition. Cambridge University Press, 2017.

+
+ +

Assuming you'll forgive me for a self-citation, I also cover this in Section 2.2.2 of my book, using a similar notation to the description above:

+ +
+

John Watrous. The Theory of Quantum Information. Cambridge University Press, 2018. (Available at https://cs.uwaterloo.ca/~watrous/TQI/ .)

+
+",1764,,1764,,4/2/2019 13:16,4/2/2019 13:16,,,,4,,,,CC BY-SA 4.0 +5817,2,,5813,3/31/2019 16:49,,1,,"

The errors from quantum annealing apart from having crappy qubits will come from the imperfect instantiation of the qubit coupling. The first problem i.e having bad qubits can ultimately be mitigated by a kind of error correction look at +Error-corrected quantum annealing with hundreds of qubits (Pudenz et al., 2014).

+ +

But as it turns out the second problem related to imperfect instantiation of qubit coupling does not need to be perfect, in fact, some disorder can actually help cf. Disorder-assisted graph coloring on quantum annealers (Więckowski et al., 2019).

+ +

The ultimate reason for the gap in the models in relation to error correction stems from the fact that the gate model is a well defined computational model that is universal while on the other hand quantum annealing is more of a heuristic. Having a model of error correction really makes sense in a precise model of computation. Quantum Annealing is a method that is really a ""physics"" idea for arriving at some state (in this case the ground state). Implementing it requires studying the device that implements it and correcting for the ""errors"" will require knowing your device well. One can't rely on some general notion of errors.

+ +

In a sense, all of quantum computing requires knowing your device well, but what helps you in the gate model is that you have a theoretical model of computation while in quantum annealing you are really dealing with some heuristic.

+",4565,,26,,3/31/2019 17:03,3/31/2019 17:03,,,,0,,,,CC BY-SA 4.0 +5818,2,,5811,3/31/2019 17:07,,9,,"

Not exactly sure what you find confusing, but the ultimate need for Stinespring dilation theorem is that in quantum mechanics the dynamics is in general defined by a completely positive trace preserving map (CPTP) $\rho \mapsto \Lambda(\rho)$.

+ +

Now, we have a belief (rightly or wrongly) that all there is is a unitary evolution governed by Schrodinger's equation. Stinespring dilation theorem is a way of stating this desire from a mathematical point of view. It guarantees that as long as I see the evolution of my density matrix as governed by a positive map (in physics we require trace preserving), this CPTP map can ultimately be lifted to a unitary operation on a higher dimensional Hilbert, where we can simply think of unitary evolution (purification).

+ +

Given that this is the case, how do we go back to the lower dimensional space? The prescription is that we trace over the system we appended to get unitary dynamics and then the dynamics in the lower Hilbert space is governed by a set of Kraus operators. +This procedure is guaranteed by Stinespring dilation theorem.

+",4565,,55,,4/1/2019 11:24,4/1/2019 11:24,,,,0,,,,CC BY-SA 4.0 +5819,2,,5681,3/31/2019 17:27,,2,,"

It's not clear what your error correction procedure is but I will state the argument more generally as to why we need the Steane code. +We want to store the information in a quantum state. This means that a possible subset of errors will be those that introduce wrong relative phase factors. This means that no pure classical procedure i.e one that doesn't care or forgets that fact that the information was stored in a quantum state can ultimately work in order to detect quantum errors and recover the quantum state.

+ +

If your classical procedure can detect a relative minus sign in an encoded quantum state, think again you have apparently found a classical error correction procedure that can detect quantum errors.

+",4565,,26,,3/31/2019 17:55,3/31/2019 17:55,,,,0,,,,CC BY-SA 4.0 +5821,2,,4636,4/1/2019 1:11,,4,,"

For amplitude damping, $\gamma$ is something like $e^{-\Delta t/T_1}$ where $\Delta t$ is how long the Kraus operator is supposed to act. But be very careful, Kraus evolution assumes your system has no initial correlations, that every qubit interacts with identical baths and that every qubit is identical. All the assumptions are most likely violated and so there will be no simple relation between the actual evolution given by Kraus operators and the evolution on the devices. We may use Kraus evolution as an approximation. It's probably more appropriate to do a master equation simulation but that will not, in general, correspond to the Kraus operators one sees in Nielsen and Chuang.

+",4565,,26,,4/1/2019 4:09,4/1/2019 4:09,,,,0,,,,CC BY-SA 4.0 +5822,1,,,4/1/2019 3:24,,2,100,"

How do I find out how many physical-qubits I'm using when I run my program in an IBM Q backend quantum computing system?

+",3043,,26,,4/1/2019 4:10,4/1/2019 13:17,How many physical qubits are used when I run a program on a IBM Q computer?,,1,0,,,,CC BY-SA 4.0 +5823,1,,,4/1/2019 4:13,,8,5730,"

Will it be possible to use quantum computing to one day solve the game of chess? If so, any estimate as to how many qubits it would require?

+ +

The game of checkers has already been solved through back in 2007 after years of number crunching. But they don't expect that chess will be able to be solved the same way because the problem is an order of magnitude more difficult. There are an estimated $10^{40}$ legal chess positions and about $10^{120}$ possible games.

+",6156,,55,,10/27/2021 17:07,10/27/2021 17:07,Will quantum computers be able to solve the game of chess?,,2,3,,,,CC BY-SA 4.0 +5824,1,,,4/1/2019 9:19,,4,464,"

I would like to start my question with a quote:

+ +
+

If an encrypted document and its source can be obtained, it is possible to attempt to find the 56-bit key. An exhaustive search by conventional means would make it necessary to search 2 to the power 55 keys before hitting the correct one. This would take more than a year even if one billion keys were tried every second, by comparison, Grover's algorithm could find the key after only 185 searches.

+
+ +

This quote is from A Brief History of Quantum Computing By Simon Bone and Matias Castro

+ +

As a reader, I wonder how the authors got the magic number of 185. Unfortunately, that is not justified.

+ +

I thought about it myself. To calculate the number of iterations, the Grover algorithm uses this formula:

+ +

$$k=\frac{\pi}{4\cdot \sin^{-1}\left(\frac{1}{\sqrt{2^n}}\right)}-0.5$$

+ +

If I just do that for the number $2^{56}$ (DES keysize), then it follows that you need k iterations:

+ +

$$k=\frac{\pi}{4\cdot \sin^{-1}\left(\frac{1}{\sqrt{2^{56}}}\right)}-0.5=210828713$$

+ +

That's still not the number the authors suggest. Therefore I ask here, if anyone can imagine, how the authors came to the number. Is my consideration correct?

+ +

Assuming it were $2^{16}$, then you would need about 200 iterations, which are still not 185. I am not aware of a cryptographic system with a key length of $2^{16} $ ...

+",,user4961,55,,12/5/2019 9:37,12/5/2019 9:37,Grover's algorithm: number of searches required to find a key,,1,3,,,,CC BY-SA 4.0 +5825,2,,5815,4/1/2019 11:46,,3,,"
+

Could someone please provide me with some reference to what he is + saying?

+
+ +

Here is a reference to a discussion of this and related questions:

+ +

Quant. Inf. Comp. 10, 3-4 pp. pp0258-0271 (2010), or https://arxiv.org/abs/0811.0898

+",1771,,26,,4/1/2019 13:03,4/1/2019 13:03,,,,0,,,,CC BY-SA 4.0 +5826,2,,5822,4/1/2019 12:15,,1,,"

When you wrote your Qiskit program you had to specify how large your quantum register was or you put qubits in your quantum register as you wrote the program in your code. That's how many qubits you are using. You can also use the len function on the Quantum Register to check it's size. Another way is to print the quantum circuit or call the draw() function and you will get a picture of the quantum circuit, this will show you how many qubits you are using.

+",4565,,26,,4/1/2019 13:17,4/1/2019 13:17,,,,1,,,,CC BY-SA 4.0 +5827,1,,,4/1/2019 14:19,,5,114,"

I am reading paper Channel Identification and its Impact on Quantum LDPC Code Performance where the authors discuss the scenario where the decoder of a Quantum LDPC code uses an estimation of the depolarization probability of the channel in order to correct the errors.

+ +

When doing so, they establish the quantum Cramer-Rao bound in terms of the Fisher information. The Fisher information is defined as

+ +

$J_f = \mathrm{Tr}(\rho_f L_f^2)$,

+ +

where $L_f$ is the symmetric logarithmic derivative $2\partial_f \rho_f=L_f\rho_f+\rho_f L _f$. They then state that when the probe for the estimation is an unnetangled pure quantum state, such Fisher information can be proved to be $J_f = [f(2-f)]^{-1}$, and if the probe is a maximally-entangled qubit pair, it equals $J_f=[f(\frac{4}{3}-f)]^{-1}$.

+ +

I have been trying to prove such equalities for those cases of the Fisher information, but I haven't been able to find something similar to it nor prove it.

+",2371,,55,,6/24/2021 14:39,6/24/2021 14:39,Why is the quantum Fisher information $J_f=[f(\frac43-f)]^{-1}$ for maximally entangled qubit pairs?,,0,0,,,,CC BY-SA 4.0 +5828,2,,5824,4/1/2019 14:22,,4,,"

I think your answer is right, the original article Searching a Quantum Phone Book said that Grover's algorithm would solve the problem after quantum-DES enciphering the known clear text a mere 185 million times.

+ +

Although it is different from the results you calculated, but it looks much better than 185.

+",6157,,26,,4/1/2019 14:25,4/1/2019 14:25,,,,2,,,,CC BY-SA 4.0 +5829,1,5838,,4/1/2019 15:04,,17,7647,"

Quantum cNOT Gate (Classical XOR Gate)

+ +

A ""Controlled NOT (cNOT) Gate"" flips the 2nd qubit if the 1st qubit is $\left|1\right>$, and returns the 2nd qubit as-is if the 1st qubit is $\left|0\right>$. The 1st qubit is simply not changed.

+ +

The net effect of this gate is a classical XOR gate:

+ +
    +
  • It keeps the 1st qubit unchanged
  • +
  • It outputs ""the 1st qubit XOR the 2nd qubit"" as the result of the 2nd qubit
  • +
+ +

In table form, the function looks like:

+ +

$$ +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{cc}0 & 0\end{array} & \begin{array}{cc}0 & 0\end{array} \\ + \hline + \begin{array}{cc}0 & 1\end{array} & \begin{array}{cc}0 & 1\end{array} \\ + \hline + \begin{array}{cc}1 & 0\end{array} & \begin{array}{cc}1 & \color{red}{1}\end{array} \\ + \hline + \begin{array}{cc}1 & 1\end{array} & \begin{array}{cc}1 & \color{red}{0}\end{array} \\ + \hline +\end{array} +$$

+ +

Therefore, an input:

+ +

$$\alpha\left|00\right>+\beta\left|01\right>+\gamma\left|10\right>+\delta\left|11\right>$$

+ +

is mapped to:

+ +

$$\alpha\left|00\right>+\beta\left|01\right>+\gamma\left|1\color{red}{1}\right>+\delta\left|1\color{red}{0}\right>$$

+ +

Or, in other words:

+ +

$$\alpha\left|00\right>+\beta\left|01\right>+\color{red}{\delta}\left|10\right>+\color{red}{\gamma}\left|11\right>$$

+ +

In matrix form, we need to find the all the $a_{ij}$'s that satisfy the following:

+ +

$$ + \begin{pmatrix} + a_{11} & a_{12} & a_{13} & a_{14} \\ + a_{21} & a_{22} & a_{23} & a_{24} \\ + a_{31} & a_{32} & a_{33} & a_{34} \\ + a_{41} & a_{42} & a_{43} & a_{44} \\ + \end{pmatrix} + \cdot + \begin{pmatrix} + \alpha \\ + \beta \\ + \gamma \\ + \delta \\ + \end{pmatrix} + = + \begin{pmatrix} + \alpha \\ + \beta \\ + \color{red}{\delta} \\ + \color{red}{\gamma} \\ + \end{pmatrix} +$$

+ +

It is trivial to find the solution:

+ +

$$ + \begin{pmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & \color{red}{0} & \color{red}{1} \\ + 0 & 0 & \color{red}{1} & \color{red}{0} \\ + \end{pmatrix} + \cdot + \begin{pmatrix} + \alpha \\ + \beta \\ + \gamma \\ + \delta \\ + \end{pmatrix} + = + \begin{pmatrix} + \alpha \\ + \beta \\ + \color{red}{\delta} \\ + \color{red}{\gamma} \\ + \end{pmatrix} +$$

+ +
+ +

Quantum AND Gate?

+ +

Similarly, if there exists a gate that mimics the classical AND gate, it should have the following net effect:

+ +
    +
  • It keeps the 1st qubit unchanged
  • +
  • It outputs ""the 1st qubit AND the 2nd qubit"" as the result of the 2nd qubit
  • +
+ +

In table form, the function looks like:

+ +

$$ +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{cc}0 & 0\end{array} & \begin{array}{cc}0 & 0\end{array} \\ + \hline + \begin{array}{cc}0 & 1\end{array} & \begin{array}{cc}0 & \color{red}{0}\end{array} \\ + \hline + \begin{array}{cc}1 & 0\end{array} & \begin{array}{cc}1 & 0\end{array} \\ + \hline + \begin{array}{cc}1 & 1\end{array} & \begin{array}{cc}1 & 1\end{array} \\ + \hline +\end{array} +$$

+ +

Therefore, an input:

+ +

$$\alpha\left|00\right>+\beta\left|01\right>+\gamma\left|10\right>+\delta\left|11\right>$$

+ +

should be mapped to:

+ +

$$\alpha\left|00\right>+\beta\left|0\color{red}{0}\right>+\gamma\left|10\right>+\delta\left|11\right>$$

+ +

Or, in other words:

+ +

$$\color{red}{(\alpha+\beta)}\left|00\right>+\color{red}{0}\left|01\right>+\gamma\left|10\right>+\delta\left|11\right>$$

+ +

In matrix form, we need to find the all the $a_{ij}$'s that satisfy the following:

+ +

$$ + \begin{pmatrix} + a_{11} & a_{12} & a_{13} & a_{14} \\ + a_{21} & a_{22} & a_{23} & a_{24} \\ + a_{31} & a_{32} & a_{33} & a_{34} \\ + a_{41} & a_{42} & a_{43} & a_{44} \\ + \end{pmatrix} + \cdot + \begin{pmatrix} + \alpha \\ + \beta \\ + \gamma \\ + \delta \\ + \end{pmatrix} + = + \begin{pmatrix} + \color{red}{\alpha+\beta} \\ + \color{red}{0} \\ + \gamma \\ + \delta \\ + \end{pmatrix} +$$

+ +

It is trivial to find the solution:

+ +

$$ + \begin{pmatrix} + 1 & \color{red}{1} & 0 & 0 \\ + 0 & \color{red}{0} & 0 & 0 \\ + 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & 1 \\ + \end{pmatrix} + \cdot + \begin{pmatrix} + \alpha \\ + \beta \\ + \gamma \\ + \delta \\ + \end{pmatrix} + = + \begin{pmatrix} + \color{red}{\alpha+\beta} \\ + \color{red}{0} \\ + \gamma \\ + \delta \\ + \end{pmatrix} +$$

+ +
+ +

Quantum OR Gate?

+ +

Similarly, if there exists a gate that mimics the classical OR gate, it should have the following net effect:

+ +
    +
  • It keeps the 1st qubit unchanged
  • +
  • It outputs ""the 1st qubit OR the 2nd qubit"" as the result of the 2nd qubit
  • +
+ +

In table form, the function looks like:

+ +

$$ +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{cc}0 & 0\end{array} & \begin{array}{cc}0 & 0\end{array} \\ + \hline + \begin{array}{cc}0 & 1\end{array} & \begin{array}{cc}0 & 1\end{array} \\ + \hline + \begin{array}{cc}1 & 0\end{array} & \begin{array}{cc}1 & \color{red}{1}\end{array} \\ + \hline + \begin{array}{cc}1 & 1\end{array} & \begin{array}{cc}1 & 1\end{array} \\ + \hline +\end{array} +$$

+ +

Therefore, an input:

+ +

$$\alpha\left|00\right>+\beta\left|01\right>+\gamma\left|10\right>+\delta\left|11\right>$$

+ +

should be mapped to:

+ +

$$\alpha\left|00\right>+\beta\left|01\right>+\gamma\left|1\color{red}{1}\right>+\delta\left|11\right>$$

+ +

Or, in other words:

+ +

$$\alpha\left|00\right>+\beta\left|01\right>+\color{red}{0}\left|10\right>+\color{red}{(\gamma+\delta)}\left|11\right>$$

+ +

In matrix form, we need to find the all the $a_{ij}$'s that satisfy the following:

+ +

$$ + \begin{pmatrix} + a_{11} & a_{12} & a_{13} & a_{14} \\ + a_{21} & a_{22} & a_{23} & a_{24} \\ + a_{31} & a_{32} & a_{33} & a_{34} \\ + a_{41} & a_{42} & a_{43} & a_{44} \\ + \end{pmatrix} + \cdot + \begin{pmatrix} + \alpha \\ + \beta \\ + \gamma \\ + \delta \\ + \end{pmatrix} + = + \begin{pmatrix} + \alpha \\ + \beta \\ + \color{red}{0} \\ + \color{red}{\gamma+\delta} \\ + \end{pmatrix} +$$

+ +

It is trivial to find the solution:

+ +

$$ + \begin{pmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & \color{red}{0} & 0 \\ + 0 & 0 & \color{red}{1} & 1 \\ + \end{pmatrix} + \cdot + \begin{pmatrix} + \alpha \\ + \beta \\ + \gamma \\ + \delta \\ + \end{pmatrix} + = + \begin{pmatrix} + \alpha \\ + \beta \\ + \color{red}{0} \\ + \color{red}{\gamma+\delta} \\ + \end{pmatrix} +$$

+ +
+ +

However, since:

+ +

$$ + A + = + \begin{pmatrix} + 1 & \color{red}{1} & 0 & 0 \\ + 0 & \color{red}{0} & 0 & 0 \\ + 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & 1 \\ + \end{pmatrix} +$$

+ +

and

+ +

$$ + B + = + \begin{pmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & \color{red}{0} & 0 \\ + 0 & 0 & \color{red}{1} & 1 \\ + \end{pmatrix} +$$

+ +

are not unitary matrices, as shown by $\det(A) = \det(B) = 0 \ne 1$, they could not be implemented directly as a quantum logic gate.

+ +

I have read the answer here:

+ +

If quantum gates are reversible how can they possibly perform irreversible classical AND and OR operations?

+ +

but it is not intuitive enough for me:

+ +
    +
  • to understand what the final solution is; and
  • +
  • to visualize how it achieves the same result as the matrix $A$ and $B$ above.
  • +
+ +

Does anyone have any idea on how to implement ""Classical AND"" and ""Classical OR"" with an explanation in matrix form? Thanks!

+",6152,,26,,4/1/2019 18:17,4/3/2019 19:26,"Implementing ""Classical AND Gate"" and ""Classical OR Gate"" with a quantum circuit",,4,5,,,,CC BY-SA 4.0 +5830,2,,5815,4/1/2019 15:21,,10,,"

Apart from the formal result about #P-hardness, there's something worth touching on, about the nature of strong simulation itself. I'll comment first on strong simulation, and then specifically on the quantum case.

+ +

1. Strong simulation even of classical randomised computation is hard

+ +

Strong simulation is a very powerful concept — not only in the fact that it is a useful concept to consider, but in the more practical sense that it would allow you to do very powerful computations, even if you could do it in a purely classical setting.

+ +

At issue here is that a process with random outcomes — whether or not it is quantum — does not automatically come equipped with a way to compute the probabilities of its events; not even for the probabilities of the events which you actually see realised. The power of randomised computation, so to speak, is that you don't have to worry much about what the precise probability of an event is: it suffices to sample and attempt to realise that event sufficiently often to be confident of roughly what that probability is (or, for instance, just that the probability is non-zero).

+ +

Asking for actual probabilities is a very, well, strong requirement to ask of a simulation, in the following sense:

+ +
+

Proposition. Strongly simulating a polynomial-time randomized computation with zero error is #P-hard.

+
+ +
    +
  • Proof: For any non-deterministic Turing machine N, consider the question of how many branches it accepts on for an input $x \in \{0,1\}^m$. It is enough for us to consider the case where N makes a non-deterministic choice at every transition, and runs for time $m \in \mathrm{poly}(n)$ in every branch, so that the branches of the computation can be indexed by the strings $z \in \{0,1\}^m$. The computation performed by N can be represented similarly as a deterministic computation (a function $f$) depending on the input $x$ and a given branch string $z$. If we represent the status of 'accept' vs. 'reject' by a bit $a \in \{0,1\}$ which is computed as $a = f(x,z)$.

    + +

    Determining the number of branches $z \in \{0,1\}^m$, for which $f(x,z) = a$ for a given $x \in \{0,1\}^n$, is essentially the canonical #P-complete problem, using this connection to non-deterministic Turing machines.

    + +

    Consider a polynomial-time randomised computation. We can describe this computation as a deterministic classical computation, performed with the help of a uniformly random bit-string of length $m$. +Suppose that we are interested in whether a particular bit yields the outcome '1'. +For an input $x \in \{0,1\}^n$ and random bit-string $z \in \{0,1\}^m$, let $f(x,z) \in \{0,1\}$ be the value that this bit takes: then $f(x,z)$ can be computed in polynomial time. +The probability $P(a)$ that this computation gives the result $a \in \{0,1\}$ is then +$$ P(a) = \frac{\# \bigl\{ z \in \{0,1\}^m \;\big|\; f(x,z) = a \bigr\}}{2^m}\,. $$ +Because we could choose $f$ to be the function determining the acceptance condition of a non-deterministic Turing machine on input $x$ in branch $z$, then it is #P-complete to compute $P(a)$ exactly.

  • +
+ +
+

Proposition. Strongly simulating a polynomial-time randomized computation, with any relative error, is NP-hard.

+
+ +
    +
  • Proof. An important corner-case of the problem of approximating a probability with relative error, is the case where the exact probability is equal to zero. In this case, any process which gives the correct probability up to any multiplicative factor must correctly produce the exact probability, if that probability happens to be 0. Similarly, any process which approximates an event with positive probability up to a positive scalar factor, must yield a probability estimate which is greater than zero. That process can then be used to determine whether the number of accepting branches of a non-deterministic Turing machine is zero or non-zero.
  • +
+ +

From these two observations, you should take away the idea that strong simulation is a strong requirement — in many cases, unfairly strong — to make of a simulation method: it allows you to do much more powerful things than the computational model itself might be capable of.

+ +

2. Strong simulation of quantum computation is very hard

+ +

One difference between classical and quantum computation is on how difficult we think it is (in a complexity-theoretic sense) to strongly simulate them.

+ +

We know that it is NP-hard to strongly simulate a polynomial-time classical randomised process to relative error less than 1. Simulating a quantum process isn't going to be any easier. However, there is reason to believe that even with unreasonably powerful computational resources which would allow us to strongly simulate classical processes with bounded relative error, it will still be difficult to strongly simulate quantum processes.

+ +
+

Theorem (Stockmeyer [1]). For any counting problem in #P, and any constant $d \geqslant 0$ constant, the problem of computing the counting problem within to a $(1 + O(n^{-d}))$ factor is in $\mathbf{FP^{\:\!NP^{\:\!NP}}}$.

+
+ +

The difficulty in the q quantum case is that while classical probabilities correspond to counting the number of accepting branches of a non-deterministic Turing machine, quantum computation corresponds more closely to counting the difference between the number of accepting and rejecting branches of a non-deterministic Turing machine. That is, where a classical probability corresponds to a #P function, a quantum amplitude corresponds to a GapP function, which is the set of functions which may be expressed as a difference between two #P functions. The connection between quantum computation and GapP may be made formal, but on a high level, it is essentially because quantum computation can involve destructive interference between amplitudes associated with different events. More formally:

+ +
+

Proposition (Liberal paraphrase of Theorem 3.2 of [2]). For any $f \in \mathbf{GapP}$, there is a polynomial-time quantum algorithm $Q$, with an accepting configuration $c$, and a polynomial $p$ such that, for all $x \in \{0,1\}^n$, $\langle c | Q | x \rangle = -f(x) \cdot 2^{-p(n)/2}$.

+
+ +

Approximating GapP functions even to constant factors is difficult, because computing a GapP function to within even a constant factor determines whether it is positive or negative. If you can do this, you can immediately solve the PP-complete problem of determining whether or not the number of accepting paths is greater than the number of rejecting paths; and if you do it repeatedly, with a number of related quantum computations in which you artificially inflate the number of accepting or rejecting paths by doing your quantum computation conditionally, you can compute the exact GapP function essentially by binary search (the same way you can find a satisfying solution to a boolean formula, if one exists, given an oracle which simply tells you whether a solution exists).

+ +

References

+ +

In addition to the references mentioned above, Maarten Van den Nest's article [3] mentioned by Martin Schwarz is noteworthy for presenting the first definition of 'strong simulation' of quantum systems (to distinguish it from the more reasonable standard of weak simulation), and also for presenting a number of ideas of the links between classical and quantum computation in the context of simulation.

+ +
    +
  1. Stockmeyer. +
    +The complexity of approximate counting. +
    +Proceedings of STOC '83 (pp.&thinsp.118-126), 1983. +
    +[PDF available at acm.org]

  2. +
  3. Fenner, Green, Homer, and Pruim. +
    +Determining Acceptance Possibility for a Quantum Computation is Hard +for the Polynomial Hierarchy. +
    +Proceedings of the Royal Society London A vol. 455 (pp. 3953–3966), 1999. +
    +[arXiv:quant-ph/9812056]

  4. +
  5. Van den Nest. +
    +Classical simulation of quantum computation, the Gottesman-Knill theorem, and slightly beyond. +
    +Quantum Information and Computation, vol. 10 (pp. 258-271), 2010. +
    +[arXiv:0811.0898].

  6. +
+",124,,124,,4/1/2019 23:49,4/1/2019 23:49,,,,3,,,,CC BY-SA 4.0 +5831,1,,,4/1/2019 16:30,,3,127,"

I have several doubts about measuring Ising anyons. Measurement is crucial for quantum computation and even more so for magic state distillation which is necessary to make Ising anyons universal. +Several sources, e.g. https://arxiv.org/abs/1501.02813, say that there are basically two ways of measuring Ising anyons, one is a non-topological operation I address in this question, the other is some interferometry experiment which I might tackle in a different question.

+ +

The procedure for the measurement is the following: + Bring anyons close together so that their degenerate Hilbert space is not degenerate anymore and the energy levels split. I believe I understand this part to some extent so let me sketch what I think I know: +In a 4 quasi-particle (e.g. 4 Majorana zero modes) encoding, a qubit can be represented by +$$|0\rangle\equiv|(\sigma\times\sigma)_1\times(\sigma \times \sigma)_1\rangle=1 \\ +|1\rangle\equiv|(\sigma\times\sigma)_\psi\times(\sigma \times \sigma)_\psi\rangle=1$$ +The second state corresponds to two pairs of excited Majorana zero modes whereas the first one does not have these modes. +When the quasiparticles $\sigma$ are far apart, then dragging them around each other will cause unitary rotations in the subspace spanned by $|0\rangle $ and $|1\rangle$ which corresponds to the degenerate ground state space of a Hamiltonian that exhibits 4 quasiparticles (I am thinking of a Kitaev chain here). As Majorana zero modes are zero energy excitations when far apart, the space is degenerate. However, bringing close e.g. quasiparticle 1 and 2, suddenly, having the modes present in the system costs a finite amount of energy compared to vacuum, i.e. my logical state $|1\rangle$ sits at a higher energy than $|0\rangle$. Now, of course unitary time evolution by the Hamiltonian of the system will act like $U=e^{-iEt}$ and because of the energy difference $\Delta E$ between $|0\rangle $ and $|1\rangle$, this effectively corresponds to letting a phase gate act on the qubit until the quasi-particles $\sigma$ are pulled apart again. So far so good, only a few minor doubts.

+ +
    +
  1. When bringing the anonys together, it is claimed that upon measuring the energy of the system, we measure the state of the qubit. Does this mean an energy measurement will collapse the system even if in a superposition of $|0\rangle$ and $|1\rangle$ to either $|0\rangle$ or $|1\rangle$?
  2. +
  3. How can we experimentally measure the energy of the system and how do we know if it corresponds to $|0\rangle$ or $|1\rangle$?
  4. +
  5. When the reference says ""detect their charge parity"", what does it mean? (My encoding of $|0\rangle$ and $|1\rangle$ is such that both belong to the same fermion parity subspace as this quantity is conserved)
  6. +
+ +

A major doubt however is the following:

+ +

Is this related to fusion at all? I read so often that fusion is bringing anyons together and then regarding them as a composite and I even think I came across the term fusion measurement. Until now, I thought fusion is really just viewing two anyons as one composite one but nothing physical.

+",5322,,26,,4/1/2019 18:38,4/1/2019 18:38,Measuring Ising anyons: What is a fusion measurement?,,0,0,,,,CC BY-SA 4.0 +5832,2,,5829,4/1/2019 18:37,,3,,"

Simulating ""Classical AND Gate"" using ""Toffoli Gate"" (also known as ""Controlled-Controlled-NOT Gate"", or ""CCNOT Gate"")

+ +

With the help of Blue's comment, and the Wikipedia pages here and here, a solution to simulating classical AND gate was found.

+ +

The CCNOT gate is a 3-qubit gate having the following properties:

+ +
    +
  • If both the 1st and 2nd inputs are $\left|1\right>$, then it flips the 3rd input while keeping the 1st and 2nd inputs unchanged;
  • +
  • Otherwise, it keeps all inputs unchanged.
  • +
+ +

The net effect of this gate is:

+ +
    +
  • It keeps the 1st qubit unchanged;
  • +
  • It keeps the 2nd qubit unchanged;
  • +
  • It outputs ""the 3rd qubit XOR (the 1st qubit AND the 2nd qubit)"" as the result of the 3rd qubit.
  • +
+ +

In table form, the function looks like:

+ +

$$ +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{ccc}0 & 0 & 0\end{array} & \begin{array}{ccc}0 & 0 & 0\end{array} \\ + \hline + \begin{array}{ccc}0 & 0 & 1\end{array} & \begin{array}{ccc}0 & 0 & 1\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 0\end{array} & \begin{array}{ccc}0 & 1 & 0\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 1\end{array} & \begin{array}{ccc}0 & 1 & 1\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 0\end{array} & \begin{array}{ccc}1 & 0 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 1\end{array} & \begin{array}{ccc}1 & 0 & 1\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 0\end{array} & \begin{array}{ccc}1 & 1 & \color{red}{1}\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 1\end{array} & \begin{array}{ccc}1 & 1 & \color{red}{0}\end{array} \\ + \hline +\end{array} +$$

+ +

In matrix form, it looks like:

+ +

$$ + \begin{pmatrix} + 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & \color{red}{0} & \color{red}{1} \\ + 0 & 0 & 0 & 0 & 0 & 0 & \color{red}{1} & \color{red}{0} \\ + \end{pmatrix} +$$

+ +

If we want to calculate $\left|x\right>$ AND $\left|y\right>$, we can:

+ +
    +
  • Prepare the 1st input to be $\left|x\right>$;
  • +
  • Prepare the 2nd input to be $\left|y\right>$;
  • +
  • Prepare the 3rd input to be $\left|0\right>$.
  • +
+ +

Since we prepare the 3rd input to be $\left|0\right>$ on purpose, we can just ignore the cases where the 3rd input is $\left|1\right>$. By removing all the rows containing a $1$ in the 3rd input (i.e. the 2nd, 4th, 6th, 8th row) from the table above, it becomes:

+ +

$$ +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{ccc}0 & 0 & 0\end{array} & \begin{array}{ccc}0 & 0 & 0\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 0\end{array} & \begin{array}{ccc}0 & 1 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 0\end{array} & \begin{array}{ccc}1 & 0 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 0\end{array} & \begin{array}{ccc}1 & 1 & \color{red}{1}\end{array} \\ + \hline +\end{array} +$$

+ +

The net effect of the gate in this setting is:

+ +
    +
  • It keeps the 1st qubit unchanged;
  • +
  • It keeps the 2nd qubit unchanged;
  • +
  • It outputs ""the 3rd qubit XOR (the 1st qubit AND the 2nd qubit)"" as the result of the 3rd qubit, since ""0 XOR x = x"" for any ""x"".
  • +
+ +

If we just look at the 1st input, the 2nd input, and the 3rd output, the table is exactly the same as the classical AND gate:

+ +

$$ +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{cc}0 & 0\end{array} & 0 \\ + \hline + \begin{array}{cc}0 & 1\end{array} & 0 \\ + \hline + \begin{array}{cc}1 & 0\end{array} & 0 \\ + \hline + \begin{array}{cc}1 & 1\end{array} & \color{red}{1} \\ + \hline +\end{array} +$$

+",6152,,6152,,4/1/2019 18:56,4/1/2019 18:56,,,,1,,,,CC BY-SA 4.0 +5833,1,,,4/1/2019 18:40,,4,396,"

I'm trying to evolve quantum circuits using genetic algorithms as they did in this paper Decomposition of unitary matrices for finding quantum circuits: Application to molecular Hamiltonians (Daskin & Kais).

+ +

So given a unitary target matrix ($U_t$), the task is to evolve a circuit that approximates $U_t$ (let's call it $U_a$). This is the function I'm maximizing:

+ +

$$F = \frac{1}{2^n}|\operatorname{Tr}(U_aU_t^{\dagger})|$$ (where n is the number of qubits)

+ +

My circuit encoding is a little bit different, I'm using a json string representation, here's an example of a random circuit:

+ +
[{0: ('Y', -1, None), 1: ('Td', -1, None), 2: ('Y', -1, None)}, 
+{0: ('Z', 2, None), 1: ('Y', -1, None)}, 
+{0: ('Vd', 1, None), 2: ('V', -1, None)}, 
+{1: ('X', -1, None), 2: ('Y', 0, None)}, 
+{0: ('Td', -1, None), 2: ('V', 1, None)}, 
+{1: ('S', -1, None), 2: ('X', 0, None)}]
+
+ +

Every dictionary item in the array is a column in the format {target: (gate, control, param)}. The value -1 means no control, and None means there are no parameters. Here's a visual representation of this circuit:

+ +
+--------+-------+-------+-------+-------+-------+-------+
+| qubit  | col_0 | col_1 | col_2 | col_3 | col_4 | col_5 |
++--------+-------+-------+-------+-------+-------+-------+
+| q0-->  |   Y   |  Z•2  |  Vd•1 |   I   |   Td  |   I   |
+| q1-->  |   Td  |   Y   |   I   |   X   |   I   |   S   |
+| q2-->  |   Y   |   I   |   V   |  Y•0  |  V•1  |  X•0  |
++--------+-------+-------+-------+-------+-------+-------+
+
+ +

So far, I've been successful at finding very small circuits (with 2 ""columns""). The problem comes when trying to evolve solutions for more complex circuits. For example, the paper shows this solution for the Toffoli unitary:

+ +

+ +

My algorithm is not able to find this solution or any other exact solution to this problem. I tried changing the selection method, crossover and mutation rates, but the fitness value never exceeds 0.85. After some generations, it seems that all individuals are converging to the same non-optimal circuit (this happens even with uniform crossover and random selection).

+ +

For crossover, I've tried one-point crossover and uniform crossover. The mutation operation can do these things:

+ +
    +
  1. If it's a controlled gate, it can change the type of the target gate, can change the position of the control, can swap target/control, can remove the control, or can shuffle a column.
  2. +
  3. If it's not a controlled gate, it can change the type of gate or introduce a control.
  4. +
+ +

I don't see what else can I do to improve these operators. In the paper, they also have a continuous angle phase parameter, but this particular circuit solution does not use it anyway.

+ +

Another curious fact: for this particular problem, the empty circuit has a fitness of 0.75. If a take the exact solution (from the image) and change a single gate, I can get a fitness of 0.5. So, an empty circuit has better fitness than a circuit which is a small step from the exact solution. This is very confusing, I don't see where the GA will find ""optimal sub-circuits"" to exchange during crossover.

+ +

It should be noted that the paper uses a more sophisticated version of a GA, but for the reasons stated above, I don't think it will make a difference in my case. +So what I'm missing or how can I improve this? Thank you!

+ +

Edit

+ +

It seems the GLOA did it's work. The algorithm found this for the Toffoli unitary:

+ +
+--------+-------+-------+-------+-------+-------+
+| qubit  | col_0 | col_1 | col_2 | col_3 | col_4 |
++--------+-------+-------+-------+-------+-------+
+| q0-->  |   I   |   I   |   I   |   I   |   I   |
+| q1-->  |  Z•2  |   I   |   I   |   I   |  S•0  |
+| q2-->  |   I   |  Vd•0 |  Z•1  |  V•0  |   I   |
++--------+-------+-------+-------+-------+-------+
+
+ +

But I limited the kind of gates it could use, now I'll try with all the gates.

+",6083,,6083,,4/2/2019 21:13,4/2/2019 21:13,Genetic algorithm does not converge to exact solution,,0,8,,,,CC BY-SA 4.0 +5834,2,,5829,4/1/2019 20:01,,1,,"

Simulating ""Classical OR Gate""

+ +

Please read my answer for simulating ""Classical AND Gate"" in this post first.

+ +

In this answer, I am going to use another approach to reach the solution. Let's begin with the table for classical OR gate:

+ +

$$ +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{cc}0 & 0\end{array} & 0 \\ + \hline + \begin{array}{cc}0 & 1\end{array} & 1 \\ + \hline + \begin{array}{cc}1 & 0\end{array} & 1 \\ + \hline + \begin{array}{cc}1 & 1\end{array} & 1 \\ + \hline +\end{array} +$$

+ +

As discussed in the comment section of the question, it is impossible for any 2-qubit quantum gate to simulate a classical OR gate - an ancilla bit is needed to do so.

+ +

Let's see the table for the 3-qubit identity gate:

+ +

$$ +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{ccc}0 & 0 & 0\end{array} & \begin{array}{ccc}0 & 0 & 0\end{array} \\ + \hline + \begin{array}{ccc}0 & 0 & 1\end{array} & \begin{array}{ccc}0 & 0 & 1\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 0\end{array} & \begin{array}{ccc}0 & 1 & 0\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 1\end{array} & \begin{array}{ccc}0 & 1 & 1\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 0\end{array} & \begin{array}{ccc}1 & 0 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 1\end{array} & \begin{array}{ccc}1 & 0 & 1\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 0\end{array} & \begin{array}{ccc}1 & 1 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 1\end{array} & \begin{array}{ccc}1 & 1 & 1\end{array} \\ + \hline +\end{array} +$$

+ +

Let's assume the solution to be similar to that of classical AND gate - if we want to calculate $\left|x\right>$ OR $\left|y\right>$, we can:

+ +
    +
  • Prepare the 1st input to be $\left|x\right>$;
  • +
  • Prepare the 2nd input to be $\left|y\right>$;
  • +
  • $\color{red}{\text{Prepare the 3rd input to be some value}}$.
  • +
+ +

Let's separate the table above by rows having $\left|0\right>$ as the 3rd input, and rows having $\left|1\right>$ as the 3rd input:

+ +

$$ +\begin{array}{cc} +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{ccc}0 & 0 & 0\end{array} & \begin{array}{ccc}0 & 0 & 0\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 0\end{array} & \begin{array}{ccc}0 & 1 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 0\end{array} & \begin{array}{ccc}1 & 0 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 0\end{array} & \begin{array}{ccc}1 & 1 & 0\end{array} \\ + \hline +\end{array} +& +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{ccc}0 & 0 & 1\end{array} & \begin{array}{ccc}0 & 0 & 1\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 1\end{array} & \begin{array}{ccc}0 & 1 & 1\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 1\end{array} & \begin{array}{ccc}1 & 0 & 1\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 1\end{array} & \begin{array}{ccc}1 & 1 & 1\end{array} \\ + \hline +\end{array} \\ +\end{array} +$$

+ +

It is trivial to see that the table on the right looks more similar to the classical OR gate, and thus is a better starting point. Therefore, we choose to $\color{red}{\text{prepare the 3rd input to be} \left|1\right>}$.

+ +

Since it is not possible to modify just one entry in the table to make a valid quantum gate - the resulting matrix will not be a unitary matrix, we need to pair it up and swap the values with another entry:

+ +

$$ +\begin{array}{cc} +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{ccc}0 & 0 & 0\end{array} & \begin{array}{ccc}0 & 0 & \color{red}{1}\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 0\end{array} & \begin{array}{ccc}0 & 1 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 0\end{array} & \begin{array}{ccc}1 & 0 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 0\end{array} & \begin{array}{ccc}1 & 1 & 0\end{array} \\ + \hline +\end{array} +& +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{ccc}0 & 0 & 1\end{array} & \begin{array}{ccc}0 & 0 & \color{red}{0}\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 1\end{array} & \begin{array}{ccc}0 & 1 & 1\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 1\end{array} & \begin{array}{ccc}1 & 0 & 1\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 1\end{array} & \begin{array}{ccc}1 & 1 & 1\end{array} \\ + \hline +\end{array} \\ +\end{array} +$$

+ +

Merging them back into one table, we get:

+ +

$$ +\begin{array}{|c|c|} + \hline + \text{Input} & \text{Output} \\ + \hline + \begin{array}{ccc}0 & 0 & 0\end{array} & \begin{array}{ccc}0 & 0 & \color{red}{1}\end{array} \\ + \hline + \begin{array}{ccc}0 & 0 & 1\end{array} & \begin{array}{ccc}0 & 0 & \color{red}{0}\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 0\end{array} & \begin{array}{ccc}0 & 1 & 0\end{array} \\ + \hline + \begin{array}{ccc}0 & 1 & 1\end{array} & \begin{array}{ccc}0 & 1 & 1\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 0\end{array} & \begin{array}{ccc}1 & 0 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 0 & 1\end{array} & \begin{array}{ccc}1 & 0 & 1\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 0\end{array} & \begin{array}{ccc}1 & 1 & 0\end{array} \\ + \hline + \begin{array}{ccc}1 & 1 & 1\end{array} & \begin{array}{ccc}1 & 1 & 1\end{array} \\ + \hline +\end{array} +$$

+ +

Then it is trivial to see the matrix is:

+ +

$$ + \begin{pmatrix} + \color{red}{0} & \color{red}{1} & 0 & 0 & 0 & 0 & 0 & 0 \\ + \color{red}{1} & \color{red}{0} & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ + \end{pmatrix} +$$

+ +

It is easy to show that the matrix above is unitary.

+ +

P.S.: I don't know if there is a name for this quantum gate, or how it could be written in terms of other named gates.

+",6152,,6152,,4/1/2019 21:04,4/1/2019 21:04,,,,0,,,,CC BY-SA 4.0 +5836,1,5889,,4/2/2019 9:00,,7,329,"

The classical channel capacity ($C_{ea}$) and the quantum channel capacity ($Q$) as defined here (eqs. 1 and 2) are given by +\begin{equation} +C_{ea} = \text{sup}_{\rho} \Big[S(\rho) + S(\Phi_t \rho) - S(\rho,t)\Big], +\end{equation} +and +\begin{equation} +Q(\Phi_t) = \text{sup}_{\rho} \Big[ S(\Phi_t \rho) - S(\rho,t)\Big]. +\end{equation} +Here, $S(\cdot)$ is the von-Neumann entropy. Also, $\Phi_t \rho$ is the state evolved under the action of the map $\Phi$, and $S(\rho,t)$ is the entropy at the output of the complementary channel. The two definitions look exactly the same apart from $S(\rho)$ in the first case. How does the former correspond to classical and the late to quantum case? Further, for a pure state $\rho$, $S(\rho) = 0$, so the two definitions seem to coincide. Everything right here?

+",5806,,10480,,4/5/2021 17:44,4/5/2021 17:44,Understanding classical vs. quantum channel capacities,,1,0,,,,CC BY-SA 4.0 +5837,1,5888,,4/2/2019 10:50,,4,201,"

In the Bertlmann 2009 paper in the Annals of Physics (here), an optimal witness operator for an entangled state $\rho$, given that the closest separable state to it is $\rho_0$ is given by:

+ +

$$A_{\text{opt}} = \frac{\rho_0 - \rho - \langle \rho_0, \rho_0 - \rho \rangle I}{|| \rho_0 - \rho ||} $$

+ +
    +
  1. How was this expression arrived at?
  2. +
  3. Is this true only for the separable set, or any convex set?
  4. +
+",2832,,55,,3/9/2021 22:05,3/9/2021 22:05,How is the expression for the optimal entanglement witness derived?,,1,0,,,,CC BY-SA 4.0 +5838,2,,5829,4/2/2019 18:19,,13,,"

Your construction by gueswork in this answer is OK but not really elegant. Moreover, it's a convention to start in the state $|0\rangle$; we usually don't initialize a qubit with the state $|1\rangle$. It's better to follow the general construction which I illustrate here.

+ +
+ +

The idea here is to use ancillary qubits and impose unitary evolution on the larger system instead i.e. by treating the two-qubit system as a subsystem. There's a general method for constructing such gates. Essentially, you are trying to construct a quantum gate that'll perform a Boolean mapping like $f: \{0, 1\}^n \longrightarrow \{0, 1\}$. You've noted that for $n=2$ (two qubits), you cannot constructing unitary gates corresponding to some classical operations like the AND and OR as there's a rank deficiency (this happens precisely because those classical operations are irreversible). So we'll try with $n=3$ instead. Let's take the example of the quantum OR gate, which would perform the mapping $$|a \ b \ c\rangle \mapsto |a \ b \ c\oplus(a+b)\rangle$$ where $a,b,c \in \{0,1\}$. By the way, $\oplus$ here stands for XOR and $+$ stands for OR. You do know that $0 \oplus x = x$ for any $x \in \{0,1\}$? Otherwise, check the XOR table. Thus, if we set the additional qubit to $|0\rangle$ initially, it boils down to $$|a \ b \ 0\rangle \mapsto |a \ b \ a+b\rangle.$$

+ +

Let's construct the table now.

+ +

$$\begin{array}{|c c c|c c c|} +\hline +a & b & c & a & b & c\oplus (a+b) \\ \hline +0 & 0 & \color{red}{0} & 0 & 0 & \color{red}{0} \\ \hline +0 & 0 & 1 & 0 & 0 & 1 \\ \hline +0 & 1 & \color{red}{0} & 0 & 1 & \color{red}{1} \\ \hline +0 & 1 & 1 & 0 & 1 & 0 \\ \hline +1 & 0 & \color{red}{0} & 1 & 0 & \color{red}{1} \\ \hline +1 & 0 & 1 & 1 & 0 & 0 \\ \hline +1 & 1 & \color{red}{0} & 1 & 1 & \color{red}{1} \\ \hline +1 & 1 & 1 & 1 & 1 & 0 \\ \hline +\end{array}$$

+ +

We're only only concerned with the cases where $c=0$ i.e. the ones marked in red. Half done now! If we translate this to mapping of the computational basis vectors of the three-qubit system, we get

+ +

$$|000\rangle \mapsto |000\rangle \equiv [1 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0]^T \mapsto \color{blue}{[1 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0]^T}$$ +$$|001\rangle \mapsto |001\rangle \equiv [0 \ 1 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0]^T \mapsto \color{brown}{[0 \ 1 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0]^T}$$ +$$|010\rangle \mapsto |011\rangle \equiv [0 \ 0 \ 1 \ 0 \ 0 \ 0 \ 0 \ 0]^T \mapsto \color{teal}{[0 \ 0 \ 0 \ 1 \ 0 \ 0 \ 0 \ 0]^T}$$ +$$|011\rangle \mapsto |010\rangle \equiv [0 \ 0 \ 0 \ 1 \ 0 \ 0 \ 0 \ 0]^T \mapsto \color{violet}{[0 \ 0 \ 1 \ 0 \ 0 \ 0 \ 0 \ 0]^T}$$ +$$|100\rangle \mapsto |101\rangle \equiv [0 \ 0 \ 0 \ 0 \ 1 \ 0 \ 0 \ 0]^T \mapsto \color{green}{[0 \ 0 \ 0 \ 0 \ 0 \ 1 \ 0 \ 0]^T}$$ +$$|101\rangle \mapsto |100\rangle \equiv [0 \ 0 \ 0 \ 0 \ 0 \ 1 \ 0 \ 0]^T \mapsto \color{magenta}{[0 \ 0 \ 0 \ 0 \ 1 \ 0 \ 0 \ 0]^T}$$ +$$|110\rangle \mapsto |111\rangle \equiv [0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 1 \ 0]^T \mapsto \color{orange}{[0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 1]^T}$$ +$$|111\rangle \mapsto |110\rangle \equiv [0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 1]^T \mapsto \color{purple}{[0 \ 0 \ 0 \ 0 \ 0 \ 0 \ 1 \ 0]^T}$$

+ +

The columns vectors highlighted in blue will the columns of the required matrix cf. change of basis transformation matrix. The matrix is certainly unitary as basis vectors are simply getting mapped to basis vectors, and the mapping is bijective.

+ +

$$\color{red}{\text{quantum OR}} = \begin{pmatrix} +{\color{blue} 1} & {\color{brown} 0} & {\color{teal} 0} & {\color{violet} 0} & {\color{green} 0} & {\color{magenta} 0} & {\color{orange} 0} & {\color{purple} 0} \\ +{\color{blue} 0} & {\color{brown} 1} & {\color{teal} 0} & {\color{violet} 0} & {\color{green} 0} & {\color{magenta} 0} & {\color{orange} 0} & {\color{purple} 0} \\ +{\color{blue} 0} & {\color{brown} 0} & {\color{teal} 0} & {\color{violet} 1} & {\color{green} 0} & {\color{magenta} 0} & {\color{orange} 0} & {\color{purple} 0} \\ +{\color{blue} 0} & {\color{brown} 0} & {\color{teal} 1} & {\color{violet} 0} & {\color{green} 0} & {\color{magenta} 0} & {\color{orange} 0} & {\color{purple} 0} \\ +{\color{blue} 0} & {\color{brown} 0} & {\color{teal} 0} & {\color{violet} 0} & {\color{green} 0} & {\color{magenta} 1} & {\color{orange} 0} & {\color{purple} 0} \\ +{\color{blue} 0} & {\color{brown} 0} & {\color{teal} 0} & {\color{violet} 0} & {\color{green} 1} & {\color{magenta} 0} & {\color{orange} 0} & {\color{purple} 0} \\ +{\color{blue} 0} & {\color{brown} 0} & {\color{teal} 0} & {\color{violet} 0} & {\color{green} 0} & {\color{magenta} 0} & {\color{orange} 0} & {\color{purple} 1} \\ +{\color{blue} 0} & {\color{brown} 0} & {\color{teal} 0} & {\color{violet} 0} & {\color{green} 0} & {\color{magenta} 0} & {\color{orange} 1} & {\color{purple} 0} \\ +\end{pmatrix} +$$

+ +

Calculate the determinant and convince yourself that it's unitary.

+ +

Exercise:

+ +
    +
  1. Use the method demonstrated here to construct the quantum gates corresponding to the classical NAND, NOR and XNOR gates.

  2. +
  3. Prove that the mapping defined by $(a,b,c)\mapsto (a, b, c\oplus f(a,b))$ is one-one and onto, where $f$ is any arbitrary Boolean function of $a$ and $b$.

  4. +
+",26,,26,,4/2/2019 18:41,4/2/2019 18:41,,,,1,,,,CC BY-SA 4.0 +5839,1,,,4/2/2019 20:48,,5,397,"

Could you give me an example of a measurement which is separable but not LOCC (Local Operations Classical Communication)? +Given an ensable of states $\rho^{N}$, a separable measurement on it is a POVM $\lbrace N_i \rbrace$ where the effects $N_i$ are all of the form $N_i = A_i^{1} \otimes A_i^{2} \otimes \dots \otimes A_i^{N}$. So they are a separable product of effects acting on each state $\rho$ in $\rho^{N}$.

+ +

Note: Cross-posted on Physics SE.

+",2490,,55,,6/29/2021 22:48,6/29/2021 22:48,What is an example of a measurement that is LOCC but not separable?,,1,3,,,,CC BY-SA 4.0 +5840,1,,,4/3/2019 0:20,,4,222,"

The transmon achieves its reduced sensitivity to charge noise by significantly increasing the ratio of the Josephson energy to the charging energy. What is this charging energy?

+",5719,,,,,4/3/2019 0:20,What is the charging energy in relation to a superconducting transmon?,,0,0,,,,CC BY-SA 4.0 +5841,2,,5823,4/3/2019 2:43,,3,,"

As an initial matter, let's ask ""what is the classical computational complexity of solving 'mate-in-$n$' type games?"" For example, is it even in $\mathcal{NP}$ to know, given a certain chess position, that white can mate in $10$ or fewer moves?

+ +

It's been known for a while that we can consider such questions as a ""quantified boolean formula"" (QBF) question. Let's rephrase our question as:

+ +

$$\exists w_1\forall b_1\exists w_2\forall b_2\cdots\exists w_n:\phi(w_1,b_1,w_2,b_2,\cdots,w_n)?$$

+ +

This ""mate-in-$n$"" statement can be read as ""given a state of the board $\phi$ encoding the rules of chess, does there exist a move by white such that for moves by black, there is a countermove by white such that... the moves applied to the board $\phi$ will lead to a mate by white?""

+ +

This ""mate-in-$n$"" is precisely a way to think about the polynomial hierarchy $\mathcal{PH}$. The mate-in-$10$ is at the $10^{th}$ level of the hierarchy (or maybe it's the $20^{th}$) because there are $20$ iterations of for-alls and there-exists. $\phi$ is easy to evaluate (polynomial evaluation of whether there's a mate or not). The number of qubits would be polynomial in $n$ I think (high thousands?).

+ +

Letting $n$ vary polynomialy distinguishes $\mathcal{PH}$ from $\mathcal{PSPACE}$. Magically, although we know that $\mathcal{BQP}\subseteq\mathcal{PSPACE}$, it's likely that $\mathcal{BQP}$ and $\mathcal{PH}$ are incomparable. I think the implication is that certain well-framed QBF-style questions can be answered faster than classical algorithms.

+ +

For chess proper, most games can be completed in about $50$ moves or less. So we can say ""is there a mate-in-$50$ for white, given the starting position?""

+ +

Chess has a lot of asymmetry that may make it difficult to frame in the right way. Weichi (Go) may be a better candidate for pondering. I suspect a toy game, based on forrelation, can be built where a quantum computer can outperform a classical computer.

+ +

EDIT

+ +

To think about how to utilize such an algorithm, let's take the QBF a little bit more. The output of the QBF is either a ""YES"" (a forced mate is possible) or ""NO"" (a forced mate is not possible).

+ +

Say we are white, and we have a quantum QBF-solver that can be fed a given board position with black to move, and will spit out whether there's a winning strategy for black (i.e. YES or NO). It is our turn to move.

+ +

We can cycle through all of the available moves for white by making a putative move, and ask our quantum QBF-solver whether black has a winning response. If we find a move where black doesn't have a winning response we can take that line.

+ +

In the comments, you suggest that chess isn't likely played out in $50$ moves starting from the initial board, and that $6000$ moves is more likely.

+ +

Nonetheless even accepting $6000$ is the better estimate, I maintain that the number of qubits is polynomial in the depth of the tree you are willing to review, otherwise you haven't got a practical algorithm.

+",2927,,2927,,4/3/2019 12:19,4/3/2019 12:19,,,,3,,,,CC BY-SA 4.0 +5842,1,,,4/3/2019 9:40,,5,86,"

I am going to implement ""turn circuit encoding"" method of +Coarse-grained lattice protein folding on a quantum annealer(Babej, Ing & Fingerhuth; 2018) using PyQUBO to run on the DWave qbsolv environment.

+ +

In this method I have to implement equation 36 given below. +$$s^r_{\pm k}(i,j) = r^{\text{th}} \text{ digit of } \sum ^{j−1}_{p=i}d^p_{\pm k}$$

+ +

Where $d^p_{\pm k} \implies $

+ +

$$d^j_{+x} = (1−q_2+\varphi)q_1 + \varphi q_3+\varphi, $$

+ +

$$d^j_{−x} = (1−q_3+\varphi)q_1 + \varphi q_2+ \varphi, $$

+ +

$$d^j_{+y} = (1−q_1+\varphi)(1−q_2+\varphi)q_3+\varphi, $$

+ +

$$d^j_{−y} = (1−q_1+\varphi)(1−q_3+\varphi)q2+\varphi, $$

+ +

$$d^j_{+z} = q_1+\varphi q_2+\varphi q_3+\varphi, $$

+ +

$$d^j_{−z} = (1−q_2+\varphi)(1−q_3+\varphi)q_1+\varphi $$

+ +

and $$\varphi = 3(j − 2).$$

+ +

When we calculate $$\sum ^{j−1}_{p=i}d^p_{\pm k},$$ we get a list of qubits and want to find the $r^\text{th}$ digit using PyQUBO. Is it possible to calculate $r^\text{th}$ digit using PyQUBO and how should I do it?

+",5968,,2293,,12/16/2021 20:51,12/16/2021 20:51,How to calculate the $r^{\text{th}}$ digit of $\sum ^{j−1}_{p=i}d^p_{\pm k}$ using PyQUBO?,,0,1,,,,CC BY-SA 4.0 +5844,2,,2110,4/3/2019 11:38,,4,,"

The question is ultimately: ""What's the point to execute the algorithm if we have already searched for the element in order to build the oracle?""

+ +

Whilst somebody prebuilt the oracle, it may not have been the person using the oracle.

+ +

Grover's algorithm requires the oracle be queried no more times than $\sqrt{\text{size of list}}$. Naturally we cannot hope respective database lookups, as proposed earlier against which I cannot comment for lack of reputation, on say 5 million keys will return the content we want if our content is not addressed by any of those 5 million keys, but by saying the 9 millionth key, which happens not to be in our sample. How does Grover's algorithm do it then?

+ +

We ask the oracle: what is the answer it already has for the question it already has? Even Mateus and Omar would ask the ""oracle-for-a-particular-alphabet-symbol"" during runtime, what are the position(s) of its symbol in the string that it has already compiled? The oracle will give the answer to our query after only one consultation, but in this story, it cannot for example simply write out the answer as a binary string and send it to us over a classical communication channel. It will hide its answer in a superposition for us to draw it out.

+ +

I let fancy or metaphor run away in this next bit: we don't quite hear the answer the first time, and we have to ask the oracle to repeat the same answer over and over again until we are sure what the oracle has said, except we start to hallucinate from misinformation in the diffusion process if we ask too many times.

+",6086,,26,,4/3/2019 12:17,4/3/2019 12:17,,,,0,,,,CC BY-SA 4.0 +5847,1,,,4/3/2019 14:36,,8,373,"

This question is inspired by thinking about quantum computing power with respect to games, such as chess/checkers/other toy games. Games fit naturally into the polynomial hierarchy $\mathrm{PH}$; I'm curious about follow-up questions.

+ +

Every Venn diagram or Hasse diagram I see illustrating the ""standard model"" of computational complexity describes a universe of $\mathrm{PSPACE}$ problems, and puts $\mathrm{BQP}$ into a position containing all of $\mathrm{P}$, and not containing all of $\mathrm{NP}$, but cutting through to outside of the polynomial hierarchy $\mathrm{PH}$. That is, such Venn diagrams posit that there are likely problems efficiently solvable with a quantum computer that are outside of $\mathrm{PH}$.

+ +

But how does this ""cut through?""

+ +

That is, does this imply that there must be a $\mathrm{BQP}$ problem in the first level of the hierarchy, one in the second level of the hierarchy, one in the third level $\cdots$, and one such as ""forrelation"" (correlation of Fourier series) completely outside of the hierarchy?

+ +

Or could it be that there are some $\mathrm{BQP}$ problems in the first level of the hierarchy, some outside of the hierarchy, and an infinite number of levels of the hierarchy that are voided of any $\mathrm{BQP}$ problems?

+ +

+ +

See, e.g., the above picture from the Quanta Magazine article ""Finally, a Problem that Only Quantum Computers Will Ever Be Able to Solve"" link. Could $\mathrm{BQP}$ be disconnected between $\mathrm{NP}$ and the island outside of $\mathrm{PH}$? Or must there be a bridge over $\mathrm{PH}$ connecting the two?

+",2927,,2927,,12/5/2019 19:28,12/5/2019 19:28,Is there a BQP algorithm for each level of the polynomial hierarchy PH?,,0,0,,,,CC BY-SA 4.0 +5848,1,5856,,4/3/2019 17:04,,1,264,"

                      

+ +

I have a certain transformations that goes as follows: +Given $A=|abc\rangle$, $B=|xyz\rangle$, now I have cases as:

+ +

$$\text{if }c=1,z=1, b\oplus y=1 \implies \text{flip}(x)$$ +$$\text{if }c=1, z=1 \implies \text{flip}(y)$$ +$$\text{if }c=1\implies \text{flip}(z)$$ +$$\text{if }b=1\implies \text{flip}(y)$$ +$$\text{if }a=1\implies \text{flip}(x)$$

+ +

Can somebody just tell me the circuit for the bit-wise XOR that I have used between $b$ and $y$, i.e $b\oplus y=1$? The other gates I know are CNOT and Toffoli.

+",6070,,26,,5/9/2019 10:01,5/9/2019 10:01,How to construct a quantum circuit for the following state transformation?,,1,11,,,,CC BY-SA 4.0 +5849,2,,5829,4/3/2019 19:14,,8,,"

Simulating Classical ""AND/NAND/OR/NOR/XOR/XNOR"" Gates

+ +

With the help of this answer from Blue, constructing a matrix for a classical gate is just a matter of following the steps.

+ +

Here is the combined truth table for classical logic gates:

+ +

$$ +\begin{array}{|c|c|c|c|c|c|c|} + \hline + \text{Input} & \text{AND} & \text{NAND} & \text{OR} & \text{NOR} & \text{XOR} & \text{XNOR} \\ + \hline + \begin{array}{cc}0 & 0\end{array} & 0 & 1 & 0 & 1 & 0 & 1 \\ + \hline + \begin{array}{cc}0 & 1\end{array} & 0 & 1 & 1 & 0 & 1 & 0 \\ + \hline + \begin{array}{cc}1 & 0\end{array} & 0 & 1 & 1 & 0 & 1 & 0 \\ + \hline + \begin{array}{cc}1 & 1\end{array} & 1 & 0 & 1 & 0 & 0 & 1 \\ + \hline +\end{array} +$$

+ +

It could be seen that since the output of AND, NAND, OR, and XOR do not have equal number of 0's and 1's, they need an ancilla bit. For XOR and XNOR, no ancilla bit is needed.

+ +

Below is a table for the mappings and matrices.

+ +

The light color mappings represent mappings that are ""not used"", since the ancilla bit is always prepared to be $\left|0\right>$ by convention.

+ +

A color tone groups a pair of mapping swap, which is necessary to achieve reversibility and keep the matrix a unitary matrix.

+ +

$$ +\begin{array}{|c|c|} + \hline + \text{Gate} & \text{Mapping} & \text{Matrix} \\ + \hline + \text{AND} & + \begin{array}{} + \left|000\right> \mapsto \left|000\right> \\ + \color{#999}{\left|001\right> \mapsto \left|001\right>} \\ + \left|010\right> \mapsto \left|010\right> \\ + \color{#999}{\left|011\right> \mapsto \left|011\right>} \\ + \left|100\right> \mapsto \left|100\right> \\ + \color{#999}{\left|101\right> \mapsto \left|101\right>} \\ + \left|110\right> \mapsto \color{#f00}{\left|111\right>} \\ + \color{#999}{\left|111\right> \mapsto \color{#f99}{\left|110\right>}} \\ + \end{array} & + \begin{pmatrix} + 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & \color{#f00}{0} & \color{#f00}{1} \\ + 0 & 0 & 0 & 0 & 0 & 0 & \color{#f00}{1} & \color{#f00}{0} \\ + \end{pmatrix} \\ + \hline + \text{NAND} & + \begin{array}{} + \left|000\right> \mapsto \color{#f00}{\left|001\right>} \\ + \color{#999}{\left|001\right> \mapsto \color{#f99}{\left|000\right>}} \\ + \left|010\right> \mapsto \color{#0b5}{\left|011\right>} \\ + \color{#999}{\left|011\right> \mapsto \color{#7b9}{\left|010\right>}} \\ + \left|100\right> \mapsto \color{#07c}{\left|101\right>} \\ + \color{#999}{\left|101\right> \mapsto \color{#7ac}{\left|100\right>}} \\ + \left|110\right> \mapsto \left|110\right> \\ + \color{#999}{\left|111\right> \mapsto \left|111\right>} \\ + \end{array} & + \begin{pmatrix} + \color{#f00}{0} & \color{#f00}{1} & 0 & 0 & 0 & 0 & 0 & 0 \\ + \color{#f00}{1} & \color{#f00}{0} & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & \color{#0b5}{0} & \color{#0b5}{1} & 0 & 0 & 0 & 0 \\ + 0 & 0 & \color{#0b5}{1} & \color{#0b5}{0} & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & \color{#07c}{0} & \color{#07c}{1} & 0 & 0 \\ + 0 & 0 & 0 & 0 & \color{#07c}{1} & \color{#07c}{0} & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ + \end{pmatrix} \\ + \hline + \text{OR} & + \begin{array}{} + \left|000\right> \mapsto \left|000\right> \\ + \color{#999}{\left|001\right> \mapsto \left|001\right>} \\ + \left|010\right> \mapsto \color{#f00}{\left|011\right>} \\ + \color{#999}{\left|011\right> \mapsto \color{#f99}{\left|010\right>}} \\ + \left|100\right> \mapsto \color{#0b5}{\left|101\right>} \\ + \color{#999}{\left|101\right> \mapsto \color{#7b9}{\left|100\right>}} \\ + \left|110\right> \mapsto \color{#07c}{\left|111\right>} \\ + \color{#999}{\left|111\right> \mapsto \color{#7ac}{\left|110\right>}} \\ + \end{array} & + \begin{pmatrix} + 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & \color{#f00}{0} & \color{#f00}{1} & 0 & 0 & 0 & 0 \\ + 0 & 0 & \color{#f00}{1} & \color{#f00}{0} & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & \color{#0b5}{0} & \color{#0b5}{1} & 0 & 0 \\ + 0 & 0 & 0 & 0 & \color{#0b5}{1} & \color{#0b5}{0} & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & \color{#07c}{0} & \color{#07c}{1} \\ + 0 & 0 & 0 & 0 & 0 & 0 & \color{#07c}{1} & \color{#07c}{0} \\ + \end{pmatrix} \\ + \hline + \text{NOR} & + \begin{array}{} + \left|000\right> \mapsto \color{#f00}{\left|001\right>} \\ + \color{#999}{\left|001\right> \color{#f99}{\mapsto \left|000\right>}} \\ + \left|010\right> \mapsto \left|010\right> \\ + \color{#999}{\left|011\right> \mapsto \left|011\right>} \\ + \left|100\right> \mapsto \left|100\right> \\ + \color{#999}{\left|101\right> \mapsto \left|101\right>} \\ + \left|110\right> \mapsto \left|110\right> \\ + \color{#999}{\left|111\right> \mapsto \left|111\right>} \\ + \end{array} & + \begin{pmatrix} + \color{#f00}{0} & \color{#f00}{1} & 0 & 0 & 0 & 0 & 0 & 0 \\ + \color{#f00}{1} & \color{#f00}{0} & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ + \end{pmatrix} \\ + \hline + \text{XOR} & + \begin{array}{} + \left|00\right> \mapsto \left|00\right> \\ + \left|01\right> \mapsto \left|01\right> \\ + \left|10\right> \mapsto \color{#f00}{\left|11\right>} \\ + \left|11\right> \mapsto \color{#f00}{\left|10\right>} \\ + \end{array} & + \begin{pmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & \color{#f00}{0} & \color{#f00}{1} \\ + 0 & 0 & \color{#f00}{1} & \color{#f00}{0} \\ + \end{pmatrix} \\ + \hline + \text{XNOR} & + \begin{array}{} + \left|00\right> \mapsto \color{#f00}{\left|01\right>} \\ + \left|01\right> \mapsto \color{#f00}{\left|00\right>} \\ + \left|10\right> \mapsto \left|10\right> \\ + \left|11\right> \mapsto \left|11\right> \\ + \end{array} & + \begin{pmatrix} + \color{#f00}{0} & \color{#f00}{1} & 0 & 0 \\ + \color{#f00}{1} & \color{#f00}{0} & 0 & 0 \\ + 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & 1 \\ + \end{pmatrix} \\ + \hline +\end{array} +$$

+",6152,,6152,,4/3/2019 19:26,4/3/2019 19:26,,,,0,,,,CC BY-SA 4.0 +5850,1,5871,,4/4/2019 4:36,,6,347,"

I encountered the hidden shift problem as a benchmarking function to test the quantum algorithm outlined in this paper (the problem also features here).

+ +
+

There are two oracle functions $f$, $f'$ : $\mathbb{F}_{2}^{n} +\rightarrow \{ \pm 1 \}$ and a hidden shift string $s \in +\mathbb{F}_{2}^{n}$. It is promised that $f$ is a bent (maximally + non-linear) function, that is, the Hadamard transform of f takes + values $ \pm 1$. It is also promised that $f′$ is the shifted version + of the Hadamard transform of $f$, that is

+ +

$$f'(x \oplus s) = 2^{−\frac{n}{2}} \sum_{y \in \mathbb{F}^{n}_{2}} +(−1)^{x·y}f(y) \forall x \in \mathbb{F}_{2}^{n} $$

+ +

The oracles are diagonal $n$ qubit unitary operators such that + $O_{f}|x \rangle = f(x) |x \rangle$ and $O_{f'}|x \rangle = f'(x) |x +\rangle$ for all $x \in \mathbb{F}^{n}_{2}$.

+
+ +

It is stated that $|s⟩ = U|0^{n}⟩$, $U ≡ H^{\otimes n} O_{f′} H^{\otimes n} O_{f} H^{\otimes n}$. I am struggling with this calculation. Here's what I did.

+ +

$$H^{\otimes n} O_{f′} H^{\otimes n} O_{f} H^{\otimes n}|0^{n}\rangle$$ $$= H^{\otimes n} O_{f′} H^{\otimes n} 2^{−\frac{n}{2}}\sum_{x \in \mathbb{F}^{n}_{2}} +f(x) |x \rangle$$ +$$= H^{\otimes n} O_{f′} ~2^{−n}\sum_{x \in \mathbb{F}^{n}_{2}} +f(x) \sum_{y \in \mathbb{F}^{n}_{2}} (-1)^{x.y} |y \rangle $$ +$$= H^{\otimes n} ~2^{−n} \sum_{x \in \mathbb{F}^{n}_{2}} +f(x) \sum_{y \in \mathbb{F}^{n}_{2}} (-1)^{x.y} f'(y) |y \rangle $$ +$$= 2^{−\frac{3n}{2}} \sum_{x \in \mathbb{F}^{n}_{2}} +f(x) \sum_{y \in \mathbb{F}^{n}_{2}} (-1)^{x.y} f'(y) \sum_{z \in \mathbb{F}^{n}_{2}} (-1)^{y.z} |z \rangle $$

+ +

I am not sure whether I have the correct expression and if I do, I have no idea how to simplify this large expression to get $|s\rangle$.

+",1351,,26,,4/4/2019 7:51,4/8/2019 5:52,Hidden shift problem as a benchmarking function,,2,0,0,,,CC BY-SA 4.0 +5851,1,,,4/4/2019 14:48,,3,185,"

Nielsen explains how a search algorithm can access a classic database. I have a few questions. I hope you can help me a bit :) I work with a few quotes from the book.

+
+

The principle of operation is a means by which the binary encoded state of the quantum index (where $0$ to $2^n − 1$ is represented by n qubits) is translated into a unary encoding (where $0$ to $2^n − 1$ is represented by the position of a single probe within $2^n$ possible locations) which addresses the classical database.

+
+

Ok, if I understand that correctly, the quantum index register is translated into a unary system that specifies the position in the classic database. What I understand less is this statement: "represented by the position of a single probe within $2^n$ possible locations" what is being said with "a single probe within $2^n$ possible locations"?

+
+

The database effects a change on a degree of freedom within the probe which is unrelated to its position.

+
+

What is the "probe"? And what is behind "degree of freedom"? The sentence is not clear to me.

+
+

Each circle represents a switch, addressed by the qubit inscribed within.

+
+

OK, so the qubit controls the switch and thus the route.

+
+

The data register qubits enter at the top of the tree, and are routed down to the database

+
+

How does that work exactly? So where is the connection with the switches from earlier?

+
+

The binary to unary encoding is then reversed, leaving the data register with the desired contents.

+
+

That is, the entries in the database affect the qubits that penetrate the schema. So that the qubits can then accept their content?

+
+

The qubits are then routed back into a definite position

+
+

How does the way back work?

+",,user4961,7460,user4961,8/3/2020 7:15,9/2/2020 8:00,Quantum addressing scheme,,1,3,,,,CC BY-SA 4.0 +5852,2,,5648,4/4/2019 15:38,,2,,"

This page might give some useful information in regards to your question:

+ +

On this page you can see the Average Measurements for $T_1$ and $T_2$ times, Gate Error, Frequency, and Readout Error for each machine since its most recent calibration. If look at these measurements for ""ibmqx4"" (IBM Q 5 Tenerife) and ""ibmqx2"" (IBM Q 5 Yorktown) you can see that the measurements differ. If you were to run the same program on both devices, there could be some variance in results based on these differing measurements, as well as the inherent noise you had mentioned.

+ +

As for exactly how much variance there would be, that is hard to say.

+",6180,,26,,4/4/2019 17:05,4/4/2019 17:05,,,,0,,,,CC BY-SA 4.0 +5853,1,,,4/4/2019 17:39,,3,145,"

As per the Shor's algorithm, we need to evaluate $a^x \bmod N$ from $x = 0$ to $N^2$. What is the reason for this? Why can't we just evaluate for $N$, $2N$ or something like that?

+",5410,,26,,4/5/2019 14:36,4/5/2019 14:36,Reason for evaluating $a^x \bmod N$ from $x = 0$ to $N^2$,,1,0,,,,CC BY-SA 4.0 +5854,2,,5853,4/5/2019 0:51,,5,,"

Shor's algorithm relies on determining the period of $a^x\bmod N$. If you only evaluate up to $N$, then you are undersampling, in much the same way that you would classically be below the Nyquist criteria.

+ +

For example, if you measure the second register and get $y$, the first register collapses to all $x$ such that $a^x\bmod N =y$. These $x$ collide at $y$. If you only evaluate up to $N$, there is a chance that there will be no collisions for which you can properly measure the frequency in the first register.

+ +

Evaluating up to $N^2$ increases the number of such collisions, and hence decreases the odds that you undersampled.

+",2927,,,,,4/5/2019 0:51,,,,0,,,,CC BY-SA 4.0 +5856,2,,5848,4/5/2019 7:05,,4,,"

Why not simply try the following? + +You could have used an ancilla and computed $y\oplus b$ (that requires two controlled-nots, one controlled off each of $b$ and $y$, not a Toffoli) provided you later uncomputed the ancilla to reset it back to 0. But having an ancilla is unnecessary.

+ +

Just to explain what's happening in the boxed part of my circuit, both gates only work if $c=z=1$. Then the two gates flip $x$ depending on the value of $b$ or $y$ respectively. So, if $b\oplus y=1$, only one flip is applied, because one value is 0 and one value is 1. If $b\oplus y=0$, then either $b=y=0$, and no flip is applied, or $b=y=1$ and two flips are applied. But 2 flips cancel each other, so if $b\oplus y=0$, no operation is applied.

+",1837,,434,,4/5/2019 16:38,4/5/2019 16:38,,,,6,,,,CC BY-SA 4.0 +5857,1,,,4/5/2019 17:17,,4,99,"

Note: Cross-posted on Physics SE.

+ +
+ +

The quantum Singleton bound states that for an error-correcting code with $n$ physical qubits and $k$ encoded qubits, and some subsystem $R$ of $m$ qubits that can 'access the entire quantum code', it is necessary that $m \ge \frac{n+k}{2}$.

+ +

As I understand (from section 4.3 of Harlow's TASI notes), one way to state the condition for 'accessing the entire code' is the Knill-Laflamme condition, which is the following.

+ +
+

Let $\bar{R}$ denote the complement of $R$, $\mathscr{H}_\bar{R}$ be + the space of operators supported on $\bar{R}$, and $P$ denote the projection matrix onto the code subspace $\mathscr{H}_{code}$. Then for any operator + $O_{\bar{R}} \in \mathscr{H}_\bar{R}$, $P O_{\bar{R}} P = \lambda P$, where $\lambda$ is some constant that depends on the operator $O_{\bar{R}}$

+
+ +

This means that operator supported on the complement region $\bar{R}$ has no effect on measurements on $\mathscr{H}_{code}$.

+ +

I'm confused because this does not seem compatible with the toric code. Because, it can be shown that in the toric code (where the number of encoded bits $k=2$), the Knill-Laflamme condition is satisfied for $\bar{R}$ being any contractible region of qubits, i.e. for $R$ containing the union of two distinct nontrivial cycles on the torus. In this case on a torus of length $L \times L$, we will have the number of physical qubits being $n = L^2$ and the number of bits needed to access being $m = 2L$. So, it seems that the singleton bound is explicitly violated.

+ +

Where does the logic I'm presenting fail, and why should the Toric Code be compatible with this?

+",6188,,26,,4/5/2019 18:34,4/5/2019 18:34,Is the quantum Singleton bound compatible with the Toric Code?,,0,0,,,,CC BY-SA 4.0 +5859,1,,,4/5/2019 22:24,,4,136,"

The HHL paper ""Quantum algorithm for linear systems of equations"" [link] initially describes a ""simple example"" to illustrate the potential power of their algorithm.

+ +

They state:

+ +
+

Consider a stochastic process $x_t=Ax_{t−1}+b$, where the $i$’th coordinate in the vector $x_t$ represents the abundance of item $i$ in time $t$. The stable state of this distribution is given by $\vert x\rangle = (I−A)^{−1}\vert b\rangle$. Let $x_t'=A'x_{t−1}'+b'$, and $\vert x'\rangle = (I−A')^{−1}\vert b '\rangle$. To know if $\vert x\rangle$ and $\vert x'\rangle$ are similar, we perform the $\mathsf{SWAP}$ test between them.

+
+ +

If I understand this correctly, this seems like a very potent application of HHL.

+ +

That is, if we have some large space that we know can be fully explored with a certain set of moves $s= \langle P, Q, R\rangle$ but we suspect can be fully explored with a simpler set of moves $s'=\langle P, Q \rangle$, then I believe as long as we have some way to prepare $\vert b\rangle$ and $\vert b' \rangle$ in a uniform superposition of the entire space, we can determine if both $s'$ generate as big a space as $s$.

+ +

For example, it's debated whether the Rubik's Cube can be generated with only $5$ of the $6$ twists - that, whether one of the twists is redundant. If we define $A$ to correspond to a transition matrix flipping all $6$ of the faces, while $A'$ is defined to be only $5$ of the faces, and we let both $\vert b \rangle$ and $\vert b' \rangle$ be in a uniform superposition over all of the Rubik's cube states, then I believe running the HHL embodiment described above will answer whether that $6^{\text{th}}$ face twist is redundant.

+ +

As another example, we know that knot moves on a grid diagram - including cyclic permutations, stabilizations, and castling moves - are sufficient to tie and untie any knot to any other knot. However, I read somewhere that cyclic permutations may be redundant, and be realized by a sequence of castling and stabilization/destabilization moves. If we are able to generate a uniform superposition over all grid diagrams, and have $A$ be the transition matrix including permutations and $A'$ be the transition matrix excluding permutations, then I believe we would show the same.

+ +

Is this the correct way to think about the HHL paper's example? Are there other good examples of HHL's reasoning?

+",2927,,2927,,4/7/2019 13:27,4/7/2019 13:27,"What are applications of HHL's ""simple example"" to determine similar stable states of different quantum processes?",,0,2,,,,CC BY-SA 4.0 +5863,2,,5204,4/6/2019 15:08,,1,,"

Initially I'll admit that I find the linked papers to be dense as well.

+ +

However, to make some headway, a complete problem in $\mathrm{NP}$ can be phrased as ""given a $\mathsf{3SAT}$ instance, does there exist a solution?"" A complete problem in $\mathrm{coNP}$ is ""given $\mathsf{3SAT}$ instance, do all inputs satisfy the $\mathsf{3SAT}$? Problems in the polynomial hierarchy $\mathrm{PH}$ alternate ""there exists"" with ""for alls,"" with a constant number of iterations of $\exists$ and $\forall$. For me, the easiest problem in $\mathrm{PH}$ to think about is ""is there a mate in $n$ for this board position?"" because this is just ""does there exist a move by white such that for all moves by black, there is a counter-move by white such that... white wins.""

+ +

Ponder the difficulty of such $\forall x_1,\exists x_2\cdots$ problems as compared to factoring, which is in $\mathrm{NP}\cap\mathrm{coNP}$.

+ +

Turning to Recursive Fourier Sampling (RFS), much as in Simon's problem, with RFS we are only given oracle access to a function $A$. However, RFS involves a promise having just such an alternation of $\exists$ and $\forall$. By going up to a small-enough height (number of iterations of $\exists$ and $\forall$,) the problem can be shown to be likely difficult for a classical computer to efficiently solve but definitely easy for a quantum computer to solve.

+ +

Comparing RFS to the ""forrelation"" problem that I think is a little easier to understand but somewhat more difficult to see the connection to $\forall x_1,\exists x_2\cdots$. Forrelation is as simple as asking if, given two black-box (oracle) functions $f$ and $g$, is there a correlation between $f$ and the Fourier transform of $g$? Here, we can simply Fourier transform $g$ and find the inner product with $f$.

+ +

Forrelation is likely even completely outside the polynomial hierarchy. Here the relation to the $\forall, \exists$ is less clear to me right now but effectively involves translating a tree of alternating $\mathsf{AND's}$ and $\mathsf{OR's}$ that are capable of solving forrelation to a sequence of alternating $\forall$ and $\exists$.

+ +

Here $f$ and $g$ are simply black-box, without any structure. As far as I know, we don't know a good instantiation of $f$ or $g$ ""in the real world"" yet, with $f$ and/or $g$ have a particular structure.

+",2927,,,,,4/6/2019 15:08,,,,0,,,,CC BY-SA 4.0 +5864,1,,,4/6/2019 16:40,,5,59,"

On p. 3 of ""Separability Probability Formulas and Their Proofs for Generalized Two-Qubit X-Matrices Endowed with Hilbert-Schmidt and Induced Measures"" (https://arxiv.org/abs/1501.02289), it is asserted that the Hilbert-Schmidt separability probabilities for the two-rebit, two-qubit and two-quarter[nionic]-bit X-states are, $\frac{16}{3 \pi^2}, \frac{2}{5}$ and $\frac{2}{7}$, respectively. (Of course, by X-states [https://arxiv.org/abs/1407.3021], we mean density matrices having an X-shaped nonzero-zero pattern.)

+ +

More generally still, for random induced measure (the case $k=0$, corresponding to the Hilbert-Schmidt instance), for the two-qubit X-states, we have, on the same page, the formula +\begin{equation} +1-\frac{2 \Gamma (2 k+4)^2}{\Gamma (k+2) \Gamma (3 k+6)}, +\end{equation} +giving the indicated $\frac{2}{5}$ for $k=0$, and now $\frac{9}{14}$ for $k=1$,...(Also, 0 for $k=-1$, we note.)

+ +

Now, in the abstract and sec. VIII of ""Extensions of Generalized Two-Qubit Separability Probability Analyses to Higher Dimensions, Additional Measures and New Methodologies"" (https://arxiv.org/abs/1809.09040), it has been asserted that these same probabilities continue to hold in the X-state cases for the higher-dimensional rebit-retrit, two-retrit, qubit-qutrit, two-qutrit,...cases.

+ +

Now, on some level this seems counter-intuitive, as the evidence (see previous citation) is that for the (15-dimensional) two-qubit states, in general, the Hilbert-Schmidt separability probability is $\frac{8}{33} \approx 0.242424$ and possibly (certainly much less) $\frac{27}{1000}$ for the qubit-qutrit states,..., also shrinking to zero, asymptotically (as the various works of Aubrun, Szarek, Ye, et al indicate). The numerical evidence is certainly of a similar nature for the rebit/retrit counterparts.

+ +

So, it would be nice to have some independent examination of the proposition that for the X-states, separability/PPT-probabilities remain invariant as the dimensions of the spaces in which they are embedded increase.

+",3089,,55,,12/6/2021 11:32,12/6/2021 11:32,"Are X-state separability and PPT- probabilities the same for the two-qubit, qubit-qutrit, two-qutrit, etc. states?",,0,0,,,,CC BY-SA 4.0 +5865,1,5874,,4/6/2019 17:14,,3,110,"

Say, qubit $\left|a\right\rangle = \alpha_1|0\rangle + \beta_1|1\rangle$ and $|b\rangle = \alpha_2|0\rangle + \beta_2|1\rangle$.

+ +

After $\sqrt{\text{SWAP}}$(a,b) what are new probability amplitudes of $a$ and $b$ in terms of $\alpha_1,\, \alpha_2,\, \beta_1,\, \beta_2$?

+",6196,,6196,,4/6/2019 20:19,4/8/2019 9:26,What are the individual probabilities after √SWAP gate?,,2,1,0,,,CC BY-SA 4.0 +5866,1,5880,,4/6/2019 19:26,,1,134,"

I just started working in Qiskit and want to use some of the new functions available to Qiskit on Github. Unfortunately, I don't know how to implement the latest GitHub version into my Anaconda distribution of Python.

+ +

Anaconda uses an older Qiskit library which I installed using pip. I would now like to git clone the latest version of Qiskit into that location. How can I do this? When I just type git clone https://github.com/Qiskit or something similar, it doesn't work.

+",5600,,26,,4/6/2019 19:52,4/9/2019 13:38,Using latest (GitHub) version of Qiskit as Python library,,1,0,,,,CC BY-SA 4.0 +5867,1,5882,,4/6/2019 20:31,,2,402,"

I created a DAG circuit in Qiskit and don't really understand how to see which gate is which.

+ +

I want to call a function like dag_circuit.gate_info(gate_number), which will then print, for example, that gate number 9 is a hadamard gate $H$, and that gate number 11 is a $U_3(\theta=0.1,\phi=0.2,\lambda=-0.5)$.

+ +

How do I get this information?

+",5600,,23,,4/6/2019 20:45,4/10/2019 13:47,Qiskit DAG circuit - print information about individual gate/node by number,,1,0,,,,CC BY-SA 4.0 +5868,2,,5865,4/6/2019 21:35,,2,,"

Just apply corresponding matrix of this gate on the vector +$$ |a\rangle |b\rangle = \alpha_1\alpha_2|00\rangle + \alpha_1\beta_2|01\rangle + \beta_1\alpha_2|10\rangle + \beta_1\beta_2|11\rangle $$

+ +

Note that in general the resulting state will be entangled. Hence every qubit individually will be in the mixed state.

+",5870,,5870,,4/6/2019 21:52,4/6/2019 21:52,,,,0,,,,CC BY-SA 4.0 +5869,1,5884,,4/7/2019 9:48,,1,219,"

I'm trying to define a custom gate for my computations. I decided to copy the structure in one of the files in qiskit.extensions.standard package. Here is the code of h.py (Hadamard gate):

+ +
# -*- coding: utf-8 -*-
+
+# Copyright 2017, IBM.
+#
+# This source code is licensed under the Apache License, Version 2.0 found in
+# the LICENSE.txt file in the root directory of this source tree.
+
+# pylint: disable=invalid-name
+
+""""""
+Hadamard gate.
+""""""
+from qiskit.circuit import Gate
+from qiskit.circuit import QuantumCircuit
+from qiskit.circuit import InstructionSet
+from qiskit.circuit import QuantumRegister
+from qiskit.qasm import pi
+from qiskit.dagcircuit import DAGCircuit
+from qiskit.extensions.standard import header  # pylint: disable=unused-import
+from qiskit.extensions.standard.u2 import U2Gate
+
+
+class HGate(Gate):
+    """"""Hadamard gate.""""""
+
+    def __init__(self, qubit, circ=None):
+        """"""Create new Hadamard gate.""""""
+        super().__init__(""h"", [], [qubit], circ)
+
+    def _define_decompositions(self):
+        """"""
+        gate h a { u2(0,pi) a; }
+        """"""
+        decomposition = DAGCircuit()
+        q = QuantumRegister(1, ""q"")
+        decomposition.add_qreg(q)
+        decomposition.add_basis_element(""u2"", 1, 0, 2)
+        rule = [
+            U2Gate(0, pi, q[0])
+        ]
+        for inst in rule:
+            decomposition.apply_operation_back(inst)
+        self._decompositions = [decomposition]
+
+    def inverse(self):
+        """"""Invert this gate.""""""
+        return self  # self-inverse
+
+    def reapply(self, circ):
+        """"""Reapply this gate to corresponding qubits in circ.""""""
+        self._modifiers(circ.h(self.qargs[0]))
+
+
+def h(self, q):
+    """"""Apply H to q.""""""
+    if isinstance(q, QuantumRegister):
+        instructions = InstructionSet()
+        for j in range(q.size):
+            instructions.add(self.h((q, j)))
+        return instructions
+
+    if isinstance(q, QuantumRegister):
+        instructions = InstructionSet()
+        for j in range(q.size):
+            instructions.add(self.h(q))
+        return instructions
+
+    self._check_qubit(q)
+    return self._attach(HGate(q, self))
+
+
+QuantumCircuit.h = h
+
+ +

Trying to change the names of the class, the property of QuantumCircuit and the name string in Gate constructor results in an exception (name of the gate) is not in the list of basic operations if I try to either draw or execute an example circuit containing the gate.

+ +

""

+ +
""""
+[1]-const gate.
+""""""
+from qiskit.circuit import Gate
+from qiskit.circuit import QuantumCircuit
+from qiskit.circuit import InstructionSet
+from qiskit.circuit import QuantumRegister
+from qiskit.qasm import pi
+from qiskit.dagcircuit import DAGCircuit
+from qiskit.extensions.standard import header  # pylint: disable=unused-import
+from qiskit.extensions.standard.u2 import U2Gate
+
+
+class OneConstGate(Gate):
+
+    def __init__(self, qubit, circ=None):
+        super().__init__(""oneconst"", [], [qubit], circ)
+
+    def _define_decompositions(self):
+        decomposition = DAGCircuit()
+        q = QuantumRegister(1, ""q"")
+        decomposition.add_qreg(q)
+        decomposition.add_basis_element(""u2"", 1, 0, 2)
+        rule = [
+            U2Gate(0, pi, q[0])
+        ]
+        for inst in rule:
+            decomposition.apply_operation_back(inst)
+        self._decompositions = [decomposition]
+
+    def inverse(self):
+        """"""Invert this gate.""""""
+        return self  # self-inverse
+
+    def reapply(self, circ):
+        """"""Reapply this gate to corresponding qubits in circ.""""""
+        self._modifiers(circ.oneconst(self.qargs[0]))
+
+
+def oneconst(self, q):
+    """"""Apply H to q.""""""
+    if isinstance(q, QuantumRegister):
+        instructions = InstructionSet()
+        for j in range(q.size):
+            instructions.add(self.oneconst((q, j)))
+        return instructions
+
+    if isinstance(q, QuantumRegister):
+        instructions = InstructionSet()
+        for j in range(q.size):
+            instructions.add(self.oneconst(q))
+        return instructions
+
+    self._check_qubit(q)
+    return self._attach(OneConstGate(q, self))
+
+
+QuantumCircuit.oneconst = oneconst
+
+ +

Here is the example code:

+ +
x = QuantumRegister(1, 'x')
+gate = QuantumCircuit(x)
+gate.oneconst(x[0])
+gate.draw()
+
+ +

Note that I haven't changed any logic yet. Just the names. Did I forgot something?

+ +

Edit (1):

+ +

I had a look at header.py code in qiskit.extensions.standard. Adding these lines of code remove the error on draw method, but not in execute method:

+ +
import sympy
+from qiskit.circuit import QuantumCircuit
+from qiskit.qasm import _node as node
+
+QuantumCircuit.definitions[""oneconst""] = {
+    ""print"": False,
+    ""opaque"": False,
+    ""n_args"": 0,
+    ""n_bits"": 1,
+    ""args"": [],
+    ""bits"": [""a""],
+    # gate x a { u3(pi,0,pi) a; }
+    ""body"": node.GateBody([
+        node.CustomUnitary([
+            node.Id(""u3"", 0, """"),
+            node.ExpressionList([
+                node.Real(sympy.pi),
+                node.Int(0),
+                node.Real(sympy.pi)
+            ]),
+            node.PrimaryList([
+                node.Id(""a"", 0, """")
+            ])
+        ])
+    ])
+}
+
+",1874,,26,,4/7/2019 10:13,4/9/2019 17:49,(name of gate) is not in the list of basis operations,,1,0,,,,CC BY-SA 4.0 +5871,2,,5850,4/7/2019 14:37,,2,,"

Well, you can simplify +$$ H^{\otimes n} O_{f} H^{\otimes n}|0^{n}\rangle = +H^{\otimes n} 2^{−\frac{n}{2}}\sum_{x \in \mathbb{F}^{n}_{2}} +f(x) |x \rangle = +$$ +$$ += ~2^{−n}\sum_{x \in \mathbb{F}^{n}_{2}} +f(x) \sum_{y \in \mathbb{F}^{n}_{2}} (-1)^{x.y} |y \rangle = +~2^{−n}\sum_{x \in \mathbb{F}^{n}_{2}}\sum_{y \in \mathbb{F}^{n}_{2}} +f(x) (-1)^{x.y} |y \rangle = +$$ +$$ += ~2^{−\frac{n}{2}} \sum_{y \in \mathbb{F}^{n}_{2}}\left(~2^{−\frac{n}{2}}\sum_{x \in \mathbb{F}^{n}_{2}} +f(x) (-1)^{x.y} \right) |y \rangle = +~2^{−\frac{n}{2}} \sum_{y \in \mathbb{F}^{n}_{2}} f′(y\oplus s)|y \rangle +$$

+ +

On the other hand +$$ +O_{f'} H^{\otimes n} |s\rangle = +O_{f'} ~2^{−\frac{n}{2}} \sum_{y \in \mathbb{F}^{n}_{2}} (-1)^{s.y}|y \rangle = +~2^{−\frac{n}{2}} \sum_{y \in \mathbb{F}^{n}_{2}} (-1)^{s.y}f'(y)|y \rangle +$$

+ +

Now, if $|s\rangle = H^{\otimes n} O_{f′} H^{\otimes n} O_{f} H^{\otimes n} |0\rangle$ then $ O_{f′} H^{\otimes n} |s\rangle = H^{\otimes n} O_{f} H^{\otimes n} |0\rangle$.
+Hence it must be +$$ +~2^{−\frac{n}{2}} \sum_{y \in \mathbb{F}^{n}_{2}} f′(y\oplus s)|y \rangle = +~2^{−\frac{n}{2}} \sum_{y \in \mathbb{F}^{n}_{2}} (-1)^{s.y}f'(y)|y \rangle , +$$ i.e. +$$ +f′(y\oplus s) = (-1)^{s.y}f'(y) +$$

+ +

Well, the last equality just can't be true for a general bent $f'$ and $s$,$y$, because you can deduce $f'(y)=f'(s)$, hence $f'$ must be constant.

+ +

So, there is a mistake somewhere. Probably with notations or definitions. A deeper look is needed.

+ +

EDIT.
+Ok, after some digging I found a mistake :) +Authors of the first paper not quite carefully restated results of the source paper (your second link). In fact, $f'$ must be a Hadamard transform of the shifted $f$, and not a shift of the Hadamard transform of $f$! That is, it must be +$$ +f'(x) = ~2^{−\frac{n}{2}} \sum_{y \in \mathbb{F}^{n}_{2}} (-1)^{x.y}f(y\oplus s) +$$ +or, equivalently, by changing $x$,$y$ +$$ +f'(y) = ~2^{−\frac{n}{2}} \sum_{x \in \mathbb{F}^{n}_{2}} (-1)^{x.y}f(x\oplus s) +$$

+ +

With this correct $f'$ we have +$$ +~2^{−\frac{n}{2}} \sum_{y \in \mathbb{F}^{n}_{2}}\left(~2^{−\frac{n}{2}}\sum_{x \in \mathbb{F}^{n}_{2}} +f(x) (-1)^{x.y} \right) |y \rangle = +~2^{−\frac{n}{2}} \sum_{y \in \mathbb{F}^{n}_{2}} (-1)^{y.s}f′(y)|y \rangle +$$ +and everything coincides (in the context of my previous calculations).

+",5870,,5870,,4/7/2019 18:01,4/7/2019 18:01,,,,0,,,,CC BY-SA 4.0 +5872,2,,5823,4/7/2019 19:24,,4,,"

Speculatively expanding on previous answer

+ +

Quantum computers tend to outperform classical computers in determining global properties of functions. Further, the properties tend to be some measure of global symmetry. Based on the global symmetry, the probability amplitudes can constructively (and destructively) interfere, in ways that a classical computer could not.

+ +

Let's look at chess for a moment.

+ +
    +
  1. Deciding a winning position in chess, e.g. a mate, seems very much a local property of the board. There may be many pieces left on a board, but many of the pieces are irrelevant to the mating position. Of course pawn structure is a global property in a way, but pawns and many pieces (knights/kings/bad-color bishops) only have a local influence.

  2. +
  3. Chess by its nature is very asymmetric. Castling of course is a very asymmetric move, but I also mean, for example, that a bishop behaves significantly differently than a knight or a queen. A pawn captures differently than it moves.

  4. +
+ +

Let's compare chess to wei-chi/go/paduk.

+ +
    +
  1. Wei-chi has much more of a global feel to it than chess. Each stone can have both a long-range and a short-range impact. Life and death may hinge on being able to connect to a far-away island.

  2. +
  3. The rules of wei-chi are much more symmetric, in a sense that ""all stones are born equal."" There are some asymmetries, of course, such as the ko rule. The edge-of-the-board is different than the center, which is a bit of asymmetry; however, there's nothing quite like the dramatic difference in strength between a queen and a knight or a pawn.

  4. +
+ +

Ignoring such ko-rule asymmetries for now, let's let black be $0$, white be $1$, let $x\in\{0,1,blank\}$, and $f(x_1^1,x_1^2,\cdots,x_1^{19},\cdots,x_{19}^{19})$ be a function that takes a $19\times 19$ wei-chi board (e.g., a board after two consecutive passes), and returns whether white or black or neither has more claimed territory. I'm pretty sure $f$ is not that difficult to calculate, at least to a first level. Once black places the first stone, we can ask the same about the new board position with a new function $f^1$, and so on. Here $f^1$ is just like $f$ but one of the values of one of the $x^i_j$ has been fixed to $0$.

+ +

Speculatively, a quantum computer may be able to answer such a global property of $f$ as ""is there a move for black, such that for all moves by white, there's a countermove by black, such that... black ends up with more territory?"" With the placement of each of the stones, it feels like maybe there's constructive/destructive interference at work.

+ +

Speculating very much even more, perhaps we can construct a toy ""battleship-style"" or ""Kiregspiel"" style wei-chi game, where white $f$ and black $g$ take turns placing stones secretly on their respective board, and the value of the board is determined by a measure of the correlation between $f$ and the Fourier transform of $g$. We know a quantum computer is likely to outperform a classical computer for such a ""forrelation"" game; working backwards to create rules for such a game may be possible.

+",2927,,2927,,4/8/2019 18:03,4/8/2019 18:03,,,,0,,,,CC BY-SA 4.0 +5873,2,,5850,4/8/2019 5:52,,6,,"

Your calculations are correct, however, there are two issues: first, note that the promise on the dual bent function is actually not +$$ +f^\prime(x\oplus s) = 2^{-\frac{n}{2}} \sum_{y \in \mathbb{F}_2^n} (-1)^{xy} f(y) , \; \forall x \in \mathbb{F}_2^n +$$ +as stated. Instead you really want to define here the dual as in my paper https://arxiv.org/abs/0811.3208 as +$$ +f^\prime(x) = 2^{-\frac{n}{2}} \sum_{y \in \mathbb{F}_2^n} (-1)^{xy} f(y) , \; \forall x \in \mathbb{F}_2^n. +$$ +Note that the definition of the dual is independent of the hidden shift $s$.

+ +

The second issue is that in your calculation $H^{\otimes n} {\cal O}_{f^\prime} H^{\otimes n} {\cal O}_{f} H^{\otimes n} |0\rangle$ you used the unshifted version of $f$. Hence, the outcome is the shift $s=(0,\ldots,0)$, corresponding to the unshifted function (which is a perfectly valid input to the problem of course). Indeed, your second to last line can be simplified to +$$ +H^{\otimes n} 2^{-n/2} \sum_{y \in \mathbb{F}_2^n} f^\prime(y) f^\prime(y) |y\rangle = +H^{\otimes n} 2^{-n/2} \sum_{y \in \mathbb{F}_2^n} |y\rangle = |0 \ldots 0\rangle, +$$ +as it should be for hidden shift $s=(0,\ldots, 0)$.

+ +

For a general hidden shift $s\in \mathbb{F}_2^n$, the calculation is as follows. Denote by $g(x) = f(x\oplus s)$. Then +$$ + H^{\otimes n} {\cal O}_{f^\prime} H^{\otimes n} {\cal O}_{g} H^{\otimes n} |0\rangle +$$ +$$ += H^{\otimes n} {\cal O}_{f^\prime} H^{\otimes n} 2^{-n/2} \sum_{x\in \mathbb{F}_2^n} f(x\oplus s)|x\rangle +$$ +$$ += H^{\otimes n} {\cal O}_{f^\prime} 2^{-n} \sum_{y \in \mathbb{F}_2^n} \left( +\sum_{x \in \mathbb{F}_2^n} (-1)^{xy} f(x\oplus s) \right) |y \rangle +$$ +$$ += H^{\otimes n} {\cal O}_{f^\prime} 2^{-n} \sum_{y \in \mathbb{F}_2^n} (-1)^{ys} \left( +\sum_{x \in \mathbb{F}_2^n} (-1)^{xy} f(x) \right) |y \rangle +$$ +$$ += H^{\otimes n} {\cal O}_{f^\prime} 2^{-n/2} \sum_{y \in \mathbb{F}_2^n} (-1)^{ys} f^\prime(y) |y\rangle +$$ +$$ += H^{\otimes n} 2^{-n/2} \sum_{y \in \mathbb{F}_2^n} (-1)^{ys} f^\prime(y) f^\prime(y) |y\rangle +$$ +$$ += H^{\otimes n} 2^{-n/2} \sum_{y \in \mathbb{F}_2^n} (-1)^{ys} |y\rangle +$$ +$$ += |s\rangle, +$$ +as desired.

+",1828,,,,,4/8/2019 5:52,,,,1,,,,CC BY-SA 4.0 +5874,2,,5865,4/8/2019 7:08,,4,,"

The overall state of the input is $|a\rangle|b\rangle$, which we can represent as:

+ +

$$ +\left(\begin{array}{c} \alpha_1\alpha_2 \\ \alpha_1\beta_2 \\ \beta_1\alpha_2 \\ \beta_1\beta_2 \end{array}\right) +$$ +We apply the square root of swap gate (note that there are different ways that this matrix could be written ), +$$ +\sqrt{\text{SWAP}}=\left(\begin{array}{cccc} +1 & 0 & 0 & 0 \\ +0 & e^{i\pi/4}/\sqrt{2} & e^{-i\pi/4}/\sqrt{2} & 0 \\ +0 & e^{-i\pi/4}/\sqrt{2} & e^{i\pi/4}/\sqrt{2} & 0 \\ +0 & 0 & 0 & 1 +\end{array}\right). +$$ +Hence, we're after the calculation +$$ +\left(\begin{array}{cccc} +1 & 0 & 0 & 0 \\ +0 & e^{i\pi/4}/\sqrt{2} & e^{-i\pi/4}/\sqrt{2} & 0 \\ +0 & e^{-i\pi/4}/\sqrt{2} & e^{i\pi/4}/\sqrt{2} & 0 \\ +0 & 0 & 0 & 1 +\end{array}\right)\left(\begin{array}{c} \alpha_1\alpha_2 \\ \alpha_1\beta_2 \\ \beta_1\alpha_2 \\ \beta_2\beta_2 \end{array}\right)=\left(\begin{array}{c} +\alpha_1\alpha_2 \\ e^{i\pi/4}(\alpha_1\beta_2-i\beta_1\alpha_2)/\sqrt{2} \\ e^{-i\pi/4}(\alpha_1\beta_2+i\beta_1\alpha_2)/\sqrt{2} \\ \beta_1\beta_2 +\end{array}\right). +$$ +Converting this back to Dirac notation gives us the final answer +$$\alpha_1\alpha_2|00\rangle+\frac{e^{i\pi/4}}{\sqrt{2}}(\alpha_1\beta_2-i\beta_1\alpha_2)|01\rangle+ \frac{e^{-i\pi/4}}{\sqrt{2}}(\alpha_1\beta_2+i\beta_1\alpha_2)|10\rangle+\beta_1\beta_2|11\rangle. +$$ +Note that the probability amplitudes of each term are joint probability amplitudes of the whole system. As a general rule, you cannot separate this state into (state of a)$\otimes$(state of b), and therefore cannot identify individual probability amplitudes for each system.

+ +

Perhaps I could also suggest a bit of a notational change? If you want to refer to the two qubits as $a$ and $b$, do not also refer to the states of the two qubits as $|a\rangle$ and $|b\rangle$, as that's only likely to lead to confusion when the states change.

+",1837,,5791,,4/8/2019 9:26,4/8/2019 9:26,,,,0,,,,CC BY-SA 4.0 +5875,1,,,4/8/2019 7:53,,1,76,"

Suppose we have a matrix $A=\begin{bmatrix} +2 &4 \\ +1 & 4\\ +\end{bmatrix}$, when applying the discrete wavelet transform to this matrix we get 4 parts i.e smooth part ($1\times 1$) matrix, 3 detail parts each of them being ($1\times 1$) matrices. Is there any quantum transformation that performs this task? Can somebody suggest? Is it in some way related to Fourier Transformation?

+",6070,,26,,4/8/2019 13:13,4/9/2019 2:36,Quantum transformation equivalent to Discrete Wavelet transform,,1,3,,,,CC BY-SA 4.0 +5876,2,,5839,4/8/2019 17:44,,6,,"

Such an example is given in Bennett et al., Quantum Nonlocality without Entanglement, Phys. Rev. A. 59, 1070 (1999).

+",491,,1764,,4/8/2019 19:36,4/8/2019 19:36,,,,0,,,,CC BY-SA 4.0 +5877,1,5878,,4/8/2019 20:19,,3,74,"

When initially writing an operator in Q#, I often want to see intermediate values of registers during the computation. This allows me to check that I haven't made mistakes. For example, if I was writing an addition circuit I would input a computational basis state and print out the computational basis states of qubits at particular key points.

+ +

I am not aware of a way to do this conveniently. If I print out the qubits like Message($""{qubit}"") then I get their IDs instead of their values. That makes sense. I have to do a measurement to access their value. But if I do a measurement, then Q# will e.g. not automatically generate an adjoint operation and this tends to cause compilation failures. Also, I don't actually want to perform a measurement (which may have side effects) I just want to peek at the simulator state.

+ +

(I originally thought I could package the concept of ""peeking"" at a value into an operation that did a hidden measurement, which would have resolved the issue. But Q# doesn't allow operations with an adjoint to have a return type.)

+ +

Is there some built-in way to get at the computational basis value of some qubits, and print it to the console during simulation under the Toffoli simulator?

+",119,,119,,4/8/2019 20:41,4/9/2019 1:14,How do I do printf debugging in Q# in a convenient way?,,1,0,,,,CC BY-SA 4.0 +5878,2,,5877,4/9/2019 1:14,,4,,"

For Toffoli simulator in particular, DumpRegister will provide this information. For example, the following code

+ +
operation XorTest() : Bool {
+    using ((a, b) = (Qubit[2], Qubit[2])) {
+        // initialize: a = 1, b = 2
+        ApplyPauli([PauliI, PauliX], a);
+        ApplyPauli([PauliX, PauliI], b);
+        // check initialization
+        Message(""a = "");
+        DumpRegister((), a);
+        Message(""b = "");
+        DumpRegister((), b);
+        // calculate a ⊕ b and write it to b
+        CNOT(a[0], b[0]);
+        CNOT(a[1], b[1]);
+        // check result: a ⊕ b = 3
+        Message(""a xor b = "");
+        DumpRegister((), b);
+    }
+    return true;
+}
+
+ +

will print the following result (and throw an exception in the end because the qubits are released not in zero state):

+ +
a =
+State:
+0:      False
+1:      True
+b =
+State:
+2:      True
+3:      False
+a xor b =
+State:
+2:      True
+3:      True
+
+ +

The numbers before values are qubit ids.

+",2879,,,,,4/9/2019 1:14,,,,0,,,,CC BY-SA 4.0 +5879,2,,5875,4/9/2019 2:36,,2,,"

This paper by Andreas Klappenecker might be a good starting point. The paper spearheaded quantum wavelet transforms and so-called wavelet packet transforms. A wavelet packet transforms yields an iterated decomposition into high-pass and low-pass filtered signals, whereas a wavelet transform only further decomposes the low-pass filtered and down-scaled version of the signal.

+",1828,,,,,4/9/2019 2:36,,,,0,,,,CC BY-SA 4.0 +5880,2,,5866,4/9/2019 13:38,,3,,"

Yes, installing Qiskit through pip install will install the latest, stable version of Qiskit onto your environment. So do note, the version you want to clone may not be functional with existing Jupyter Notebooks and other tutorials, since the code is not yet officially released.

+ +

That being said, cloning the repo is very easy. The URL that you were trying to clone, https://github.com/Qiskit, is the Qiskit Github user account page. That is why you were receiving an error. The repo that you are looking to clone would be qiskit-terra. Once you are there, you can follow this article on cloning github repositories.

+ +

Once you have cloned the repo, you can follow this guide on how to install Qiskit Terra from the source code you just cloned.

+",6180,,,,,4/9/2019 13:38,,,,1,,,,CC BY-SA 4.0 +5881,1,,,4/9/2019 14:35,,4,317,"

How many qubits and what is the minimum number of gate operations needed to factor an n-bit integer? Are there any other published algorithms that are simpler or more efficient?

+",6109,,55,,4/10/2019 9:50,4/27/2019 1:56,Are there any other published quantum factoring algorithms that are simpler or more efficient than Shor’s?,,1,2,,,,CC BY-SA 4.0 +5882,2,,5867,4/9/2019 14:37,,3,,"

NOTE: At the moment this method is correct, however, this information might be out of date once the 0.9 release of Qiskit is deployed.

+ +

Hi Samuel, if you have a dag circuit and you want to access information about the nodes, you need to call dag_circuit.multi_graph.nodes[index_of_node]

+ +

The information you can get from a node in the circuit is a dictionary containing the following:

+ +
    +
  • type (either ""in"", ""out"", or ""op"")
  • +
  • name (either a qubit, classical bit, or an operation name)
  • +
  • wire (the Register Object of the qubit or classical bit that the wire is attached to)
  • +
+ +

An ""op"" node will will have these other values in addition to the ones above (excluding the ""wire"" value):

+ +
    +
  • 'op' (The data type of the operation)
  • +
  • qargs (The qubits this gate is applied to)
  • +
  • cargs (The classical bits this gate is applied to)
  • +
  • condition
  • +
+ +

In your example where you have an $H$ Gate at node 9 and a $U_3(\theta=0.1, \phi=0.2, \lambda=-0.5)$ Gate at node 11, if you were to call print(dag_circuit.multi_graph.nodes[8]) and print(dag_circuit.multi_graph.nodes[10]), you would receive the following output:

+ +

{'type': 'op', 'op': <qiskit.extensions.standard.h.HGate object at ""some_memory_address"">, 'name': 'h', 'qargs': [(QuantumRegister(1, 'q'), 0)], 'cargs': [], 'condition': None}
+{'type': 'op', 'op': <qiskit.extensions.standard.u3.U3Gate object at ""some_memory_address"">, 'name': 'u3', 'qargs': [(QuantumRegister(1, 'q'), 0)], 'cargs': [], 'condition': None}

+",6180,,6180,,4/10/2019 13:47,4/10/2019 13:47,,,,4,,,,CC BY-SA 4.0 +5883,1,,,4/9/2019 17:33,,1,101,"

I am trying to run the code of the notebook example aqua/artificial_intelligence/qsvm_kernel_classification.ipynb. I save it in a python file and I have an exception at runtime the display of {'A': 0, 'B': 1}.

+ +
xception ignored in: <bound method Image.__del__ of <tkinter.PhotoImage object at 0x7f78a3b23d30>>
+Traceback (most recent call last):
+  File ""/home/.../anaconda3/lib/python3.6/tkinter/__init__.py"", line 3501, in __del__
+    self.tk.call('image', 'delete', self.name)
+RuntimeError: main thread is not in main loop
+Tcl_AsyncDelete: async handler deleted by the wrong thread
+Abandon (core dumped)
+
+ +

The classical example worked fine: I don't see what I am doing wrong.

+",6216,,26,,4/9/2019 22:12,4/10/2019 18:39,Exception encountered while running quantum-enhanced support vector machines,,0,5,,,,CC BY-SA 4.0 +5884,2,,5869,4/9/2019 17:49,,3,,"

Did you add these lines to the file qiskit/extensions/standard/__init__.py:

+ +

from .oneconst import oneconst
+from .oneconst import OneConstGate

+ +

I did everything you described doing, as well as added those lines to __init__.py and the following code ran without error:

+ +
import qiskit
+from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute
+from qiskit import Aer
+
+qr = QuantumRegister(1)
+cr = ClassicalRegister(1)
+gate = QuantumCircuit(qr, cr)
+gate.oneconst(qr[0])
+gate.measure(qr[0], cr[0])
+print(gate.draw())
+
+backend = Aer.get_backend(""qasm_simulator"")
+
+job = execute(gate, backend, shots=100)
+
+print(job.result().get_counts(gate))
+
+",6180,,,,,4/9/2019 17:49,,,,0,,,,CC BY-SA 4.0 +5885,2,,5881,4/9/2019 18:09,,4,,"

Shor's algorithm is based on the gate model of quantum computation. However, there are alternatives to the gate model, such as quantum walks, etc. See all of the answers to this question for a nice summary of the different models of computation.

+ +

As to what I believe to be the implicit question ""is Shor's the only known quantum factoring algorithm, or are there alternatives that use fewer qubits and/or fewer gate operations?"" I refer you to ""A Quantum Adiabatic Algorithm for Factorization and Its Experimental Implementation"" (link) by Peng, Liao, Xu, Zhou, Suter, and Du.

+ +

The adiabatic factoring algorithm paper notes that factoring can be recast as an optimization problem. More specifically, the adiabatic algorithm notes that in order to factor a number $N=p\times q$, it suffices to find an $(x,y)\in\mathbb{N}^2$ such that $f(x,y)=(N-xy)^2$ obtains a minimum.

+ +

The paper describes the preparation of a Hamiltonian whose lowest energy corresponds to this minimum. The first paragraph of the second page of the paper compares the qubit count of the adiabatic algorithm somewhat favorably to that of Shor's.

+ +

Because the adiabatic algorithm evolves adiabatically to the ground state, it does not really make sense to talk about the ""total number"" of gate operations; rather it makes more sense to talk about the length of time the adiabatic evolution takes. As I understand, the runtime of such adiabatic algorithms are notoriously difficult to describe exactly/analytically, or even to a first order, being based on the spectral gap of the problem Hamiltonian. So we may be left with only numerical simulations. That is, unlike counting gates in the gate model, in general it's very difficult (nay undecidable) to know how long the adiabatic evolution takes, but the paper claims that numerical simulations indicate that the running time (evolution time) grows only quadratically with the number of qubits.

+ +

Thus, to answer the questions, there are other quantum factoring algorithms that don't require the same repeated squaring/QFT/classical post-processing of Shor's algorithm, and that uses fewer qubits. The runtime may also grow polynomially as in s algorithm, but proving that the runtime is quadratic or even polynomial in the number of qubits (bits of $N$) is difficult.

+",2927,,2927,,4/27/2019 1:56,4/27/2019 1:56,,,,0,,,,CC BY-SA 4.0 +5886,1,5887,,4/9/2019 23:15,,2,100,"

Let $U$ be a unitary $n$-qubit transformation that applies a Hadamard on the $k$-th qubit and the identity on all the others. How would I go about calculating $U_{ij}=\langle i | U | j \rangle$ in polynomial time? Calculating all of $U$ is not feasible in polynomial time as it is a $2^n \times 2^n$ matrix.

+",5816,,26,,4/10/2019 5:22,4/10/2019 6:31,Calculating entries of unitary transformation,,1,0,,,,CC BY-SA 4.0 +5887,2,,5886,4/10/2019 6:31,,3,,"

If $|i\rangle$ and $|j\rangle$ are from computational basis, then we can write +$$ +U = I \otimes I ~\otimes ... \otimes ~H ~\otimes ... \otimes ~ I \otimes I +$$ +$$ +\langle i | = \langle i_1| \otimes \langle i_2| ~\otimes ... \otimes ~\langle i_k| ~\otimes ... \otimes ~ \langle i_{n-1}| \otimes \langle i_n| +$$ +$$ +|j \rangle = |j_1\rangle \otimes |j_2\rangle ~\otimes ... \otimes ~ |j_k\rangle ~\otimes ... \otimes ~ | j_{n-1}\rangle \otimes | j_n\rangle +$$ +where every $i_x$ and $j_x$ are $0$ or $1$.

+ +

Then the product $\langle i | U | j \rangle$ will be +$$ +\langle i | U | j \rangle = \langle i_1| j_1\rangle \otimes \langle i_2| j_2\rangle~\otimes ... \otimes ~\langle i_k|H|j_k\rangle ~\otimes ... \otimes ~ \langle i_{n-1}| j_{n-1}\rangle\otimes \langle i_n|j_n\rangle = +$$ +$$ += \langle i_1| j_1\rangle \cdot \langle i_2| j_2\rangle~\cdot ... \cdot ~\langle i_k|H|j_k\rangle ~\cdot ... \cdot ~ \langle i_{n-1}| j_{n-1}\rangle\cdot \langle i_n|j_n\rangle +$$ +$$ += \delta_{i_1j_1} \cdot \delta_{i_2j_2}~\cdot ... \cdot ~\langle i_k|H|j_k\rangle ~\cdot ... \cdot ~ \delta_{i_{n-1}j_{n-1}}\cdot \delta_{i_nj_n} +$$ +where $\delta_{i_xj_x} = 1$ if $i_x = j_x$ and $0$ otherwise.

+ +

If $|i\rangle$ and $|j\rangle$ are not from computational basis, then it's impossible to compute it that fast, because you need exponential number of parameters just to define $|i\rangle$ or $|j\rangle$.

+",5870,,,,,4/10/2019 6:31,,,,0,,,,CC BY-SA 4.0 +5888,2,,5837,4/10/2019 11:55,,4,,"

The idea behind this expression is indeed a fairly general one.

+ +

$\newcommand{\bs}[1]{\boldsymbol{#1}}\newcommand{\calS}{\mathcal{S}}$An entanglement witness $\mathcal W$ is defined as an operator such that $\operatorname{Tr}(\mathcal W\rho)\ge0$ for all separable $\rho\in\mathcal S$, while for some entangled $\rho_{ent}$ we have $\operatorname{Tr}(\mathcal W\rho_{ent})<0$.

+ +

Geometrically, this definition is very easily understood as saying that $\mathcal W$ defines a hyperplane in the space of states that separates the separable states from the non-separable ones. Because of the convexity of the space of separable states, any non-separable state can be separated by such an operator (see e.g. (Horodecki 2007) or (Gühne 2008)).

+ +

Now forget for a second about states and quantum mechanics. Let $\calS$ denote a convex subset of $\mathbb R^n$ for some $n$, let $ v\notin \calS$, and let $ v_0\in\calS$ be the vector in $\calS$ that is the closest to $ v$ (in standard euclidean distance). +This means that the line (or more generally hyperplane) that is orthogonal to $ v- v_0$ and touches $ v_0$ is tangent to $\calS$ at $ v_0$. Such a ""line"" is an ""optimal"" linear separation between $\calS$ and $ v$:

+ +

+ +

We now simply need to define an operator that tells us on which side of such separation we are in. A natural candidate would be an operator which projects a candidate vector $ w$ on the line $ v- v_0$, or, more precisely, an operator $A$ defined via

+ +

$$A w\equiv\langle v- v_0, w- v_0\rangle.$$

+ +

Clearly, we then have $A v>0$, and $A v_0=0$, while all vectors in $\calS$ (together with the points on the $\calS$ side of the separation) correspond to $Aw<0$.

+ +

To obtain the given expression for the witness you now simply change the sign (because we conventionally define witnesses to be positive on the separable).

+ +

In conclusion, you have +$A_{opt} w=\langle v- v_0, v_0- w\rangle$, that corresponds to +$$A_{opt}=( v_0^*-v^*)-\langle v_0, v_0-v\rangle I.$$ +where $v^*$ denotes the linear functional $v^*(w)\equiv \langle v,w\rangle$ (or, if you prefer, the bra $\langle v\rvert$).

+ +

To get to the expression given in the paper you now just add a normalisation factor, which I guess was added to make something simpler later on in the paper.

+",55,,,,,4/10/2019 11:55,,,,5,,,,CC BY-SA 4.0 +5889,2,,5836,4/10/2019 14:15,,5,,"

These are not really the definitions of classical and quantum capacity, as I will explain. Before doing that, let me adjust the notation being used slightly: let $\Phi:\text{L}(\mathcal{X}) \rightarrow \text{L}(\mathcal{Y})$ be the channel whose capacities we are interested in and let $\Psi:\text{L}(\mathcal{X}) \rightarrow \text{L}(\mathcal{Z})$ be a channel that is complementary to $\Phi$.

+ +

First, we define the coherent information of $\Phi$ with respect to a state $\rho \in \text{D}(\mathcal{X})$ like this: +$$ +\text{I}_\text{C}(\rho;\Phi) = \text{S}(\Phi(\rho)) - \text{S}(\Psi(\rho)). +$$ +(This value is the same for all choices of a complementary channel $\Psi$.) +We then define the maximum coherent information of $\Phi$ by maximizing over all $\rho$: +$$ +\text{I}_\text{C}(\Phi) = \max_{\rho\in\text{D}(\mathcal{X})} \text{I}_\text{C}(\rho;\Phi). +$$ +This is equivalent to the expression written in the second equation of the question. (In particular, the supremum is taken over a compact set and the coherent information is continuous, so we can safely replace it by a maximum.) It is not, however, equal to the quantum capacity in general; the quantum capacity is defined in a completely different, operationally motivated way that I won't explain in this answer.

+ +

There is, however, a theorem that connects the two quantities, known alternatively as the quantum capacity theorem or the LSD theorem (named after Lloyd, Shor, and Devetak). The theorem states that the quantum capacity is given by this expression: +$$ +\text{Q}(\Phi) = \lim_{n\rightarrow\infty} \frac{\text{I}_{\text{C}}(\Phi^{\otimes n})}{n}. +$$ +This is a regularization of the maximum coherent information, and in general the regularization is requied. There are examples of channels, however, including all so-called degradable channels, for which the regularization is not required and we have $\text{Q}(\Phi) = \text{I}_{\text{C}}(\Phi)$.

+ +

The other quantity under consideration is the entanglement assisted classical capacity. Again this quantity is defined in a different, operationally motivated way, but this time there is a theorem that characterizes this quantity perfectly: +$$ +\text{C}_{\text{E}}(\Phi) = \max_{\rho\in\text{D}(\mathcal{X})} +\Bigl( \text{I}_\text{C}(\rho;\Phi) + \text{S}(\rho) \Bigr). +$$ +This theorem is sometimes called the entanglement assisted classical capacity theorem, and it was proved by Bennett, Shor, Smolin, and Thapliyal. It is a rare example in quantum Shannon theory where the characterization of a channel capacity does not require a regularization.

+ +

In both cases, it is helpful to see the theorems as being quantum analogues of Shannon's noisy channel coding theorem. The states $\rho$ that achieve the maximum values should really not be thought of so much as actual states that are sent through the channels, but ""suggestions"" for codes that stretch across multiple independent uses of $\Phi$. It is true, as the question suggests, that the values of these expressions are both zero for pure states, but the codes that these states suggest are effectively trivial and useless for transmitting information.

+ +

The proofs of both theorems are rather difficult. There are intuitive ways of thinking about the different expressions, but I don't think it is healthy to think about the term $\text{S}(\rho)$ as arising from something classical and disappearing in the quantum case. It is immediate from the definitions that the entanglement assisted classical capacity should be at least as large as the quantum capacity, but because one of these capacities is an entanglement assisted notion and the other is not, we are comparing apples with oranges to some extent. The entanglement assisted quantum capacity, for instance, is always exactly half the entanglement assisted classical capacity (and that is probably why people don't bother talking about it).

+",1764,,1764,,4/11/2019 13:12,4/11/2019 13:12,,,,0,,,,CC BY-SA 4.0 +5890,2,,1918,4/10/2019 15:10,,2,,"

Since this question is still open, I thought I'd share a great paper by professor Pete Wittek titled Open Source Software in Quantum Computing. Dr. Wittek has compiled a list of some open-source quantum computing projects with evaluations based on criteria such as documentation, license, etc. Dr. Wittek also provides a sort of call-to-action to get more people involved in advancing the quantum software stack

+",5481,,5481,,4/11/2019 5:15,4/11/2019 5:15,,,,0,,,,CC BY-SA 4.0 +5891,1,5896,,4/10/2019 17:16,,4,904,"

Which of the following sets of gates are universal for quantum computation?

+ +
    +
  1. {H, T, CPHASE}
  2. +
  3. {H, T, SWAP}
  4. +
+ +

And how do we prove it?

+",6224,,26,,4/10/2019 20:05,4/12/2019 6:07,How to prove universality for a set of gates?,,1,5,,,,CC BY-SA 4.0 +5895,1,,,4/11/2019 2:18,,5,163,"

How would I be able to graph the decoherence of qubits being used to perform an algorithm? I'm working with the IBMQ Qiskit framework and I'm trying to write a program that allows me to find the decoherence of qubits. But I do not know if IBMQ has a method to do that. Can anyone help me, or point me the right direction to implement such a thing?

+",3043,,26,,4/11/2019 12:16,8/15/2020 1:58,Graphing the decoherence of qubits being used to perform an algorithm,,1,1,,,,CC BY-SA 4.0 +5896,2,,5891,4/11/2019 7:21,,4,,"

You can prove that one gate set is universal by showing how to construct another universal gate set out of it. For example, we know that {H, T, cNOT} is universal, so can you find a way of making cNOT out of {H, T, CPHASE}? (Hint: Yes)

+ +

On the other hand, the best way to prove that a gate set is not universal is to show that you can simulate the evolution of any circuit efficiently on a classical computer. To the extent that we believe that classical and quantum computers are different is the extent to which we believe that gate set cannot be universal for quantum computation. So, how would you efficiently simulate arbitrary single qubit gates being applied to a set of $n$ qubits? Can you update your simulation algorithm to include SWAP without losing efficiency? (Hint: Yes)

+ +
+ +

I just wanted to clarify the reasoning behind choosing a particular route for disproving universality. You could try to make the argument that a universal gate set has to be capable of producing any unitary, which means it has to be capable of producing any state starting from the all zeros state. However, the concept of universality is a bit more subtle than that. For example, the gate set {H,Toffoli} is universal, and yet it can not produce states with complex phases because both gates are real valued. The reason is that it produces arbitrary unitaries within a large enough subspace of the system. But due to this possibility, it makes universality much harder to disprove through this sort of reasoning.

+",1837,,1837,,4/12/2019 6:07,4/12/2019 6:07,,,,2,,,,CC BY-SA 4.0 +5897,1,,,4/11/2019 12:03,,4,47,"

For two particular (twelve-and thirteen-dimensional) sets of two-retrit states (corresponding to 9 x 9 density matrices with real off-diagonal entries), I have been able to calculate the Hilbert-Schmidt probabilities that members of the sets have positive partial transposes (the PPT property).

+ +

The first set is composed of the two-retrit $X$-states--having non-zero diagonal and anti-diagonal entries, and all others zero. For this set, the Hilbert-Schmidt PPT-probability is $\frac{16}{3 \pi^2} \approx 0.54038$. +(For the rebit-retrit and two-rebit $X$-states [https://arxiv.org/abs/1501.02289 p.3], the [now, separability] probability is--somewhat surprisingly--the very same. For still higher [than two-retrit] dimensional states, the PPT-probabilities of their $X$-states seem not to be presently known--and also not known for the $8 \times 8$ $X$-states.)

+ +

The second (thirteen-dimensional) set is a one-parameter enlargement of the two-retrit $X$-states, in which the (1,2) (and (2,1)) entries are now unrestricted. For this set, the HS PPT-probability increases to $\frac{65}{36 \pi} \approx 0.574726$. (It remains an interesting research question of to what extent, if any, does this probability change if other--than the (1,2) (and (2,1)) entries--are chosen to be similarly unrestricted.)

+ +

So, now is there any manner, by which I can determine to what extent these two sets of (12- and 13-dimensional) PPT-states are bound entangled or separable?

+ +

Also, along similar lines, it would be of interest to try to compute the Hilbert-Schmidt PPT-probability of the eight-dimensional ""magic simplex $\mathcal{W}$ presented in sec. IV of the paper ""The geometry of bipartite qutrits including bound entanglement"" https://arxiv.org/abs/0705.1403 . +However, at this point, I have not yet been able to fully implement in Mathematica, the steps required.

+",3089,,55,,9/30/2021 9:46,9/30/2021 9:46,What proportions of certain sets of PPT-two-retrit states are bound entangled or separable?,,0,0,,,,CC BY-SA 4.0 +5899,1,5900,,4/12/2019 13:16,,3,440,"

I was reading a research article on quantum computing and didn't understand the tensor notations for the unitary operations. The article defined two controlled gates.

+ +

Let $U_{2^m}$ be a $2^m \times 2^m$ unitary matrix, $I_{2^m}$ be a $2^m \times 2^m$ identity matrix. Then, controlled gates $C_n^j(U_{2^m})$ and $V_n^j(U_{2^m})$ with $n$ control qubits and $m$ target qubits are defined by $$ C_n^j(U_{2^m})=(|j\rangle \langle j|) \otimes U_{2^m}+ \sum_{i=0,i \neq j}^{2^n-1}((|i\rangle \langle i| \ \otimes I_{2^m}$$

+ +

$$ V_n^j(U_{2^m}) = U_{2^m} \otimes (|j\rangle \langle j|) + \sum_{i=0,i \neq j}^{2^n-1}( I_{2^m} \otimes (|i\rangle \langle i| ))$$ + Then they say that $C_2^j(X)$ and $V_2^j(X) $are toffoli gates. +Can someone explain the equations that are given +and how does this special case be a Toffoli?

+",6070,,26,,4/12/2019 18:30,4/12/2019 18:30,Quantum Toffoli gate equation,,1,0,,,,CC BY-SA 4.0 +5900,2,,5899,4/12/2019 14:53,,4,,"

Here $i$ and $j$ are bit strings of size $n$. Correspondingly, $|i\rangle$, $|j\rangle$ are some basis vectors in $2^n$-dimensional space, that corresponds to $n$-qubit register.

+ +

Those controlled operations $C$ and $V$ act on $(n+m)$-qubit space. You can consider first $n$ qubits as control register and last $m$ qubits as target register. Now, $C_n^j(U_{2^m})$ applies unitary operation $U_{2^m}$ on the target register if control register is in the state $|j\rangle$ and applies $I_{2^m}$ (i.e. do nothing) otherwise. You can see this by applying $C_n^j(U_{2^m})$ on some vector $|x\rangle|y\rangle$ from the $(n+m)$-qubit space, where $x$ is some $n$-bit string:

+ +

$$ +C_n^j(U_{2^m}) |x\rangle|y\rangle = (|j\rangle \langle j|x\rangle) \otimes U_{2^m} |y\rangle+ \sum_{i=0,i \neq j}^{2^n-1}((|i\rangle \langle i| x \rangle) \otimes |y\rangle) +$$

+ +

Here $|i\rangle \langle i|x\rangle = 0$ if $x\neq i$ and it equals $|i\rangle$ if $x=i$. +Hence +$$C_n^j(U_{2^m}) |x\rangle|y\rangle = |j\rangle \otimes U_{2^m} |y\rangle + 0 = |x\rangle \otimes U_{2^m} |y\rangle ~~\text{if}~~ x=j$$ +and +$$C_n^j(U_{2^m}) |x\rangle|y\rangle = 0 + |x\rangle|y\rangle = |x\rangle|y\rangle ~~\text{if}~~ x\neq j.$$

+ +

Gate $V_n^j(U_{2^m})$ is basically the same as $C_n^j(U_{2^m})$, though we consider first $m$ qubits as target and last $n$ qubits as control register in this case.

+ +

Now, if $j=11$ then $C_2^j(X)$ is exactly CCNOT gate on 3 qubits. Because we apply $X$ (i.e. negating the value) on the last qubit only if two first qubits are in $|11\rangle$ state.

+",5870,,5870,,4/12/2019 15:08,4/12/2019 15:08,,,,10,,,,CC BY-SA 4.0 +5901,1,5902,,4/12/2019 15:03,,1,486,"

How do you create a random initial state by modifying the $2^{n}$ vector amplitudes instead of starting every simulation at $|0000...000\rangle$?

+",362,,26,,4/12/2019 18:21,4/12/2019 18:21,How do you start a simulation with a random initial state in Cirq?,,1,0,,,,CC BY-SA 4.0 +5902,2,,5901,4/12/2019 15:50,,2,,"

If you want a random computational basis state, set the input state to the integer random.randint(0, 2**qubits-1).

+ +

If you want a random superposition sampled from the Haar measure, there is a method cirq.testing.random_superposition(dim=2**qubits).

+ +

Once you have created your initial state, you pass it into the simulator like cirq.Simulator().simulate(circuit, initial_state=...). Note that run methods do not support an initial state, because they are supposed to more closely mimic the hardware.

+",119,,119,,4/12/2019 18:19,4/12/2019 18:19,,,,0,,,,CC BY-SA 4.0 +5903,2,,1918,4/12/2019 21:13,,4,,"

To follow up on esduran's answer, another great source is the Quantum Open Source Foundation, run the authors of the same paper. It contains a constantly updated list of all open source projects in quantum computation, which ones are active, good learning resources and community channels, as well as evaluations of the bigger software packages.

+",371,,,,,4/12/2019 21:13,,,,0,,,,CC BY-SA 4.0 +5904,1,9911,,4/13/2019 10:22,,2,450,"

I have been trying to get the runtime of my experiment on IBM's quantum computer. I am using the classic stuff, i.e

+ +
job = execute(qwalk_circuit, backend='ibmq_16_melbourne', shots=1000)
+results = job.result()
+results.get_counts()
+print(results.data())
+
+ +

I saw on another post that you could see the runtime by using results.get_data(), but that doesnt work anymore, giving me an error that the get_data() attribute does not exist. Is there another way to pull the runtime of my experiment from IBM's quantum computer backend?

+ +

My imports, in case I am missing something there:

+ +
# importing QISKit
+from qiskit import Aer, IBMQ
+from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister, execute
+from qiskit import IBMQ, BasicAer
+from qiskit.providers.ibmq import least_busy
+from qiskit.tools.monitor import job_monitor
+
+",6244,,26,,4/13/2019 10:23,2/19/2020 15:37,Experiment runtime on IBMQ,,2,0,0,,,CC BY-SA 4.0 +5905,1,5906,,4/13/2019 13:52,,5,203,"

I'm trying to solve the following problem related to the mathematical explanation of Grover's algorithm. +Let +$$ +\lvert\psi\rangle = \dfrac{1}{\sqrt{N}} \sum_{x=0}^{N-1}{\lvert x \rangle} \,\text{,} +$$ +then prove that the operator $HU_{0^{\perp}}H$ can be expressed as $\left( 2\lvert\psi\rangle\langle\psi\rvert-I \right)$, where the operator $U_{0^\perp}$ is defined as +$$ +U_{0^\perp}:\lvert x\rangle\mapsto-\lvert x\rangle \quad \forall\lvert x\rangle \ne \lvert 00...0 \rangle +$$

+ +

However, I'm not able to see which steps should I follow. This problem is from the book An Introduction to Quantum Computing by Phillip Kaye, but it does not give any hint to solve it. I hope anyone can at least tell me where should I begin to get the answer.

+",6245,,55,,4/14/2019 16:56,4/14/2019 16:56,Prove that the operator $H U_{0^\perp}H$ can be expressed as $2|\psi\rangle\langle\psi|-I$,,1,2,,,,CC BY-SA 4.0 +5906,2,,5905,4/13/2019 15:07,,4,,"

You can start by checking the action of the operator $2|0\rangle\langle0|-I$ on your quantum state $|x\rangle$.

+ +
    +
  1. If $|x\rangle = |0\rangle$, then $(2|0\rangle\langle0|-I)|0\rangle = |0\rangle$.

  2. +
  3. If $|x\rangle \neq |0\rangle$, then $(2|0\rangle\langle0|-I)|x\rangle = -|x\rangle$

  4. +
+ +

Thus, you can see that the operator $2|0\rangle\langle0|-I$ shifts the phase of $|x\rangle$ if $|x\rangle \neq |0\rangle$.

+ +

After that, you do the expression $H^{\otimes n}(2|0\rangle\langle0|-I)H^{\otimes n}$ by applying the mathematical expression from right to left (i.e first you apply $(2|0\rangle\langle0|-I)$ to $H^{\otimes n}$ and then $H^{\otimes n}$ to the result of that). That should give you the operator $2|\psi\rangle\langle\psi|-I$. Mathematically this goes as following:

+ +

\begin{equation} +\begin{aligned} +D &= H^{\otimes n}(2|0\rangle\langle0|-I)H^{\otimes n} \\ +&= 2 (H^{\otimes n}|0^{\otimes n}\rangle)(\langle0^{\otimes n}|H^{\otimes n}) -H^{\otimes n}IH^{\otimes n} \\ +&= 2 (H^{\otimes n}|0^{\otimes n}\rangle)(H^{\otimes n}|0^{\otimes n}\rangle)^{\dagger} - H^{\otimes n}H^{\otimes n} \\ +&= 2|\psi\rangle\langle\psi|-I +\end{aligned} +\end{equation}

+ +

if you notice that $HH=I$ and $|\psi\rangle = H^{\otimes n}|0^{\otimes n}\rangle = \frac{1}{\sqrt{N}}\sum_{x=0}^{N-1} |x\rangle$.

+ +

This operator $D$ is called the diffusion operator and is essentially the operator that, when applied to your oracle $O$ gives you Grover's operator $G$.

+ +

Hope this helps.

+",6244,,,,,4/13/2019 15:07,,,,0,,,,CC BY-SA 4.0 +5907,1,5908,,4/13/2019 16:17,,5,442,"

In the literature before me, the quantum oracle of the Grover algorithm is shown as a function, in which a sign change is made possible $|x\rangle\rightarrow(-1)^{f(x)}|x\rangle$. I have read that it is possible to transform any efficient classical circuit into a quantum circuit.

+ +

My question, if I want to crack the DES encryption, is it possible to implement the DES algorithm as a circuit that acts as an oracle then? That's just a consideration. Is that conceivable? Could I find the key you are looking for? Is there perhaps some paper about it?

+ +

I would be very interested in what you think about it!

+",,user4961,26,,4/18/2019 19:45,4/18/2019 19:45,Grover's algorithm – DES circuit as oracle?,,1,0,,,,CC BY-SA 4.0 +5908,2,,5907,4/13/2019 20:46,,5,,"

In principle it is possible to generate code for oracles such as the DES encryption (under fixed plaintext/ciphertext pairs, so that the search space becomes the set of all possible encryption keys). One (simple) way to do so is to apply the Bennett method to a classical, irreversible circuit and then to count the gates manually. There are better ways known that do not create as much memory overhead as Bennett's method. As far as programmatic support for this is concerned, there are several attempts for various ciphers and hash-functions to perform this cost analysis with the help of a computer:

+ +
    +
  1. AES was analyzed (using C/C++ programs for resource counting and well known circuits for the underlying finite field arithmetic) in ""Applying Grover's algorithm to AES: quantum resource estimates"" by Grassl et al. Link to paper: https://arxiv.org/abs/1512.04965  
  2. +
  3. MD5 and SHA-2 were analyzed (using prototypes such as REVS) in ""Reversible circuit compilation with space constraints"" by Parent et al. Note that technically not the entire encryption was implemented, but just one round function. In particular, no key scheduler. Link to paper: https://arxiv.org/abs/1510.00377
  4. +
  5. SHA-2 and SHA-3 were analyzed (again using prototypes such as ReVer) in ""Estimating the cost of generic quantum pre-image attacks on SHA-2 and SHA-3"" by Amy et al. Again, again not the entire encryption. Link to paper: https://arxiv.org/abs/1603.09383
  6. +
+ +

A general programmatic framework to express general oracles, synthesize them into quantum circuits (while keeping quantum memory bounded), and perform cost analyses does not exist to the best of my knowledge.

+ +

Finally, note that applying Grover to breaking ciphers and hash-functions does not lead to practical attacks on these schemes, at least not for real-world parameters choices (such as AES-128 or even DES-56). The reason is that despite the quadratic speedup that you get from Grover's algorithm, the problem to find the encryption key is still exponential. Furthermore, the requirement to implement the oracle reversible typically leads to large overheads in terms of qubits and gates, so the quadratic speedup is even less pronounced than one might expect (see e.g. the mentioned AES-128 case above where the gate count is not $2^{64}$ as one might expect from the square root speedup over a naïve solution, but worked out to be about $2^{86}$ in the first paper above).

+ +

In other words, the whole point of applying Grover's algorithm (and other known quantum algorithm such as claw-finding etc.) to classical cryptographic schemes is not so much to carry out said attacks, but instead is assess their security parameters against quantum attacks.

+",1828,,1828,,4/13/2019 23:57,4/13/2019 23:57,,,,5,,,,CC BY-SA 4.0 +5911,1,5912,,4/14/2019 20:26,,3,820,"

In my lecture notes on quantum information processing my lecturer gives an example of composite systems as $|\phi\rangle=|0\rangle |0\rangle=|00\rangle$. I understand that if we have two qubits then its product state will be in 2n dimensional Hilbert space and I understand the 2 qubit state $|00\rangle$ to be represented in matrix representation as $\begin{pmatrix} 1 & 1 \\ 0 & 0 \end{pmatrix}$ (if that is wrong please do correct my misunderstanding though). My question is about the notation $|0\rangle|0\rangle=|00\rangle$, how can we calculate this with matrices on the left-hand side we have a 2 by 1 matrix multiplied by a 2 by 1 matrix which cannot be calculated. I thought perhaps it was a matter of direct products but my calculation led to an incorrect result there too.

+ +

Could anyone clarify this for me, please?

+ +

Edit: It occurred to me that I think I'm mistaken about the matrix representation of $|00\rangle$, I think it would make more sense to be $\begin{pmatrix} 1 \\ 0\\0\\0 \end{pmatrix}$ in which case the direct product does work and I should take the notation $|0\rangle|0\rangle$ to be a shorthand for the direct product not the multiplication of two matrices, is that correct?

+",6254,,26,,4/14/2019 21:50,4/14/2019 21:50,Notation for two qubit composite product state,,1,0,,,,CC BY-SA 4.0 +5912,2,,5911,4/14/2019 21:14,,3,,"

$|0\rangle|0\rangle$ is actually a shorthand for $|0\rangle \otimes |0\rangle$ or $\begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \begin{bmatrix} 1 \\ 0\end{bmatrix} $ where $\otimes$ stands for the tensor product or essentially the Kronecker product. To quote Wikipedia:

+ +
+

In mathematics, the Kronecker product, denoted by $\otimes$, is an operation + on two matrices of arbitrary size resulting in a block matrix. It is a + generalization of the outer product (which is denoted by the same + symbol) from vectors to matrices, and gives the matrix of the tensor + product with respect to a standard choice of basis. The Kronecker + product should not be confused with the usual matrix multiplication, + which is an entirely different operation.

+
+ +

Now the standard choice of basis for a two-qubit system is:

+ +

$\{|00\rangle = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}, |01\rangle = \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}, |10\rangle = \begin{bmatrix} 0 \\ 0 \\ 1 \\ 0 \end{bmatrix}, |11\rangle = \begin{bmatrix} 0 \\ 0 \\ 0 \\ 1 \end{bmatrix}\}$

+ +

If you wish, you can also represent the basis as (if you strictly take $\otimes$ as the outer product):

+ +

$\{|00\rangle = \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}, |01\rangle = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix}, |10\rangle = \begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix}, |11\rangle = \begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix}\}$

+ +

but then while carrying out calculations like determining the action of a quantum gate on a composite state you'd have to write the state using the vector representation (carefully read the linked Mathematics SE answer).

+ +

The key point here is that don't be bent on thinking of these linear algebraic operations in terms of matrices, but rather think in terms of linear maps. You'll get more comfortable with these things once you learn about tensors!

+ +

P.S: Kronecker product and outer product confusion

+",26,,26,,4/14/2019 21:27,4/14/2019 21:27,,,,0,,,,CC BY-SA 4.0 +5913,1,5914,,4/14/2019 23:22,,5,317,"

In the context of quantum teleportation, my lecturer writes the following (note that I assume the reader is familiar with the circuit):

+ +

If the measurement of the first qubit is 0 and the measurement of the second qubit is 0 , then we have the state $\left|\phi_4\right>=c_0\left|000\right>+c_1\left|001\right>=\left|00\right>\otimes \left(c_0\left|0\right>+c_1\left|1\right>\right)=\left|00\right> \otimes \left|\psi '\right>$.

+ +

Now to get the final teleported state we have to go through the final two gates $Z, X$.

+ +

My lecturer writes this as;

+ +

$\left|\gamma\right>=Z^0X^0\left|\psi '\right>= \left|\psi'\right>= c_0\left|0\right>+c_1\left|1\right>$

+ +

Here are my questions:

+ +
    +
  1. Why is it that the we do not have $\left|\gamma\right>=Z^0X^0\left(\left|00\right>\otimes \left|\psi '\right>\right)$? I don't understand why we cut the state $\left|\phi_4\right>$ ""in half "", to use bad terminology, at this step.

  2. +
  3. What does the superscript 0 on the operators refer to?

  4. +
  5. In the final state again to use bad terminology we only use half of the state $\left|\phi_4\right>$ can we always assume that the final state will be the $\left|\psi'\right>$ part of $\left|\phi_4\right>=\left|xy\right>\otimes\left|\psi'\right>$ state, and if so what is the significance of the final step.

  6. +
+ +

If my question is unanswerable due to a deep misunderstanding of the math processes here, I'd still really appreciate some clarification on whatever points can be answered and I can edit it to make more sense as I learn.

+",6254,,55,,9/30/2021 9:45,9/30/2021 9:45,Understanding this description of teleportation,,1,0,,,,CC BY-SA 4.0 +5914,2,,5913,4/15/2019 5:24,,6,,"
    +
  1. The first two qubits stay on the sender's side, and since they are not entangled with the receiver's qubit, it's not necessary to mention them any further — we switched to discussing the receiver's side of the protocol, and all information from the first two qubits is now in measurement results.

  2. +
  3. The superscripts denote the power of the operator applied: if both measurement results are 0, you don't need to apply X or Z corrections, which is the same as applying these operators raised to power 0 ($X^0 = Z^0 = I$).

  4. +
  5. After measuring the first two qubits, the state will always be represented as $|xy\rangle \otimes |\text{some state}\rangle$, but to convert the receiver's qubit from $|\text{some state}\rangle$ to the state that needed to be teleported $|\psi'\rangle$ you'll need to apply corrections which depend on the measurement results $x$ and $y$. I believe this is what you refer to as the final step, and its goal is fixing the amplitudes of the state for it to match the state that was teleported.

  6. +
+",2879,,2879,,4/15/2019 6:04,4/15/2019 6:04,,,,1,,,,CC BY-SA 4.0 +5915,1,,,4/15/2019 7:13,,1,514,"

This is just a basic question. I need to output odd integers till $15$, i.e $1,3,5,7,9,11,13,15$. Since $15$ requires $4$ bits, I prepare initial state by using Hadamard gate on initial $|0\rangle$, i.e $$H|0\rangle \otimes H|0\rangle \otimes H|0\rangle$$ $$=|000\rangle+|001\rangle+|010\rangle+|011\rangle+|100\rangle+|101\rangle+|110\rangle+|111\rangle.$$ Then take the tensor product with $|1\rangle$, i.e $$(H|0\rangle \otimes H|0\rangle \otimes H|0\rangle)|1\rangle$$ $$=|0001\rangle+|0011\rangle+|0101\rangle+|0111\rangle+|1001\rangle+|1011\rangle+|1101\rangle+|1111\rangle.$$ Is this right? +Actually, I know the ideas but don't know how to write it in the quantum computing terms, that involves using terms as registers, qubits

+",6070,,26,,4/15/2019 10:57,4/15/2019 10:57,Preparing odd integers using quantum computation,,1,0,,,,CC BY-SA 4.0 +5916,2,,5915,4/15/2019 7:18,,4,,"

It depends what you mean by ""output odd integers till 15"". If you actually mean ""prepare a uniform superposition of all odd, positive integers up to and including 15"", then yes, you are essentially correct. The only thing to say is that your initial preparation using Hadamards is only over 3 qubits, not 4 (you've got 4 qubits on the left-hand side and 3 on the right-hand side). Similarly for your second equation, you've got 5 qubits on the left-hand side and 4 on the right. You would also be safer to include the normalisation factor.

+",1837,,,,,4/15/2019 7:18,,,,2,,,,CC BY-SA 4.0 +5917,2,,5676,4/15/2019 10:20,,3,,"

Seems like you are interested in the theory of applying results from classical linear coding theory to quantum information theory. When you want to understand how to generalize the Hamming code to a quantum code - the so-called Steane code - you should definitely get familiar to the ""stabilizer formalism"" introduced by Daniel Gottesman in his Ph.D. thesis which you can find here.

+ +

An easier to read and understand book about this topic is ""Quantum Computation and Quantum Information"" by Michael Nielsen and Isaac Chuang. In particular, in chapter 10 they explain how to construct the Steane code from the Hamming code. I highly recommend this book when you are only getting started with this topic.

+",6263,,26,,4/15/2019 10:29,4/15/2019 10:29,,,,0,,,,CC BY-SA 4.0 +5918,1,,,4/15/2019 10:37,,3,213,"

Note: Cross-posted on Theoretical Computer Science Stack Exchange.

+ +
+ +

I am an undergraduate, reading about quantum information and quantum technology. For about some time, I have been interested in the applications of quantum walks to quantum algorithms. What can be some bachelor thesis ideas in quantum random walks? Can anybody suggest a starting point?

+",6207,,26,,4/15/2019 10:44,8/8/2019 21:16,What can be some bachelor thesis ideas in quantum random walks?,,0,5,,8/10/2019 11:01,,CC BY-SA 4.0 +5919,1,,,4/15/2019 11:21,,3,947,"

I have a matrix equation $X_{\text{new}}=AX_{\text{old}}$, where $A=\begin{bmatrix}1 & 1 & 1\\ +2 & 3 &2\\ +3&4&4 +\end{bmatrix}\bmod 64$, and $X_{\text{old, new}}\in \{1,2,...64\}$. Now I need to do these calculations in quantum sense, using gates.

+ +

What I see is that to get $X_{\text{new}}(1)=(X_{\text{old}}(1)+X_{\text{old}}(2)+X_{\text{old}}(3))\bmod 2^{6}$.

+ +

Since each $X_{\text{old}}(i)\in \{1,2,...64\}$, to add these three components, I need 6 full adders and to do the mod $2^6$ operation I need to just keep the 6 least significant bits of the sum. Is my approach correct?

+",6070,,26,,4/15/2019 11:30,4/15/2019 15:58,Quantum addition and modulo operation using gates,,1,2,,,,CC BY-SA 4.0 +5920,2,,5904,4/15/2019 13:19,,3,,"

results.get_data() was replaced by results.data(). The new function returns (almost) the same information, but the runtime attribute was removed. As far as I know, there is no official way to get the runtime of your job on the computer.

+ +

There are some ways to get it through your own code, but keep in mind these are not official methods of doing so, and the times might not be very accurate. One way would be to call time.time() right when you send your job, and compare it to a time.time() call right when your job completes. However, this would include any time the job spent waiting in queue. You could also try calling the first time.time() call when the job.status() is in a running state, and then call another time.time() once the job completes. This should, in theory, bypass any time the job spends in queue.

+ +

However, the feature may be brought back in the future, so I would keep an eye on future release notes as well.

+",6180,,,,,4/15/2019 13:19,,,,2,,,,CC BY-SA 4.0 +5921,1,5922,,4/15/2019 13:33,,4,148,"

In ""Another subexponential-time quantum algorithm for the dihedral hidden subgroup problem"", Kuperberg writes that $\mathbb{C}[G]$ has a ""Burnside decomposition"" of

+ +

$$\mathbb{C}[G]\cong \bigoplus_{V} V^*\otimes V$$

+ +

where each $V$ is an irreducible representation.

+ +

He defines $\mathbb{C}[G]$ as a Hilbert space with an orthonormal basis identified by $G$, a finite group. So $\mathbb{C}[G]$ is the span of $\{\vert g\rangle :g\in G\}$ for orthonormal vectors $\vert g\rangle$.

+ +

This means $\mathbb{C}[G]$ works naturally as the representation space of either the left-regular or right-regular representation of $G$. Thus, it makes sense to me that, letting $V_i$ be the representation spaces of different representations, we would have

+ +

$$\mathbb{C}[G]=\bigoplus_{i} V_i.$$

+ +

But I don't see why the tensor product appears. Even if we consider $B(\mathbb{C}[G])$, the set of operators on $\mathbb{C}[G]$, to get the density matrices on this Hilbert space, we would end up with vectors of the form $v_j\otimes v_i$, where $v_j\in V_j$ and $v_i\in V_i$ for $i\neq j$.

+ +

Alternatively, he may be identifying $\mathbb{C}[G]$ with the left- or right-regular representation itself, and then decomposing it into the representations, not the representation spaces. But this doesn't make sense to me either; $V$ is finite-dimensional, so $V^*\otimes V\cong M_n$ for some $n$, so this decomposition would imply that every irreducible representation of $G$ is isomorphic to $M_n$ for some $n$, which I don't think is true.

+ +

So what is this decomposition?

+",4517,,23,,10/28/2019 9:00,10/28/2019 18:41,Burnside Decomposition in Kuperberg's Hidden Shift,,2,0,,,,CC BY-SA 4.0 +5922,2,,5921,4/15/2019 14:16,,4,,"

The second part of each tensor product serves as a multiplicity space. It might be more satisfying to write it as a full decomposition like your second one.

+ +

So you have $\bigoplus V_\lambda \otimes V_\lambda^*$ and you want it to look more like your second equation.

+ +

What would happen is each $V_\lambda$ would show up as a direct summand $d_\lambda$ times where $d_\lambda$ is the dimension of $V_\lambda^*$.

+ +

The tensor product there is as vector spaces with one of the factors being a bookkeeping device to say how many times that irreducible is a summand. It is not tensoring as representations that have to be broken down by further C-G coefficients.

+ +

More detail possible, but for a first pass just leave it at that. Don't take it beyond just conveniently keeping track of multiplicities.

+ +

Maschke's theorem

+",434,,,,,4/15/2019 14:16,,,,2,,,,CC BY-SA 4.0 +5923,2,,5919,4/15/2019 15:58,,5,,"

The main criteria that you need, in order to multiply by a matrix on a quantum computer (in the sense of permuting the states, not in the sense of adjusting the amplitudes) is for the matrix to have an inverse. You can find this inverse by performing Guassian elimination. Performing the Guassian elimination spits out exactly the operations you will need to perform, in reverse.

+ +

Let's do the Guassian elimination of $M$:

+ +
# 111
+# 232
+# 344
+
+r2 -= 2*r1
+r3 -= 3*r1
+# 111
+# 010
+# 011
+
+r1 -= r2
+r3 -= r2
+# 101
+# 010
+# 001
+
+r1 -= r3
+# 100
+# 010
+# 001
+
+ +

We managed to reach the identity matrix. Note that we didn't need to compute any multiplicative inverses in order to make the rows cancel properly or to make elements along the diagonal equal to 1, which is good because it means we can multiply by this matrix modulo any $n$. That won't always be the case.

+ +

If you run these operations backwards (reverse order and += instead of -=), you will turn the identity matrix into $M$. Run them backwards against a vector, and you are multiplying by $M$.

+ +

For example, here is a circuit which multiplies by $M$, working modulo 8:

+ +

+ +

The first column is preparing an input state to test it, the second column is green state displays showing the prepared value is [1, 2, 3], the final column is green state displays showing the output (modulo 8) is [6, 6, 7]. All the stuff in between is the reversed Gaussian elimination operations.

+",119,,,,,4/15/2019 15:58,,,,9,,,,CC BY-SA 4.0 +5925,1,5926,,4/17/2019 8:31,,5,550,"

I have a question about the implementation of the controlled unitary $e^{iAt}$, from the paper Demonstration of a Quantum Circuit Design Methodology for Multiple Regression, using the Qiskit framework.

+ +

In this paper, a $4\times 4$ Hermitian matrix $A$ is transformed into $4\times 4$ unitary and then decomposed by applying the GLOA algorithm. +I'm not interested in this particular example but rather in general implementation of the arbitrary unitary by using Qiskit. However, it is convenient to use this case as an example. In this paper, we have a series of controlled $4\times4$ unitary operators implemented according to the phase estimation algorithm. Since the resulting circuit is given in the paper, I have successfully implemented the unitary but I have a difficult time to apply the controlled action of the given unitary in Qiskit framework.

+ +

In other words, how can I implement a controlled unitary for some arbitrary $A$? Should I use a given circuit from the paper and apply control to each gate in the circuit or there is another way?

+",5730,,26,,4/17/2019 14:42,4/17/2019 14:42,Controlled unitary from the HHL algorithm – practical implementation using Qiskit,,1,1,,,,CC BY-SA 4.0 +5926,2,,5925,4/17/2019 8:46,,4,,"

Disclaimer: I'm the one that wrote the code of the 4x4 HHL.

+ +
+ +

Controlling a quantum gate $U$ can be achieved by controlling each of the $U_i$ gates that are composing $U$.

+ +

For the specific example you are considering, the implementation is available online. Some remarks about the code:

+ +
    +
  1. I think the code is not up to date with the last version of Qiskit. I did not re-tested recently. The code should be compatible with Qiskit 0.6.1 as written in the requirements.txt file.
  2. +
  3. The implementation of the controlled unitary is available here.
  4. +
  5. The controls are not really explicit, but you can see that each gate used in the implementation of the unitary is controlled by the same qubit.
  6. +
  7. Everything in the above implementation has been hand-tuned. You will probably not be able to understand the generic algorithms to control an arbitrary gate with the code.
  8. +
+ +

In the general case, controlling an arbitrary gate may be programmatically quite hard. For example, in order to control a $Z$ gate (and so to perform a controlled-$Z$), you will probably end up decomposing the controlled-$Z$ gate as 2 $H$ gates around a controlled-$X$. Another example is how do you implement a multi-controlled-$X$ gate. There are known algorithms, but they should be implemented beforehand.

+ +

End note: if you want to discuss about the implementation, feel free to contact me at the mail address at the end of the README.

+",1386,,,,,4/17/2019 8:46,,,,2,,,,CC BY-SA 4.0 +5927,1,,,4/17/2019 8:53,,0,73,"

I have the following matrix

+ +

\begin{bmatrix} +1 & 0 & 0 & 0\\ +0 & \frac{1}{\sqrt{2}} & \frac{-i}{\sqrt{2}} & 0\\ +0 & \frac{-i}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0\\ +0 & 0 & 0 & 1\\ +\end{bmatrix} +I want to understand the operation by this matrix in terms of the familiar quantum logic gates. More precisely, how can one write the above matrix in terms of the quantum logic gates?

+",5806,,55,,7/26/2020 18:12,7/26/2020 18:12,Identifying a matrix with the fundamental quantum logic gates,,1,5,,5/9/2019 17:45,,CC BY-SA 4.0 +5928,1,5932,,4/17/2019 9:13,,3,136,"

I'm working on some papers (here and here) that use the Grover algorithm to crack krypto systems like AES and SHA.

+ +

I had already asked a first question here. Now, however, a new question has arisen for me.

+ +

So to my knowledge, AES uses a key and a clear text and generates a cipher from this. If AES is reversibly implemented in the paper, then one could read the plaintext and the key, because the circuit is reversible. Does it make sense? How do you prevent that? Reversible means that I can make the input from an output. In this context, that means that I could read the key directly. Why then use the Grover algorithm at all?

+ +

For example in the paper here pages 3-4 it is said:

+ +
+

Let $f : \{0, 1\}^k → \{0, 1\}^k$ be an efficiently function. For a fixed $y ∈ \{0, 1\}^k$, the value $x$ such that $f(x) = y$ is called a pre-image of $y$. In the worst case, the only way to compute a pre-image of $y$ is to systematically search the space of all inputs to f. A function that must be searched in this way is known as a one-way function. The Grover iteration has two subroutines. The first, $U_g$, implements the predicate $g : \{0, 1\}^k \rightarrow \{0, 1\}$ that + maps $x$ to $1$ if and only if $f(x) = y$. Each call to $U_g$ involves two calls to a reversible implementation of $f$ and one call to a comparison circuit that checks whether $f(x) = y$.

+
+ +

Then the hash function is a sub-call of the oracle. Which means that the hash function must be reversible. But if the has-function is reversible, I can directly read the plaintext, because I have the cryptotext (the hash). Do I understand something wrong here? Why do you need the Grover algorithm at all?

+ +

I also have to ask the question, why in the first paper $AES$ and $AES^{-1}$ are executed once and in the second paper $f$ and $f^{-1}$ in the oracle part? Why is not just $AES$ and only $f$ executed as a call?

+",,user4961,,user4961,4/17/2019 10:25,4/17/2019 12:42,Reversible crypto systems for use in the Grover's algorithm,,1,0,,,,CC BY-SA 4.0 +5929,1,5931,,4/17/2019 9:39,,4,584,"

Assuming we have two sets of $n$ qubits. The first set of $n$ qubits is in state $|a\rangle$ and second set in $|b\rangle$. Is there a fixed procedure that generates a superposed state of the two $|a\rangle + |b\rangle$ ?

+",6109,,26,,4/17/2019 14:27,4/17/2019 14:27,How to superpose two composite qubit states?,,2,0,,,,CC BY-SA 4.0 +5930,2,,5927,4/17/2019 10:51,,3,,"

This gate, which I'll denote as $U$ is essentially the square root of not gate, whose decomposition has already been discussed elsewhere. Hence, we only need the conversion:

+ +

Specifically, if we perform the corresponding matrix multiplications, we have +$$ +\left( +\begin{array}{cccc} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & i \\ +\end{array} +\right)\cdot\left(\left( +\begin{array}{cc} + 1 & 0 \\ + 0 & e^{-\frac{i \pi }{4}} \\ +\end{array} +\right)\otimes \left( +\begin{array}{cc} + 1 & 0 \\ + 0 & e^{-\frac{i \pi }{4}} \\ +\end{array} +\right)\right)\cdot\left( +\begin{array}{cccc} + 1 & 0 & 0 & 0 \\ + 0 & \frac{e^{\frac{i \pi }{4}}}{\sqrt{2}} & \frac{e^{-\frac{i \pi }{4}}}{\sqrt{2}} & 0 \\ + 0 & \frac{e^{-\frac{i \pi }{4}}}{\sqrt{2}} & \frac{e^{\frac{i \pi }{4}}}{\sqrt{2}} & 0 \\ + 0 & 0 & 0 & 1 \\ +\end{array} +\right)=\\ +\left( +\begin{array}{cccc} + 1 & 0 & 0 & 0 \\ + 0 & \frac{1}{\sqrt{2}} & -\frac{i}{\sqrt{2}} & 0 \\ + 0 & -\frac{i}{\sqrt{2}} & \frac{1}{\sqrt{2}} & 0 \\ + 0 & 0 & 0 & 1 \\ +\end{array} +\right) +$$ +as required.

+",1837,,1837,,4/17/2019 11:36,4/17/2019 11:36,,,,4,,,,CC BY-SA 4.0 +5931,2,,5929,4/17/2019 10:56,,7,,"

Depending on what precisely your assumptions are about a, b, I think this is essentially impossible, and is something called the ""no superposing theorem"". Please see this paper.

+",1837,,26,,4/17/2019 14:26,4/17/2019 14:26,,,,0,,,,CC BY-SA 4.0 +5932,2,,5928,4/17/2019 12:42,,2,,"

I think there are two meanings of ""reversible"" at work. These may be causing confusion.

+ +
    +
  1. Initially, even in the classical world, when we say that a function $f(x)$ is irreversible without any other qualifications, we mean that, given $y$, it is computationally difficult to find an $x$ such that $y=f(x)$

  2. +
  3. In other contexts, when talking about quantum circuits, when we say that a function $f$ is implemented in reversible gates, we mean that the gates come from our favorite set of universal unitaries, e.g. $\mathsf{CCNOT}$'s, etc.

  4. +
+ +

We believe SHA is irreversible in the first sense; that does not mean it cannot be implemented with reversible gates as in the second sense.

+ +

If we were to use Grover's algorithm to get a polynomial speedup on SHA, then given an output $y_0$, we would find a way to implement the SHA function $f(x)$ with a set of reversible gates to create a unitary $U_f$, prepare a first register $\vert x \rangle$ into a uniform superposition, apply $U_f$ to a second register $\vert y \rangle$ conditioned on the values of the first register, and repeatedly apply the Grover rotations conditioned on the value of the second register $\vert y \rangle$ being $y_0$.

+ +

When we implement $f(x)$, we could also implement it with all of our lossy/irreversible gates $\mathsf{AND}$, $\mathsf{NOR}$, etc., as long as we keep a copy of $x$ in some of the outputs. We apply the Grover rotations to the entire superposition.

+",2927,,,,,4/17/2019 12:42,,,,2,,,,CC BY-SA 4.0 +5934,2,,5929,4/17/2019 14:00,,4,,"

Your question is not quite correctly defined.

+ +

First of all, $|a\rangle + |b\rangle$ is not a state. You need to normalize it by considering $\frac{1}{|||a\rangle + |b\rangle||}(|a\rangle + |b\rangle)$.
+Secondly, in fact, you don't have access to the states $|a\rangle$ and $|b\rangle$ but to the states up to some global phase, i.e. you can think that the first register is in the vector-state $e^{i\phi}|a\rangle$ and the second register is in the vector-state $e^{i\psi}|b\rangle$ with inaccessible $\phi, \psi$. Since you don't have access to $\phi, \psi$, you can't define sum $|a\rangle + |b\rangle$. But you can ask to construct normalized state $|a\rangle + e^{ it}|b\rangle$ for some $t$. This question is correct. Though, as DaftWullie pointed out in his answer, it is impossible to construct such a state.

+",5870,,26,,4/17/2019 14:23,4/17/2019 14:23,,,,2,,,,CC BY-SA 4.0 +5935,1,5940,,4/17/2019 15:16,,5,467,"

This is actually an exercise from Preskill (chapter 4, new version 4.4). So they are asking about the fidelity of teleporting a random pure quantum state from Bob to Alice, who both have one qubit of the following system (""noisy"" entangled state):

+ +

$$\rho = (1 − \lambda)|\psi ^-\rangle \langle \psi ^- | + \frac{1}{4} \lambda I $$

+ +

with $|\psi ^-\rangle$ one of the Bell states. In the notes of Preskill they show you the example of quantum teleportation with a Bell state $|ψ ^-\rangle_{AB}$, by uniting the random qubit with the system (Bell state) and then make Alice do some measurements on the system, from which Bob gets a ""copy"" (or to be correct: the qubit was teleported to Bob) of the random qubit.

+ +

Now in this example, we are presented with the density matrix $\rho$, from which we cannot just get one ""state"". As I can not follow the example of the book (where they manipulate the state $|\psi ^-\rangle$), but now have to deal with the density matrix, I have no idea where to begin. How can we proceed to calculate the fidelity with which Bob will have the correct teleported state if using the given noisy entangled system $\rho$ to teleport the random qubit?

+ +

They also state that a random 'guess' has a 1/2 chance (which refers to the identity part $I$ in the $\rho$ system). I also know the fidelity of a pure Bell state will be 1. But I suppose I can't just say that for the system $\rho$ the fidelity is the sum of the parts?:

+ +

$$F = (1 − λ) + \frac{1}{4} \lambda \times \frac{1}{2}$$

+ +

And if I can, why is this? How can I explicitly calculate this?

+ +

P.S: By the way, if anyone would have solutions to the exercises in the notes of Preskill, a link would be much appreciated.

+",6276,,26,,4/18/2019 19:39,4/18/2019 21:44,"Quantum teleportation with ""noisy"" entangled state",,1,2,,,,CC BY-SA 4.0 +5936,1,,,4/17/2019 19:08,,3,1122,"

Sometimes we find that the result we want from a quantum algorithm is expressed in terms of a basis that is different from the usual computational basis, which I will call

+ +

$$ +B_C = \left\{ \lvert 0 \rangle, \lvert 1 \rangle \right\} = \left\{ \left(\begin{array}{c}1\\0\end{array}\right),\left(\begin{array}{c}0\\1\end{array}\right) \right\}. +$$

+ +

For example, at the end of the Deutsch's algorithm, the first qubits is in the state

+ +

$$ +\lvert\psi\rangle = (-1)^{f(0)} \dfrac{\lvert 0 \rangle + (-1)^{f(0) \oplus f(1)} \lvert 1 \rangle}{\sqrt{2}}, +$$

+ +

which can be expressed in terms of the Hadamard's basis

+ +

$$ +B_H = \{ \lvert + \rangle, \lvert - \rangle \} = \left\{ \dfrac{1}{\sqrt{2}} \left( \begin{array}{c}1\\1\end{array} \right), \dfrac{1}{\sqrt{2}} \left( \begin{array}{c}1\\-1\end{array} \right) \right\} +$$

+ +

$$ +\begin{cases} f(0) \oplus f(1) = 0 \quad\Rightarrow\quad \lvert\psi\rangle = (-1)^{f(0)} \lvert + \rangle \\ f(0) \oplus f(1) = 1 \quad\Rightarrow\quad \lvert\psi\rangle = (-1)^{f(0)} \lvert - \rangle \end{cases} +$$

+ +

Therefore, we can get the value of $f(0) \oplus f(1)$ just by measuring $\lvert\psi\rangle$ on $B_H$. Since we can only perform physical measurements on $B_C$, this can be achieved performing a change of basis.

+ +

Given two basis $A$ and $B$, if the matrix that transforms the elements of $A$ to the elements of $B$ is the matrix $M$, this is also the matrix that maps the coordinates of vectors with respect to $B$ to their coordinates with respect to $A$. Hence, which of these propositions is the correct to express the change of basis we must do to perform the measurement on $B_H$ knowing that physical measurements are actually performed in $B_C$?

+ +
    +
  1. We must apply the Hadamard's gate, because the matrix $H$ maps $\left\{ \lvert 0 \rangle,\lvert 1 \rangle \right\}$ to $\left\{ \lvert + \rangle, \lvert - \rangle \right\}$, and therefore it transforms the components $\lvert\psi\rangle_{B_H}$ to $\lvert\psi\rangle_{B_C}$.

  2. +
  3. We must apply the Hadamard's gate, because the matrix $H$ maps $\left\{ \lvert + \rangle,\lvert - \rangle \right\}$ to $\left\{ \lvert 0 \rangle, \lvert 1 \rangle \right\}$, and therefore it transforms the components $\lvert\psi\rangle_{B_C}$ to $\lvert\psi\rangle_{B_H}$.

  4. +
+",6245,,26,,4/18/2019 19:19,2/19/2022 21:13,Correct way of expressing a measurement in a different computational basis,,2,2,,,,CC BY-SA 4.0 +5937,2,,5936,4/18/2019 10:17,,1,,"

If you want to measure $|\phi\rangle$ in some basis $U|b_1\rangle,...,U|b_n\rangle$ instead of $|b_1\rangle,...,|b_n\rangle$, then you need to rotate the state ""backward"", i.e. measure $U^{-1}|\phi\rangle$ in $|b_1\rangle,...,|b_n\rangle$.
+The simple rule to find the direction of rotation is to consider the state and the required measurement basis together $\{|\phi\rangle, U|b_1\rangle,...,U|b_n\rangle\}$. Then If you what to perform the same measurement in a different basis you need to rotate the whole system altogether.

+",5870,,,,,4/18/2019 10:17,,,,0,,,,CC BY-SA 4.0 +5938,1,5941,,4/18/2019 16:03,,2,339,"
+

c) Compute $$\text{Prob}(\uparrow_\hat{n}\uparrow_\hat{m}) \equiv \text{tr}(\pmb{E}_A(\hat{n})\pmb{E}_B(\hat{n})\pmb{p}(\lambda)), \tag{4.164}$$

+

where $\pmb{E}_A(\hat{n})$ is the projection of Alice's qubit onto $\left|\uparrow_{\hat{n}}\right\rangle$ and $\pmb{E}_B(\hat{m})$ is the projection of Bob's qubit onto $\left|\uparrow_{\hat{m}}\right\rangle$.

+
+

So what they are actually asking is, you have an entangled system of two qubits $\rho$ and we measure the first qubit on some (random) axis n and then the second on some other (random) axis $m$. What is the probability of both spins being "spin-up" on their respective axes? The system in the actual exercise is a bit hard, but to show my problem, let's take an easy example:

+

$$\rho = \left|\uparrow \downarrow \right\rangle _{AB} \left\langle \uparrow \downarrow\right|_{AB}$$

+

Now without actually using the formula, let's assume we measure in the z-direction twice. We will measure for example a spin-up for qubit A, so looking at the system we know that the second qubit should be spin-down, because this density matrix comes from the state $|\psi \rangle_{AB} = \left|\uparrow \downarrow\right\rangle $. Now if we look at the given formula, $E_B(z)$ measures the spin of qubit B, which can be for example -1, then the second operator measures $E_A(z)$, as we said, is +1 in the given state (because A & B have opposite spins). We know that the expectation value of an operator is $\langle E_A E_B \rangle$, which is the same as taking the trace $\text{Tr}(E_A E_B \rho)$, which is the described formula above. We will not explicitly calculate this with the trace formula, because we have the corresponding state here, so we know that the probability is

+

$$\text{Tr}(E_A E_B \rho)= \langle E_A E_B \rangle = \langle \psi | E_A E_B | \psi \rangle = \langle \psi | (+1)(-1) | \psi \rangle = -1$$

+

So we have a "probability" of minus 1. How can this be a probability? In the original example, I have also calculated this and we get an expression in the function of the angle between the two axes, which can also be negative. This seems quite logical for two qubits A and B which are entangled in a way they will almost always have opposite spin direction, for example. So my question is: how can this probability be negative?

+",6276,,55,,9/30/2021 9:45,9/30/2021 9:45,How does the probability of measurement turn out to be negative?,,2,2,,,,CC BY-SA 4.0 +5939,2,,5938,4/18/2019 18:36,,2,,"

$\langle \psi \vert E_A E_B \vert \psi \rangle$ is just the expectation value of the composite operator $E_AE_B$ which, of course, can be negative. This is not the same as the probability of measuring $\left\vert\uparrow \downarrow \right\rangle_{AB}$ which in your case of $\rho = \left\vert\uparrow \downarrow \right\rangle_{AB} \left\langle \uparrow \downarrow \right\vert_{AB}$ is 1.

+ +

The two values are related by:

+ +

$\langle \alpha \rangle = \sum_{i} h_i \phi_i $ where $\langle \alpha \rangle$ is the expectation value of $\alpha$, the $h_i$'s are the eigenvalues of the state in question and the $\phi_i$'s their respective probability amplitudes squared (read probabilities).

+ +

An easy way to remember the difference is with the basic Schrodinger equation

+ +

$$ \hat{H} \vert \psi\rangle = E \vert \psi \rangle$$

+ +

where then the expectation value $\langle \hat{H} \rangle = \langle \psi \vert E \vert \psi \rangle = E$ which is an energy and can be any real number you like, positive or negative. This, again, is not the probability of measuring state $\vert\psi\rangle$.

+",6175,,26,,4/18/2019 19:14,4/18/2019 19:14,,,,2,,,,CC BY-SA 4.0 +5940,2,,5935,4/18/2019 21:44,,3,,"

I'm not sure what was the expected solution, but this also works.

+ +

First of all, note that $$ I = |\phi^+\rangle\langle\phi^+| + |\phi^-\rangle\langle\phi^-| + |\psi^+\rangle\langle\psi^+| + |\psi^-\rangle\langle\psi^-|,$$ +where $|\phi^+\rangle, |\phi^-\rangle, |\psi^+\rangle, |\psi^-\rangle$ are Bell states and $I$ is 4-dimensional identity operator.

+ +

The second observation is that if you apply teleportation scheme (that supposed to correctly work with $|\psi^-\rangle$ entangled state) on the wrong entangled Bell state (for example, Alice and Bob could share $|\phi^+\rangle$ instead of $|\psi^-\rangle$), then you will end up with one of this +$$ +|r_0\rangle = a|0\rangle + b|1\rangle \\ +|r_1\rangle = a|0\rangle - b|1\rangle \\ +|r_2\rangle = a|1\rangle + b|0\rangle \\ +|r_3\rangle = a|1\rangle - b|0\rangle \\ +$$ +where $|r_0\rangle$ is the teleported qubit. I'm sure it can be checked that for 4 possible +Bell states a fixed teleportation scheme will give exactly 4 different results $|r_0\rangle, |r_1\rangle, |r_2\rangle, |r_3\rangle$.

+ +

So, if you will use teleportation scheme (specified to $|\psi^-\rangle$) with the entangled state +$$ \rho = (1 − \lambda)|\psi ^-\rangle \langle \psi ^- | + \frac{1}{4} \lambda I = \\ += (1 − \lambda)|\psi ^-\rangle \langle \psi ^- | + \frac{1}{4} \lambda (|\phi^+\rangle\langle\phi^+| + |\phi^-\rangle\langle\phi^-| + |\psi^+\rangle\langle\psi^+| + |\psi^-\rangle\langle\psi^-|) +$$ +then the result will be +$$ +(1-\lambda)|r_0\rangle\langle r_0| + \frac{1}{4} \lambda (|r_0\rangle\langle r_0| + |r_1\rangle\langle r_1| + |r_2\rangle\langle r_2| + |r_3\rangle\langle r_3|) +$$

+ +

But you can check that +$$ +|r_0\rangle\langle r_0| + |r_1\rangle\langle r_1| + |r_2\rangle\langle r_2| + |r_3\rangle\langle r_3| = 2I +$$ +for any random qubit $|r_0\rangle$.

+ +

So, the final teleported state will be +$$ +f = (1-\lambda)|r_0\rangle\langle r_0| + \frac{1}{4} \lambda \cdot 2I = +(1-\lambda)|r_0\rangle\langle r_0| + \frac{1}{2} \lambda I +$$

+ +

The fidelity between $r = |r_0\rangle\langle r_0|$ and $f$ is +$$ +\left(\text{Tr}\sqrt{\sqrt{r}f\sqrt{r}}\right)^2 = \left(\text{Tr}\sqrt{rfr}\right)^2 = \left(\text{Tr}\sqrt{r((1-\lambda)r + \frac{1}{2} \lambda I)} r \right)^2 = \\ += \left(\text{Tr}\sqrt{(1-\lambda)r^3 + \frac{1}{2} \lambda r^2)} \right)^2 = +\left(\text{Tr}\sqrt{(1-\lambda)r + \frac{1}{2} \lambda r)} \right)^2 = \\ += \left(\text{Tr}\sqrt{\frac{1}{2}(2-\lambda)r} \right)^2 = \frac{1}{2}(2-\lambda) +$$ +Note, that the link you shared contain the answer on the page 45 (but there $\lambda$ is actually $1-\lambda$).

+",5870,,,,,4/18/2019 21:44,,,,2,,,,CC BY-SA 4.0 +5941,2,,5938,4/19/2019 8:19,,2,,"

If $\boldsymbol{E}_A(\hat{n})$ is the projection on $\left|\uparrow_{\hat{n}}\right\rangle$, then +$$ +\boldsymbol{E}_A(\hat{n}) = \left|\uparrow_{\hat{n}}\right\rangle\left\langle \uparrow_{\hat{n}}\right|, +$$ +Similarly, +$$ +\boldsymbol{E}_B(\hat{m}) = \left|\uparrow_{\hat{m}}\right\rangle \left\langle \uparrow_{\hat{m}}\right|. +$$

+ +

The corresponding projection on the composite system $AB$ is the tensor product of projections, that is +$$ +\boldsymbol{E}_{AB}(\hat{n},\hat{m}) = \boldsymbol{E}_A(\hat{n}) \otimes \boldsymbol{E}_B(\hat{m}) = \left|\uparrow_{\hat{n}}\right\rangle \left\langle \uparrow_{\hat{n}}\right| \otimes \left|\uparrow_{\hat{m}}\right\rangle \left\langle \uparrow_{\hat{m}}\right| = +\left|\uparrow_{\hat{n}}\uparrow_{\hat{m}}\right\rangle \left\langle \uparrow_{\hat{n}}\uparrow_{\hat{m}}\right| +. +$$ +Now you can take the usual matrix product of $\boldsymbol{E}_{AB}(\hat{n},\hat{m})$ and $\rho$ because they have the same size 4 x 4.
+The trace of the product of two non-negative (positive semi-definite) hermitian matrices always non-negative. So the answer must be non-negative.

+",5870,,,,,4/19/2019 8:19,,,,3,,,,CC BY-SA 4.0 +5943,1,,,4/19/2019 14:49,,3,76,"

Equation (7) in the 2012 paper, ""Complementarity Reveals Bound Entanglement of Two Twisted Photons"" of B. C. Hiesmayr and W. Löffler for a state $\rho_d$ in the ""magic simplex"" of Bell states +\begin{equation} +\rho_d= \frac{q_4 (1-\delta (d-3)) \sum _{z=2}^{d-2} \left(\sum _{i=0}^{d-1} + P_{i,z}\right)}{d}+\frac{q_2 \sum _{i=1}^{d-1} P_{i,0}}{(d-1) (d+1)}+\frac{q_3 \sum + _{i=0}^{d-1} P_{i,1}}{d}+\frac{\left(-\frac{q_1}{d^2-d-1}-\frac{q_2}{d+1}-(d-3) + q_4-q_3+1\right) \text{IdentityMatrix}\left[d^2\right]}{d^2}+\frac{q_1 + P_{0,0}}{d^2-d-1} +\end{equation} +yields ""for $d=3$ the one-parameter Horodecki-state, the first found bound entangled state"".

+ +

No explicit ranges — in which I am interested — for the four $q$ parameters are given, though. Any thoughts/insights?

+",3089,,55,,9/25/2021 9:41,9/25/2021 9:41,What are the ranges of the four $q$ parameters in the magic simplex of Bell states formula?,,1,1,,,,CC BY-SA 4.0 +5944,2,,5943,4/19/2019 17:59,,2,,"

It looks like the only relation they say is $\text{IdentityMatrix}[3^2]=\sum P_{k,l}$.

+ +

You get a linear combination of $P_{k,l}$. Those are vertices of a $d^2-1$ simplex so the coefficents $c_{k,l}$ are baryocentric coordinates.

+ +

You can then match with the previous more general definition of $\rho_d$ term by term on each of the $c_{k,l}$.

+ +

The inequalities $0 \leq c_{k,l} \leq 1$ turn into $2d^2$ inequalities on the $q_i$.

+ +

It looks like that how the $q_i$ were constructed in the first place.

+",434,,,,,4/19/2019 17:59,,,,4,,,,CC BY-SA 4.0 +5945,1,,,4/19/2019 18:55,,5,512,"

Can someone explain to me how to build a quantum circuit representing the Ising Model? I just want to understand how to represent the Ising Model for the purposes of quantum state label classification.

+",6253,,119,,4/24/2019 2:35,4/24/2019 2:35,How to build a quantum circuit representing the Ising Model?,,0,7,,,,CC BY-SA 4.0 +5946,1,5948,,4/20/2019 14:22,,2,208,"

In the ""Quantum Computation and Quantum Information 10th Anniversary textbook by Nielsen and Chuang"", chapter 5.3.1 introduces the concept of solving the Order-Finding Problem.

+ +

(Eqn 5.36) states the following:

+ +
+

$$U|y\rangle = |xy\text{ mod } N\rangle \text{ whereby } x<N \text{ and } \gcd(x,N)=1$$

+
+ +

(Eqn 5.37) defines the eigenstates of the unitary operator $U$ as:

+ +
+

$$|u_s\rangle = \frac{1}{\sqrt{r}}\sum_{k=0}^{r-1}\exp\left(\frac{-2\pi isk}{r}\right)\left|x^k\text{ mod } N\right\rangle \text{ for integer } 0 \leq s \leq r-1$$

+
+ +

Then when $U$ acts on $|u_s\rangle$, (Eqn 5.38 to 5.39) gives:

+ +
+

$$U|u_s\rangle = \frac{1}{\sqrt{r}} \sum_{k=0}^{r-1}\exp\left(\frac{-2\pi isk}{r}\right) |x^{k+1}\text{ mod } N\rangle = \exp\left(\frac{2\pi is}{r}\right)|u_s\rangle$$

+
+ +

I tried to work out Eqn 5.38 to 5.39 by substituting the index $k$ as dummy index $v=k+1$ which I get:

+ +

$$U|u_s\rangle = \exp\left(\frac{2{\pi}is}{r}\right) \frac{1}{\sqrt{r}}\sum_{v=1}^{r}\exp\left(\frac{-2\pi isv}{r}\right)|x^v\text{ mod }N\rangle$$

+ +

Question

+ +

Why is $\frac{1}{\sqrt{r}}\sum_{v=1}^{r}\exp\left(\frac{-2\pi isv}{r}\right)|x^v\text{ mod }N\rangle = |u_s\rangle$ when the summation limits are different? +$|x^0\text{ mod }N\rangle$ and $|x^r\text{ mod }N\rangle$ are not the same right?

+",5253,,26,,4/21/2019 7:09,4/21/2019 12:13,Eigenstate of unitary operator used for Order-Finding,,1,4,,,,CC BY-SA 4.0 +5948,2,,5946,4/21/2019 10:58,,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$.

+",5253,,26,,4/21/2019 12:13,4/21/2019 12:13,,,,0,,,,CC BY-SA 4.0 +5949,1,,,4/21/2019 19:58,,1,552,"

Let's say I have a vector $\vec{v}=(1,0)$ and a state $|10\rangle$, and a decimal number $3$. I know that I can associate the decimal $3$ with the vector $\vec{v}$, but can I also associate the state $|10\rangle$ with the decimal $3$? Is there some kind of isomorphism between these two, which I don't think there is because the state $|10\rangle$ corresponds to a 4 dimensional vector. Can someone clarify these doubts?

+",6070,,26,,4/22/2019 19:28,4/22/2019 19:28,Associating quantum states with decimal numbers,,1,2,,,,CC BY-SA 4.0 +5950,2,,5949,4/21/2019 23:11,,5,,"

Let's use four bits/qubits for exposition.

+ +

With four bits, you want there to be an isomorphism between the classical vectors $(d,c,b,a)$ (with $d,c,b,a\in \{0,1\}$) and decimal numbers $D$. There is the obvious mapping $D=8d+4c+2b+a$. If you have $(d,c,b,a)=(0,0,1,1)$ then you map to $3$.

+ +

When you have four qubits that you know are in $\vert dcba\rangle$ with $(d,c,b,a)=(0,0,1,1)$ (because, say, you measured them) then it's OK to have that same mapping. The qubits are, in sense, classical bits after measurement.

+ +

It sounds like you're nervous about whether this mapping is still valid even when the system is in a superposition. But why wouldn't it be? After Hadamarding $4$ qubits that are initially $\vert 0000 \rangle$ then you can think of it as a uniform superpositon of $\vert 0000\rangle, \vert 0001\rangle, \cdots, \vert 1111\rangle$ or as a uniform superposition of $0,1,\cdots ,15$ as you see fit.

+ +

EDIT

+ +

Classically, with modern electronic computers, we have an ""isomorphism"" between bits and voltages. For example, we can equate +0V to $0$, and +1.1V to $1$. If we have a plurality of inputs, then we can equate the $n$ input voltages to an $n$-bit binary number.

+ +

Quantum mechanically, we have an ""isomorphism"" between, say, qubits and spin states. For example, we can equate spin down to $\vert 0\rangle$, and spin up to $\vert 1\rangle$. If we have a plurality of spin states, then we can equate a superposition of the $n$ spin states to a superposition of an $n$-bit binary number.

+",2927,,2927,,4/22/2019 12:11,4/22/2019 12:11,,,,1,,,,CC BY-SA 4.0 +5951,1,,,4/22/2019 0:20,,4,90,"

From official D-Wave docs:

+ +
+

The D-Wave 2000Q QPU has up to 2048 qubits and 6016 couplers.

+
+ +

For example, I have the optimization problem defined as the QUBO problem.

+ +

If I want to solve it on D-Wave, does it mean that my problem has to have at most 2048 variables (vertices) and no more than 6016 mutual dot products between variables (edges)?

+",6134,,6134,,4/22/2019 22:16,3/12/2021 23:37,What does it mean to have 2000 qubits and 6016 couplers?,,2,0,,,,CC BY-SA 4.0 +5952,1,5953,,4/22/2019 5:29,,7,2750,"

Say we have a single qubit with some density matrix, for example lets say we have the density matrix $\rho=\begin{pmatrix}3/4&1/2\\1/2&1/2\end{pmatrix}$. I would like to know what is the procedure for checking whether this state is pure or mixed.

+ +

I know that a pure state is one which can be written $\rho=|\psi\rangle\langle\psi|$, and that a mixed state is one which can be written $\rho=\sum_{k=1}^Np_k|\psi_k\rangle\langle\psi_k|$. But I have two problems. Firstly I'm not sure what the $p_k$ is, I know it's called the weight function but I don't understand it significance, how to find it, or its role mathematically. Secondly I don't see how it is possible to determine from these definition whether the sate I mentioned above is pure or mixed. How can we? Or perhaps there's some method that doesn't use the definitions directly?

+ +

Could anyone please clear up this problem for me ?

+",6254,,55,,2/14/2021 18:58,2/14/2021 18:58,How to show a density matrix is in a pure/mixed state?,,2,2,,,,CC BY-SA 4.0 +5953,2,,5952,4/22/2019 6:04,,10,,"

First, the example that you give is not a density matrix (they must have trace 1).

+ +

Second, you’re asking how to go from the matrix into an operator representation that is not unique. So, there are many ways of doing this. However, a particularly natural way of decomposing it is using the spectral decomposition. The weights are the eigenvalues and the states are the corresponding eigenvectors.

+ +

However, if all you want to do is determine if the state is mixed, there’s a simpler way: calculate the trace of the square of the density matrix, $\text{Tr}(\rho^2)$. That's called the purity. If it’s 1, the state is pure. If it’s less than 1, the state is mixed. If it’s more than 1, you’ve messed up.

+",1837,,1837,,4/23/2019 7:32,4/23/2019 7:32,,,,0,,,,CC BY-SA 4.0 +5954,2,,5952,4/22/2019 6:09,,8,,"

By spectral theorem density matrices are diagonizable, since they are hermitian (also they are positive semi-definite and have trace 1). That means that there is a set of $n$ non-negative eigenvalues $\lambda_i$ with $n$ corresponding mutually orthogonal eigenvectors $|v_i\rangle$ such that +$$ +\rho = \sum_{i=1}^n{\lambda_i |v_i\rangle \langle v_i|} +$$ +This matrix represents pure state only if it has exactly one non-zero eigenvalue (it must be equal to 1 since $\mathrm{tr}(\rho)=\sum_{i=1}^n{\lambda_i}=1$).

+ +

So, to analyze density matrix you just need to find eigenvalues and eigenvectors.
+Though, to check if $\rho$ is pure it is enough to verify the equality +$$ +\mathrm{tr}(\rho^2)=1 +$$

+",5870,,26,,4/22/2019 19:32,4/22/2019 19:32,,,,0,,,,CC BY-SA 4.0 +5956,1,,,4/22/2019 18:59,,4,50,"

Two recent papers of Jun-Li Li and Cong-Feng Qiao (arXiv:1607.03364 and arXiv:1708.05336) present ""practical schemes for the decomposition of a bipartite mixed state into a sum of direct products of local density matrices"".

+ +

I would like to know if this methodology can be applied to (two-qubit, qubit-qutrit, two-qutrit,...) $X$-states (only the diagonal and antidiagonal entries of the corresponding density matrices being non-zero).

+ +

If this can be successfully accomplished, it might be useful in addressing the question of what amount, if any, does the two-retrit $X$-state Hilbert-Schmidt PPT-probability of $\frac{16}{3 \pi^2} \approx 0.54038$ correspond to bound entangled states--an issue I have raised in my earlier postings (Are X-state separability and PPT- probabilities the same for the two-qubit, qubit-qutrit, two-qutrit, etc. states? and What proportions of certain sets of PPT-two-retrit states are bound entangled or separable?)

+",3089,,55,,9/25/2021 9:42,9/25/2021 9:42,Finding separable decompositions of bipartite X-states using the methodology of Li and Qiao,,0,0,,,,CC BY-SA 4.0 +5957,1,5963,,4/22/2019 23:35,,4,394,"

My understanding of the Bernstein-Vazirani algorithm is as follows:

+ +
    +
  1. We have a black box oracle with secret string $s$. The black box does +$$f(x) =s\cdot{x}=(\sum_1^n s_i\cdot{x_i})$$

  2. +
  3. We run each qubit through a Hadamard gate first, then through the oracle:

  4. +
  5. If $s_i = 0$, nothing happens and the ith qubit is still in the $|+\rangle$ state. If $s_i = 1$, the $i$-th qubit picks up a phase and is now in the $|-\rangle$ state.

  6. +
  7. We run ignore the output and run the inputs qubits through another Hadamard gate, and now we've recovered s with only a single query!

  8. +
+ +
+ +

The part I don't understand is that nothing about the oracle (1) promises this phase kickback will occur. The references I've seen seem to implicitly assume this, why are they assuming this behavior?

+ +

Even the first reference, which describes a CNOT-gate based implementation of this oracle, only does so after the solution — which to me suggests that the implementation is a detail rather than a necessary feature of the problem.

+ +

To clarify, I'd have no issues if the oracle was explicitly stated to have this phase kickback behavior, but its seems like this condition is being taken for granted.

+ +
+ +

References:

+ + +",6304,,6304,,4/26/2019 23:07,4/26/2019 23:07,Is the Bernstein-Vazirani algorithm dependent on the specific behavior of the oracle?,,1,0,,,,CC BY-SA 4.0 +5958,1,,,4/23/2019 1:06,,9,609,"

A quantum circuit can use any unitary operator. Its matrix is exponential in the number of input bits. In practice how can this ever be possible (aside from operators which are tensor products), i.e. how can you construct exponential size matrix?

+",6306,,26,,4/23/2019 7:51,4/23/2019 18:05,How is it possible to implement unitary operator when its size is exponential in inputs?,,2,0,,,,CC BY-SA 4.0 +5959,1,6083,,4/23/2019 2:10,,2,227,"

I wrote an implementation of Grover's algorithm that looks like this:

+ +
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, Aer, execute
+
+# Initialize circuit
+m_qubit = QuantumRegister(1)
+search_register = QuantumRegister(4)
+result_register = ClassicalRegister(4)
+ancillaries = QuantumRegister(3)
+circuit = QuantumCircuit(search_register, result_register, m_qubit, ancillaries)
+
+# Put M qubit into 1-superposition
+circuit.x(m_qubit)
+circuit.h(m_qubit)
+
+# Put search qubits into superposition
+circuit.h(search_register)
+
+for _ in range(2):
+
+    # Encode S1 * !S2 * S3
+    circuit.x( search_register[2] )
+    circuit.ccx( search_register[1], search_register[2], ancillaries[0] )
+    circuit.ccx( search_register[3], ancillaries[0], ancillaries[1] )
+    circuit.x( search_register[2] )
+
+    # Encode S0 * S1
+    circuit.ccx( search_register[0], search_register[1], ancillaries[2] )
+
+    # Encode oracle ((S0 * S1) + (S1 * !S2 * S3))
+    circuit.x(ancillaries)
+    circuit.ccx( ancillaries[1], ancillaries[2], m_qubit[0] )
+    circuit.x(ancillaries)
+    circuit.x(m_qubit)
+
+    # Reset ancillaries to be used later
+    circuit.reset(ancillaries)
+
+    # Do rotation about the average
+    circuit.h(search_register)
+    circuit.x(search_register)
+    circuit.ccx( search_register[0], search_register[1], ancillaries[0] )
+    circuit.ccx( search_register[2], ancillaries[0], ancillaries[1] )
+    circuit.ccx( search_register[3], ancillaries[1], m_qubit[0] )
+    circuit.x(search_register)
+    circuit.x(m_qubit)
+    circuit.h(search_register)
+
+    # Reset ancillaries for use later
+    circuit.reset(ancillaries)
+
+circuit.measure(search_register, result_register)
+
+# Run the circuit with a given number of shots
+backend_sim = Aer.get_backend('qasm_simulator')
+job_sim = execute(circuit, backend_sim, shots = 1024)
+result_sim = job_sim.result()
+
+# get_counts returns a dictionary with the bit-strings as keys
+# and the number of times the string resulted as the value
+print(result_sim.get_counts(circuit))
+
+ +

Essentially, this circuit should search for any value that matches $X_1 X_2 X_3 + X_0 X_1$. When I do the math for this circuit I get the following:

+ +

$$\frac{1}{1024 \sqrt{2}} \left( -304 \left( \sum_{x \in \{00, 01, 11\}} \left| x \right> \left( \left|00\right> + \left|01\right> + \left|10\right> \right) + \left|1000\right> + \left|1001\right> \right) + 80 \left( \sum_{x = 00}^{11} \left|x\right> \left|11\right> + \left|1010\right> \right) \right) \left( \left|0\right> - \left|1\right> \right)$$

+ +

These amplitudes correspond to probabilities of $-\frac{{304}^{2}}{2({1024}^{2})} = -\frac{{19}^{2}}{2({64}^{2})}$ and $\frac{{80}^{2}}{2({1024}^{2})} = \frac{{5}^{2}}{2({64}^{2})}$ for the unsuccessful and successful probabilities, respectively.

+ +

What I don't understand from this is how the successful outputs would appear over the unsuccessful ones, because the magnitude of the probability for the unsuccessful results is much higher. Can someone explain how the normalization is done in this case?

+ +

Furthermore, these results do not obtain when I actually run the circuit. Instead of a step-function for the probabilities, when I run 1024 shots I tend to get between 30 and 50 for the unsuccessful results and the successful results are spread between 200 and 460. While it's obvious that the successful results have been selected, the spread is concerning because the math seems to indicate that they should be fairly close together. Moreover, the successful results always fall in the same order, which is also counter-intuitive given that results are probabilistic. This implies one of two things to me:

+ +
    +
  1. The superposition isn't actually equal (i.e. there's some bias towards one value versus the other). However, this doesn't make sense as these results were obtained with a simulator so they should be very close to optimal.
  2. +
  3. I have inadvertently entangled the qubits in such a way that the result is affected.
  4. +
+ +

Any insight into this would be greatly appreciated.

+",5472,,26,,4/26/2019 14:28,10/26/2022 23:52,Grover's algorithm returns skewed probability distribution,,1,0,,,,CC BY-SA 4.0 +5962,2,,5958,4/23/2019 7:17,,9,,"

The key is that you don't actually construct a matrix. Yes, if you wanted to simulate a quantum computation on a classical computer, one method is to build the corresponding unitary matrix, and this is essentially why (unless there's special structure) it's impossible to efficiently perform a classical simulation of quantum computation.

+ +

However, think on this point: if I have an $n$-qubit quantum system and I do nothing to it, that is described by a $2^n\times 2^n$ identity matrix. So, by your way of thinking, I have constructed a special case of an exponential size matrix. But the point is that we just do some operation. It might be represented by a matrix, but we never look at that matrix, never construct it.

+ +

The basic quantum operations that we use are thought about in this way - you only really do anything to one or two qubits at a time and you make it exponential size by adding identities (""do nothing"") to all the other qubits. Combining a small number of these acting on different sets of qubits can create some unitary matrices that are not tensor products.

+ +

Now, while a quantum computer can in principle implement any unitary operator, universality in that sense doesn't say anything about how long the construction takes. The vast, overwhelming, majority of them do take exponential time to implement. Quantum computation is specifically interested in finding that Goldilocks zone, those small number of instances which can be implemented in polynomial time and give an interesting computation that cannot be computed in polynomial time on a classical computer.

+",1837,,1837,,4/23/2019 14:36,4/23/2019 14:36,,,,0,,,,CC BY-SA 4.0 +5963,2,,5957,4/23/2019 8:03,,6,,"

The whole point of an oracle-based algorithm is that it does depend on the promised structure of the oracle. For Bernstein-Vazirani, it is assumed that the oracle acts as $$ +|x\rangle|y\rangle\rightarrow |x\rangle|y\oplus (x\cdot s)\rangle. +$$ +That is the fundamental starting point (and is just the reversible implementation of $x\cdot s$). If you didn't have an oracle that did this, all bets would be off (this is one of the key reasons why we haven't proven that quantum computation is faster that classical - the only proven speedups are with respect to specific oracles, but that can never eliminate the possibility of different oracles offering different results).

+ +

Notice that this definition of the oracle involves $n+1$ qubits, the $n$ qubits of input and one ancilla qubit. The way that you've described the functionality does not quite fit with this. The way that you've written it seems to suggest that you're expecting $|x\rangle\mapsto|x\oplus s\rangle$. This is not the case. Indeed, if that were the case, then what you'd actually have to state for the oracle is

+ +
    +
  1. We have a black box oracle with secret string s. For each bit, if $s_i=1$ then 0 is mapped to 1 and 1 is mapped to 0. If $s_i=0$ then it is unchanged.
  2. +
  3. If $s_i=1$ then it also maps $|+\rangle$ to $|+\rangle$ and $|-\rangle$ to $-|-\rangle$.
  4. +
+ +

This is the result of linearity: if $|0\rangle\mapsto|0\rangle$ and $|1\rangle\mapsto|1\rangle$, then this is the identity map; whatever you input is what you output. Meanwhile, if $|0\rangle\mapsto|1\rangle$ and $|1\rangle\mapsto|0\rangle$, then it must be that $(|0\rangle+|1\rangle)\mapsto(|1\rangle+|0\rangle)$ and $(|0\rangle-|1\rangle)\mapsto(|1\rangle-|0\rangle)$. Moreover, determining $s$ would be trivial; we'd just input $x=0$, and read the output.

+ +

Instead, what you actually have to do is make sure that you input the state $(|0\rangle-|1\rangle)/\sqrt{2}$ on the ancilla qubit. In doing so, the state of the ancilla qubit will not change. So, we can describe the net effect on just the $n$ other qubits as being +$$ +|x\rangle\mapsto (-1)^{s\cdot x}|x\rangle. +$$ +This is the phase kick-back that you mention. Notice that if all you do is use basis states, then the phase is undetectable. However, if you input the state $|+\rangle^{\otimes n}$, as you mention, then you do indeed get the output $H^{\otimes n}|s\rangle$.

+",1837,,,,,4/23/2019 8:03,,,,11,,,,CC BY-SA 4.0 +5964,1,5971,,4/23/2019 14:46,,6,612,"

I need to plot drawings of qubit dynamics on the Bloch sphere. I know QuTip allows to do such drawings but I specifically need to represent evolution velocities on the Bloch sphere so I need to draw tangent vectors. Is there a way I can do it with QuTip? More generally it would be good to be able to draw affine vectors with QuTip. Do you know of any way I can do it? If this cannot be done with QuTip do you know of any other software that allows me to do it?

+",2490,,55,,4/24/2019 11:39,4/24/2019 11:39,Drawing tangent vectors to the Bloch sphere with qutip,,1,2,,,,CC BY-SA 4.0 +5965,1,,,4/23/2019 16:27,,6,145,"

A well-known way of encoding $N$ levels of a harmonic (bosonic) oscillator is as follows: +\begin{equation} + |n\rangle = |1\rangle^{\otimes n} \otimes |0\rangle^{\otimes N-n+1} + \quad,\qquad + 0\leq n \leq N + \quad, +\end{equation} +with the ladder operators being defined as: +\begin{equation} + \label{bosenc} + \begin{alignedat}{99} + a &= |000\rangle\langle100|_{1,\,2,\,3} + \sum\limits_{j=2}^{N} \sqrt{j}|100\rangle\langle110|_{j-1,\,j,\,j+1} + \sqrt{N+1}|110\rangle\langle111|_{N-1,\,N,\,N+1} + \quad&&,\\ + a^\dagger &= |100\rangle\langle000|_{1,\,2,\,3} + \sum\limits_{j=2}^{N} \sqrt{j}|110\rangle\langle100|_{j-1,\,j,\,j+1} + \sqrt{N+1}|111\rangle\langle110|_{N-1,\,N,\,N+1} + \quad&&. + \end{alignedat} +\end{equation} +The subscripts denote on which qubits the term is acting (for the rest of qubits it's just the unity operator). +Indeed, one can check that the commutator of the so-defined operators is +\begin{equation} + [a,\,a^\dagger] = \sum \limits_{n=0}^{N} |n\rangle\langle n| - (N+1)|N+1\rangle\langle N+1| \quad. +\end{equation} +(the last term being the unavoidable 'correction' due to the absence of finite-dimensional representations of the Heisenberg algebra)

+

An obvious downside of such an approach is that we are only using $N$ out of total of $2^{N+1}$ states of the $N+1$ qubit system. The main advantage, however, stems from the fact that the raising and lowering operators are $3$-local, and contain only $N+1$ terms each.

+

Is anybody aware of more efficient ways of storing bosonic degrees of freedom? I'm personally interested in encoding multiple bosonic degrees of freedom having various numbers of levels; so, not only I'm interested in "what's the minimum number of qubits required to efficiently work with $N$ bosonic levels?", but also "given a fixed number of qubits, how many bosonic oscillators (with, possibly, different number of levels) can one efficiently encode?" Obviously, 'efficiently' here implies that the raising and lowering operators have some reasonable scaling properties.

+

UPDATE

+

The approach opposite to the one presented above was suggested by Craig Gidney in comments: one can encode the $n$-th level of the oscillator with its binary representation $|(n)_2\rangle$, where $(\ldots)_2$ stands for the binary form of the number. The number of terms in the expression for ladder operators is the same as in the first approach (it is exponential in the number of qubits - but the number of qubits itself is logarithmic in the number of levels). Note, however, that the main downside of this approach is that each term in the sum is not $3$- or any fixed number-local. Instead, they all are $\log N$-local: +$$ +a = \underbrace{|\ldots0000\rangle}_{\text{$\log N$ qubits}}\langle\ldots0001| + \ldots +$$

+

It would be interesting though to find a compromise between these two approaches.

+",6313,,-1,,6/18/2020 8:31,4/24/2019 17:42,Encoding bosonic degrees of freedom,,0,5,,,,CC BY-SA 4.0 +5966,2,,5958,4/23/2019 18:05,,3,,"

Note that there is nothing specifically quantum about this.

+ +

An arbitrary classical operation over $n$ bits can also be represented as a $2^n\times2^n$ matrix, describing where each input bitstring is sent by the operation. Such matrices are permutation matrices for deterministic operations (in which case using matrices is a bit pointless as there is no notion of ""linear combinations of inputs""), or more generally stochastic matrices if one wants to also describe probabilistic processes.

+ +

The dimension of these matrices also clearly increases exponentially with the number of bits, but this is a non-issue, as it has no connection with how difficult it actually is to implement the corresponding operation, for the reasons laid out in the other answer.

+",55,,,,,4/23/2019 18:05,,,,0,,,,CC BY-SA 4.0 +5967,2,,2110,4/24/2019 1:29,,3,,"

Given the oracle you have provided, the search is indeed pointless. However, that oracle misses the point of Grover's algorithm because searching for a card in a deck of cards is not an unstructured search because, as you stated, you already know the order. Ergo, your search is structured. The reason this oracle is used is that it demonstrates how Grover's may be applied without having to discuss an oracle that would make Grover's useful because such an oracle would be more complicated than valuable. Therefore, a better oracle to demonstrate the usefulness of Grover's might be something like:

+ +

$$ +f(x) = \begin{cases} + 1, & x[0, \ldots, 3] + x[4, \ldots, 7] = 1010 \\ + 0, & \text{otherwise} +\end{cases} +$$

+ +

What this oracle implies is that you have an 8-qubit search where you take the first four qubits and add them to the second four qubits and flip M if the addition makes 10 (1010 in binary). The difference between this oracle and the one you provided is that this oracle tests a pattern (do the operands add to 10) whereas yours tests equality (is this index 5). This oracle is much more difficult to build but it leverages the true power of Grover's, which is, in essence, a brute-force search where your oracle defines the search space.

+",5472,,26,,4/24/2019 4:42,4/24/2019 4:42,,,,0,,,,CC BY-SA 4.0 +5968,1,5970,,4/24/2019 8:02,,2,1184,"

I need to write the tensorial representation of the Controlled Swap Gate, what I have written is +$\operatorname{CSWAP}=|0\rangle\langle0|\otimes I\otimes I+|1\rangle\langle1|\otimes U$, where U is the matrix of $\operatorname{CSWAP}$ gate transformation, i.ethat is $$|00\rangle\to |00\rangle=1|00\rangle+0|01\rangle+0|10\rangle +0|11\rangle $$ +$$ |01\rangle=0|00\rangle+0|01\rangle+1|10\rangle +0|11\rangle $$ +$$|10\rangle=0|00\rangle+1|01\rangle+0|10\rangle +0|11\rangle $$ +$$|11\rangle=0|00\rangle+0|01\rangle+0|10\rangle +1|11\rangle,$$ so the matrix becomes $$U=\begin{bmatrix} +1 &0&0&0\\ +0&0&1&0\\ +0&1&0&0\\ +0&0&0&1 +\end{bmatrix},$$ +Is this the correct implementation? Just to add a bit, how do I make this $2$-qubit gate as a tensor product of $1$-qubit gate so that there is uniformity in the equation above?

+",6070,,26,,4/28/2019 13:16,4/28/2019 13:16,What is the tensorial representation of the quantum swap gate?,,2,0,,,,CC BY-SA 4.0 +5969,2,,5968,4/24/2019 8:53,,1,,"

Yes, that is the correct matrix representation of the CSWAP (also often referred to as Fredkin gate).

+ +

Regarding writing it as a ""tensor product of $1$-qubit gates"", the only missing step is writing the swap in braket notation, which you can do as follows: +$$\operatorname{SWAP}=\lvert00\rangle\!\langle00\rvert+\lvert11\rangle\!\langle11\rvert+\lvert01\rangle\!\langle10\rvert+\lvert10\rangle\!\langle01\rvert,$$ +so that the overall gate reads +\begin{align} +\operatorname{CSWAP}&=|0\rangle\!\langle0|\otimes I\otimes I+|1\rangle\!\langle1|\otimes \operatorname{SWAP}\\ +&=|0\rangle\!\langle0|\otimes I\otimes I+|1\rangle\!\langle1|\otimes(\lvert00\rangle\!\langle00\rvert+\lvert11\rangle\!\langle11\rvert+\lvert01\rangle\!\langle10\rvert+\lvert10\rangle\!\langle01\rvert). +\end{align}

+",55,,55,,4/24/2019 9:54,4/24/2019 9:54,,,,3,,,,CC BY-SA 4.0 +5970,2,,5968,4/24/2019 9:22,,2,,"

SWAP is a two-qubit gate and needs to be written as +$$ +\text{SWAP}=|00\rangle\langle 00|+|11\rangle\langle 11|+|01\rangle\langle 10|+|10\rangle\langle 01|. +$$ +If you want to write this in terms of Pauli-operators, for example, you might write +$$ +\text{SWAP}=\frac12\left(\mathbb{I}\otimes\mathbb{I}+Z\otimes Z+X\otimes X+Y\otimes Y\right). +$$

+",1837,,,,,4/24/2019 9:22,,,,0,,,,CC BY-SA 4.0 +5971,2,,5964,4/24/2019 11:36,,8,,"

First of all, qutip is not a visualisation library, even though it does provide some visualisation functionalities, mostly leveraging matplotlib. +However, because qutip does provide handy functionalities to plot Bloch spheres and points on it, it does make sense to ask how one can tweak such functionalities to for example add tangent vectors to the bloch sphere.

+ +

Reading the relevant doc page, this functionality does not seem to have been implemented. +However, having a look at the relevant source code, it does not seem particularly difficult to add manually additional vectors to the Bloch sphere.

+ +

In particular, at least in the current version of qutip, the vectors are added via the method plot_vectors, which creates the arrows using an Arrow3D object. +One can add any other vector to the sphere by simply adding new Arrow3D objects to the underlying matplotlib axes object.

+ +

Here is an example of how to do this:

+ +
import matplotlib.pyplot as plt
+%matplotlib inline
+import qutip
+b = qutip.Bloch()
+b.render(b.fig, b.axes)
+new_arrow = qutip.bloch.Arrow3D(xs=[1, 1], ys=[0, .5], zs=[0, .5],
+                    mutation_scale=b.vector_mutation,
+                    lw=b.vector_width, arrowstyle=b.vector_style, color='blue')
+b.axes.add_artist(new_arrow)
+
+ +

which gives

+ +

+ +

note that we need to call explicitly b.render instead of b.show because we need the axes object to be created but the plot to not be drawn before we add the new arrow.

+ +

Just change the coordinates given to the parameters xs, ys, zs to decide what vectors to draw.

+ +

As a final more or less unrelated note, you might also be interested in the drawing library plotly, which allows to build very nice 3d plots (see e.g. these examples).

+",55,,,,,4/24/2019 11:36,,,,1,,,,CC BY-SA 4.0 +5972,1,12010,,4/24/2019 13:23,,5,288,"

I am interested in HHL algorithm and despite all the problems related to current technologies, I am trying to understand how it has to be implemented.

+ +

I have seen from these two available circuits (arXiv:1804.03719, arXiv:1811.01726) that when you define a circuit it is necessary to apply a certain rotation of the ancilla qubit based on the eigenvalues. For what I understood from the original paper, the algorithm ""extracts"" the information about eigenvalues using the quantum phase estimation algorithm but this part is missing in the circuits.

+ +

My doubt is if I have to decompose my matrix to find eigenvalues I lose the possible advantage derived from the algorithm; is that correct?

+",6310,,26,,4/26/2019 14:45,5/13/2020 18:27,Does HHL implementation require a priori eigendecomposition?,,1,3,,,,CC BY-SA 4.0 +5973,1,6446,,4/24/2019 13:33,,3,469,"

I have this program derived from Microsoft Quantum Katas for counting (see here):

+ +
namespace Quantum.Sample
+{
+    open Microsoft.Quantum.Primitive;
+    open Microsoft.Quantum.Canon;
+    open Microsoft.Quantum.Extensions.Convert;
+    open Microsoft.Quantum.Extensions.Math;
+
+    operation SprinklerAnc (queryRegister:  Qubit[],  target : Qubit,ancilla: Qubit[]) : Unit {
+        body (...) {
+            X(queryRegister[2]);
+            X(queryRegister[3]);
+            X(queryRegister[4]);
+            X(queryRegister[5]);
+            X(queryRegister[6]);
+            X(ancilla[0]);
+            X(ancilla[1]);
+            X(ancilla[2]);
+
+            CCNOT(queryRegister[0],queryRegister[1],ancilla[0]);
+            CCNOT(queryRegister[1],queryRegister[2],ancilla[1]);
+            CCNOT(queryRegister[0],queryRegister[2],ancilla[2]);
+            (Controlled X)([ancilla[0],ancilla[1],ancilla[2],queryRegister[3],queryRegister[4],queryRegister[5],queryRegister[6]],target);
+            CCNOT(queryRegister[0],queryRegister[2],ancilla[2]);
+            CCNOT(queryRegister[1],queryRegister[2],ancilla[1]);
+            CCNOT(queryRegister[0],queryRegister[1],ancilla[0]);
+
+            X(ancilla[2]);
+            X(ancilla[1]);
+            X(ancilla[0]);
+                        X(queryRegister[2]);
+            X(queryRegister[6]);
+            X(queryRegister[5]);
+            X(queryRegister[4]);
+            X(queryRegister[3]);
+
+
+        }
+        adjoint invert;
+        controlled auto;
+        controlled adjoint auto;
+    }           
+    operation OracleConverterImpl (markingOracle : ((Qubit[], Qubit) => Unit : Adjoint, Controlled), register : Qubit[]) : Unit {
+
+        body (...) {
+            using (target = Qubit()) {
+                // Put the target into the |-⟩ state
+                X(target);
+                H(target);
+
+                // Apply the marking oracle; since the target is in the |-⟩ state,
+                // flipping the target if the register satisfies the oracle condition will apply a -1 factor to the state
+                markingOracle(register, target);
+
+                // Put the target back into |0⟩ so we can return it
+                H(target);
+                X(target);
+            }
+        }
+
+        adjoint invert;
+        controlled auto;
+        adjoint controlled auto;
+    }
+
+    operation HadamardTransform (register : Qubit[]) : Unit {
+
+        body (...) {
+            //ApplyToEachA(H, register);
+
+            // ApplyToEach is a library routine that is equivalent to the following code:
+             let nQubits = Length(register);
+             for (idxQubit in 0..nQubits - 1) {
+                 H(register[idxQubit]);
+             }
+        }
+
+        adjoint invert;
+        controlled auto;
+        controlled adjoint auto;
+    }
+    operation Oracle_ArbitraryPattern (queryRegister : Qubit[], target : Qubit, pattern : Bool[]) : Unit {
+
+        body (...) {
+            (ControlledOnBitString(pattern, X))(queryRegister, target);
+        }
+
+        adjoint invert;
+        controlled auto;
+        controlled adjoint auto;
+
+    }   
+
+    // Task 2.2. Conditional phase flip
+    operation ConditionalPhaseFlip (register : Qubit[]) : Unit {
+
+        body (...) {
+            // Define a marking oracle which detects an all zero state
+            let allZerosOracle = Oracle_ArbitraryPattern(_, _, new Bool[Length(register)]);
+
+            // Convert it into a phase-flip oracle and apply it
+            let flipOracle = OracleConverter(allZerosOracle);
+            flipOracle(register);
+        }
+
+        adjoint self;
+        controlled  auto;
+
+        controlled adjoint auto;
+
+    }
+
+
+
+    // Task 2.3. The Grover iteration
+    operation GroverIteration (register : Qubit[], oracle : (Qubit[] => Unit :   Adjoint, Controlled)) : Unit {
+
+        body (...) {
+            oracle(register);
+            HadamardTransform(register);
+            ConditionalPhaseFlip(register);
+            HadamardTransform(register);
+        }
+
+        adjoint invert;
+              controlled auto;
+        controlled adjoint auto;
+    }    
+    function OracleConverter (markingOracle : ((Qubit[], Qubit) => Unit : Adjoint, Controlled)) : (Qubit[] => Unit : Adjoint, Controlled) {
+        return OracleConverterImpl(markingOracle, _);
+    }
+
+    operation UnitaryPowerImpl (U : (Qubit[] => Unit : Adjoint, Controlled), power : Int, q : Qubit[]) : Unit {
+        body (...) {
+            for (i in 1..power) {
+                U(q);
+            }
+        }
+        adjoint auto;
+        controlled auto;
+        controlled adjoint auto;
+    }
+
+    operation QPE() : Double {
+        mutable phase = -1.0;
+        let n=8;
+                       using ((reg,phaseRegister,ancilla)=(Qubit[7 ], Qubit[n],Qubit[3]))
+                       {
+        // Construct a phase estimation oracle from the unitary
+                         let phaseOracle = OracleConverter(SprinklerAnc(_,_,ancilla));
+
+        let oracle = DiscreteOracle(UnitaryPowerImpl(GroverIteration(_, phaseOracle), _, _));
+
+              //  let markingOracle = Sprinkler(_, _);
+
+        // Allocate qubits to hold the eigenstate of U and the phase in a big endian register 
+
+            let phaseRegisterBE = BigEndian(phaseRegister);
+            // Prepare the eigenstate of U
+                HadamardTransform(reg);
+
+            // Call library
+            QuantumPhaseEstimation(oracle, reg, phaseRegisterBE);
+            // Read out the phase
+            set phase = ToDouble(MeasureIntegerBE(phaseRegisterBE)) / ToDouble(1 <<< (n));
+
+            ResetAll(reg);
+            ResetAll(phaseRegister);
+        }
+        let angle = PI()*phase;
+        let res = 128.0 *(1.0- PowD(Sin(angle),2.0));
+
+        return res;
+    }
+
+
+
+}
+
+ +

with driver (see this):

+ +
using System;
+
+using Microsoft.Quantum.Simulation.Core;
+using Microsoft.Quantum.Simulation.Simulators;
+
+namespace Quantum.Sample
+{
+    class Driver
+    {
+        static void Main(string[] args)
+        {
+            using (var qsim = new QuantumSimulator())
+            {
+                for (int i = 0; i < 100; i++)
+                {
+                    var res = QPE.Run(qsim).Result;
+                    System.Console.WriteLine($""Res:{res}"");
+                }
+            }
+        }
+    }
+}
+
+ +

It should count the solutions of the 3 bits formula +(not reg[0] or reg[2]) and (not reg[1] or reg[2]) and (not reg[0] or not reg[1]) +This formula has 4 solutions. +I consider an extended formula with 7 bits that is true when the first three bit satisfy the above formula and the other four bits are at 0. The extended formula this has 4 solutions as well but I can increase easily the number of solutions by excluding variables from the formula. +I compute the phase $\phi$ with the linked program, then I compute $\theta/2$ as $2\pi\phi/2=\pi\phi$ +Now the number of solutions should be +$$128\sin(\theta/2)^2$$ + right? +I get the correct number of solutions if I compute +$$128(1-\sin(\theta/2)^2)$$ +It's as if the formula is negated but I can't find where the negation is. +This same formula with GroverSearch from Microsoft Quantum Katas returns correct solutions.

+",7318,,7318,,4/25/2019 8:23,6/14/2019 0:00,Counting in Q#: number of solutions,,1,0,,,,CC BY-SA 4.0 +5974,1,5975,,4/24/2019 18:54,,1,109,"

Let's say I have a square matrix of size $2^n\times 2^n$ with entries being 8 bit integers, where $2^n\times 2^n=b\times b\times b=2^l\times 2^l\times 2^l$, then if I want to represent that matrix in the form of a cube, is the following representation correct? +$$|A\rangle=\dfrac{1}{2^{3k/2}}\sum_{i=0}^{2^l-1}\sum_{j=0}^{2^l-1}\sum_{k=0}^{2^l-1}|A(i,j,k)\rangle\otimes |i\rangle|j\rangle|k\rangle,$$ where $A(i,j,k)$ is the value at the location $(i,j,k)$ and $|A(i,j,k)\rangle$ is the binary representation of the decimal value, and $|i\rangle,|j\rangle,|k\rangle$ are the position coordinates each of length $b$ bits. Can we represent the cube like this?

+",6070,,26,,4/26/2019 14:22,4/26/2019 14:22,Quantum representation of cube,,1,1,,,,CC BY-SA 4.0 +5975,2,,5974,4/25/2019 7:04,,2,,"

To be clear, you essentially have a cube consisting of $2^l$ points along each direction, and associated with each point $(i,j,k)$ is an 8 bit integer $A(i,j,k)$?

+ +

In that case, a state of $3l+8$ qubits, +$$ +|A\rangle=\frac{1}{2^{3l/2}}\sum_{i,j,k=0}^{2^l-1}|A(i,j,k)\rangle|i\rangle|j\rangle|k\rangle +$$ +is one possible way of representing the data. It is very reminiscent of quantum fingerprinting schemes.

+ +

The real question is what you want to use such a representation for? That will determine if the representation is any good. What you cannot do is use single copies to deterministically extract information about the values of $A(i,j,k)$. This should be obvious - you cannot use $3l+8$ qubits to give you arbitrary access to $24l$ bits of data.

+",1837,,,,,4/25/2019 7:04,,,,3,,,,CC BY-SA 4.0 +5976,1,5977,,4/25/2019 9:40,,6,2019,"

It is said in a lecture note[1] by John Preskill that,

+ +
+

Equivalently, we may imagine measuring system $B$ in the basis $\{|a\rangle\}$, but failing to record the measurement outcome, so we are forced to average over all the possible post-measurement states, weighted by their probabilities. The result is that the initial density operator $\boldsymbol{\rho} = |\psi\rangle\langle \psi|$ is subjected to a linear map $\mathcal{E}$, which acts as

+ +

$$\mathcal{E}(\boldsymbol {\rho}) = \sum_a M_a\boldsymbol{\rho} M^{\dagger}_a, \tag{3.32}$$

+ +

where the operators $\{M_a\}$ obey the completeness relation eq.(3.25).

+ +
+ +

The justification for this name will emerge shortly. Eq.(3.32) is said to be an operator-sum representation of the quantum channel, and the operators $\{M_a\}$ are called the Kraus operators or operation elements of the channel.

+
+ +

It seems that Kraus operators and measurement operators are the same thing. Is that right?

+ +
+ +

[1]: Lecture Notes for Ph219/CS219: Quantum Information Chapter 3 (John Preskill, 2018)

+",7327,,55,,9/23/2021 7:38,9/23/2021 7:38,What's the difference between Kraus operators and measurement operators?,,1,1,,,,CC BY-SA 4.0 +5977,2,,5976,4/25/2019 16:27,,8,,"

Quantum measurement (without results recording) is just a special case of quantum operation (quantum channel). So, yes, measurement operators (as in general measurement formalism) are indeed Kraus operators. But Kraus operators are more general. For example, they can be ""rectangular"", while measurement operators can't.

+",5870,,,,,4/25/2019 16:27,,,,2,,,,CC BY-SA 4.0 +5978,1,,,4/25/2019 18:30,,3,244,"

Suppose we have qubit $|a\rangle$ and we want to implement quantum addition say adding $|a\rangle$ and $|a\rangle$. When drawing the circuit for this operation one of the outputs that we get is keeping the state $|a\rangle$ unaltered for reversibility. But since we know the the sum is just the twice of the state, can't we just keep the sum and nothing else and to get back the original we just half it? Pardon if this question sounds weird.

+",6070,,26,,4/26/2019 13:20,4/26/2019 15:59,Why do we need reversibility?,,2,2,,,,CC BY-SA 4.0 +5979,1,,,4/25/2019 18:38,,1,64,"

If I use for example 5-qubit IBM-Q quantum computer and we accept the law of quantum parallelism ($n$ qubit = $2^n$ ordinary bits), so does it mean that computational power of this computer is equal to only $2^5 = 32$ bits (transistors)? For example in last Intel core processors — hundreds of millions transistors, so is it right that ordinary processors at this time faster than 5-qubit computer for millions of times?

+",5876,,26,,4/26/2019 13:22,4/26/2019 13:22,What is the difference in computational power between qubit and bit (transistor)?,,0,0,,4/25/2019 19:13,,CC BY-SA 4.0 +5980,1,5987,,4/26/2019 1:28,,7,337,"

In quantum mechanics each operator corresponds to some physical observable, but say we have the operators $X,Y,Z,H, \operatorname{CNOT}$. I understand how these gates act on qubits, but what do they actually represent in terms of a physical observable?

+",6254,,55,,7/17/2021 12:43,7/17/2021 12:43,How should we interpret these quantum logic gates as physical observables?,,2,0,,,,CC BY-SA 4.0 +5981,2,,5978,4/26/2019 11:17,,4,,"

There is a standard way for constructing a function evaluation $f(x)$ in a reversible manner: you define a circuit that acts $|x\rangle|y\rangle\mapsto |x\rangle|y\oplus f(x)\rangle$. This always works (you prove reversibility by acting it twice). Note that while I've used the quantum notation, this is actually a classical statement.

+ +

That does not mean it's the only way to construct a reversible circuit for a specific function. A particularly simple example is the binary function $f(x)=1-x$ for $x\in\{0,1\}$. If we use the standard construction, we end up with a two-bit gate, controlled-NOT. However, if it sufficient to just apply NOT on the bit, as this is reversible. If I've understood your question correctly, this is exactly what's happening with your example.

+",1837,,,,,4/26/2019 11:17,,,,0,,,,CC BY-SA 4.0 +5982,2,,5980,4/26/2019 11:20,,5,,"

In quantum mechanics, not all operators are observables. Many operators are observables, and in the first year or two of treatments in some physics courses you will only see operators which are observables; but not all operators of interest are observables.

+ +

The operators you have mentioned all happen to be Hermitian, and could therefore be interpreted as observables. This is particularly useful for the operators $X$, $Y$, and $Z$, which up to a scalar factor of $2\hbar$ you may be more familiar with as orbital angular momentum components. However, in the context of quantum computation, the more important property of the operators $\{X,Y,Z,H,\mathrm{CNOT}\}$ is that they are unitary: that is, their eigenvalues are all roots of unity, and so they represent possible finite-time evolutions of a quantum system.

+ +

Finite-time evolutions of the system are of course governed by the wave-equation. Specifically, from the time-independent Schrödinger equation, we have +$$ i\hbar \frac{\mathrm d}{\mathrm d t} \lvert \psi(t) \rangle = \hat{\mathrm{H}} \, \lvert \psi(t) \rangle$$ +which has solutions of the form $\lvert \psi(t) \rangle \,=\, \hat{\mathrm{U}}(t) \: \lvert \psi(0)\rangle$, for some initial state-vector $\lvert \psi(0)\rangle$ and where $\hat{\mathrm{U}}(t)$ is a unitary operator given by +$$ +\hat{\mathrm{U}} (t) +\,=\, +\exp\bigl(-i \:\!\hat{\mathrm{H}} \,t\big/\hbar\bigr) +\,=\, +\sum_{n \geqslant 0} \frac{\bigl( -i\!\:\hat{\mathrm{H}}\,t \big/ \hbar\bigr)^n}{n!} $$ +whose eigenvalues are of the form $\mathrm e^{-iE_k t / \hbar}$ for eigenvalues $E_k$ of $\hat{\mathrm H}$. Such an operator is called a unitary operator, and had the property that $\hat{\mathrm U}(t){}^{-1} = \hat{\mathrm U}(-t) = \hat{\mathrm U}{}^\dagger$. The gates $X$, $Y$, $Z$, $H$, and $\mathrm{CNOT}$ are all operators of this form, where it so happens that the eigenvalues are $\pm 1$.

+ +

All unitary operators can be obtained from the exponentiation of a Hermitian operator in this way; though in many cases we prefer to consider them as products if a sequence of different operators $\hat{\mathrm U} = \hat{\mathrm U}_N(t_N)\,\cdots\,\hat{\mathrm U}_2(t_2)\,\hat{\mathrm U}_1(t_1)$, representing evolution according to piecewise-constant Hamiltonians. (Realising such a unitary evolution will be more complicated in practise, of course, just as computing with classical computers is more complicated than just applying 'AND' and 'OR' gates to bits represented by electrical voltages in wires, but this is the picture of quantum computation to first-order.)

+",124,,124,,4/26/2019 19:15,4/26/2019 19:15,,,,3,,,,CC BY-SA 4.0 +5983,2,,5978,4/26/2019 13:13,,4,,"

The way in which we typically describe quantum computation is by unitary circuits, which is a sequence of transformations $\def\ket#1{\lvert#1\rangle}\ket\psi \mapsto U\ket\psi$, for unitary operators $U$. (This is not the only way in which to describe quantum computation — for instance, there is measurement-based quantum computation, and quantum annealing — but measurement-based quantum computation is almost always considered just a way to simulate unitary circuits, and quantum annealing doesn't lend itself well to describing computations by a sequence of operations which you do to compute functions on data.) So for us the starting point is to consider how to describe computations with unitary transformations.

+ +

When you have a piece of classical data, such as $a \in \{0,1\}^n$ for some $n>0$, this data is represented by a ""standard basis state"": a state $\ket{a}$ which is a vector in $\mathbb C^{2^n}$, whose coefficients are indexed by the $\{0,1\}$ strings of length $n$. The vector $\ket{a}$ is the one where the $a$-th coefficient is $1$, and the others are zero. We can transform this state — do computations on it — by acting on it with unitary transformations $U$, which are $2^n \times 2^n$ matrices over $\mathbb C$ which are (a) invertible, and (b) satisfy $U^{-1} = U^\dagger$.

+ +

The short answer to you question is then that because the computations that you do are by invertible transformations, that there has to be a way to invert it. And if the transformation you're interested in maps every standard basis state to another standard basis state (as it would if it is realising a computation just with classical data), that transformation is precisely a 'reversible computation'.

+ +

For a somewhat longer answer you would have to consider how to do your computation reversibly. Building on DaftWullie's answer above, it matters what computation you are doing, and what conditions you want on the output. If you want to add some integer $b$ to $a$, you either have to be flexible enough to allow this to be done reversibly on just the $n$ qubit register — for instance, by performing your computation modulo $2^n$ — or you have to allow for the possibility that $a+b \geqslant 2^n$, which will require that you use something like an extra 'overflow' qubit in a particular way. The same goes for multiplying $a$ by $2$, or by any other constant. (As Mark S mentions in a comment, multiplying by $2$ is not automatically a reversible operation: if you multiply by $2$ in a binary representation on $n$-bit integers, there will be an overflow if $a \geqslant 2^{n-1}$; and also the reverse operation of dividing by $2$ is not well-defined on odd integers.) There are common conventions for what you might choose to do, but ultimately it depends on what you want to compute and how many qubits, how few operations, etc. you are prepared to use to do it.

+",124,,124,,4/26/2019 15:59,4/26/2019 15:59,,,,5,,,,CC BY-SA 4.0 +5984,1,5986,,4/27/2019 7:25,,2,112,"

DaftWullie mentions an interesting point here:

+ +
+

let's assume that we know an efficient classical computation of $f(x)$. That means we can build a reversible quantum computation that runs in the same time.

+
+ +

Questions:

+ +
    +
  1. What exactly is meant by efficient ""classical computation"" here? Does it mean something like the Volder's algorithm for implementing trigonometric, hyperbolic and exponential functions?

  2. +
  3. Say, we know how to implement $\sin^{-1}(x)$ using a CORDIC-based digital circuit (with registers, multiplexers, adders and all that). Can we build an equivalent quantum circuit that has the same computational complexity as its digital counterpart? If yes, how?

  4. +
  5. How do we prove that the time complexities of the digital and quantum counterparts are equal (or nearly equal)?

  6. +
+",26,,,,,4/27/2019 13:36,Is it possible to construct an equivalent quantum circuit from a CORDIC-based digital circuit?,,1,2,,,,CC BY-SA 4.0 +5985,1,5996,,4/27/2019 9:53,,2,308,"

I'm working on an implementation of the algorithms described Brassard et al. in the following paper: arXiv:quant-ph/0005055v1.

+ +

I managed to make the amplitude amplification cases working but I'm stuck with the amplitude estimation because in the paper there is the definition of a ""special"" operator in a way I don't understand how to realize it. It is the $\Lambda_M(U^ĵ)$ defined at the bottom of page 15 as

+ +

$$|j\rangle|y\rangle\mapsto|j\rangle(|U^j |j\rangle)$$ for $0 \le j \le M$

+ +

For a generic integer M and a unitary operator $U$ of size N (!= M), and where the exponent j is its repetition j times. Any idea on how to realize it in practice, as a product of matrices (not necessarily universal), or build element by element?

+",4927,,26,,4/27/2019 10:20,4/27/2019 23:45,Amplitude Estimation Algorithm — Lambda (Q) Operator,,1,0,,,,CC BY-SA 4.0 +5986,2,,5984,4/27/2019 13:19,,3,,"

DaftWullie's comments aren't special to 'efficiently computable' functions $f(x)$ — any function at all which we know how to compute by conventional means, we can compute reversibly with at most a (small!) constant factor overhead.

+ +

How to reversibly compute a function

+ +

The proof is simple. For any procedure to compute something conventionally — classically and without regard to reversibility — we can suppose that it is described in terms of a circuit consisting of FANOUT, NOT, XOR, and AND gates. (If you prefer a different set of universal logic gates, a very slightly different proof can easily be found for that gate set — but it is important that we explicitly account for when we make copies of a bit, which is what we use FANOUT for.) Then we can stimulate each of the gates FANOUT, XOR, and AND using CNOT and TOFFOLI gates as follows: +$$\begin {aligned} +\mathrm{FANOUT} (a)& = \mathrm{CNOT} (a, 0) \\ +\bigl(a, \mathrm{XOR} (a, b) \bigr) & = \mathrm{CNOT} (a, b) \\ +\bigl(a, b, \mathrm{AND} (a, b) \bigr) & = \mathrm{TOFFOLI} (a, b, 0) +\end {aligned} $$ +Thus it takes exactly one of either CNOT or TOFFOLI (and possibly a fresh bit with the value 0) to simulate the computation of a single FANOUT, XOR, or AND gate.

+ +

Composing these in the appropriate way, we can compute any classical function that we know how to compute, using only reversible gates.

+ +
    +
  • If (as is usually the case for quantum computation) the TOFFOLI or CNOT operations are not primitive operations of your computational model, the more important thing is that it be possible to realise those operations somehow. If you can decompose them into a fixed size sequence of primitive operations, then doing the computation reversibly only requires an overhead up to some constant factor, i.e. the size of the most complicated decomposition of those reversible gates. For quantum circuits, it is reasonable to suppose that this factor is at most 15 (which is not wonderful, but from a theoretical standpoint is also not terrible, and can be improved depending on what operations you allow).

  • +
  • This reversible realisation of the computation may require some extra workspace: a number of bits which is at most the number of logic gates in your procedure. In some cases, there may be cleverer ways to reversibly realise the computation which requires fewer additional bits than this: coming up with the most sparing such reversible realisation is not necessarily easy.

  • +
+ +

On efficient functions

+ +

The above remarks apply in principle to any classical circuit construction, and indeed to the primitive operations in any higher-level gate model (e.g. the CORDIC-based circuits of your question or any digit-extraction algorithm to compute some function). In principle, given a modest amount of (sufficiently high quality) additional memory, we can simulate any such circuit on a gate-by-gate basis to provide reversible equivalents with the same number of gates, or nearly so.

+ +

For more complicated functions, there is ironically enough more opportunities to save on the additional workspace required, which are impossible for the simpler gates (because those gates are too simple to provide opportunities to save) — economies of scale become possible, though not guaranteed.

+ +

The important part is that, additional workspace aside, these realisations will respect most notions of 'efficiency'. It does not increase the depth or size of the circuit by more than a constant factor, if at all. If you care about polynomial-size, linear-size, poly-log-depth, what-have-you — this simulation method preserves it.

+",124,,124,,4/27/2019 13:36,4/27/2019 13:36,,,,3,,,,CC BY-SA 4.0 +5987,2,,5980,4/27/2019 17:34,,6,,"

I agree with the main points that Niel makes: not all operators are observables, and the purpose of the ones you list is typically to transform states, not to be measured. However, the operators you list happen to be hermitian (allowing them also to represent observables) as well as unitary (allowing them to represent transformations), so in this case we can still play devil's advocate, and ask if they have physical interpretations as measurable quantities. So, interpreting your list as observables to be measured...

+ +
    +
  • $X$, $Y$, and $Z$ are easy: these represent unitless versions of spin measurement (or the analogous quantity, if your system is not a spin system) along the three spatial coordinate directions.
  • +
  • $H$ also represents a unitless version of a spin measurement, but along an axis exactly between the $x$ and $z$ axes.
  • +
  • $\operatorname{CNOT}$ is the hardest, and I don't have a clean physical interpretation. It has eigenvalues $\pm1$ (3 eigenvectors with eigenvalue +1, and one with eivenvalue -1), and as an observable it should represent correlative properties of the two qubits. We could state what it literally measures, in terms of the four dimensions that it acts on, but this information will be less informative than just looking at its matrix form.
  • +
+ +

All this being said, typically the only one of the five that is actually measured is $Z$, and occasionally the other coordinate spin measurements.

+",7336,,26,,4/27/2019 18:20,4/27/2019 18:20,,,,0,,,,CC BY-SA 4.0 +5988,1,5990,,4/27/2019 18:48,,1,92,"

I read that the relation $\operatorname{CPHASE}_{12}=\operatorname{CPHASE}_{21}$ in the matrix representation but when I tried to work it out I don't see how.

+ +

$\operatorname{CPHASE}_{12}$ acts in the following way:

+ +

$$\operatorname{CPHASE}_{12}|00\rangle=\operatorname{CPHASE}_{12}|0\rangle|0\rangle=|0\rangle|0\rangle=|00\rangle$$

+ +

$$\operatorname{CPHASE}_{12}|01\rangle=\operatorname{CPHASE}_{12}|0\rangle|1\rangle=|0\rangle|1\rangle=|01\rangle$$

+ +

$$\operatorname{CPHASE}_{12}|10\rangle=\operatorname{CPHASE}_{12}|1\rangle|0\rangle=|1\rangle(-|0\rangle)=-|10\rangle$$

+ +

$$\operatorname{CPHASE}_{12}|11\rangle=\operatorname{CPHASE}_{12}|1\rangle|1\rangle=|1\rangle(-|1\rangle)=-|11\rangle$$

+ +

Which means its matrix representation is:

+ +

$$\operatorname{CPHASE}_{12}= \begin{pmatrix} 1 &0&0&0\\0&1&0&0\\0&0&-1&0\\0&0&0&-1 \end{pmatrix}$$

+ +

$\operatorname{CPHASE}_{21}$ though acts as follows:

+ +

$$\operatorname{CPHASE}_{21}|00\rangle=\operatorname{CPHASE}_{12}|0\rangle|0\rangle=|0\rangle|0\rangle=|00\rangle$$

+ +

$$\operatorname{CPHASE}_{21}|01\rangle=\operatorname{CPHASE}_{12}|0\rangle|1\rangle=(-|0\rangle)|1\rangle=-|01\rangle$$

+ +

$$\operatorname{CPHASE}_{21}|10\rangle=\operatorname{CPHASE}_{12}|1\rangle|0\rangle=|1\rangle|0\rangle=|10\rangle$$

+ +

$$\operatorname{CPHASE}_{21}|11\rangle=\operatorname{CPHASE}_{12}|1\rangle|1\rangle=(-|1\rangle)|1\rangle=-|11\rangle$$

+ +

Which will give matrix representation:

+ +

$$\operatorname{CPHASE}_{21}=\begin{pmatrix} 1 &0&0&0\\0&-1&0&0\\0&0&1&0\\0&0&0&-1 \end{pmatrix}$$

+ +

Obviously, the way I have done it has not produced the aforementioned identity, so where am I going wrong?

+",6254,,26,,4/27/2019 18:57,4/27/2019 22:07,Error in showing $\operatorname{CPHASE}_{12}=\operatorname{CPHASE}_{21}$ in the matrix representation,,1,0,,,,CC BY-SA 4.0 +5989,1,5992,,4/27/2019 19:08,,5,2144,"

When discussing the Dirac notation of an operator, for example, let's just say we have the bit flip gate $X$ if we want to write this in the Dirac notation does that just mean writing it as follows?

+ +

$$X|\psi\rangle=X(c_0|0\rangle+c_1|1\rangle)=c_0|1\rangle+c_1|0\rangle$$

+",6254,,26,,4/27/2019 19:12,5/1/2019 4:15,What does it mean to express a gate in Dirac notation?,,2,0,,,,CC BY-SA 4.0 +5990,2,,5988,4/27/2019 19:20,,2,,"

The gates you calculated are not controlled gates.

+ +

The $\operatorname{CPHASE}_{12}$ and $\operatorname{CPHASE}_{21}$ you calculated are just $\sigma_z \otimes \mathbb{I}$ and $\mathbb{I} \otimes \sigma_z$ respectively. These are not controlled gates. +A general controlled phase gates controlled on 1 is

+ +

\begin{equation} +\operatorname{CPHASE}_{12} = \vert 0 \rangle \langle 0 \vert \otimes \mathbb{I} + \vert 1 \rangle \langle 1 \vert \otimes R_{\phi}, +\end{equation}

+ +

where, +\begin{equation} +R_{\phi} = \begin{bmatrix} + 1 & + 0 \\ + 0 & + e^{i\phi} +\end{bmatrix} +\end{equation}

+ +

Which means $\operatorname{CPHASE}_{12}$ is +\begin{bmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & e^{i\phi} +\end{bmatrix} +You can similarly calculate the other one, +Now, even these gates are not equivalent, maybe you read that their action on some states are equivalent. Please provide the reference of your claim about the equivalency of the two gates.

+ +

How to relate to $\operatorname{CNOT}_{12}$

+ +

For $\phi = \pi$ +\begin{equation} +\operatorname{CPHASE}_{12} = \vert 0 \rangle \langle 0 \vert \otimes \mathbb{I} + \vert 1 \rangle \langle 1 \vert \otimes R_{\pi} = \vert 0 \rangle \langle 0 \vert \otimes \mathbb{I} + \vert 1 \rangle \langle 1 \vert \otimes \begin{bmatrix} + 1 & + 0 \\ + 0 & + -1 +\end{bmatrix}, +\end{equation} +A $\operatorname{CNOT}_{12}$ gate is +\begin{equation} +\operatorname{CNOT}_{12} = \vert 0 \rangle \langle 0 \vert \otimes \mathbb{I} + \vert 1 \rangle \langle 1 \vert \otimes \sigma_x = \vert 0 \rangle \langle 0 \vert \otimes \mathbb{I} + \vert 1 \rangle \langle 1 \vert \otimes \begin{bmatrix} + 0 & + 1 \\ + 1 & + 0 +\end{bmatrix}, +\end{equation}

+ +

Which means, +\begin{equation} +\operatorname{CNOT}_{12} = (\mathbb{I} \otimes R^{\pi/2}_y) \cdot \operatorname{CPHASE}_{12} \cdot (\mathbb{I} \otimes R^{-\pi/2}_y) +\end{equation}

+",5746,,26,,4/27/2019 22:07,4/27/2019 22:07,,,,21,,,,CC BY-SA 4.0 +5991,2,,5989,4/27/2019 19:25,,3,,"

This might mean using the ketbra notation:

+ +

$$X = |1\rangle \langle0| + |0\rangle \langle1|$$

+ +

This notation describes the effect the operator has on the basis vectors: in this case $X$ converts $|0\rangle$ into $|1\rangle$ and vice versa.

+ +

A couple of other examples:

+ +

$$Z = |0\rangle \langle0| - |1\rangle \langle1|$$

+ +

$$\operatorname{CNOT} = |0 \rangle\langle0| \otimes I + |1 \rangle\langle 1| \otimes X = |00\rangle \langle00| + |01\rangle \langle01| + |11\rangle \langle10| + |10\rangle \langle11|$$

+",2879,,2879,,5/1/2019 1:53,5/1/2019 1:53,,,,2,,,,CC BY-SA 4.0 +5992,2,,5989,4/27/2019 20:04,,4,,"

The Dirac notation for the Pauli-$X$ gate is:

+ +

$$|1\rangle \langle0| + |0\rangle \langle1|.$$

+ +

Now you might be wondering where this comes from. The term you're looking for is outer product representation of the $X$ gate. It follows from the spectral decomposition theorem (check Nielsen & Chuang 10th edition, p. 72) which holds for all normal operators. The key point:

+ +
+

In terms of the outer product representation, this means that $M$ can be written as $M=\sum_i\lambda_i|i\rangle\langle i|$,where $\lambda_i$ are the eigenvalues of $M$,$|i\rangle$ is an orthonormal basis for $V$, and each $|i\rangle$ an eigenvector of $M$ with eigenvalue $\lambda_i$.

+
+ +

The eigenvectors of the Pauli-$X$ gate are $-|0\rangle+|1\rangle$ and $|0\rangle+|1\rangle$, and the corresponding eigenvalues are $-1$ and $+1$ cf. Wolfram Alpha. Normalize the eigenvectors to get an orthonormal basis for $X$ i.e. $\{\frac{-|0\rangle+|1\rangle}{\sqrt{2}},\frac{|0\rangle+|1\rangle}{\sqrt{2}}\}$. According the spectral decomposition theorem you can represent the $X$ gate as:

+ +

$$-1(\frac{-|0\rangle+|1\rangle}{\sqrt{2}})(\frac{-\langle 0|+\langle1|}{\sqrt{2}}) + 1(\frac{|0\rangle+|1\rangle}{\sqrt{2}})(\frac{\langle 0|+\langle1|}{\sqrt{2}})$$ +$$=-\frac{1}{2}(|0\rangle\langle0|-|0\rangle\langle1|-|1\rangle\langle0|+|1\rangle\langle1|)+\frac{1}{2}(|0\rangle\langle0|+|0\rangle\langle1|+|1\rangle\langle0|+|1\rangle\langle1|)$$ +$$=|1\rangle \langle0| + |0\rangle \langle1|$$

+ +

To convince you that this result is correct let's apply it on an arbitrary qubit state $c_0|0\rangle+c_1 |1\rangle$:

+ +

$$(|1\rangle \langle0| + |0\rangle \langle1|)(c_0|0\rangle+c_1|1\rangle)$$ +$$=c_0|1\rangle\langle0|0\rangle+c_1|0\rangle\langle 1|1\rangle$$ +$$=c_0 |1\rangle + c_1 |0\rangle$$

+ +

So yes, our result is correct and the bits were indeed flipped upon application of $X=|1\rangle \langle0| + |0\rangle \langle1|$ to $c_0|0\rangle + c_1|1\rangle$.The last step followed from the fact that $\langle 0|0\rangle$ and $\langle 1|1\rangle$ are both equal to $1$, as $|0\rangle$ and $|1\rangle$ are orthonormal vectors i.e. their inner product $\langle \psi|\psi\rangle=1$ by definition.

+ +

We're done. As an exercise, find the outer product representation of the Pauli-$Z$ gate by yourself. And definitely, do go through the proof of the spectral theorem in Nielsen and Chung if time permits!

+",26,,2879,,5/1/2019 4:15,5/1/2019 4:15,,,,0,,,,CC BY-SA 4.0 +5993,1,5994,,4/27/2019 20:24,,3,1176,"

What is the meaning of writing a state $|\psi\rangle$ in its Bloch representation. Would I be correct in saying it's just writing out its Bloch vector?

+",6254,,55,,4/29/2019 10:28,4/29/2019 10:43,What is the meaning of writing a state in its Bloch representation?,,1,1,,,,CC BY-SA 4.0 +5994,2,,5993,4/27/2019 21:34,,7,,"

Yes. The Bloch sphere formalism is used for geometrically representing pure and mixed states of two-dimensional quantum systems a.k.a qubits. Any pure state $|\Psi\rangle$ of a qubit can be written in the form:

+ +

$$|\Psi\rangle = \cos\frac{\theta}{2}|0\rangle + e^{i\phi}\sin\frac{\theta}{2}|1\rangle$$ where $0\leq \theta\leq \pi$ and $0\leq \phi\leq 2\pi$. This $|\Psi\rangle$ can be represented on the Bloch sphere as:

+ +

+ +

The Bloch vector $\vec{a}\in \Bbb R^3$ is basically $(\sin\theta \cos\phi, \sin\theta\sin\phi, \cos \theta) = (a_1,a_2,a_3)$.

+ +

To represent mixed states you need to consider the corresponding density operator $\rho$. the set of states of a single qubit can be described in terms of $2\times 2$ density matrices and as $\{I,X,Y,Z\}$ forms a basis for the vector space of $2\times 2$ Hermitian matrices, you can write the density operator as $$\rho = a_0I+a_1X+a_2Y+a_3Z = \frac{1}{2}\begin{pmatrix}1+a_3 & a_1-ia_2 \\ a_1+ia_2 & 1-a_3\end{pmatrix}.$$ As density matrices always have trace $1$, and here $\mathrm{tr}(\rho)=2a_0$, so $a_0$ is necessarily $\frac{1}{2}$. So from here you can find out the Bloch coordinates of the any mixed state i.e. $(a_1,a_2,a_3)$ after performing the Pauli decompostion of the density matrix. If you're wondering what ensures that $|\vec{a}|\leq 1$, it's the positive semidefiniteness! The two eigenvalues of $\rho$ are $\frac{1}{2}(1+|\vec{a}|)$ and $\frac{1}{2}(1-|\vec{a}|)$. Thus, to ensure that the second eigenvalue is non-negative, $|\vec{a}|\leq 1$. The three properties of density matrices which you should drill into your brain are: self-adjointness, positive-semidefiniteness and unit trace; prove them as an exercise.

+ +

Once you determine the values $a_1,a_2$ and $a_3$ from the density operator, you can easily find the location of the qubit state $(\sin\theta \cos\phi, \sin\theta\sin\phi, \cos \theta)$ inside the Bloch sphere. Let me emphasize on this point: pure states lie on the Bloch sphere (i.e. $|\vec{a}|=1$) whereas mixed states lie inside the Bloch sphere (i.e. $|\vec{a}|<1$). If you're mathematically inclined, you'll also love to think about the Bloch sphere in terms of stereographic projections; it's excellently summarized in this Physics SE answer. I'll attach the image from there, which is originally from this blogpost (the article is in French, sorry :).

+ +

+ +

Here are a few ""further readings"" for you:

+ + + +

Essentially, go through the bloch-sphere tag; you'll find several interesting questions and answers, which should clarify most of your beginner confusions about the Bloch sphere formalism.

+",26,,26,,4/29/2019 10:43,4/29/2019 10:43,,,,0,,,,CC BY-SA 4.0 +5995,2,,3873,4/27/2019 22:34,,1,,"

The full scaling will be $O(4^n\text{poly}\left(\log\frac{1}{\epsilon}\right))$, so you do indeed get exponential scaling in the number of qubits.

+",7336,,,,,4/27/2019 22:34,,,,0,,,,CC BY-SA 4.0 +5996,2,,5985,4/27/2019 23:45,,3,,"

There are several different answers to your question, but let me give the answer that computer scientists will find most satisfying here.

+ +

As it comes to implementing general unitary operators $U$, I would like to refer you to section 4.5 in the book ""Quantum Computation and Information"" by Nielsen and Chuang. They give a construction which allows one to implement any unitary operator $U$ approximately, using only a finite set of elementary quantum gates. Note that one can use this construction to implement the controlled-$U$ operation as well.

+ +

So then the question remains how one implements the mapping $|j\rangle|y\rangle \mapsto |j\rangle U^j|y\rangle$ for $0 \leq j \leq M$. I will use the convention that if $j = j_{n-1}\dots j_0$ is the binary expansion of $j$, then $|j\rangle = |j_{n-1}\rangle \cdots |j_0\rangle$. If $M \leq 7$, then one can use the following circuit:

+ +

+ +

If we want to allow for bigger $M$, we just have to increase the size of this circuit. Note that in this construction, the number of times one has to apply the controlled $U$ operation equals $2^{\lceil \log_2(M) + 1\rceil} - 1 = \Theta(M)$.

+",24,,,,,4/27/2019 23:45,,,,1,,,,CC BY-SA 4.0 +5997,1,5999,,4/28/2019 2:00,,3,1354,"

I'm trying to compute the spectral decomposition of the Hadamard gate but I'm making a mistake somewhere.

+ +

Note: I believe (though I may be wrong so correct me if I am) that spectral decomposition is a way to find a diagonalized version of a matrix, additionally I am trying to work out $\sqrt{\operatorname{CNOT}_{12}}$, and based off an exam paper question it said to do so knowing that $\operatorname{CNOT}_{12}=H_2Z_{12}H_2$. I know that $H_2=I \otimes H$, and I thought the best way to do this would be to diagonalize $H_2$ by diagonalizing $H$ then take the square root of the diagonals of $H_2, Z$ to find $\sqrt{\operatorname{CNOT}_{12}}$.

+ +

Say we have $$H=\begin{bmatrix} \tfrac{1}{\sqrt{2}} &\tfrac{1}{\sqrt{2}} \\ \tfrac{1}{\sqrt{2}} & -\tfrac{1}{\sqrt{2}} \end{bmatrix}.$$

+ +

Now spectral decomposition of this matrix will be $H=\sum_i \lambda_i|\psi_i\rangle \langle\psi_i|$, where $\lambda_i$ corresponds to an eigenvalue and $|\psi_i \rangle$ is its associated eigenvector.

+ +

First we find the eigenvalues:

+ +

$$\det(H-\lambda I)=\det \begin{bmatrix} \tfrac{1}{\sqrt{2}}-\lambda &\tfrac{1}{\sqrt{2}} \\ \tfrac{1}{\sqrt{2}} & -\tfrac{1}{\sqrt{2}}-\lambda \end{bmatrix}$$ +$$=(\tfrac{1}{\sqrt{2}}-\lambda)(-\tfrac{1}{\sqrt{2}}-\lambda)-\tfrac{1}{2}$$ +$$=-\tfrac{1}{2}+\lambda^2-\tfrac{1}{2}=-1+\lambda^2\implies \lambda=\pm 1$$

+ +

Now we find the eigenvectors:

+ +

$\lambda=1$:

+ +

$$\begin{bmatrix} x\\y \end{bmatrix}=\begin{bmatrix} \tfrac{1}{\sqrt{2}} &\tfrac{1}{\sqrt{2}} \\ \tfrac{1}{\sqrt{2}} & -\tfrac{1}{\sqrt{2}} \end{bmatrix}\begin{bmatrix} x\\y \end{bmatrix}$$

+ +

$$\implies \tfrac{x+y}{\sqrt{2}}=x \implies (\sqrt{2}-1)x=y$$

+ +

$$\tfrac{x-y}{\sqrt{2}}=y \implies (\sqrt{2}+1)y=x$$

+ +

These equations give eigenvectors $$v_1=\begin{bmatrix} 1 \\(\sqrt{2}-1) \end{bmatrix}, v_2=\begin{bmatrix} (\sqrt{2}+1)\\1 \end{bmatrix}$$

+ +

The eigenvectors for $\lambda=-1$ are found, similarly, to be $$v_3=\begin{bmatrix} 1 \\(-\sqrt{2}-1) \end{bmatrix}, v_4=\begin{bmatrix} (-\sqrt{2}+1)\\1 \end{bmatrix}$$ +But $$H=-\begin{bmatrix} 1 \\(-\sqrt{2}-1) \end{bmatrix}\begin{bmatrix} 1 &(-\sqrt{2}-1) \end{bmatrix}- \begin{bmatrix} (-\sqrt{2}+1)\\1 \end{bmatrix}\begin{bmatrix} (-\sqrt{2}+1)&1 \end{bmatrix}+\begin{bmatrix} 1 \\(\sqrt{2}-1) \end{bmatrix}\begin{bmatrix} 1 &(\sqrt{2}-1) \end{bmatrix}+\begin{bmatrix} (\sqrt{2}+1)\\1 \end{bmatrix}\begin{bmatrix} (\sqrt{2}+1)&1 \end{bmatrix}$$

+ +

Doesn't give me a diagonal matrix, where have I gone wrong?

+",6254,,26,,4/29/2019 6:33,4/29/2019 6:33,Square root of CNOT and spectral decomposition of the Hadamard gate,,2,6,,,,CC BY-SA 4.0 +5998,2,,5997,4/28/2019 6:55,,1,,"

There are two points where you are wrong.

+ +

First: When you compute the eigenvector of H, which is $2\times 2$ matrix. So there should be one eigenvector corresponding to an eigenvalue, and should be normalized. In your computation for the case of $\lambda=1$, if you make a normalization you will find that there are the same.

+ +

Second: If you just want to get the square root of a self-adjoint one, then just make a square root of the eigenvalue is fine. That is for a self-adjoint operator: +$$A = \sum_i \lambda_i |\psi_i\rangle\langle\psi_i|$$ +then +$$\sqrt{A} = \sum_i \sqrt{\lambda_i}|\psi_i\rangle\langle\psi_i| $$

+",6128,,26,,4/28/2019 15:25,4/28/2019 15:25,,,,0,,,,CC BY-SA 4.0 +5999,2,,5997,4/28/2019 7:02,,4,,"

Firstly, there's a conceptual error in your calculation of the eigenvectors.

+ +

$$\begin{bmatrix} x\\y \end{bmatrix}=\begin{bmatrix} \tfrac{1}{\sqrt{2}} &\tfrac{1}{\sqrt{2}} \\ \tfrac{1}{\sqrt{2}} & -\tfrac{1}{\sqrt{2}} \end{bmatrix}\begin{bmatrix} x\\y \end{bmatrix}$$

+ +

$$(\sqrt{2}-1)x=y \tag{1}$$

+ +

$$(\sqrt{2}+1)y=x \tag{2}$$

+ +

(1) and (2) are equivalent equations. To convince yourself multiply both sides of (1) by $(\sqrt{2}+1)$. The point is that when you solve the eigenvalue equation, you do not get a single eigenvector but rather a linear subspace of eigenvectors. We can only put forth the form of the eigenvectors in that subspace as:

+ +

$$\begin{bmatrix}x \\ (\sqrt{2}-1)x\end{bmatrix}=x\begin{bmatrix}1 \\ (\sqrt{2}-1)\end{bmatrix}$$ where $x\in \Bbb C$.

+ +

Your other vector $\nu_2$ lies in this same linear subspace. It's equivalent to $(\sqrt{2}+1)\nu_1$.

+ +

And again, $\nu_4$ is simply $(-\sqrt{2}+1)\nu_3$.

+ +
+ +

Secondly, for finding the square root of $\operatorname{CNOT}_{12}$ you could directly diagonalize $\operatorname{CNOT}_{12}$ instead of going about it in such a roundabout fashion (i.e. writing $\operatorname{CNOT}_{12}$ as $H_2Z_{12}H_2$). However, that approach is particularly useful for this specific case; see my update below.

+ +

It's a block diagonal matrix, so you can easily diagonalize the individual $2\times 2$ blocks.

+ +

Proceed like this:

+ +

Spectral decompose the upper left block like $P\Lambda P^{-1}$ and the lower right block like $Q\Lambda'Q^{-1}$. Then $$\operatorname{CNOT}_{12}=\begin{pmatrix}P&0\\0&Q\end{pmatrix}\begin{pmatrix}\Lambda&0\\0&\Lambda'\end{pmatrix}\begin{pmatrix}P^{-1}&0\\0&Q^{-1}\end{pmatrix}.$$

+ +

The required square root is simply $$\sqrt{\operatorname{CNOT}_{12}}=\begin{pmatrix}P&0\\0&Q\end{pmatrix}\begin{pmatrix}\sqrt\Lambda&0\\0&\sqrt\Lambda'\end{pmatrix}\begin{pmatrix}P^{-1}&0\\0&Q^{-1}\end{pmatrix}.$$

+ +
+ +

Update:

+ +

Initially, I didn't understand the significance of writing the $\operatorname{CNOT}_{12}$ as $H_2Z_{12}H_2$ but the hint in the question paper helped. One obvious fact (as $H_2.H_2=\Bbb I$) is that $$\operatorname{CNOT}_{12}=H_2Z_{12}H_2 = (H_2\sqrt{Z_{12}}H_2)(H_2\sqrt{Z_{12}}H_2),$$ and so $$\sqrt{\operatorname{CNOT}_{12}}=H_2\sqrt{Z_{12}}H_2.$$

+ +

Note that $Z_{12}$ is the controlled phase gate for $\phi=\pi$.

+ +

Now, an interesting property of the controlled phase gate is:

+ +

$$\begin{pmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & e^{i\phi/2} + \end{pmatrix}.\begin{pmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & e^{i\phi/2} + \end{pmatrix}= +\begin{pmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & e^{i\phi} + \end{pmatrix}$$

+ +

So the square root of the $Z_{12}$ gate i.e. $\sqrt{Z_{12}}$ is $$\begin{pmatrix} + 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & 1 & 0 \\ + 0 & 0 & 0 & e^{i\pi/2} + \end{pmatrix}.$$

+ +

Now just pre- and post-multiply $\sqrt{Z_{12}}$ with $H_2$'s and you're done! This is indeed simpler than the spectral decomposition method I suggested earlier.

+",26,,26,,4/29/2019 4:50,4/29/2019 4:50,,,,1,,,,CC BY-SA 4.0 +6000,2,,5674,4/28/2019 14:43,,2,,"

I think you've simplified the problem too much. The way your question is framed it sounds like you expect a square-root speedup of a small problem, which doesn't seem that impressive. In actuality there may be a Grover-style speedup not of $O(\sqrt{X Y})$ but of $O(\sqrt{2^X 2^Y})$.

+ +

Let's set up the problem, and see what is to be solved.

+ +

Let's let your opponent's battleship grid be of size $X\times Y$. It is populated with $s\in\{0,1\}$ binary numbers, where $1$ is ""ship"" and $0$ is ""sea"". Thus you can think of your opponent's grid as an element $S$ of $\{0,1\}^{XY}$.

+ +

The size of and placement of ships further constrains what $S$ can be; for example, there must be two consecutive $1$'s for a destroyer, four consecutive $1$'s for a battleship, etc.

+ +

Nonetheless your goal is to guess the location of all of your opponent's $1$'s with fewest number of guesses.

+ +

Thus, you are trying to determine $S\in \{0,1\}^{XY}$. When properly framed this can be a $\mathsf{3SAT}$ instance and Grover's algorithm can get the polynomial speedup of an exponential problem.

+",2927,,,,,4/28/2019 14:43,,,,0,,,,CC BY-SA 4.0 +6002,1,6005,,4/28/2019 18:53,,3,768,"

I see a question quite a lot in past exam papers that goes like propose a quantum circuit that generates the state $|\psi \rangle$ given the initial state $|\phi\rangle$

+ +

Here's an example:

+ +

Given the initial state $|000 \rangle $ propose a quantum circuit that generates the state

+ +

$$|\psi \rangle=\tfrac{1}{\sqrt{2}} (|+++ \rangle - |--- \rangle)$$

+ +

Where $|\pm \rangle=(|0 \rangle \pm |1\rangle)/\sqrt{2}$

+ +

Now there's a square root of 2 involved so one would imagine a Hadamard gate is involved, but other than that I don't really see how you could just know the circuit apart from trial and error.

+ +

Are there any tips and tricks for making circuits that generate states given some initial state?

+",6254,,26,,4/29/2019 6:35,8/1/2019 1:22,Tips and tricks for constructing circuits to generate arbitrary quantum states,,3,0,,,,CC BY-SA 4.0 +6003,1,6007,,4/29/2019 6:02,,2,299,"

In Example 6, the case of multiple qubit controlled custom $U$ gate is covered, but I want to reuse the standard NOT symbol i.e. $\bigoplus$.

+ +

+ +

Say I want to draw this circuit, but with a $\bigoplus$ instead of the $U$ in a box. Clearly, defining a new custom gate isn't going to work as it'll still place the $\bigoplus$ in a box. I was trying to do something like this:

+ +
qubit   j0
+qubit   j1
+qubit   j2
+qubit   j3
+
+toffoli j0,j1,j2
+X   j0
+cnot    j2,j3,j0,j1
+H   j2
+measure j3
+
+ +

but as expected, I get the ERROR: [qgate] OOPS! line 8 wrong number of qubits in cnot j2,j3,j0,j1. There's also the toffoli but even that is limited to a maximum of two control qubits. It's surprising that none of the other examples cover this case. So, any idea whether it's possible to draw a multiple qubit controlled NOT using the qasm2circ package?

+",26,,26,,4/29/2019 6:12,4/29/2019 10:11,How to draw a multiple qubit controlled NOT gate using qasm2circ?,,1,0,,,,CC BY-SA 4.0 +6004,1,,,4/29/2019 7:16,,2,129,"

I have a set of transformations that transforms $|11001\rangle\to |10101\rangle$ which is basically keeping the leftmost qubit as it is and then it is just the CNOT between the successive qubits, I have done the circuit construction for this with the steps with the register $|abcde\rangle$ +$$1.~~ \operatorname{CNOT}|d,e\rangle$$ +$$2.~~ \operatorname{CNOT}|c,d\rangle$$ +$$3.~~ \operatorname{CNOT}|b,c\rangle$$ +$$4.~~ \operatorname{CNOT}|a,b\rangle$$ +after these transformations, we get the desired results, but how do I write this whole transformation in Dirac notation or matrix notation. I have figured it myself can somebody just check +for the $$1. A=\mathrm{kron}(\mathrm{kron}(\mathrm{kron}(I_2,I_2),I_2),U)$$ + $$2. B=\mathrm{kron}(\mathrm{kron}(\mathrm{kron}(I_2,I_2),U),I_2)$$ + $$3. C=\mathrm{kron}(\mathrm{kron}(\mathrm{kron}(I_2,U),I_2),I_2)$$ + $$4. D=\mathrm{kron}(\mathrm{kron}(\mathrm{kron}(U,I_2),I_2),I_2)$$ +where $$U=\begin{bmatrix} +1 &0&0&0\\ +0&1&0&0\\ +0&0&0&1\\ +0&0&1&0 +\end{bmatrix}$$ +The last step is just to multiply all these matrix so final transformation matrix is $$U_f=ABCD$$ +I have the circuit representation for $8$-qubits as

+ +

Since this is product of unitary of transformations, i need $6$ unitary matrices for this. The first of these matrices say $U_1$ that i calculated shoyld be $$ U_1= I^6\otimes \lbrace{|0\rangle \langle 0|\otimes I+|1\rangle \langle 1|\otimes X\rbrace }$$ similarly for the other $5$ matrices just the identity matrix size keeps changing. Is my inference correct, can somebody help?

+",6070,,6070,,4/29/2019 17:50,4/29/2019 17:50,Writing the transformation matrix for the following in terms of Kronecker products of elementary 2-qubit gates,,0,7,,,,CC BY-SA 4.0 +6005,2,,6002,4/29/2019 7:28,,3,,"

For the single qubit case, we can consider the circuit/operation/mapping as a rotation on the Bloch sphere, so just use the form $R_y(\theta_1)R_z(\theta_2)R_y(\theta_3)$ or any other similar stuff and try to get a set of $\{\theta\}$ to satisfy the requirements.

+ +

However, multiple qubits could be much more difficult. Take two-qubit computation, for example, you could find the decomposition is very complex if only real gates are allowed (look at this paper).

+ +

So if you don't need the exact operation giving the exact output, I would recommend quantum circuit learning.

+",4178,,26,,4/29/2019 8:05,4/29/2019 8:05,,,,0,,,,CC BY-SA 4.0 +6006,1,,,4/29/2019 8:49,,4,288,"

I am trying to use IBM Q to perform the following depolarizing channel on a state of 2 qubits $\rho=|\psi \rangle \langle \psi |$:

+ +

$$\rho \to (1-\lambda)\rho + \frac{\lambda}{4}I$$

+ +

This is within the limitations of the IBM Q. Namely 5 channels.

+ +

How can I come up with a combination of gates that will give this result?

+ +

A specific case I want to try would be

+ +

$$|\psi\rangle = \cos \theta |00\rangle + \sin \theta |11\rangle$$

+",4725,,,,,4/29/2019 8:49,Implementing a depolarizing channel for 2 qubits on IBM Q,,0,6,,,,CC BY-SA 4.0 +6007,2,,6003,4/29/2019 10:01,,1,,"

I checked the source code in the qasm2tex.py file. On line 410 the if structure goes like:

+ +
if(m):
+    (name,nctrl) = m.group(1).split(',')
+    tex = m.group(2)
+    if(tex=='bullet'):        # special for bullet, no \op{}
+        texsym = r'\b'
+    elif(tex.find(r'\dmeter')>=0):  # if meas, don't put in \op{}
+        texsym = tex
+    else:
+        texsym = '\op{%s}' % tex
+    nctrl = int(nctrl)
+    if GateMasterDef.has_key(name):
+        print ""[qasm_parser] oops! duplicate def for op %s"" % line
+    else:
+        GateMasterDef[name] = (nctrl+1, nctrl, texsym)
+    # print ""definition: %s"" % m.group(1)
+    continue
+
+ +

So there are no cases for handling oplus and times is handled, although they're defined along with bullet in the xyqcirc.tex file, as single qubit operations, i.e.

+ +
% single qubit operations
+
+\def\op#1{*+[F]{\rule[-0.2ex]{0ex}{2.1ex}#1}}   % operator in box
+\def\b{*={\bullet}}
+\def\o{*={\oplus}}
+\def\t{*={\times}}              % for swap gate
+\def\sq{*=<6pt,6pt>[F]{}}           % square, for controlled-phase
+\def\m#1{\left[\matrix{#1}\right]}      % matrix shortcut
+\def\z{*+[]{\rule[-0.2ex]{0ex}{2.1ex}~|0\>}}    % re-init to |0>
+\def\discard{*[]{\rule[-0.2ex]{0.75pt}{2.1ex}~}}    % vertical ``|''
+\def\slash{*={/}}               % slash for wire bundles
+
+ +

This is most likely a bug. However, according to the qasm2tex.py docstring it was last updated by Ike (Isaac Chuang) on 2004/03/25 15:36:59, so I'm not hoping that it'll ever be officially fixed. Anyhow, the fix is just a four-line addition to qasm2tex.py, so I'm writing it down here just in case someone finds it helpful or wishes to write their own extension to the code:

+ +
if(m):
+    (name,nctrl) = m.group(1).split(',')
+    tex = m.group(2)
+    if(tex=='bullet'):        # special for bullet, no \op{}
+        texsym = r'\b'
+    if(tex=='oplus'):
+        texsym = r'\o'        # special for oplus, no \op{}
+    if(tex=='times'):
+        texsym = r'\t'        # special for times, no \op{}        
+    elif(tex.find(r'\dmeter')>=0):  # if meas, don't put in \op{}
+        texsym = tex
+    else:
+        texsym = '\op{%s}' % tex
+    nctrl = int(nctrl)
+    if GateMasterDef.has_key(name):
+        print ""[qasm_parser] oops! duplicate def for op %s"" % line
+    else:
+        GateMasterDef[name] = (nctrl+1, nctrl, texsym)
+    # print ""definition: %s"" % m.group(1)
+    continue
+
+ +

Now to answer the original question, after the above fix has been made, the required QASM code and the corresponding TeX output is:

+ +
%   def cccnot,3,'oplus'
+% 
+%   qubit   j0
+%   qubit   j1
+%   qubit   j2
+%   qubit   j3
+% 
+%   toffoli j0,j1,j2
+%   X   j0
+%   cccnot  j2,j3,j0,j1
+%   H   j2
+%   measure j3
+% 
+
+%  Time 01:
+%    Gate 00 toffoli(j0,j1,j2)
+%  Time 02:
+%    Gate 01 X(j0)
+%  Time 03:
+%    Gate 02 cccnot(j2,j3,j0,j1)
+%  Time 04:
+%    Gate 03 H(j2)
+%    Gate 04 measure(j3)
+
+% Qubit circuit matrix:
+%
+% j0: gAxA, gBxA, gCxA, n  , n  
+% j1: gAxB, n  , gCxB, n  , n  
+% j2: gAxC, n  , gCxC, gDxC, n  
+% j3: n  , n  , gCxD, gDxD, N  
+
+\documentclass[11pt]{article}
+\input{xyqcirc.tex}
+
+% definitions for the circuit elements
+
+\def\gAxA{\b\w\A{gAxA}}
+\def\gAxB{\b\w\A{gAxB}}
+\def\gAxC{\o\w\A{gAxC}}
+\def\gBxA{\op{X}\w\A{gBxA}}
+\def\gCxC{\b\w\A{gCxC}}
+\def\gCxD{\b\w\A{gCxD}}
+\def\gCxA{\b\w\A{gCxA}}
+\def\gCxB{\o\w\A{gCxB}}
+\def\gDxC{\op{H}\w\A{gDxC}}
+\def\gDxD{\meter\w\A{gDxD}}
+
+% definitions for bit labels and initial states
+
+\def\bA{ \q{j_{0}}}
+\def\bB{ \q{j_{1}}}
+\def\bC{ \q{j_{2}}}
+\def\bD{ \q{j_{3}}}
+
+% The quantum circuit as an xymatrix
+
+\xymatrix@R=5pt@C=10pt{
+    \bA & \gAxA &\gBxA &\gCxA &\n   &\n  
+\\  \bB & \gAxB &\n   &\gCxB &\n   &\n  
+\\  \bC & \gAxC &\n   &\gCxC &\gDxC &\n  
+\\  \bD & \n   &\n   &\gCxD &\gDxD &\N  
+%
+% Vertical lines and other post-xymatrix latex
+%
+\ar@{-}""gAxC"";""gAxA""\ar@{-}""gAxC"";""gAxB""
+\ar@{-}""gCxB"";""gCxC""\ar@{-}""gCxB"";""gCxD""\ar@{-}""gCxB"";""gCxA""
+}
+
+\end{document}
+
+ +

Circuit Diagram:

+ +

+",26,,26,,4/29/2019 10:11,4/29/2019 10:11,,,,0,,,,CC BY-SA 4.0 +6008,2,,6002,4/29/2019 11:42,,2,,"

As an exam question, you're unlikely to be asked to produce some entirely arbitrary state (I guess). What you want to do is try and spot similarities to things you already know how to produce. On particularly useful strategy to think about here is a change of basis - it's a very cheap way to disguise something you know about as something else.

+ +

In this instance, have you seen the GHZ state before? Does it look kind of similar in structure? What is the difference and how do you build that into a circuit?

+ +

Once you've got a circuit that works, take a moment to see if there are any obvious simplifications you can make.

+",1837,,,,,4/29/2019 11:42,,,,0,,,,CC BY-SA 4.0 +6009,1,6025,,4/29/2019 14:37,,4,398,"

Consider an arbitrary qudit state $\rho$ over $d$ modes. +Any such state can be represented as a point in $\mathbb R^{d^2-1}$ via the standard Bloch representation:

+ +

$$\rho=\frac{1}{d}\left(\mathbb I +\sum_k c_k\sigma_k\right)$$ +with $\sigma_k$ traceless Hermitian matrices satisfying $\text{Tr}(\sigma_j\sigma_k)=d\delta_{jk}$.

+ +

In the case of a qubit, $d=2$, we can take the $\sigma_k$ matrices to be the standard Pauli matrices, and the set of states is thus mapped into a sphere in $\mathbb R^3$, which is the standard Bloch sphere representation of qubits. +For $d>2$, this picture becomes significantly more complicated, and the states are not in general mapped into a (hyper-)sphere.

+ +

In particular, the special case $d=3$ is analysed in this paper. At the beginning of page 6, the authors make the following statement:

+ +
+

It is clear that the boundary of $\Omega_3$ comprises density matrices which are singular.

+
+ +

Here, $\Omega_3$ represents the set of qutrit states in their standard Bloch representation (thus $\Omega_3\subset\mathbb R^8$).

+ +

This statement does not, however, seem so obvious to me. I understand that if $\rho$ is not singular, then it can be written as convex combinations of other states, and it would therefore seem that it could not lie on the boundary of the set of states. However, is it not in principle possible that at least a section of $\Omega_3$ is ""flat"" (as in, is a subsection of a hyperplane), so that convex combinations of states on this boundary still lie on the boundary?

+ +

Intuitively this is most likely not the case, but is there an easy way to prove it?

+ +
+ +

Related questions:

+ +
    +
  1. Geometry of qutrit and Gell-Mann matrices
  2. +
  3. What is the dimension of the space of all pure qudit states of dimension $D$?
  4. +
+",55,,55,,6/5/2019 9:36,6/5/2019 9:36,Why is the boundary of the set of states in the generalised Bloch representation comprised of singular matrices?,,2,0,,,,CC BY-SA 4.0 +6011,1,6020,,4/29/2019 16:01,,8,2583,"

What is the smartest way of calculating the expectation value of some unitary $U$ in some state $|\psi\rangle$?

+ +

There are two ways I know:

+ +
    +
  1. quantum phase estimation algorithm;
  2. +
  3. Hadamard test.
  4. +
+ +

Are there more efficient techniques to do that?

+",4144,,4144,,4/29/2019 16:03,2/19/2021 4:00,Calculating the expectation value of a unitary operator on a quantum computer,,3,2,,,,CC BY-SA 4.0 +6012,2,,1803,4/29/2019 17:15,,3,,"

This article seems to adequately explain what you are asking. It shows the growth of usable qubits in quantum computers.

+
+

So the question comes up whether Moore’s Law can also be applied to quantum qubits. And early evidence suggests that indeed it may [...]

+

+

The adiabatic line would be a prediction for quantum annealing machines like the D-Wave computers. These have followed the Moore’s Law prediction pretty closely so far with the D-Wave 1 at 128 qubits in 2011, the D-Wave 2 at 512 qubits in 2013, the D-Wave 2X at 1097 qubits in 2015, and a 2048 qubit machine in 2017. [...]

+

The Physical curve predicts the number of physical qubits that will be available. There is less historical data on these, but there are indications that these will progress rapidly too. As examples, IBM has a 5 qubit machine that is available in the cloud through the IBM Quantum Experience and Google has demonstrated a 9 qubit machine. Both of these companies, and others have indicated that these densities will increase rapidly so the Physical curve maintains the improvement rate of a doubling every year for the next 10 years and a doubling every two years thereafter.

+
+",7369,,-1,,6/18/2020 8:31,5/1/2019 9:30,,,,0,,,,CC BY-SA 4.0 +6013,2,,6011,4/29/2019 20:34,,4,,"

To find modulus of that expectation value you can use swap test on $|\psi\rangle \otimes U|\psi\rangle$.
+I doubt there are simpler ways since $\langle \psi |U|\psi\rangle$ is complex in general.

+ +

Also note, that both algorithms you mentioned require access to the controlled version of $U$. But you can't construct circuit for controlled $U$ if $U$ is given as blackbox. Though there are ways to physically implement controlled version. See here.

+",5870,,,,,4/29/2019 20:34,,,,1,,,,CC BY-SA 4.0 +6015,1,,,4/29/2019 23:21,,3,169,"

I am trying to make a 2-qubit maximally mixed state $\mathbb{I}/4$ where $\mathbb{I}$ is the identity $4\times 4$ matrix.

+ +

I know that, for a maximally mixed 1-qubit state I can use a Hadamard gate, and a CNOT gate with an ancilla, and then trace out the ancilla as follows:

+ +

$$(H\otimes \mathrm{id})(|0\rangle \otimes |0\rangle)=\frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$$

+ +

Therefore, the density matrix would be

+ +

$$\rho=\frac{1}{2}(|0\rangle\langle0| + |1\rangle\langle1|)=\frac{1}{2}\begin{pmatrix}1&0\\0&1\end{pmatrix}$$

+ +

How can I do the same for 2 qubits?

+",4725,,7336,,4/30/2019 5:47,4/30/2019 5:47,Making a maximally mixed 2-qubit state in the IBM Q,,1,0,,,,CC BY-SA 4.0 +6016,2,,6015,4/30/2019 1:15,,2,,"

Prepare two qubits each in the single-qubit maximally mixed state. Their state together will be the two-qubit maximally mixed state ;) You could prepare them sequentially and use the same ancillary qubit for both.

+",7336,,,,,4/30/2019 1:15,,,,2,,,,CC BY-SA 4.0 +6017,1,6031,,4/30/2019 2:57,,1,96,"

Let $f(x,y)$ be a random 2n- to 1-bit function.

+ +

Consider the quantum circuit $|x,y,z\rangle \to |x,y,z\oplus f(x,y)\rangle$.

+ +

Is the new state entangled in general?

+ +

Is it entangled if $x,y$ are $H^{\bigotimes n}|0\rangle$ ?

+",7371,,26,,5/1/2019 9:35,5/1/2019 11:57,"Is $ |x,y,z\oplus f(x,y)\rangle$ entangled?",,2,1,,,,CC BY-SA 4.0 +6018,2,,6017,4/30/2019 3:17,,3,,"

It depends on the input state.

+ +

If f(x, y) is zero for all x, y in the superposition, then the output will equal the input.

+ +

This operation is its own inverse, so if you apply it to an unentangled state u and get an entangled state v, that means when you get v as an input state the operation actually disentangles it.

+",119,,,,,4/30/2019 3:17,,,,1,,,,CC BY-SA 4.0 +6019,1,,,4/30/2019 5:13,,4,101,"

I am playing with the IBM Q and I would like to know what interesting properties I can measure with only a 1 qubit state. This is because things like Bell's inequalities, concurrence, PPT criterion, etc. are all for 2 qubit states (which I plan on doing, eventually).

+",4725,,26,,5/1/2019 10:02,3/26/2021 10:25,What interesting properties can I measure with a 1 qubit state?,,1,4,,,,CC BY-SA 4.0 +6020,2,,6011,4/30/2019 12:09,,7,,"

Since the state $|\psi\rangle$ is known, we can assume that we have a preparation procedure that takes some standard state (call it $|0\rangle$, although in general it will be composed of many qubits). Thus, there is a unitary $V$ such that +$$ +V|0\rangle=|\psi\rangle. +$$

+ +

In that case, to measure $|\langle\psi|U|\psi\rangle|^2$, we simply follow the procedure

+ +
    +
  1. Prepare $|0\rangle$
  2. +
  3. Apply $V$
  4. +
  5. Apply $U$
  6. +
  7. Apply $V^\dagger$
  8. +
  9. Measure in a basis for which $0\rangle$ is one of the elements
  10. +
  11. Repeat until you have a suitably accurate estimate of the probability of getting the answer $|0\rangle$.
  12. +
+ +

This probability is your answer.

+ +

If you want $\langle\psi|U|\psi\rangle$, the Hadamard test is probably your best bet. Yes, it requires controlled-$U$, but you're going to need something like that. This is because there's no observable difference between $U$ and $e^{i\theta}U$, so nothing you do can access the phase of $\langle\psi|U|\psi\rangle$ (but there is a difference between controlled-$U$ and controlled-$e^{i\theta}U$).

+",1837,,,,,4/30/2019 12:09,,,,0,,,,CC BY-SA 4.0 +6021,1,,,4/30/2019 12:46,,1,88,"

I am working with a circuit where I use 4 cables, and perform measurements in all of them. Nevertheless, I am only interested in the results from two cables since the other two are ancillas. When I run the circuit in the processor I get more than 4 bars. How do I interpret my results? I attached an example.

+ +

Processor:

+ +

+ +

Simulator:

+ +

+ +

In this case (and with any other test I ran), if I add up the processor's result for 00000 and 00010 I get almost the same result for 00000 in the simulator. I don't know if this is due to the partial traces.

+",4725,,26,,5/2/2019 4:22,5/2/2019 4:22,Interpreting results from IBM's processor vs. simulator,,1,1,,,,CC BY-SA 4.0 +6022,2,,6021,4/30/2019 13:39,,1,,"

When you run in the simulator you are running in an ""ideal"" environment. This means there is no noise that could cause errors in the readouts. That is why the results you get from the simulator are only those 3 expected results.

+ +

However, when you run on the real devices, in this case 'ibmqx2', the environment is not a perfect one. The real devices are noisy, and that noise affects the qubits. These errors are seen when you measure the qubits and experience all of the other unexpected results. You will still see the expected answer as having the highest probability in most cases, though.

+",6180,,,,,4/30/2019 13:39,,,,2,,,,CC BY-SA 4.0 +6023,1,,,4/30/2019 14:53,,3,537,"

Note: Cross-posted on Physics SE.

+ +

I made some circuit to prepare a 2 qubit state, but I am having trouble understanding how to measure Bell's inequality. I know the inequality is of the form

+ +

$$|E(a,b)-E(a,b')+E(a',b)+E(a',b')| \leq 2$$

+ +

where for each $E$

+ +

$$E = \frac{N_{++} + N_{--} - N_{-+} - N_{+-}}{N_{++} + N_{--} + N_{-+} + N_{+-}} $$

+ +

My problem is, what would the different $a,a',b,b'$ be? With this question, I don't mean what their values would be (since IBM Q just outputs $0$ or $1$ in the $01$ basis), but how do I implement this?

+ +

Can I just do $a,b$ in $01$ basis and $a',b'$ in $\pm$ basis? And if so, how do I proceed with this? Do I just apply a Hadamard gate before the measurement and take whatever $0$ or $1$ value it outputs?

+",4725,,26,,5/1/2019 9:54,5/1/2019 9:54,How to measure a Bell inequality violation in IBM Q?,,0,1,,,,CC BY-SA 4.0 +6024,1,6032,,4/30/2019 15:52,,0,292,"

Nilsen states that one can define a function for the oracle in the Grover algorithm, which is constructed as follows. So there is a number $m$ that consists of $p$ and $q$ (both primes) $m = pq$. Now define a function that says $f (x) \equiv 1 $ if $x$ divides $m$, 0 otherwise.

+ +

Then the function $f(x)$ for $x \in \{1,7,11,77\}$ would be 1. That means in the algorithm then the amplitudes of these states would be negated and increased by the diffusion operator. If I measure the register then say I could measure states $1, 7, 11, 77$. But 1 and 77 do not bring me much as prime factors?

+ +

So that I actually measure 7 and 11 as correct prime factors, would it be enough to simply rerun the algorithm?

+",,user4961,26,,5/1/2019 9:34,5/1/2019 12:20,Grover's algorithm and RSA from Nielsen,,1,3,,,,CC BY-SA 4.0 +6025,2,,6009,4/30/2019 16:30,,2,,"

Your intuition is correct, since rank-2 density matrices will be convex combinations of rank-1 density matrices, but they will be singular and hence will still be on the boundary.

+ +

We can prove that non-singular $\rho$ are in the interior of $\Omega_3$ with a fairly direct proof. Let $\epsilon>0$ and let $\rho'$ be some matrix (the Bloch representation of some vector of $\mathbb{R}^8$) such that $\Vert\rho-\rho'\Vert<\epsilon$. Because $\rho'$ is a Bloch representation of something, it has trace 1, so if we want to show that it's a density matrix, we just need to show that it's positive. To do this we show that $\langle v,\rho'v\rangle\geq 0$ for all vectors $v$.

+ +

Note that since $\rho$ is non-singular, it has a minimum eigenvalue $\lambda>0$. Thus, $\langle v,\rho v\rangle\geq\lambda\Vert v\Vert^2$ for all vectors $v$. We also have that $\vert \langle v,(\rho-\rho')v\rangle\vert\leq \Vert \rho-\rho'\Vert\Vert v\Vert^2$. Combining these facts: +$$\begin{aligned}\langle v,\rho'v\rangle=&\langle v,(\rho'-\rho) v\rangle+\langle v,\rho v\rangle \\ +\geq & -\Vert \rho-\rho'\Vert\Vert v\Vert^2+\lambda \Vert v\Vert^2\\ +>&-\epsilon\Vert v\Vert^2+\lambda\Vert v\Vert^2 +\end{aligned}$$ +If we choose $\epsilon<\lambda$, this will be positive for all such $\rho'$. Thus, the ball of radius $\epsilon$ around $\rho$ is contained in $\Omega_3$, so $\rho$ is an interior point.

+",4517,,4517,,5/1/2019 9:50,5/1/2019 9:50,,,,6,,,,CC BY-SA 4.0 +6026,1,6027,,4/30/2019 18:02,,3,227,"

I am trying to understand how the quantum gates work, so I started with the simplest one, the Pauli X gate.

+ +

I get that it turns $|0\rangle$ into $|1\rangle$ and $|1\rangle$ +to $|0\rangle$.

+ +

So my question is how do I read its matrix:

+ +

\begin{equation} +X = \begin{bmatrix} +0 & 1 \\ +1 & 0 +\end{bmatrix} +\end{equation}

+ +

What maps to it?

+",7375,,26,,5/1/2019 9:49,5/1/2019 9:49,How to interpret the matrix representation of a quantum gate?,,1,2,,,,CC BY-SA 4.0 +6027,2,,6026,5/1/2019 3:01,,3,,"

Lets understand this first using Bra-Ket notation then we move on to answering : what does a matrix maps by just looking at it.

+ +

Lets get some basics out of the way, +the vectors $\vert 0 \rangle$ and $\vert 1 \rangle$ are represented by,

+ +

\begin{equation} +\vert 0 \rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix} \ \ \ \ \ \& \ \ \ +\vert 1 \rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix}. +\end{equation}

+ +

This implies, +\begin{equation} +\vert 0 \rangle \langle 1\vert = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} +\ \ \ \ \ \& \ \ \ +\vert 1 \rangle \langle 0\vert = \begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix}. +\end{equation}

+ +

Now, I can write my $X$ gate as, +\begin{equation} +X = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix} = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} ++ \begin{bmatrix} 0 & 0 \\ 1 & 0 \end{bmatrix} = \vert 0 \rangle \langle 1\vert + \vert 1 \rangle \langle 0\vert . +\end{equation}

+ +

The term $\vert 1 \rangle \langle 0\vert$ maps $\vert 0 \rangle \rightarrow \vert 1 \rangle$, and the term $\vert 0 \rangle \langle 1\vert$ maps $\vert 0 \rangle \rightarrow \vert 1 \rangle$. You can see this by:

+ +

\begin{equation} +\left(\vert 0 \rangle \langle 1 \vert\right) \vert 1\rangle = \vert 0 \rangle +\ \ \ \ \ \& \ \ \ +\left(\vert 1 \rangle \langle 0 \vert\right) \vert 0\rangle = \vert 1 \rangle. +\end{equation}

+ +

Given a matix you can always write it in this bra-ket notation, and easily see how it maps.

+ +

As you gain experience working with these it is easy to see that a general matrix pictorially can be represented as, +\begin{equation} +\begin{bmatrix} a & b \\ c & d \end{bmatrix} = \begin{bmatrix} a\vert 0 \rangle\langle 0 \vert & b \vert 0 \rangle\langle 1 \vert \\ c\vert 1 \rangle\langle 0 \vert & d\vert 1 \rangle\langle 1 \vert \end{bmatrix} +\end{equation} +Note the word pictorially, cause the way I wrote it, in standard text it would imply a $4\times4$ matrix. Now given a matrix you can easily work out how each of the non-zero term acts on the basis states $\vert 0 \rangle, \vert 1 \rangle$ ans see where the matrix maps to.

+ +

For example, +\begin{equation} +Z = \begin{bmatrix}1 & 0 \\ 0 & -1 \end{bmatrix} +\end{equation} +has non-zero terms $\vert 0 \rangle\langle0 \vert$ which maps $\vert 0 \rangle \rightarrow \vert 0 \rangle$, and $-\vert 1 \rangle\langle1 \vert$ which maps $\vert 1 \rangle \rightarrow -\vert 1 \rangle$.

+ +

Now a homework for you, Understand the mapping of Hadamard gate and then move on to understand $CNOT$ gate.

+ +

Note: I did not worry about what $\vert 1 \rangle \langle 0\vert$ maps $\vert 1 \rangle$ to, cause of orthogonality.

+ +

EDIT : After writing this I realized maybe you are asking the following

+ +

Lets say someone gives you a mapping and ask you to find the matrix that applies the said mapping. Note that +$$ +\vert x \rangle \langle b \vert +$$ +maps $\vert b \rangle $ to $\vert x \rangle$. +So as an example if one asks you find the matrix that maps +$\vert 0 \rangle \rightarrow (\vert 0 \rangle + \vert 1 \rangle)/\sqrt{2}$ + and $\vert 1 \rangle \rightarrow (\vert 0 \rangle - \vert 1 \rangle)/\sqrt{2}$ you can easily write the matrix being

+ +

$$ +\frac{\vert 0 \rangle + \vert 1 \rangle}{\sqrt{2}}\langle 0 \vert + \frac{\vert 0 \rangle - \vert 1 \rangle}{\sqrt{2}}\langle 1 \vert +$$

+ +

$$ +=\frac{1}{\sqrt{2}}(\vert 0 \rangle\langle 0 \vert + \vert 0 \rangle\langle 1 \vert + \vert 1 \rangle\langle 0 \vert - \vert 1 \rangle\langle 1 \vert) = \frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\ 1 & -1 \end{bmatrix} +$$

+",5746,,5746,,5/1/2019 8:32,5/1/2019 8:32,,,,5,,,,CC BY-SA 4.0 +6028,1,,,5/1/2019 3:56,,4,72,"

Example 2 in arXiv:1811.09896 states that the "Choi EW (entanglement witness) $W^{(+)}$ obtained from the Choi map in $d=3$ $\ldots$ is given by +\begin{equation} +W^{(+)} = \frac{1}{6} \left( \sum_{i=0}^{2} [ 2| ii \rangle \langle ii | + | i,i-1 \rangle \langle i, i-1 | ] - 3 \mathrm{P}_{+} \right) \nonumber, +\end{equation} +where $\mathrm{P}_+ = |\phi^+\rangle \langle \phi^+|$ with the Bell state $|\phi^+\rangle = (|00\rangle + |11\rangle + |22\rangle) / \sqrt{3}$." It is noted that this is applicable in the two-qutrit ($9 \times 9$ density matrix) setting.

+

I would like to know - if it exists - a two-qudit analogue, applicable to $16 \times 16$ density matrices. If it does, I presume the summation would run from 0 to 3, and the $\sqrt{3}$ in the new (obvious) Bell state formula be replaced by 2. Might the coefficient 2 be replaced by 3, and the $3 P_+$ by $4 P_+$? The $\frac{1}{6}$ does not seem of particular importance for testing purposes.

+

However, the last paragraph of arXiv:1105.4821 strongly suggests that there is no simple/direct two-qudit analogue.

+",3089,,55,,9/23/2021 7:38,9/23/2021 7:38,Is there a two-qudit Choi entanglement witness $W^{(+)}$?,,0,0,,,,CC BY-SA 4.0 +6029,2,,6009,5/1/2019 9:56,,2,,"

Non-singular density matrices $\rho$ have no zero eigenvalues, $\lambda=\lambda_{\mathrm{min}}(\rho)>0$, with $\lambda_{\min}$ the smallest eigenvalue. Then, the ball +$$ +\{\rho+M|-\lambda I \le M \le \lambda I\} +$$ +will also be in the set of density operators, and thus, $\rho$ is an interior point.

+",491,,,,,5/1/2019 9:56,,,,0,,,,CC BY-SA 4.0 +6030,1,,,5/1/2019 10:58,,5,159,"

I am new to the concept of topological quantum computation (TQC).

+ +

Recently I have been thinking about simulating a quantum computer on a classical computer. I know that if I use merely the unitary matrices, the process will be very slow due to the $2^n$ factor, as is pointed out by many SE answers, such as this to name one.

+ +

My question is that what if I don't simulate quantum computers that way? What if I simulate a TQC, by (for example) introducing defects on a 2D topological insulators, and do some ""simulated"" manipulations on such defects? Will that be faster than the brute-force matrix-multiplication method?

+ +

I suspect that in this way, all the calculations will be reasonably small since the simulation should scale linearly with more ""qubits"", which is just an ab-initio calculation.

+ +

Part of me thinks that simulating a TQC will be better, while part of me thinks that this can't be right, TQC should be equivalent to QC.

+ +

Is there anything I am missing? Or simulating a TQC is indeed faster and better? And if so, why is quantum supremacy has not been achieved yet?

+",7379,,7379,,5/2/2019 8:10,11/26/2021 22:03,Simulating quantum computers using anyon braiding,,1,4,,,,CC BY-SA 4.0 +6031,2,,6017,5/1/2019 11:19,,1,,"

If applied on $H^{\otimes n}|0\rangle$ then the result will be entangled if $f$ is not constant also in the simpler situation.

+ +

Suppose $x,y$ are $n$-bit strings, $\forall x,y:~ U|x,y\rangle = |x, y \oplus f(x) \rangle$ and $|\phi\rangle = U \cdot H^{\otimes n}|0\rangle\otimes|y\rangle$ for some bit string $y$. Let's calculate $|\phi\rangle\langle\phi|$. +$$ +|\phi\rangle\langle\phi| = U \cdot \frac{1}{2^{n-1}}\sum_{i=0}^{2^n-1}|i\rangle\otimes|y\rangle \cdot \frac{1}{2^{n-1}}\sum_{j=0}^{2^n-1}\langle j|\otimes\langle y| \cdot U^\dagger = +$$ +$$ += \frac{1}{2^{n}} \sum_{i=0}^{2^n-1}|i\rangle\otimes|y\oplus f(i)\rangle \cdot \sum_{j=0}^{2^n-1}\langle j|\otimes\langle y \oplus f(j)| = +$$ +$$ += \frac{1}{2^{n}} \sum_{i=0}^{2^n-1}\sum_{j=0}^{2^n-1}|i\rangle\langle j|\otimes|y\oplus f(i)\rangle\langle y \oplus f(j)| +$$ +Now we can calculate partial trace of $|\phi\rangle\langle\phi|$ over the first subsystem +$$ +\text{tr}_1\left(|\phi\rangle\langle\phi|\right) = \text{tr}_1\left(\frac{1}{2^{n}} \sum_{i=0}^{2^n-1}\sum_{j=0}^{2^n-1}|i\rangle\langle j|\otimes|y\oplus f(i)\rangle\langle y \oplus f(j)|\right) = +$$ +$$ +=\frac{1}{2^{n}} \sum_{i=0}^{2^n-1}|y\oplus f(i)\rangle\langle y \oplus f(i)| +$$ +The result is pure state if and only if $f$ is constant. Hence $|\phi\rangle$ is entagled iff $f$ is not constant.

+",5870,,5870,,5/1/2019 11:57,5/1/2019 11:57,,,,2,,,,CC BY-SA 4.0 +6032,2,,6024,5/1/2019 12:20,,2,,"

If you implement an oracle for Grover's algorithm that sometimes gives unhelpful answers, you can, as you suggest, rerun and remeasure. In your example, there are only two incorrect answers $x=0$ and $x=m$. With the way you defined $f(x)$, these would indeed be negated and diffused. Because there are only two bad answers, the impact may be small.

+ +

However the oracle in Grover's Algorithm can be anything that you can define. So you can explicitly define $f(x)$ to be $1$ iff $x$ divides $m$ and $x\not\in \{0,m\}$. This has the effect of making $f$ a little more complicated of course, increasing the gate count, but depending on the situation it may be more efficient than having to rerun/remeasure.

+ +

Is there a reason you wish to run Grover's algorithm to factor a number? Are you trying to understand something in N&C?

+",2927,,,,,5/1/2019 12:20,,,,1,,,,CC BY-SA 4.0 +6033,1,6035,,5/1/2019 18:18,,3,328,"

Consider two finite dimensional Hilbert spaces $A$ and $B$. If I have an isometry $V:A\rightarrow A\otimes B$, under what condition can I find a unitary $U:A\otimes B\to A\otimes B$ such that $$U\rho_{A}\otimes |\psi\rangle\langle \psi|_BU^\dagger=V\rho_{A}V^\dagger$$

+ +

for some state $|\psi\rangle_B$? The motivation is I have an isometry like $V$ and I would like it very much for a state to satisfy $S(A)_\rho=S(AB)_{V\rho V^\dagger}$ where $S$ is quantum entropy. Is this possible?

+",5125,,10480,,3/20/2021 6:11,3/20/2021 6:11,Can an isometry leave entropy invariant?,,2,2,,,,CC BY-SA 4.0 +6034,1,,,5/1/2019 19:32,,-1,158,"

I am stuck in a dilemma about how to proceed with a quantum computing algorithm that changes the original state of a system to another.

+ +

Say I have a superposition of all $8$ bit integer values that are stored in the form of a $256\times 256$ matrix $A$. In total I would then need $8+16=24$ qubits to represent the matrix, with the first $8$ qubits representing the value in binary i.e $x\in \{0,1\}^8$ and similarly with index needing $8+8$ qubits.

+ +

Suppose I write this matrix in a uniform superposition of all the initial states. If I don't want to perform any operation on this matrix; I need to multiply it with a unitary matrix of size $ 2^{24}\times 2^{24}$.

+ +

Implementing such a huge matrix on classical computers just to do technically nothing seems weird. Does quantum computing just theorize this concept for the future? Is merely writing this sufficient when I use classical methods?

+",6070,,91,,5/1/2019 22:42,5/2/2019 22:04,Large size of matrices for little outcome,,1,8,,5/4/2019 19:49,,CC BY-SA 4.0 +6035,2,,6033,5/1/2019 19:33,,5,,"

You don't need any additional conditions beyond those already stated in the question. That is, for any isometry $V: A \rightarrow A\otimes B$ and any unit vector $|\psi\rangle_B$, there will always be a unitary $U$ satisfying the equation in the question (simultaneously for every choice of $\rho_A$).

+ +

One way to see this is to first pick any orthonormal basis $\{|1\rangle,\ldots,|n\rangle\}$ for $A$, and then consider the two sets $\{|1\rangle\otimes|\psi\rangle, \ldots, |n\rangle\otimes|\psi\rangle\}$ and $\{V|1\rangle,\ldots,V|n\rangle\}$. These are orthonormal sets (using the fact that $V$ is an isometry in the second case), so you can extend them both to be orthonormal bases of $A\otimes B$ and choose a unitary $U$ that maps the first completed basis to the second. Of course there are many ways to do this in general, but in particular you can choose $U$ so that it maps $|k\rangle\otimes|\psi\rangle$ to $V|k\rangle$ for each $k \in \{1,\ldots,n\}$. This implies that the equation in the question is satisfied.

+ +

Note that if what you really want is $S(A)_{\rho} = S(AB)_{V\rho V^{\dagger}}$, then it is simpler to conclude that this is always true from the observation that $\rho$ and $V \rho V^{\dagger}$ must agree on their nonzero eigenvalues.

+",1764,,,,,5/1/2019 19:33,,,,0,,,,CC BY-SA 4.0 +6036,2,,6033,5/1/2019 19:37,,4,,"

You can always do that.
+Subspaces $\text{Im}(V)$ and $A\otimes |0\rangle$ have the same dimension, so there must be some unitary that translates one subspace to another. That is, $\exists W \in \text{Unitary}(A\otimes B), W(\text{Im}(V)) = A\otimes |0\rangle$. Now $WV$ translates $A$ to $A\otimes |0\rangle$. Since $V$ is isometry $WV$ is also isometry, hence there exists unitary $Y$ on $A$ such that $WV|\phi\rangle = Y|\phi\rangle\otimes |0\rangle$.
+Now the unitary you are looking is $U = W^{-1}\cdot Y\otimes I$.

+",5870,,,,,5/1/2019 19:37,,,,0,,,,CC BY-SA 4.0 +6037,1,,,5/2/2019 5:36,,9,1655,"

What is the representation of the CH gate in ZX-calculus?

+ +

Is there a general recipe for going from a ZX-calculus representation of a gate to the representation of the controlled version?

+",1370,,26,,5/2/2019 6:12,5/6/2019 11:45,Controlled Hadamard gate in ZX-calculus,,4,0,,,,CC BY-SA 4.0 +6038,1,15393,,5/2/2019 6:01,,7,506,"

Suppose we use Uhlmann-Jozsa fidelity

+

$$ +F(\rho, \sigma):=\left(\mathrm{tr}\sqrt{\sqrt{\rho}\sigma\sqrt{\rho}}\right)^2. +$$

+

Can we construct a quantum circuit that helps us calculate the fidelity of two mixed states?

+",4178,,2927,,3/20/2021 23:31,3/20/2021 23:31,Quantum circuit for computing fidelity,,1,0,,,,CC BY-SA 4.0 +6041,2,,6037,5/2/2019 12:11,,6,,"

The easiest way to do this would be to use the general controlled unitary construction given in this post: Given a decomposition for a unitary $U$, how do you decompose the corresponding controlled unitary gate $C(U)$? translate the circuit to ZX and hopefully simplify the circuit using ZX rewrite rules to get a nicer expression.

+",2649,,,,,5/2/2019 12:11,,,,0,,,,CC BY-SA 4.0 +6042,2,,6037,5/2/2019 12:12,,11,,"

In answer to your first question, yes there is a way to build controlled-$H$ in ZX. It more or less mirrors the construction in quantum circuits. First, one can construct controlled-$Z$-phase gates using the technique described in the ""Quantum Computing"" chapter of mine and Coecke's book (Picturing Quantum Processes, p. 687):

+ +

+ +

n.b. the white dots are $Z$-spiders, gray dots are $X$-spiders.

+ +

This is a controlled phase gate, which conditionally applies a $Z(\alpha)$ on the second qubit if the first qubit is $|1\rangle$. Using the bialgebra law, it is not too hard to show this is actually equivalent to a more familiar ""circuit-like"" form of the gate:

+ +

+ +

From the controlled-$\operatorname{Z}$ phase gate, wrap the control bit in Hadamards to get a controlled-$X$ phase gate.

+ +

To create a controlled Hadamard, take its Euler decomposition to get $Z(\pi/2) X(\pi/2) Z(\pi/2)$, then to get the controlled version, replace each of the phase gates with controlled-phase gates.

+ +

As a general rule (and somewhat in line with Nick's answer), any ""circuit-like"" ZX-diagram (i.e. built out of $\operatorname{CNOT}$, $H$, and phase gates) can be transformed into the controlled version much like you can with a circuit. Phases become controlled-phases, $H$s becomes controlled-$H$s, and $\operatorname{CNOT}$s become Toffolis (which can also be constructed from spiders, though it's a bit more elaborate).

+ +

There is also a general technique for adding control wires to ZX-diagrams, which is explained in a recent paper by Jeandel, Perdrix, and Vilmart: arXiv:1805.05296

+ +

However, either technique tends to yields big, unwieldy diagrams. If you find you are working with controlled or multiply-controlled operations a lot, the ZH calculus (a variation on ZX which allows many-legged $H$-gates) could be more convenient to work with: arXiv:1805.02175.

+",7392,,26,,5/2/2019 13:53,5/2/2019 13:53,,,,2,,,,CC BY-SA 4.0 +6043,1,,,5/2/2019 14:05,,1,311,"

What are some introductory textbooks and resources on quantum computing that do not use Dirac-notation, but rather ordinary mathematical notation (i.e. the notation used by mathematicians to represent vectors, dual vectors, norms, tensor products, inner products, operators, etc.)?

+",7367,,26,,5/4/2019 8:08,5/6/2019 7:45,Resources for quantum computing which do not use Dirac notation,,2,8,,,,CC BY-SA 4.0 +6045,2,,6043,5/2/2019 14:45,,3,,"

Note: There's some merit in not using the Dirac notation if you're a mathematics student. Mathematics deals with broader classes of spaces than just Hilbert spaces and the properties of Hilbert spaces don't simply carry over cf. this. For instance, in Banach spaces the norm isn't necessarily given by an inner product. In fact, there exist generalizations to quantum theory which specifically employ special Banach spaces rather than the narrower class of Hilbert spaces. It's the additional geometric structure imposed on the Hilbert space that allows for the bra-ket notation. Using this notation naively when you're studying the properties of the Hilbert spaces as an example of a broader class, isn't a great idea. That said, the bra-ket notation has some beautiful properties cf. the discussion on Physics SE and has almost become a tradition in physics. You'll have a hard time following the popular literatures in quantum computing if you do not pick it up over time. Prof. Balakrishnan's has a wonderful lecture on this topic! At the end of the lecture, he remarks that ""machinery"" of Dirac notation, once established, is almost ""automatic"" and ""self-correcting"", which indeed is true.

+ +
+ +

You may be interested in Quantum Algorithms via Linear Algebra: A Primer (R.J. Lipton & K.W. Regan).

+ +

Summary of notation (including correspondence with Dirac notation)

+ +
    +
  • Quantum states (vectors in Hilbert space $\Bbb H^N$) $$\text{Ket: }|a\rangle \longrightarrow \boldsymbol{a} = \begin{bmatrix}a_0\\ \vdots \\ a_{N-1}\end{bmatrix}$$ +$$\text{Bra: }\langle a| \longrightarrow \boldsymbol{a}^* = \begin{bmatrix}a_0^* \\ \vdots \\ a_{N-1}^*\end{bmatrix}$$ +where $a_k \in \Bbb C \space \forall \space k\in\{0,N-1\}$ and * denotes complex conjugate. The $k$-th component of $\boldsymbol{a}$ i.e. $\boldsymbol{a}_k$ is represented as $\boldsymbol{a}(k)$. In the textbook, they don't really distinguish between vectors (kets) and their duals (bras) (i.e. the dual state of $\boldsymbol{a}$ is treated like $\begin{bmatrix}a_0^* & \dots & a_{N-1}^*\end{bmatrix}^T$ rather than $\begin{bmatrix}a_0^* & \dots & a_{N-1}^*\end{bmatrix}$), so be wary. Note that one particular advantage of the bra-ket notation is that it helps to distinguish a vector from its dual.
  • +
  • Norm

    + +

    $$\langle a|a\rangle^{\frac{1}{2}} \longrightarrow \langle \boldsymbol{a},\boldsymbol{a}\rangle = ||\boldsymbol{a}|| = |\sum_k\boldsymbol{a}(k)^2|^{1/2}$$

  • +
  • Tensor Product

    + +

    The tensor product of two vectors $\boldsymbol{a}$ and $\boldsymbol{b}$ is the vector $\boldsymbol{c} = \boldsymbol{a} \otimes \boldsymbol{b}$ defined by $$|c\rangle=|a\rangle\otimes |b\rangle \longrightarrow \boldsymbol{c}(ij)=\boldsymbol{a}(i)\boldsymbol{b}(j).$$

  • +
  • Matrices

    + +

    These are linear operators $\boldsymbol{U}$ on Hilbert spaces. The following properties hold: + $$U(|a\rangle+|b\rangle) = U|a\rangle + U|b\rangle \longrightarrow\boldsymbol{U(a+b)}=\boldsymbol{U(a)+U(b)}\tag{1}$$ + $$U(k|a\rangle) \longrightarrow \boldsymbol{U}(k\boldsymbol{a})=k\boldsymbol{U(a)}\tag{2}$$ + where $k$ is a scalar from the underlying field, which is generally $\Bbb C$.

  • +
  • Inner product

    + +

    The inner product of two vectors $\boldsymbol{a}$ and $\boldsymbol{b}$ is given by $$\langle a|b\rangle \longrightarrow \langle \boldsymbol{a},\boldsymbol{b}\rangle = \sum_{k=0}^{m}\boldsymbol{a}^*(k)\boldsymbol{b}(k).$$

  • +
+ +

From the Preface

+ +
+

This book is an introduction to quantum algorithms unlike any other. + It is short, yet it is comprehensive and covers the most important and + famous quantum algorithms; it assumes minimal background, yet is + mathematically rigorous; it explains quantum algorithms, yet steers + clear of the notorious philosophical problems and issues of quantum + mechanics.

+ +
+ +

Almost all summaries, notes, and books on quantum algorithms use a special notation for vectors and matrices. This is the famous Dirac notation that was + invented by Paul Dirac — who else. It has many advantages and is the + de-facto standard in the study of quantum algorithms. It is a great + notation for experts and instrumental to becoming an expert, but we + suspect it is a barrier for those starting out who are not experts. + Thus, we avoid using it, except for a few places toward the end to + givea second view of some complicated states. Our thesis is that we + can explain quantum algorithms without a single use of this notation. + Essentially this book is a testament to that belief: if you find this + book more accessible than others, then we believe it owes to this + decision. Our notation follows certain ISO recommendations, including + boldface italics for vectors and heavy slant for matrices and + operators.

+
+",26,,26,,5/6/2019 7:45,5/6/2019 7:45,,,,1,,,,CC BY-SA 4.0 +6046,2,,3873,5/2/2019 14:59,,2,,"

Note that Solovay-Kitaev theorem holds for unitaries on qu$d$it (section 5 in DN05), then we can set $d=2^n$ for $n$-qubit unitary. Following the same analysis, we obtain

+ +
    +
  • length of gate sequences $l_{\epsilon} = O(\ln^{\ln 5/\ln(3/2)} (1/\epsilon))$,
  • +
  • time complexity $t_{\epsilon} = O(\ln^{\ln 3/\ln(3/2)}(1/\epsilon))$.
  • +
+ +

Now the issue is the accuracy parameter $\epsilon$. Since $SU(d)$ is $(d^2-1)$-dimension manifold, so to approximate every gate in $SU(d)$ within $\epsilon_0$, we generate $O(1/\epsilon_0^{d^2-1})$ sequences.

+ +

Hence, for any specific universal gate set $\mathcal{G}$ the length of gate sequences $$l_0 \geq O\left(\frac{d^2-1}{\log |\mathcal{G}|} \log(1/\epsilon_0)\right).$$ +Set $d=2^n$ for $n$ qubits, then we obtain $l_0 \sim 4^n \mathrm{poly}\log(1/\epsilon)$. Therefore, you indeed need exponentially many gates for approximating unitaries on $n$ qubits.

+",1777,,26,,5/2/2019 15:25,5/2/2019 15:25,,,,0,,,,CC BY-SA 4.0 +6047,2,,5603,5/2/2019 15:58,,4,,"

Let me supplement the other answer by also showing what happens in the general case of the Bloch representation of generic qudits of dimension $d$.

+ +

Let $\rho$ be an arbitrary state over $d$ modes, that is, a $d\times d$ positive semi-definite Hermitian matrix with unit trace.

+ +

As any other Hermitian matrix, we can decompose it in terms of a basis of Hermitian matrices, writing it as something like $\rho=\sum_k c_k\sigma_k$ with $\sigma_k$ an orthonormal basis of Hermitians and $c_k\in\mathbb R$. +There are many ways to choose such a basis for the Hermitian matrices, but a fairly natural choice is to include the identity matrix in it. If we do, the constraint of orthogonality automatically imposes that all the other elements of the basis must be traceless (because we must have $\text{Tr}(\mathbb I^\dagger\sigma_k)=\operatorname{Tr}(\sigma_k)=0$). Moreover, we remember that we must have $\text{Tr}(\rho)=1$, and thus we can write the decomposition of $\rho$ as: +$$\rho=\frac{1}{d}\left(\mathbb I+\sum_k c_k\sigma_k\right),$$ +where $\text{Tr}(\sigma_j\sigma_k)=\delta_{jk}d$. +Note that this choice of normalisation is conventional (we could have equally written $\rho=\mathbb I/d+\sum_k c_k\sigma_k$ with the $\sigma_k$ normalised to one), but is somewhat ""natural"" in that it puts $\sigma_k$ to a more even footing with $\mathbb I$, whose normalisation is instead ""forced"" by the normalisation constraint on $\rho$ (of course, this is conventional as well, but is a ""very established"" convention).

+ +

It is now not hard to compute $\text{Tr}(\rho^2)$, and find it equal to +$$\text{Tr}(\rho^2)=\frac{1}{d}\left(1+\sum_k c_k^2\right)=\frac{1}{d}(1+\lvert\vec c\rvert^2).$$

+ +

The state $\rho$ being pure means that it is a projector over some pure state, $\rho=\lvert\psi\rangle\!\langle\psi\rvert$, and thus satisfies $\text{Tr}(\rho^2)=1$. +It then follows that $\rho$ is pure if and only if $|\vec c|=\sqrt{d-1}$.

+ +

It should be noted that while this result could seem to suggest that the state space for higher-dimensional systems is not significantly more complex than the Bloch sphere we have for qubits, this is far from the case. Indeed, the state space is in general not a (hyper)sphere, nor an (hyper)ellipse or other simple geometrical figure. It stretches by different amounts at different angles, and its boundary contains non-pure states. +Nevertheless, at least the length of pure states is easy to compute.

+",55,,,,,5/2/2019 15:58,,,,0,,,,CC BY-SA 4.0 +6048,2,,5603,5/2/2019 19:30,,2,,"

A simple way of proving that the purity (or any other property which only depends on the eigenvalues of $\rho$) can only depend on the distance from the center of the Bloch sphere is rotational invariance: Rotating a density matrix $\rho\mapsto U\rho U^\dagger$ corresponds to a rotation on the Bloch sphere. Thus, any property which only depends on the eigenvalues (which do not change under $\rho\mapsto U\rho U^\dagger$) can only depend on the distance from the center.

+ +

To get an explicit formula, you can then e.g. restrict to diagonal density matrices.

+",491,,,,,5/2/2019 19:30,,,,0,,,,CC BY-SA 4.0 +6049,2,,6034,5/2/2019 20:21,,1,,"

I'm confused about what you want to do with a $256\times 256$ matrix of integers $[0,1,\cdots, 255]$.

+ +

You can create a uniform superposition by Hadamard'ing $24$ separate qubits, and consider your system as the adjacency matrix of a $256$-vertex directed graph, where vertices can be connected with an edge weighted with an integer between $0$ and $2^8-1=255$.

+ +

But remember your superposition of $24$ qubits is then over all possible such graphs. When you measure your superposition, you would be drawing from all $2^{24}$ such graphs.

+ +

It sounds like you want to focus on a particular instance - e.g., you know your graph already. But then it's not clear what you are trying to achieve.

+",2927,,2927,,5/2/2019 22:04,5/2/2019 22:04,,,,0,,,,CC BY-SA 4.0 +6050,2,,6043,5/3/2019 12:27,,3,,"

Lance Fortnow has written a brief introduction to quantum complexity theory targeted at computer scientists with no background in quantum physics. It avoids the use of Dirac's bra-ket notation, except in one section that explicitly discusses its absence.

+",1771,,1771,,5/6/2019 7:26,5/6/2019 7:26,,,,2,,,,CC BY-SA 4.0 +6052,1,6053,,5/4/2019 9:08,,11,2690,"

This is a really easy question, but my mother language is not English and I get confused quite a lot reading Preskill notes.

+ +

What does a bipartite system mean? Is this just that it ""lives"" in a tensor product of two Hilbert spaces? Does it mean that the system is separable? I just want a clear definition of what bipartite means (without any other special conditions on it), so that I can know for sure. Thanks in advance!

+",6276,,55,,5/31/2021 15:03,5/31/2021 15:03,"What does ""bipartite"" mean?",,1,0,,,,CC BY-SA 4.0 +6053,2,,6052,5/4/2019 11:34,,11,,"
+

What does a bipartite system mean?

+
+ +

I'll summarize the main definitions below (adapted from Quantiki).

+ +
    +
  • Bipartite system and states: If Alice's subsystem is described by the Hilbert space $\mathcal{H}_A$ and Bob's is described by $\mathcal{H}_B$, the compound bipartite system is described by the tensor product of the two spaces, $\mathcal{H}_A\otimes \mathcal{H}_B$. State vectors and density operators on $\mathcal{H}_A\otimes \mathcal{H}_B$ are called bipartite quantum states.

  • +
  • Bipartite pure state: Let $\mathcal{H}=\mathcal{H}_A\otimes \mathcal{H}_B$ be a Hilbert space defined as a tensor product of two Hilbert spaces $\mathcal{H}_A$ and $\mathcal{H}_B$. We call some pure state $|\Psi\rangle_{AB}$ on the composite system $A\cup B$ bipartite, if it is written with respect to the partition $AB$, which means $|\Psi\rangle_{AB} = \sum_{ij}c_{ij} |i\rangle_A|j\rangle_B$, where $\{|i\rangle_A\}$ and $\{|j\rangle_B\}$ are bases in $\mathcal{H}_A$ and $\mathcal{H}_B$ respectively. Note that if $\mathcal{H}_A$ has a basis $\{|i\rangle_A\}$ and $\mathcal{H}_B$ has a basis $\{|j\rangle_B\}$ then then $\{|i\rangle_A\otimes |j\rangle_B\}$ is automatically a basis for $\mathcal{H}_A\otimes \mathcal{H}_B$.

  • +
  • Bipartite mixed state: Let $\rho_{AB}$ be a mixed state on a composite system $A\cup B$. Then we say $\rho_{AB}$ is a bipartite mixed state on $\mathcal{H}_A\otimes\mathcal{H}_B$ and write $\rho_{AB}=\sum_{ij}p_{ij}\rho_{A}^i\otimes \rho_{B}^j$ where $\{\rho_A^i\}$ and $\{\rho_B^j\}$ are bases of density operators in $A$ and $B$ respectively. Note that if $\mathcal{H}_A$ has a basis of density operators $\{\rho_A^i\}$ and $\mathcal{H}_B$ has a basis of density operators $\{\rho_B^j\}$ then then $\{\rho_A^i\otimes \rho_B^j\}$ is automatically a basis for mixed states on $\mathcal{H}_A\otimes \mathcal{H}_B$.

  • +
+ +
+

Is this just that it ""lives"" in a tensor product of two Hilbert spaces?

+
+ +

Almost, yes.

+ +
+

Does it mean that the system is separable?

+
+ +

No, not necessarily. You might want to read the Wikipedia page on Separable state.

+ +

There exist bipartite pure states $|\Psi\rangle_{AB}$ which cannot be written as $|\Psi_1\rangle_A\otimes |\Psi_2\rangle_B$ for $|\Psi_1\rangle_A\in \mathcal{H}_A$ and $|\Psi_2\rangle_B\in \mathcal{H}_B$. A bipartite state $|\Psi\rangle_{AB}$ will separable if and only if it lies in the image of the Segre embedding $$\iota: \mathbb{C}P^1 \times \mathbb{C}P^1 \to \mathcal{P}(\mathcal{H}_A \otimes \mathcal{H}_B) \cong \mathbb{C}P^3,$$ $$([x_1 : y_1],[x_2 : y_2]) \mapsto [x_1x_2:x_1y_2:y_1x_2:y_1y_2]$$ as discussed here.

+ +

Similarly, not every mixed state $\rho_{AB}$ can be written as a convex combination of product states (i.e. given $p_k\geq 0$ and $\sum_kp_k=1$) $$\rho_{AB}=\sum_kp_k\rho_A^k\otimes\rho_B^k$$ where $\{\rho_A^k\}$ and $\{\rho_B^k\}$ are bases of mixed states on subsystems $A$ and $B$ respectively.

+ +

Interestingly, unlike bipartite pure states, deciding whether an arbitrary density matrix $\rho_{AB}$ is a NP-hard problem cf. Gurvits, 2003 and this TCS SE discussion. So in general there are no nice set of rules to distinguish between entangled and separable bipartite mixed states. This is also an open research problem.

+ +

For a detailed treatment of quantum entanglement go through arXiv:quant-ph/0702225.

+",26,,26,,5/4/2019 22:24,5/4/2019 22:24,,,,3,,,,CC BY-SA 4.0 +6054,2,,6037,5/4/2019 16:13,,4,,"

If you use the symbol of triangle and lambda box in ZX, see e.g. my paper with KangFeng Ng arXiv:1706.09877, then there are two simple ways of representing the CH gate in ZX-calculus, one of them even need not any decomposition of the H gate (diagrams should be read from top to bottom):

+ +

+ +

If you don't want any H showing in CH, then you have another diagram for CH: +

+ +

From my experience, translating C(U) circuits into ZX usually is not an easy way for getting nice expression even after ZX simplification, if you don't know a nicer expression in advance.

+",7412,,7412,,5/6/2019 11:45,5/6/2019 11:45,,,,0,,,,CC BY-SA 4.0 +6056,1,,,5/4/2019 22:34,,4,45,"

It's well known that determining whether a bipartite mixed state is separable or entangled is a $\mathsf{NP}$-hard problem under some accuracy estimates (cf. this TCS SE discussion). Now I'm curious whether there exist detailed treatises on the complexity analysis of various possible cases of complete1 and partial separability of multipartite (pure and mixed) states.

+ +

Could someone provide some insight into this? Say, is there any specific case of partial separability, determining which would be a problem in $\mathsf{P}$ rather than in $\mathsf{NP}$?

+ +

1: For complete separability, I believe the same arguments apply as for the bipartite case, as mentioned by Norbert Schuch. However, it'd be interesting to look at partial separability too.

+",26,,55,,9/23/2021 7:38,9/23/2021 7:38,Complexity analysis of separability in the multipartite case,,0,1,,,,CC BY-SA 4.0 +6057,1,6058,,5/5/2019 0:47,,4,259,"

It is known that both algorithms use the same gates: $H^{\oplus n}U_fH^{\oplus n}$.

+ +

After the circuit, the qubits are in the state $\sum_y \left( \sum_x (-1)^{f(x)+xy} \right) |y\rangle $.

+ +

In DJ's algorithm, one measures the amplitude of $|0\rangle^{\oplus n}$. It can only be $0$ or $\pm 1$, and the function is balanced iff it is 0 (for any balanced or constant function).

+ +

In Bernstein-Vazirani, one measures every qubit in its $Z$ basis and deduces the bits of the dot-product function.

+ +

It seems that one can apply Bernstein-Vazirani to any balanced or constant function (not just a dot-product function) to get a bit vector, and state that the function is constant iff the vector is zero.

+ +

What seems strange to me is that all the vector returned by BV for a DJ input is not necessarily all zero or all one, so I don't understand the criterion.

+ +

How are the measurements of each qubit and of the state $|0\rangle^{\oplus n}$ related?

+",7415,,7415,,5/5/2019 10:32,5/5/2019 10:55,Deutsch-Jozsa algorithm as a generalization of Bernstein-Vazirani,,1,2,,,,CC BY-SA 4.0 +6058,2,,6057,5/5/2019 10:55,,1,,"

Finally, I found the answer myself there.

+ +

The only interesting thing is the amplitude of $|0\rangle^{\oplus n}$. +If the function is constant, it is $\pm 1$ and if the function is balanced, it is $0$.

+ +

Hence, in the first case we are sure to measure all qubits in the $|0\rangle$ state and in the second case, we cannot measure all of them in this state (else we would have the state $|0\rangle^{\oplus n}$ that has amplitude $0$).

+",7415,,,,,5/5/2019 10:55,,,,2,,,,CC BY-SA 4.0 +6059,1,6060,,5/5/2019 11:07,,1,68,"

What's the default value for a state created by QuantumRegister(1,'name_of_the_register')? Is it a $|0\rangle$ or a $|1\rangle$?

+",7405,,26,,5/6/2019 15:15,5/6/2019 15:15,Default value for a state created by QuantumRegister,,1,0,,,,CC BY-SA 4.0 +6060,2,,6059,5/5/2019 12:06,,2,,"

Here's the source code for quantumregister.py and quantumcircuit.py.

+ +

The default is $|0\rangle$. The code goes like:

+ +
from qiskit import QuantumCircuit, QuantumRegister
+qr = QuantumRegister(1) 
+circuit = QuantumCircuit(qr) 
+
+ +

By the way, if you're just beginning with Qiskit, you could check out Dr. Moran's textbook (this specific example is covered in chapter 5, ~p. 83).

+",26,,26,,5/5/2019 13:58,5/5/2019 13:58,,,,0,,,,CC BY-SA 4.0 +6062,2,,5454,5/5/2019 14:01,,1,,"

As a reminder, Shor's algorithm is implemented in the gate model of computation.

+ +

As mentioned by @nippon, factoring is can also be described as an optimization problem, which may be solved with an adiabatic algorithm - e.g., by evolving a quantum state to a minimum of $(N-xy)^2$, $x$ and $y$ may be factors of $N$.

+ +

The adiabatic algorithm's runtime is, as I understand it, notoriously fickle to be determined, being based on spectral properties of the problem Hamiltonian.

+ +

Although numerical simulations have sometimes looked encouraging, I believe it is still an open question as to whether an adiabatic factoring algorithm really provides an exponential speedup over classical factoring.

+ +

See more details in this paper by Peng, Liao, Xu, Gan Qin, Zhou, Suter, and Du - their FIG. 3 simulations of the runtime suggest a quadratic fit; however; I'm not sure if any further research on proving such a fit, or providing more evidence of even a polynomial runtime, has taken place.

+",2927,,,,,5/5/2019 14:01,,,,0,,,,CC BY-SA 4.0 +6063,1,6068,,5/5/2019 16:57,,2,384,"

I'm going through the Quantum computing for the very curious (Matuschak & Nielsen) tutorial. The example shows a $\operatorname{CNOT}$ gate where the input of the control bit is preceded by a Hadamard gate

+ +

+ +

The output of the $H$ gate (@ point 2) is $\frac{|0\rangle+|1\rangle}{\sqrt{2}}$. So far so good.

+ +

The tutorial then writes:

+ +
+

For the two qubits it doesn't affect the second qubit at all, and so it takes $|00\rangle$ to $\frac{|00\rangle + |10\rangle}{\sqrt 2}$

+
+ +

The end result is: $\frac{|00\rangle + |11\rangle}{\sqrt 2}$

+ +

(I think) I understand:

+ +
    +
  • the first qubit of $|00\rangle$ is for the control bit and the second for the target qubit
  • +
  • a $|10\rangle$ would output a $|11\rangle$ in a $\operatorname{CNOT}$ gate
  • +
+ +

However, the piece I don't understand is why is the $\frac{1}{\sqrt{2}}$ also part of the target qubit. +At point A, the input of the target qubit, remains unchanged a $|0\rangle$, no? Why does it suddenly have a $\frac{1}{\sqrt 2}$?

+",7418,,26,,5/6/2019 5:09,5/6/2019 8:04,CNOT's control qubit preceded by Hadamard: Why is sqrt also applied to target qubit?,,2,3,,,,CC BY-SA 4.0 +6064,2,,6063,5/5/2019 19:13,,3,,"

In general, you can do any computation without worrying about the norm because you cannot actually measure the norm of a quantum state.

+ +

In the simplest superposition $a |0\rangle + b |1\rangle$, you know that the probability to measure $|0\rangle$ (resp. $|1\rangle$) is proportional to $|a|^2$ (resp. $|b|^2$). Therefore, as the total must be equal to 1, if we want to directly consider the squared norms as probabilities, it implies $|a|^2 + |b|^2 = 1$.

+ +

As a convention, it is often supposed that the norm of a quantum state is $1$. Some authors don't bother to write it though.

+ +

Similarly, the quantum gates are unitary matrices. +The Hadamard gate $H$ from your question verifies indeed $HH^* = I$. A consequence is that its eigenvalues are all on the unit circle, therefore it also won't change the norm of a quantum state (it is an isometry for the Euclidean norm).

+ +

A related question is whether the phase factor (a multiplicative factor of norm 1, see Wikipedia) matters. That is, are $|0\rangle$ and $e^{i\pi/3}|0\rangle$ different?

+ +

The answer (see here for more details) is that you don't really care about the phase because all experimental values are averages obtained as real eigenvalues of an Hermitial operator, hence the phase is ignored. However, the relative phases between states matter, like in $|0\rangle + e^{i\pi/3}|1\rangle$.

+",7415,,7415,,5/5/2019 20:27,5/5/2019 20:27,,,,1,,,,CC BY-SA 4.0 +6065,1,6081,,5/5/2019 21:05,,3,168,"

Say, I wanted to implement a unitary $U_f$ to compute a Boolean function $f:B_n \to B_n$. This is done by the unitary $$U_f|x\rangle | y \rangle = +|x\rangle|y\oplus f(x)\rangle$$ which one can construct even if $f$ itself is not invertible. Now, suppose $f$ can classically be computed in polynomial time.

+ +

What is the cost of implementing $U_f$?

+",5322,,26,,5/6/2019 5:10,5/6/2019 21:21,Cost of implementing Boolean function quantumly?,,1,5,,,,CC BY-SA 4.0 +6066,1,6086,,5/5/2019 21:23,,5,103,"

Note: Cross-posted on Physics SE.

+ +

So I have to show that a superoperator $\$$ cannot increase relative entropy using the monotonicity of relative entropy:

+ +

$$S(\rho_A || \sigma_A) \leq S(\rho_{AB} || \sigma_{AB}).$$

+ +

What I have to prove:

+ +

$$S(\$\rho|| \$ \sigma) \leq S(\rho || \sigma).$$

+ +

Now the hint is that I should use the unitary representation of the superoperator $\$$. I know that we can represent $ \$ \rho = \sum_i M_i \rho M_i^{\dagger} $ with $\sum_i M_i M_i^{\dagger} = I$. Now I am able to write out $S(\$\rho|| \$ \sigma_A)$ in this notation, but that doesn't bring me any further.

+ +

Does anyone have any idea how to show this in the way that the questions hints to? I already read the original paper of Lindblad but this doesn't help me (he does it another special way). Any clues or how to do this?

+",6276,,10480,,3/20/2021 23:26,3/20/2021 23:26,Superoperator cannot increase relative entropy,,1,1,,,,CC BY-SA 4.0 +6067,2,,1461,5/6/2019 1:31,,9,,"

Along with glS' post:

+

A mixed state would be if you had a can of paint, but you weren't sure if it was blue or yellow. You know it is either one of the two, and once you pop the top and measure it, you'd know, but until you do it is in one of those two pure states. If you picked it up from a stack of cans where you knew there were equally many cans of blue paint as yellow, you would expect an equal chance of it being one or the other. 50% of the time it would be 100% yellow and 50% of the time it would be 100% blue.

+

A superposition is more like if you take half a can of blue and half a can of yellow and pour them together. You've now constructed a new pure state that is expressible as a combination of other pure states. If you test its 'blueness', it is about 50%. If you test its 'yellowness' it is about 50%. It is both yellow and blue at the same time. 100% of the time it is both 50% blue and 50% yellow.

+

If you measured the amount of blue and yellow in one stack of blue or yellow cans and then in another stack of green, you might be confused to see you have just as much blue and yellow in both stacks, but the difference is that the 'blueness' and 'yellowness' is in a mixed state in the former stack but is in a superposition in the latter.

+",7420,,-1,,6/1/2021 15:07,6/1/2021 15:07,,,,1,,,,CC BY-SA 4.0 +6068,2,,6063,5/6/2019 8:04,,3,,"

You should forget about amplitudes as only applying to single qubits. Amplitudes apply to the states of an entire system.

+ +

Mathematically, this comes from a property of the tensor product: +$$ +(\alpha|0\rangle)\otimes(\beta|0\rangle)=(\beta|0\rangle)\otimes(\alpha|0\rangle)=(\alpha\beta|0\rangle)\otimes |0\rangle=|0\rangle\otimes(\alpha\beta|0\rangle)=\alpha\beta(|0\rangle\otimes |0\rangle) +$$ +we can move numbers around the tensor product arbitrarily.

+ +

Physically, what does this mean? Well, if I know my first qubit has a probability amplitude $\alpha$ for being in state $|0\rangle$, and the second qubit is guaranteed to be in the state $|0\rangle$, then what is the probability amplitude for the two qubits together to be in the state $|00\rangle$? It's $\alpha$. Even if you're not yet comfortable with the maths of probability amplitudes, go back to probabilities and check my claim is consistent with what you know: if the first qubit is $|0\rangle$ with probability $|\alpha|^2$, and the second is guaranteed to be $|0\rangle$, what that the probability that the first is $|0\rangle$ and the second is $|0\rangle$? $|\alpha|^2$.

+",1837,,,,,5/6/2019 8:04,,,,0,,,,CC BY-SA 4.0 +6069,2,,6037,5/6/2019 10:56,,5,,"

First, there is a neat way of performing the controlled Hadamard, with only two occurrences of the $T$ gate:

+ +

+ +

Regarding your second question, I can give an answer that will get a tad technical, based on the paper arXiv:1805.05296. We are going to use the following construction

+ +

+ +

that we generalise to $n$ wires:

+ +

+ +

The reason we denote this operator like this is if plug $|0\rangle$ on the control half-edge, we get the identity, while if we plug $|1\rangle$ we get $2|+\rangle\langle+|$.

+ +

We are given a diagram $U:n\to n$. The first thing we do is use the map/state duality to get a diagram $U':0\to 2n$

+ +

+ +

Now, suppose there exists a diagram $\Lambda U':1\to 2n$ such that $\Lambda U'|0\rangle = 2^n|+^{2n}\rangle$ and $\Lambda U'|1\rangle = U'$. Then the controlled version of $U$ can be performed by building:

+ +

+ +

The question hence boils down to finding such a $\Lambda U'$. A first ""naive"" solution is to treat the map $U'$ nearly as a black box: we only require you know a non-null entry of $U'$: $\langle a_1...a_{2n}| U' = x \neq0$ for some $a_1,...,a_{2n}\in\{0,1\}^{2n}$, and such that one can represent $\begin{pmatrix}1\\1/x\end{pmatrix}$ with a diagram $\Lambda (1/x):0\to 1$ in the fragment (in the unrestricted ZX-Calculus, this is always possible). Using yet another construction:

+ +

+ +

generalised to:

+ +

+ +

we can define $\Lambda U'$ as:

+ +

+",7422,,,,,5/6/2019 10:56,,,,1,,,,CC BY-SA 4.0 +6070,1,6071,,5/6/2019 13:13,,3,393,"

Could somebody explain the cnx operator, and how it operates on its qubit parameters to flip the target qubit in Qiskit (Python)?

+",7405,,124,,5/7/2019 7:57,5/7/2019 7:57,How does the cnx gate work in Qiskit (Python)?,,1,5,,,,CC BY-SA 4.0 +6071,2,,6070,5/6/2019 15:01,,3,,"

The documentation for cnx says Control n-1 qubits, apply 'not' to last one.

+ +

So basically $C^n(X)$ in Qiskit is defined like $$C^n(X)|x_1\cdots x_{n-1}\rangle|\psi\rangle = |x_1\cdots x_{n-1}\rangle X^{x_1\cdots x_{n-1}}|\psi\rangle$$ where $x_1\cdots x_{n-1}$ in the exponent of $U$ means the product of the bits $x_1,\cdots, x_{n-1}$. That is, the Pauli-X gate gate gets applied to the $n$-th qubit $|\psi\rangle$ only when all of the first $n-1$ bits are $1$.

+",26,,1386,,5/6/2019 15:21,5/6/2019 15:21,,,,3,,,,CC BY-SA 4.0 +6072,1,,,5/6/2019 15:23,,4,54,"

I'm a theorist and I assume that I can use entanglement resources for practical use freely, but is this really the case? Is generating entanglement and storing it for long enough periods of time such that it can be consumed a realistic assumption? For example, is it a much longer process with respect to performing logic gates on qubits?

+ +

For example in quantum algorithms or protocols involving entanglement consumption, like quantum clock synchronization for one. Say the algorithm/protocol needs to be repeated often, continuous clock synchronization lets say. Would entanglement generation be a bottleneck in ""realistic"" scenarios?

+ +

I read about different types of qubits and how entanglement can be generated between them in a lab, but I can't seem to find information about how fast the process is or if it is a deterministic process for each qubit type. I did find some results regarding deterministic entanglement generation, but I couldn't find any metric regarding how fast the process can be repeated.

+ +

Any tips regarding speed or difficulty of quantum entanglement generation would help me a lot, or even just some general insights.

+",509,,26,,5/6/2019 15:45,5/6/2019 15:45,Is generating usable entanglement difficult?,,0,1,,,,CC BY-SA 4.0 +6073,1,6085,,5/6/2019 16:26,,3,170,"

From section 11.3.2 of Nielsen & Chuang:

+
+

(4) let $\lambda_i^j$ and $\left|e_i^j\right>$ be the eigenvalues and corresponding eigenvectors of $\rho_i$. Observe that $p_i\lambda_i^j$ and $\left|e_i^j\right>$ are the eigenvalues and eigenvectors of $\sum_ip_i\rho_i$ and thus \begin{align}S\left(\sum_ip_i\rho_i\right) &= -\sum_{ij}p_i\lambda_i^j\log p_i\lambda_i^j \\ &= - \sum_ip_i\log p_i - \sum_ip_i\sum_j\lambda_i^j\log\lambda_i^j \\ &= H\left(p_i\right) + \sum_ip_iS\left(\rho_i\right)\end{align}

+
+

So this lemma is used to prove the joint entropy of $S(\rho_{AB})$ with $\rho_{AB}$ equal to +$$\rho_{AB} = \sum_i p_i (\rho_i)_A \otimes (|e_i\rangle\langle e_i|)_B.$$ +In the attached picture (the lemma), they do it first for only the A-system $\rho_A = \sum_i p_i (\rho_i)_A$, and then they say that this result directly leads to the same result for the above described AB-system (exactly the same?).

+

First of all, I don't understand how they go from the first to the second line. I understand the fact that $p_i \lambda^j_i $ are the eigenvalues, but I really don't see how.

+

The second question being, how can you use this result to infer the same result for $S(\rho_{AB})$? I mean you have your extra system in $H_B$ "hanging" on your A-system and I don't see how this just magically disappears or eventually comes down to a factor of 1 when explicitly calculating $S(\rho_AB)$.

+

I feel pretty silly because this is already the proof aka explanation in the book Nielsen & Chuang and I don't even get it. So maybe explain it really simple and down to Earth for me please.

+",6276,,55,,6/21/2021 7:49,6/21/2021 7:49,"In the proof of the joint entropy theorem, why are $p_i\lambda_i^j$ the eigenvalues?",,2,0,,,,CC BY-SA 4.0 +6074,1,6075,,5/6/2019 16:51,,2,182,"

In the following piece of code:

+ +
cnx(qwc, q[0], q[1],q[2],q[3])
+
+ +

in what order control qubits and target qubit are? Which qubit is inverted for which values of which ones?

+",7405,,124,,5/7/2019 7:56,5/7/2019 7:56,Order of controls and targets of cnx gates in Qiskit (Python),,1,0,,,,CC BY-SA 4.0 +6075,2,,6074,5/6/2019 16:55,,2,,"

As explained here, if all of q[0], q[1] and q[2] (the n-1 qubits) are 1, then q[3] (the n-th qubit) is inverted. That is, q[3] is the target qubit and the rest (q[0], q[1] and q[2]) are controls.

+",26,,26,,5/6/2019 17:01,5/6/2019 17:01,,,,0,,,,CC BY-SA 4.0 +6080,2,,6073,5/6/2019 20:52,,3,,"

That lemma has condition that all $p_i$ ($1\le i \le n$) have support on orthogonal subspaces. This means that there is a decomposition $H = \oplus_i H_i$ of the space $H$ such that $p_i(H_j) = 0$ if $i\neq j$ and $p_i(v_i)\neq 0$ if $v_i \in H_i$. Note that there can be component $H_0$ such that $p_i(H_0)=0$ for all $i \ge 1$.
+Now there is a little oversimplification in their explanation. In fact we pick only nonzero eigenvalues $\lambda_i^j$, so vectors $|e_i^j\rangle$ lay in $H_i$. Now it is easy to see that $\sum_ip_i\rho_i |e_k^j\rangle = p_k\lambda_k^j|e_k^j\rangle$. +Moreover, the union of all vectors $|e_i^j\rangle$ span the support of $\sum_ip_i\rho_i$. So this union is a complete set of orthogonal eigenvectors (excluding those from $H_0$).

+ +

As for your second question, we apply lemma to the states $\rho_i^\prime = (\rho_i)_A \otimes (|e_i\rangle\langle e_i|)_B$ on the system $AB$. That lemma is general, it is not ""just for the A-system"". You can check that all $\rho_i^\prime$ indeed have orthogonal support.

+",5870,,5870,,5/6/2019 21:18,5/6/2019 21:18,,,,0,,,,CC BY-SA 4.0 +6081,2,,6065,5/6/2019 21:21,,3,,"

As to the question of how to convert a function performed iteratively using irreversible gates to the same function performed iteratively using reversible gates, you should probably accept that any boolean function from $\{0,1\}^n$ to $\{0,1\}$ can be written in $\mathsf{3CNF}$-normal form with a polynomial number of $\mathsf{AND, OR, NOT}$ gates (i.e. $\lor$, $\land$, and $\lnot$ gates). Of these three, only $\lnot$ is reversible; the other two, $\land$ and $\lor$ are not.

+ +

You should probably also accept that you can convert any function written in $\mathsf{3CNF}$ having $\{\lnot,\lor,\land\}$ gates to the same function written with a polynomial number of clauses using only $\uparrow$, the Sheffer stroke (for $\mathsf{NAND}$). The Sheffer stroke $\uparrow$ is not reversible.

+ +

It would suffice to replace the Sheffer stroke $\{\uparrow\}$, or the $\mathsf{3CNF}$ gates $\{\lor,\land,\lnot\}$, with some reversible gates.

+ +

Enter the Toffoli gate, aka the $\mathsf{CCNOT}$ gate.

+ +

Quoting from Wikipedia:

+ +
+

[The Toffoli gate] preserves two of its inputs a,b and replaces the third c by $c\oplus (a\cdot b)$. With $c=0$, this gives the $\mathsf{AND}$ function, and with $a\cdot b=1$ this gives the $\mathsf{NOT}$ function. Thus, the Toffoli gate is universal and can implement any reversible boolean function (given enough zero-initialized ancillary bits).

+
+ +

Thus, you can implement $\mathsf{AND}$ and $\mathsf{NOT}$ with Toffoli gates, and hence implement $\mathsf{NAND}$ with two Toffoli gates. The implication is that the ""enough zero-initialized ancillary bits"" is not more than polynomial in $n$.

+ +

I don't expect that real synthesis of boolean functions uses only Toffoli gates - but at least there's an outline of how you could convert a function written in $\mathsf{3CNF}$-normal form into some other normal form using nothing but Toffoli gates.

+",2927,,,,,5/6/2019 21:21,,,,0,,,,CC BY-SA 4.0 +6083,2,,5959,5/7/2019 1:52,,1,,"

It turns out the issue with this circuit was in the use of the reset operator in conjunction with entanglement and superposition.

+

In the oracle code I submitted, I use a Toffoli gate several times, which creates an entanglement between both input qubits and the output qubit. Since the input qubits are in superposition, that superposition state then "spreads" (for lack of a better term) to the output qubit. So, when the output qubit is reset using the reset operator, its superposition state and entanglements with the input qubits causes certain states to collapse, which changes the output of the circuit as a whole.

+

This had confused me earlier because using reset with either superposition or entanglement causes no issue, because both can collapse without change to the input; because, in a sense, the output and input qubits are separated. It is only, therefore, when they are used in conjunction that reset causes this behavior.

+

The solution then, is quite simple: reverse the circuit to return the output qubit to a $\left|0\right>$ state after it is no longer needed:

+
# Encode S1 * !S2 * S3
+circuit.x( search_register[2] )
+circuit.ccx( search_register[1], search_register[2], ancillaries[0] )
+circuit.ccx( search_register[3], ancillaries[0], ancillaries[1] )
+
+# Encode S0 * S1
+circuit.ccx( search_register[0], search_register[1], ancillaries[2] )
+
+# Encode oracle ((S0 * S1) + (S1 * !S2 * S3))
+circuit.x(ancillaries)
+circuit.ccx( ancillaries[1], ancillaries[2], m_qubit[0] )
+circuit.x(m_qubit)
+
+# Return ancillaries to 0s so they can be used later
+circuit.x(ancillaries)
+circuit.ccx( search_register[0], search_register[1], ancillaries[2] )
+circuit.ccx( search_register[3], ancillaries[0], ancillaries[1] )
+circuit.ccx( search_register[1], search_register[2], ancillaries[0] )
+circuit.x( search_register[2] )
+
+# Do rotation about the average
+circuit.h(search_register)
+circuit.x(search_register)
+circuit.ccx( search_register[0], search_register[1], ancillaries[0] )
+circuit.ccx( search_register[2], ancillaries[0], ancillaries[1] )
+circuit.ccx( search_register[3], ancillaries[1], m_qubit[0] )
+circuit.x(search_register)
+circuit.x(m_qubit)
+
+# Return ancillaries to 0s for use later
+circuit.ccx( search_register[2], ancillaries[0], ancillaries[1] )
+circuit.ccx( search_register[0], search_register[1], ancillaries[0] )
+circuit.h(search_register)
+
+

Doing this instead produced the desired result.

+",5472,,1768,,10/26/2022 23:52,10/26/2022 23:52,,,,0,,,,CC BY-SA 4.0 +6085,2,,6073,5/7/2019 7:18,,3,,"
+

I don't understand how they go from the first to the second line

+
+ +

So, you're starting from $-\sum_{ij}p_i\lambda^j_i\log(p_i\lambda^j_i)$. Remember that $\log(ab)=\log(a)+\log(b)$, so this is the same as +$$ +-\sum_{ij}p_i\lambda^j_i\log(p_i)-\sum_{ij}p_i\lambda^j_i\log(\lambda^j_i) +$$ +For the first term, do the sum over $j$: $\sum_j\lambda^j_i=\text{Tr}(\rho_i)=1$. This gives you +$$ +-\sum_{i}p_i\log(p_i)-\sum_{i}p_i\sum_j\lambda^j_i\log(\lambda^j_i), +$$ +which was the second line you were after.

+ +
+

how can you use this result to infer the same result for $S(\rho_{AB})$

+
+ +

Observe that the eigenvectors of $\rho_{AB}$ are $|e^j_i\rangle|e_i\rangle$ with eigenvalue $p_i\lambda^j_i$. Hence, +$$ +S(\rho_{AB})=-\sum_{ij}p_i\lambda^j_i\log(p_i\lambda^j_i), +$$ +and you're back to that first line again...

+ +

PS for anybody else coming in and trying to make sense of the question, it is important to state that a condition of the theorem that is being proven is that the $\rho_i$ have support on orthogonal subspaces. This way, if a given $\rho_i$ has an eigenvector $|e^j_i\rangle$ with a non-zero eigenvalue $\lambda^j_i$, then $|e^j_i\rangle$ is also an eigenvector of all other $\rho_k$ for $k\neq i$, but $\lambda^j_k=0$. That is the key reason why we can write that the eigenvalues of $\sum_ip_i\rho_i$ are $p_i\lambda^j_i$.

+",1837,,,,,5/7/2019 7:18,,,,0,,,,CC BY-SA 4.0 +6086,2,,6066,5/7/2019 7:38,,3,,"

I'm not an expert with this sort of thing (i.e. there may be imperfections in this argument), but hopefully this will set you in the right direction...

+ +

Consider $\rho_{AB}=\rho_A\otimes |0\rangle\langle 0|$ and $\sigma_{AB}=\sigma_A\otimes |0\rangle\langle 0|$. It must be that $S(\rho_A\|\sigma_A)=S(\rho_{AB}\|\sigma_{AB})$.

+ +

Now, your superoperator can be described by a unitary $U$ over a larger space: +$$ +\$\rho=\text{Tr}_B\left(U(\rho\otimes|0\rangle\langle 0|)U^\dagger\right) +$$ +So, let +$$ +\tilde\rho_{AB}=U\rho_{AB}U^\dagger\qquad\tilde\sigma_{AB}=U\sigma_{AB}U^\dagger. +$$ +Since it's unitary, +$$ +S(\rho_A\|\sigma_A)=S(\rho_{AB}\|\sigma_{AB})=S(\tilde \rho_{AB}\|\tilde\sigma_{AB}), +$$ +but from your original statement (I assume, you've not quite stated it precisely enough) +$$ +S(\tilde \rho_{AB}\|\tilde\sigma_{AB})\geq S(\$\rho_A\|\$\sigma_A) +$$

+",1837,,,,,5/7/2019 7:38,,,,1,,,,CC BY-SA 4.0 +6087,1,6095,,5/7/2019 14:08,,3,900,"

I am actually working on quantum computing with qutrits. I am trying to define standard qubit gates for qutrits. The CNOT gate for qubits is defined as follows: $$|x,y\rangle \to |x,y+x \bmod 2\rangle.$$

+ +

So the matrix is $$\mathrm{UCN} = +\begin{pmatrix} +1 & 0 & 0 & 0\\ +0 & 1 & 0 & 0\\ +0 & 0 & 0 & 1\\ +0 & 0 & 1 & 0 +\end{pmatrix}.$$

+ +

For the definition of the same type of gate for qutrit I am left with two choices:

+ +

$$|x,y\rangle \to |x,y+x \bmod 3\rangle$$ +$$|x,y\rangle \to |x,y+2x \bmod 3\rangle$$

+ +

Does anyone know if one of the two is more common or more usually defined?

+ +

PS: I know that applying one two times is equivalent to apply the other one time.

+",7426,,26,,5/7/2019 16:14,5/7/2019 23:12,Defining standard qubit gates for qutrits,,1,2,,,,CC BY-SA 4.0 +6088,1,8631,,5/7/2019 15:42,,8,3071,"

Context

+

Prof. Aaronson mentions that the quantum extended Church-Turing (quantum ECT) thesis has no known counterexamples cf. around 14:18 but doesn't mention its precise statement.

+

Questions

+
    +
  1. What precisely is the statement of the quantum extended Church-Turing thesis? Original references appreciated.

    +
  2. +
  3. Is there any quantum Church-Turing thesis (i.e. a non-extended version that doesn't concern itself with the efficiency of computation)? If yes, what's its precise statement?

    +
  4. +
  5. Is there any fundamental difference between the quantum extended Church-Turing thesis and Deutsch's 1985 version? Does the former include or imply any assertion about "finitely realizable physical systems" like the latter does?

    +
  6. +
+

†: "Every finitely realizable physical system can be perfectly simulated by a universal model computing machine operating by finite means."

+",26,,55,,9/23/2020 12:20,9/23/2020 12:20,What precisely is the quantum extended Church-Turing thesis?,,3,9,,,,CC BY-SA 4.0 +6095,2,,6087,5/7/2019 16:44,,4,,"

Your first definition,

+ +

$$|x,y\rangle \to |x,y+x \bmod 3\rangle$$

+ +

is both more common and, IMO, easier to use. Especially as you point out that the second definition can be simulated by repeated application of the first. You can see the authors have used this version of the qutrit CNOT in +Construction of two qutrit entanglement by using magnetic resonance selective pulse sequences (Çorbaci et al., 2016) and in +Controlled Not (Cnot) Gate For Two Qutrit Systems, (KOCAKOÇ & TAPRAMAZ, 2018).

+ +

Additionally, you may want to consider the context of your qutrit gates. For example, section 2 of arXiv:1105.5485 first defines three versions of the qutrit X gate and then discusses what a controlled X would mean in these cases.

+",7435,,26,,5/7/2019 23:12,5/7/2019 23:12,,,,1,,,,CC BY-SA 4.0 +6096,1,,,5/7/2019 19:31,,5,76,"

I’m looking for the theoretical calculations of charge and transmon qubit decoherence specifically, but at a high level I'm wondering how decoherence is approached generally.

+ +

I’ve seen explanations based on finding the time until the Rabi oscillations decay off as well as arguments that end with a Lindblad equation. Are these all equivalent ways of getting the decoherence rate, or does the approach to decoherence calculations depend on the approach to Quantum Computing (charge qubit vs transmon qubit vs spin qubit vs ion trap etc...)

+ +

So to restate my question, when people talk about Linblad vs Rabi, is this two side of the same coin (this is what I'm doubting), or are there specific circumstances that warrant these approaches to decoherence calculations?

+",6000,,26,,5/8/2019 10:43,5/8/2019 10:43,Is the theory of decoherence general or specific to the physical implementation?,,0,3,,,,CC BY-SA 4.0 +6097,1,6098,,5/8/2019 7:02,,2,111,"

Why is the trace preserving part necessary? Is it not enough if it can take all matrices to matrices of trace 1?

+",2832,,26,,5/8/2019 10:28,5/8/2019 10:28,What is the relevance of preservation of trace in completely postive trace preserving (CPTP) maps?,,1,0,,,,CC BY-SA 4.0 +6098,2,,6097,5/8/2019 7:56,,3,,"

Those maps are linear, so if it preserves the trace of trace 1 matrices then it preserves the trace of any other matrix.

+ +

We just don't need to restrict ourselves by considering only trace 1 matrices (from mathematical point of view).

+",5870,,,,,5/8/2019 7:56,,,,2,,,,CC BY-SA 4.0 +6099,1,9709,,5/8/2019 9:50,,3,103,"

The PLOB-bound (""Fundamental Limits of Repeaterless Quantum Communications"") gives an asymptotic upper bound on the secret-key rate per used lossy bosonic channel. +However, I'm not sure how to count the number of used channels in a physical implementation.

+ +

For example, let's assume that I use the BB84 protocol encoded in the polarization degrees of freedom of a single photon pulse. +One could think that one uses two lossy optical channels per sent photon due to the two polarizations, but this assumes that the photon would have a single frequency contradicting the spatial localization of the photon pulse. +However, if I assume a localized photon pulse, then the photon does not have a defined frequency anymore, but has a specific linewidth. Therefore, I would possibly use an uncountable number of frequencies and therefore also channels.

+ +

Have I misunderstood anything or is this bound not useful in realistic implementations of QKD?

+",4312,,10480,,4/16/2021 20:39,4/16/2021 20:39,Counting channel uses of the lossy bosonic channel or definition of channel uses,,1,0,,,,CC BY-SA 4.0 +6102,1,,,5/8/2019 14:25,,9,144,"

I'm reading about the threshold theorem, which states that +""a quantum computer with a physical error rate below a certain threshold can, through the application of quantum error correction schemes, suppress the logical error rate to arbitrarily low levels.""

+ +

Now I know that decoherence leads to errors, and I know how to calculate decoherence rates, but I don't understand how I can take a decoherence rate (let's say $5 \mathrm{\mu s}$) and turn this into an error rate. I'm also not sure how to compare a given error rate to it's threshold and the threshold theorem.

+ +

Any ideas?

+",7441,,26,,5/8/2019 14:57,9/9/2022 6:11,How is the decoherence rate connected to the error rate?,,2,1,,,,CC BY-SA 4.0 +6103,1,6104,,5/8/2019 16:07,,3,66,"

I am having some trouble understanding how the number of simulation qubits are chosen when finding the eigenvalue of a fermionic Hamiltonian.

+ +

For the phase-estimation algorithm, is the number of simulation qubits the same as the number of particles you want to simulate, or is it the number of orthogonal single-particle states you want to include?

+ +

For example: +If I want to find the eigenvalues for a two-particle system and have 10 qubits to spare, do I initialize the 10 qubits to for example $|0011111111\rangle$ or $|1100111111\rangle$ (1s are un-occupied and 0s are occupied states) and let the time evolution operator act on this system? Or do I simply go for a random two-qubit state, for example, $|00\rangle$ and let the time-evolution operator act on this state?

+",5632,,26,,5/8/2019 16:17,5/8/2019 16:48,How to pick number of simulation qubits for finding eigenvalue of fermionic Hamiltonian?,,1,0,,,,CC BY-SA 4.0 +6104,2,,6103,5/8/2019 16:48,,3,,"

Typically the second option: you map the fermionic occupation number for each single-particle state to a qubit. (Also, the usual convention is that $0$ denotes unoccupied, $1$ denotes occupied ;) This mapping is usually accomplished via the Jordan-Wigner or Bravyi-Kitaev transformation, or some hybrid of the two: see https://arxiv.org/abs/1208.5986 for a nice overview of both.

+",7336,,,,,5/8/2019 16:48,,,,0,,,,CC BY-SA 4.0 +6105,1,,,5/8/2019 19:25,,4,74,"

Is there a 5-partite state such that if two parties each hold 2 shares of the state, without knowing what shares the other party holds, they can create a Bell pair between them and know which qubit in their possession is their half of the Bell pair? The two parties may not communicate.

+",7443,,7443,,5/10/2019 21:28,5/10/2019 21:28,Does a 5-partite state with these entanglement properties exist?,,1,4,,,,CC BY-SA 4.0 +6106,1,,,5/8/2019 20:18,,3,163,"

The quantum OR circuit between $|a\rangle$ and $|b\rangle$ can be made out of 1 Toffoli and 2 CNOT gates, 1 ancillary qubit. Is there any other implementation? Or is this the minimal in the sense of gates used?

+",6070,,26,,5/8/2019 20:20,5/13/2019 14:31,Minimal quantum OR circuit,,2,1,,,,CC BY-SA 4.0 +6107,1,,,5/8/2019 22:02,,2,233,"

The quantum volume metric $V_Q$ is a proposed metric for quantifying and +comparing the performance of quantum computers1. The quantum volume is +defined as

+ +

$$V_Q = \max_{n<N} \left(\min\left[n, d(n)\right]^2\right),$$

+ +

where $n$ is the number of qubits used (out of the maximum $N$ available qubits on +the device), $d(N)\simeq 1/nε_{\text{eff}}$ is the effective/achievable circuit +depth, and $\epsilon_{\text{eff}}$ is the effective/average error rate of a random $SU(4)$ gate between any two qubits (including additional swap gates if the +device is not fully connected)[2].

+ +

Now setting aside the question of whether $V_Q$ is a ""good"" metric (asked +previously here), +can an estimate be made for what $V_Q$ is needed in order to have a single +logical qubit? More generally, what is the number of logical qubits a device with $V_Q$ can support?

+ +

Edit: By logical qubit I mean in the sense of fault-tolerant operation, i.e. if I have $n$ logical qubits I can apply any arbitrary sequence of gates to the $n$ qubits and end up with the ideal quantum state with bounded error (e.g. probability greater than 2/3).

+ +

NOTE: Cross-posted on physics.SE.

+ +
+ +

References +
+1. Bishop, Lev S., et al. ""Quantum volume."" Quantum Volume. Technical Report (2017) (PDF) +
+2. Moll, Nikolaj, et al. ""Quantum optimization using variational algorithms on near-term quantum devices."" Quantum Science and Technology 3.3 (2018): 030503 +
+3. Cross, Andrew W., et al. ""Validating quantum computers using randomized model circuits."" arXiv preprint arXiv:1811.12926 (2018).

+",440,,55,,5/15/2019 8:52,5/15/2019 8:52,What quantum volume is needed to represent a single logical qubit?,,2,3,,,,CC BY-SA 4.0 +6108,1,6282,,5/9/2019 8:52,,3,164,"

In the Quantum Computation and Quantum Information (10th ed.) textbook by Nielsen and Chuang, section 5.3.1 (titled ""Application: order-finding"") describes how phase estimation can be used to find the order $r$ of a positive integer.

+ +

After performing the inverse Fourier transform on the first register and then performing a measurement, we'll get an estimation of the phase $\varphi\approx\frac{s}{r}$ accurate to $2L+1$ bits. We hope to find $s$ and $r$ by performing the continued fractions procedure, which in certain cases returned $s'$ and $r'$ instead which happens when $s$ and $r$ share common factors.

+ +

The book describes three methods to fix this problem, two of which repeats the order-finding algorithm $O(L)$ times and the third requires a constant number of trials.

+ +

The third method:

+ +
+

The idea is to repeat the phase estimation - continued fractions procedure twice, obtaining $r'_1$, $s'_1$ the first time, and $r'_2$, $s'_2$ the second time. Provided $s'_1$, $s'_2$ have no common factors, $r$ may be extracted by taking the least common multiple of $r'_1$, $r'_2$

+
+ +

Question:

+ +

I don't understand why $r$ may be extracted by taking the least common multiple of $r'_1$, $r'_2$ and what is the rationale of repeating the phase estimation — +continued fractions procedure twice?

+",5253,,26,,5/9/2019 9:13,6/2/2022 12:48,Method to find $r$ in the case when $r'$ returned by the continued fractions procedure is a factor of $r$,,2,0,,,,CC BY-SA 4.0 +6109,1,,,5/9/2019 9:58,,4,131,"

I need to prove the fact that a quantum channel (a superoperator) cannot increase the Holevo information of an ensemble $\epsilon = \{\rho_x, p_x\}$. Mathematically expressed I need to prove

+ +

$$\begin{align} \chi(\$(\epsilon)) \leq \chi(\epsilon) \end{align} \tag{1}\label{1}$$

+ +

where $\$$ represents a quantum channel (a positive trace preserving map) which works on the ensemble as $\$ \epsilon = \{ \$\rho_x, p_x \}$. This needs to be done with the property that a superoperator $\$$ cannot increase relative entropy (some may remember my previous question about this):

+ +

$$\begin{align} S(\$\rho || \$\sigma) \leq S(\rho || \sigma) \end{align}\tag{2}\label{2}$$

+ +

with relative entropy defined as $$S(\rho || \sigma) = \mathrm{tr}(\rho \log \rho - \rho \log \sigma).$$

+ +

The Holevo information is defined as (if someone would not know)

+ +

$$\begin{align} \chi(\epsilon) = S(\sum_x p_x \rho_x ) - \sum_x p_x S(\rho_x) \end{align}.$$

+ +

Does anyone know how we get from equation $\eqref{2}$ to equation $\eqref{1}$? Maybe what density operators to fill in $\eqref{2}$? Or how do we start such a proof?

+",6276,,55,,4/6/2021 8:23,4/6/2021 8:23,Prove that quantum channels cannot increase the Holevo information of an ensemble,,1,0,,,,CC BY-SA 4.0 +6112,1,6113,,5/9/2019 15:39,,5,228,"

Note: I'm reposting this question as it was deleted by the original author, so that we do not lose out on the existing answer there, by Prof. Watrous. Further answers are obviously welcome.

+ +
+ +

I have two questions:

+ +
    +
  1. What are degradable channels?

  2. +
  3. Given the dephasing channel $$\Phi^D\begin{pmatrix} \rho_{11} & \rho_{12}\\ \rho_{21} & \rho_{22} \end{pmatrix}$$ $$=\begin{pmatrix} \rho_{11} & \rho_{12} e^{-\Gamma(t)}\\ +\rho_{21} e^{-\Gamma(t)} & \rho_{22} \end{pmatrix},$$ the complementary map is given by +$$\Phi^D\begin{pmatrix} \rho_{11} & \rho_{12}\\ \rho_{21} & \rho_{22} \end{pmatrix}$$ $$= \begin{pmatrix} \frac{1+e^{-\Gamma(t)}}{2} & \frac{\sqrt{1-e^{-2\Gamma(t)}}}{2} (\rho_{11}-\rho_{22})\\ + \frac{\sqrt{1-e^{-2\Gamma(t)}}}{2} (\rho_{11}-\rho_{22}) & \frac{1-e^{-\Gamma(t)}}{2} \end{pmatrix}.$$

    + +

    How can one prove that the quantum channel capacity is given by $Q_D = 1 - H_2(\frac{1+e^{-\Gamma(t)}}{2} )$, where $H_2(\cdot)$ is the binary Shanon entropy.

  4. +
+ +

Reference: Eq. 13 of this article.

+ +

†: Bylicka, B., D. Chruściński, and Sci Maniscalco. ""Non-Markovianity and reservoir memory of quantum channels: a quantum information theory perspective."" Scientific reports 4 (2014): 5720.

+",26,,10480,,3/20/2021 6:11,3/20/2021 6:11,Degradable channels and their quantum capacity,,1,0,,,,CC BY-SA 4.0 +6113,2,,6112,5/9/2019 15:43,,7,,"

A channel $\Phi$ is said to be degradable if there exists another channel $\Xi$ such that $\Xi\Phi$ is complementary to $\Phi$.

+ +

The idea here is as follows. Suppose $\Phi$ is a channel and $\Psi$ is complementary to $\Phi$. If $\Phi$ is applied to a state $\rho$, then the output of the channel is $\Phi(\rho)$ (of course), while $\Psi(\rho)$ represents whatever the environment effectively receives. A channel being degradable therefore means that given the output of the channel, one could reconstruct whatever the environment receives.

+ +

On its own, the property of being degradable may be difficult to motivate, except for the fact that we can actually calculate the quantum capacity for degradable channels (while we often cannot for other channels). This is based on two facts:

+ +
    +
  1. If $\Phi$ is degradable, then its quantum capacity is equal to its maximum coherent information.

  2. +
  3. The coherent information is a concave function for degradable channels.

  4. +
+ +

Now, the channel in part 2 of the question is degradable. (In fact, dephasing channels are always degradable, in every dimension.) Perhaps the easiest way to see this for this particular channel is to observe that we can take $\Xi = \Psi$, (i.e., $\Psi \Phi = \Psi$), where I am using $\Phi$ as the name of the original channel and $\Psi$ for the complementary channel given in the question.

+ +

It remains to compute the maximum coherent information of this channel. For a given state $\rho$, the coherent information of $\rho$ through $\Phi$ is defined as +$$ +\text{I}_{\text{C}}(\rho; \Phi) = \text{H}(\Phi(\rho)) - \text{H}(\Psi(\rho)). +$$ +It is perhaps not obvious, but the maximum value over all states $\rho$ is obtained by the completely mixed state $\rho = \mathbb{1}/2$, and therefore +$$ +Q(\Phi) = \max_{\rho} \text{I}_{\text{C}}(\rho; \Phi) += \text{I}_{\text{C}}(\mathbb{1}/2; \Phi) += \text{H}(\mathbb{1}/2) - \text{H}(\Psi(\mathbb{1}/2)) += 1 - \text{H}_2\Bigl(\frac{1 + e^{-\Gamma(t)}}{2}\Bigr). +$$

+ +

One way to argue that the maximum coherent information is obtained by the completely mixed state is to use the fact that $\Phi$ is a Pauli channel, together with the concavity of coherent information for degradable channels mentioned above.

+",1764,,,,,5/9/2019 15:43,,,,0,,,,CC BY-SA 4.0 +6114,1,,,5/9/2019 19:00,,4,134,"

Even after reading several papers and almost all HHL related questions and answers here on Quantum Computing Stack Exchange, one thing is yet not clear. In several papers, for illustrating HHL they choose matrix $A$ with convenient eigenvalues of the form $2^k$ such that the rotation angles are like $\frac{v\pi}{2^r}$; and show a full circuit of HHL. It's not always the case. Eigenvalues can be anything. So how can one find the angles for rotation without measuring the eigenvalues?

+ +

Does HHL need to be run in two steps? First to get the eigenvalues and then perform the rotation and QPE-inverse?

+",,user7451,26,,5/9/2019 19:03,5/9/2019 19:03,"Is HHL executed in a single run? If yes, how do they carry out controlled rotation without knowing eigenvalues?",,0,2,,,,CC BY-SA 4.0 +6115,2,,6107,5/9/2019 22:31,,3,,"

Quantum volume is a bad metric for this purpose.

+ +

For example, suppose you have a ten thousand by ten thousand grid of qubits with a gate error rate of 1 in one thousand. The quantum volume of this grid is basically 0, because if you pick two qubits at random they will on average be more than one thousand steps apart. So an error will almost certainly occur as they are routed together in order to interact, and so you can't even perform 1 randomly chosen interaction.

+ +

But quantum error correction doesn't require randomly chosen interactions. The surface code only performs local interactions, and as a result the 10k x 10k with 10^-3 error grid that I described would be easily capable of large scale fault tolerant quantum computations over thousands of logical qubits.

+ +

As you make the grid bigger, the quantum volume at the physical level will continue to get worse and worse as the quantum volume at the logical level continues to get better.

+",119,,,,,5/9/2019 22:31,,,,1,,,,CC BY-SA 4.0 +6116,2,,6105,5/10/2019 7:23,,2,,"

Yes, it does exist. Here's something that you could do (I'm sure there are better things):

+ +

Consider the symmetric state +$$ +|\psi\rangle=\frac{1}{\sqrt{\binom{5}{2}}}\sum_{x\in\{0,1\}^5:\ x\cdot x=2}|x\rangle. +$$ +The benefit of selecting the symmetric state is that it is entirely irrelevant which pair of qubit is assigned to Alice, and which pair is assigned to Bob.

+ +

Now I'm going to use a trick based on the fact that I know the total state has 2 excitations. Both Alice and Bob apply a controlled-not between their two qubits, and measure the control qubit in the Z-basis. If they both get answer 0, the protocol has succeeded and they share a Bell pair between the two control qubits, and the extra qubit is in the state $|0\rangle$. How did this work? the controlled-not+measurement simply worked to calculate the parity of the two qubits. Post-selecting on the 0 answer means that we forced the two qubits in the original state to be the same, either 00 or 11. If both pairs of qubits were of even parity, then one of them was 00 and the other was 11. Moreover, since the overall state was of even weight, that means the extra qubit must be in the 0 state.

+ +

I haven't carefully calculated it, but I believe the success probability of this protocol is 1/5. So, if we have $n$ copies, the probability of failure is $1-(4/5)^n$, although we expect it to take about 5 copies to produce a Bell pair on average.

+ +

There are definitely improvements that can be made to this protocol. I just used the part of the state +$$ +|00\rangle_A|11\rangle_B|0\rangle+|11\rangle_A|00\rangle_B|0\rangle. +$$ +There's another component that would do just as well, but with higher probability amplitude: +$$ +|00\rangle(|01\rangle+|10\rangle)|1\rangle+(|01\rangle+|10\rangle)|00\rangle|1\rangle, +$$ +which I could have used instead (but the measurement is a bit more complicated to describe - instead of mapping $|00\rangle$ to 0 and $|11\rangle$ to 1, we need to map $|00\rangle$ to 0 and $(|01\rangle+|10\rangle/\sqrt{2}$ to 1), and that's before one gets on to trying to think about whether there are better states... Or, for example, interacting between multiple copies....

+",1837,,,,,5/10/2019 7:23,,,,4,,,,CC BY-SA 4.0 +6118,2,,6106,5/10/2019 23:07,,2,,"

Your question is not localized to quantum gates, but can be rephrased as ""how do I implement a (classical) reversible gate that can realize a logical $\mathsf{OR}$?""

+ +

I propose a $3$-input ""upstart"" gate acting on $\{0,1\}^3$ and producing $3$ outputs as follows:

+ +
C X Y || O X Y
+==============
+0 0 0 || 0 0 0
+0 0 1 || 1 0 1
+0 1 0 || 1 1 0
+0 1 1 || 1 1 1
+1 0 0 || 1 0 0
+1 0 1 || 0 0 1
+1 1 0 || 0 1 0
+1 1 1 || 0 1 1
+
+ +

Here we see that the first bit is evaluated to the $\mathsf{OR}$ of the second and third bits when the first bit is $0$, and is evaluated to the $\mathsf{NOR}$ of the second and third bits when the first bit is $1$.

+ +

This can be written in matrix form as:

+ +

$$\mathsf{UPSTART}= +\left( +\begin{array}{cccc} + 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ + 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\ + 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\\ + 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ + 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0\\ + 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0\\ + 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\ +\end{array} +\right)$$

+ +

This of course can be written in many other ways.

+",2927,,23,,5/11/2019 8:42,5/11/2019 8:42,,,,1,,,,CC BY-SA 4.0 +6119,1,,,5/11/2019 12:01,,1,418,"

I would be interested to know how to transform the classic OR gate into a quantum gate. I thought a little about myself. The OR gate can also be rewritten as a NAND gate:

+ +

+ +

So, I have now tried to convert into a quantum circuit. If the lower bit of the Toffoli gate is 0, then the AND operation is performed. Accordingly, I have introduced the NOT gate to replace the NANDs.

+ +

+ +

My question, is that right? Or how would the OR gate look like a quantum gate?

+",4974,,,,,5/11/2019 12:01,Transferring classical OR gate in a quantum gate,,0,2,,,,CC BY-SA 4.0 +6120,1,6121,,5/12/2019 7:39,,8,258,"

The following statement is found on the page 199 of Nielsen and Chuang's book (10th Anniversary Edition) in the proof for the fact that 'approximating arbitrary unitary gates is generically hard':

+ +
+

Suppose we have $g$ different types of gates available, and each gate + works on at most $f$ input qubits. These numbers, $f$ and $g$, are + fixed by the computing hardware we have available, and may be + considered to be constants. Suppose we have a quantum circuit + containing m gates, starting from the computational basis state + $|0⟩^{\bigotimes n}$. For any particular gate in the circuit there are + therefore at most$\binom{n}{f}^g=O(n^{fg})$ possible choices.

+
+ +

I kind of think the number of possible choices for any particular gate is more in line with $\binom{n}{f}\cdot g=O(n^fg)$. What do you think?

+",7460,,26,,5/12/2019 8:43,5/12/2019 8:43,Nielsen and Chuang's proof for 'approximating arbitrary unitary gates is generically hard',,1,0,,,,CC BY-SA 4.0 +6121,2,,6120,5/12/2019 8:30,,3,,"

You are right. There is a choice for place and there is a choice for gate. Then we just multiply the number of choices.
+But it's even stronger limitation on the number of possible states that we can obtain. So the general reasoning is still correct.

+",5870,,,,,5/12/2019 8:30,,,,0,,,,CC BY-SA 4.0 +6122,1,6125,,5/12/2019 9:16,,4,230,"

One can make an entanglement witness by taking the partial transpose of any pure entangled state.

+ +

Consider $|\phi \rangle $ as any pure entangled state. +Then $W = | \phi \rangle \langle \phi |^{T_2} $ is an entanglement witness.

+ +

However, is there any way to prove that it is optimal? +That is if +$$\mathrm{Tr}(W \rho) = 0,$$ then $\rho$ must lie on the boundary of the separable state set.

+ +

Edit: This question is only in reference to 2 qubit systems - hence there are no PPT entangled states.

+",2832,,55,,3/9/2021 22:04,3/9/2021 22:04,Are entanglement witnesses of this form optimal?,,1,0,0,,,CC BY-SA 4.0 +6125,2,,6122,5/12/2019 13:04,,5,,"

Answer to edited question:

+ +

It's still not true for qubit systems. Consider these two unit vectors, both of which are entangled: +$$ +|\phi\rangle = \frac{1}{\sqrt{2}} | 00\rangle + \frac{1}{\sqrt{2}} | 11\rangle,\\ +|\psi\rangle = \frac{1}{\sqrt{2}} | 01\rangle + \frac{i}{\sqrt{2}} | 10\rangle. +$$ +Let $\rho = |\psi\rangle\langle \psi |$, which of course is not on the boundary of the set of separable states; it's as far away from that set as any state can be. However, we have +$$ +\text{Tr}\Bigl( |\phi\rangle \langle \phi |^{T_2} \rho\Bigr) = 0. +$$ +To verify this equation, it may help to view the relevant operators as matrices: +$$ +|\phi\rangle \langle \phi |^{T_2} = \frac{1}{2}\begin{pmatrix}1&0&0&0\\0&0&1&0\\0&1&0&0\\0&0&0&1\end{pmatrix} +$$ +and +$$ +\rho = |\psi\rangle \langle \psi | = \frac{1}{2}\begin{pmatrix}0&0&0&0\\0&1&-i&0\\0&i&1&0\\0&0&0&0\end{pmatrix}. +$$

+ +

Original answer:

+ +

If I understand it correctly, the statement suggested in the question is false.

+ +

For a counter-example, let $\rho$ be any entangled PPT state whose partial transpose has an entangled state $|\phi\rangle$ in its kernel. We then obtain +$$ +\text{Tr}\Bigl( |\phi\rangle \langle \phi |^{T_2} \rho\Bigr) = \text{Tr}\Bigl( |\phi\rangle \langle \phi | \rho^{T_2}\Bigr) = 0, +$$ +but because $\rho$ is entangled it cannot be on the boundary of the set of separable states.

+ +

Incidentally, no entanglement witness of the form suggested in the question can ever detect entanglement in a PPT state.

+ +

To construct an entangled PPT state $\rho$ whose partial transpose has an entangled state in its kernel, one may take any unextendable product basis +$$ +|\phi_1\rangle |\psi_1\rangle,\ldots,|\phi_m\rangle |\psi_m\rangle \in \mathcal{A}\otimes\mathcal{B}, +$$ +and then let +$$ +\rho = \frac{1}{m} \sum_{k = 1}^m |\phi_k\rangle \langle \phi_k| \otimes |\psi_k\rangle \langle \psi_k|. +$$ +The partial transpose looks like this: +$$ +\rho^{T_2} = \frac{1}{m} \sum_{k = 1}^m |\phi_k\rangle \langle \phi_k| \otimes |\overline{\psi_k}\rangle \langle \overline{\psi_k}|. +$$ +This operator has rank $m<\text{dim}(\mathcal{A}\otimes\mathcal{B})$ and every nonzero vector in its kernel is entangled.

+",1764,,1764,,5/13/2019 17:17,5/13/2019 17:17,,,,1,,,,CC BY-SA 4.0 +6126,1,,,5/12/2019 19:23,,1,112,"

I am curious about how to do implement functions like $$f(x)=\begin{cases} +2x &\text{if} &0\leq x <0.5 \\ +x/2 &\text{if} &0.5\leq x<1 +\end{cases}$$ +Do we implement this like any other equation on a classical computer? +What initial states and assumptions do we need to make for this computation? +What gates do we need to use?

+",6070,,26,,5/13/2019 7:08,5/13/2019 7:40,Implementing piecewise functions on a quantum computer,,1,1,,,,CC BY-SA 4.0 +6127,2,,6126,5/13/2019 7:40,,4,,"

First, you need to check if your function is reversible. This determines whether you can perform it inline or not. Your function is not reversible, so we need to perform something like $x, y \rightarrow x, y + f(x)$ instead of $x \rightarrow f(x)$.

+ +

The great thing about functions of the form $x, y \rightarrow x, y + f(x)$ is that it's very easy to derive a quantum circuit for them from a classical circuit. You just:

+ +
    +
  1. Compile the function down to a series of assembly instructions, ideally without any jumps. You could use a traditional compiler for this.

  2. +
  3. Compile each assembly instruction into a classic logic circuit.

  4. +
  5. Switch to the reversible gate set by introducing work space. Replace AND gates with Toffoli gates onto fresh zero qubits, and etc.

  6. +
  7. Add the result register into $y$ using a standard addition circuit.

  8. +
  9. Uncompute all the junk data that was computed during step 3.

  10. +
+ +

Of course in general you'll want to try to be a bit clever about it in order to create an efficient circuit.

+",119,,,,,5/13/2019 7:40,,,,0,,,,CC BY-SA 4.0 +6128,1,,,5/13/2019 8:59,,4,291,"

In classical computing, arithmetic circuit complexity is apparently a big topic. But I couldn't find much about the complexity of quantum arithmetic circuits. Almost all references like arXiv:1805.12445 talk about the implementation and construction of the quantum circuits for functions like $\frac{1}{x}$, $\sin(x)$, etc. But I'm looking for the quantum analog of the VP vs. VNP problem and complexity analyses of the quantum circuit families used to improve the implementation of those functions.

+ +

Is there any existing work on this area? In other words, what are some authoritative references on quantum arithmetic circuit complexity (with a focus on complexity classes)?

+ +

P.S: I've asked a very related question on the Theoretical CS site.

+",26,,26,,5/13/2019 9:20,6/4/2020 23:18,References on quantum arithmetic circuit complexity,,2,0,,,,CC BY-SA 4.0 +6129,1,,,5/13/2019 12:09,,3,544,"

Here's a blog post that corresponds with what IBM presented at the 2019 March Meeting.

+ +

In this post, they claim they've measured qubit T1 relaxation times above 500 microseconds, and claim that they've seen evidence of genuinely entangled 18-qubit GHZ states.

+ +

This is far beyond anything that I've seen in published literature. The best results as far as I can find are 12 genuinely entangled qubits (up from 10) from the Pan group in China (1), and ~160 microsecond T1 times (2), also from IBM, but using a 3D cavity transmon qubit.

+ +

Question:

+ +

Assuming the claims are credible, what sort of advancements in fabrication (for the long coherence times) and microwave technology (for large entangled states) could allow such fast progress?

+",1867,,26,,5/13/2019 16:19,5/15/2019 13:30,IBM's quantum computing capabilities — entangled 18-qubit GHZ states and high coherence times,,1,0,,,,CC BY-SA 4.0 +6130,2,,6106,5/13/2019 13:40,,3,,"

Note that there are many ways to make or into a reversible operation.

+ +

The truth table for the OR reads: +$$\begin{array}{ccc} x & y & x\operatorname{or}y \\ \hline +0 & 0 & 0\\ +0 & 1 & 1\\ +1 & 0 & 1\\ +1 & 1 & 1\\ +\end{array}$$ +so we only need to add an ancillary degree of freedom that registers the difference between the last three cases. +In other words, if $f(x,y)=x+y+xy$ is the OR operation ($+$ denotes modulo-$2$ sum here), our reversible operation must be some $g(x,y)$ such that +\begin{align} +g(0,0)&=(0,\alpha),\\ +g(0,1)&=(1,\beta_1), \\ +g(1,0)&=(1,\beta_2), \\ +g(1,1)&=(1,\beta_3), +\end{align} +where $\alpha$ can be anything, and the $\beta_i$ have to be different from each other. Any such $g$ is reversible, and can therefore be implemented as a quantum gate.

+ +

To satisfy the above constraints, we clearly need at least two ancillary bits, and then any assignment to the $\beta_i$ works. For example, we can choose $\beta_0=00, \beta_1=01, \beta_2=10$.

+ +

The above argument tells you that you cannot implement a quantum OR operation with less than three qubits. As to how many ""elementary gates"" you need to realise such an operation as a circuit, that question is meaningless without a choice of the elementary gate set to use.

+",55,,55,,5/13/2019 14:31,5/13/2019 14:31,,,,0,,,,CC BY-SA 4.0 +6131,2,,6129,5/13/2019 14:14,,3,,"

So, to begin, I would point out that the 500 micosec T1 time is for a single qubit in isolation, while the GHZ results are on a 20 qubit device. This device has an avg T1 time of around ~75 microsec.

+ +

The GHZ results were done by Ken Wei from IBM, and will be published shortly.

+ +

+ +

In short, the circuit is a standard GHZ building circuit, with a hadamard gate followed by a chain of CNOT gates (As pictured above). These gates are ordered in such a way as to minimize the construction time by running CNOT gates in parallel on the device(not pictured above). Then there is a layer of phase gates (U1 gates in the IBM notation), followed by the reverse sequence of gates to undo the GHZ state. The U1 layer in the middle gives the states a phase that is then kicked-back in the unrolling at the end, and measured by the top qubit.

+ +

To make everything happen, you need high-fidelity CNOT gates, and high-fidelity parallel CNOT gates. In addition, and equally important, you need to be able to correct for measurement errors in the final result. Think of this as measurement tomography if you like. This is a part of the IBM Qiskit Ignis package (qiskit.org). Further details of how all this works together will be in the forthcoming publication

+ +

Update:

+ +

Here is the paper: Wei, Ken X., et al. ""Verifying Multipartite Entangled GHZ States via Multiple Quantum Coherences"" arXiv preprint arXiv:1905.05720 (2019).

+",332,,26,,5/15/2019 13:30,5/15/2019 13:30,,,,1,,,,CC BY-SA 4.0 +6132,1,,,5/13/2019 16:23,,4,74,"

I have a set of $16 \times 16$ two-qudit density matrices. I would like to study the bound-entanglement for this set, making use of entanglement witnesses for which explicit matrix representations are available or can be generated.

+ +

So to be fully explicit, can such a matrix (or matrices) be provided?

+",3089,,55,,7/5/2021 8:24,7/5/2021 8:24,Explicit 16⨯16 matrix representations of two-qudit entanglement witnesses,,1,1,,,,CC BY-SA 4.0 +6133,2,,6109,5/13/2019 17:56,,4,,"

Suppose that $\mathsf{X}$ is a register that can store each possible choice for $x$, as a classical state, while $\mathsf{Y}$ is a register that can store each possible state $\rho_x$. It is then natural to associate the classical-quantum state +$$ +\rho = \sum_x p_x |x\rangle \langle x| \otimes \rho_x +$$ +with the ensemble $\{(p_x,\rho_x)\}$.

+ +

Now try taking the following two steps:

+ +
    +
  1. Verify that the Holevo information of the ensemble $\{(p_x,\rho_x)\}$ is just another name for the mutual information $\text{I}(\mathsf{X}:\mathsf{Y})_\rho$ between $\mathsf{X}$ and $\mathsf{Y}$.

  2. +
  3. Verify, for an arbitrary state $\rho$ of the pair $(\mathsf{X},\mathsf{Y})$, that the mutual information $\text{I}(\mathsf{X}:\mathsf{Y})_\rho$ can be expressed as +$$ +\mathrm{I}(\mathsf{X}:\mathsf{Y})_\rho = \mathrm{S}\bigl(\rho\,\big\|\, \rho^{\mathsf{X}}\otimes \rho^{\mathsf{Y}}\bigr). +$$

  4. +
+ +

Once you have done this, it should become clear how to get (1) from (2), but do not assume that it is exactly the same channel appearing in the two inequalities.

+",1764,,26,,5/13/2019 19:35,5/13/2019 19:35,,,,0,,,,CC BY-SA 4.0 +6134,1,6141,,5/13/2019 19:48,,3,244,"

In Nielsen and Chuang, in the Fidelity section, (Lemma 9.5, page 410 in the 2002 edition), they prove the following.

+ +

$$ \mathrm{tr}(AU) = |\mathrm{tr}(|A|VU)| = |\mathrm{tr}(|A|^{1/2}|A|^{1/2}VU)| $$ +$$ |\mathrm{tr}(AU)| \leq \sqrt{\mathrm{tr}|A| \mathrm{tr}(U^{\dagger}V^{\dagger}|A|VU)} = \mathrm{tr}|A|$$

+ +

First, is $|A|$ the positive matrix in the polar decomposition of $A$? +And second, apparently, the second equation comes from the first due to Cauchy Schwartz inequality of Hilbert-Schmidt.

+ +

How does the first expression lead to the second?

+",2832,,55,,6/2/2021 10:39,6/5/2021 20:56,Proving the inequality $|\mathrm{tr}(AU)|\le \mathrm{tr}|A|$ in Uhlmann's theorem,,1,0,,,,CC BY-SA 4.0 +6135,1,,,5/13/2019 20:07,,3,231,"

I have 4 states say $|00\rangle, |01\rangle,|10\rangle, |11\rangle$. I want to add the states in a manner such that

+
    +
  1. $|a\rangle=|00\rangle\otimes|01\rangle\to |00\rangle\otimes|01\rangle$
    +and
  2. +
  3. $|b\rangle=|10\rangle\otimes|11\rangle\to |10\rangle\otimes|01\rangle$.
  4. +
+

That is the sum operator where the result is saved in the second register, i.e $|x,y\rangle\to|x, \mathrm{sum}(x,y)\rangle$.

+

But there is a rule that:
+if $i=1$ then compute case $a$
+if $i=2$ then compute case $b$.

+

How do I implement this conditional statement in a quantum circuit?

+",6070,,10480,,4/5/2021 17:34,4/5/2021 17:34,Implementing conditional operators in a quantum circuit,,1,3,,,,CC BY-SA 4.0 +6136,1,6159,,5/13/2019 20:29,,4,136,"

The second qubit of a two-qubit system in the Bell state
+$$|\beta_{01}\rangle= \frac{1}{\sqrt{2}}(|01\rangle+|10\rangle)$$ is sent through an error channel which introduces a bit flip error with probability $p$. I want to calculate the state of the system after the second qubit exits the error channel.

+ +

I know how to do this for a single qubit, but there isn't anything in my notes about doing it on a single qubit of a two-qubit system (or on two qubits for that matter).

+ +

This question is from a past exam paper (my exam is next week) could anyone show me the method of how to perform this operation?

+",6254,,6254,,5/15/2019 20:30,5/16/2019 6:49,State of a system after the second qubit of a Bell state sent through a bit flip error channel,,1,2,,,,CC BY-SA 4.0 +6138,1,6140,,5/14/2019 7:35,,4,316,"

Let's take an example of an entanglement witness of the form $W = | \phi \rangle \langle \phi | ^{T_2}$ where $ | \phi \rangle $ is some pure entangled state.

+ +

If I wanted to test some state $\rho$, I would have to perform $\mathrm{Tr}(W \rho)$. I assume this is done by measuring $\rho$ multiple times in the eigenbasis of $W$ and finding the expected eigenvalue, and that would be the solution to $\mathrm{Tr}(W \rho)$.

+ +
    +
  1. Is this the way it is done?
  2. +
  3. Therefore, specifically in the above case, it is very much possible to physically apply the witness? (Even though there is a mathematical partial transpose present.)
  4. +
+",2832,,55,,3/9/2021 22:04,3/9/2021 22:04,How are witness operators physically implemented?,,1,0,,,,CC BY-SA 4.0 +6139,1,6142,,5/14/2019 8:15,,5,327,"

$\newcommand{\Y}{\mathcal{Y}}\newcommand{\X}{\mathcal{X}}\newcommand{\rmL}{\mathrm{L}}$As explained for example in Watrous' book (chapter 2, p. 79), given an arbitrary linear map $\Phi\in\rmL(\rmL( +\X),\rmL(\Y))$, for every linear operator $X\in\rmL(\X)$ we can write the Kraus representation of $\Phi(X)$ as +$$\Phi(X)=\sum_a A_a X B_a^\dagger,\tag1$$ +where $A_a,B_a\in\rmL(\X,\Y)$.

+ +

As far as I understand it, the essential step in showing this is given in Corollary 2.21 of the above book, when we write the Choi representation +as $J(\Phi)=\sum_a u_a v_a^\dagger$.

+ +

I've been trying to understand how the Kraus representation can be obtained more directly in the natural representation of $\Phi$, which essentially means to think of $\Phi$ as a matrix acting on the vectorized versions of the operators, via the equivalence $\rmL(\X)\sim\X\otimes \X$. +In this representation, we can write $\Phi(X)_{ij}=\Phi_{ijk\ell}X_{k\ell}$, where $\Phi_{ijk\ell}$ are the components of the natural representation.

+ +

One can apply SVD to the four-index object $\Phi_{ijk\ell}$ separating $i,k$ from $j,\ell$, thus obtaining a decomposition of the form +$$\Phi_{ijk\ell}=\sum_\alpha s_\alpha A^\alpha_{ik}\bar B^{\alpha}_{j\ell}.\tag2$$ +This looks very close to the typical Kraus representation for a general map as given in (1). Being $s_\alpha\ge0$, one can also write $s_\alpha=\sqrt{s_\alpha}\sqrt{s_\alpha}$ and redefine the operators $A, B$ to contain $\sqrt{s_\alpha}$, thus getting an even more similar form.

+ +

What I'm wondering is: is this way of decomposing the channel via SVD equivalent to the Kraus representation? If so, we would also know additional properties for the $A_{ik}^\alpha, B_{j\ell}^\alpha$ operators, such as their orthogonality: $\sum_{ik}A^\alpha_{ik} \bar A^\beta_{ik}=\delta_{\alpha\beta}$ etc. +In this sense, it seems to me that absorbing the singular values $s_\alpha$ into the operators, like is done in (1), is actually hiding information, because then we lose the orthogonality between the $A_a, B_a$. +Does one approach have any advantage over the other (assuming they are both equally correct)?

+",55,,55,,7/5/2021 8:24,7/5/2021 8:24,"Direct derivation of the Kraus representation from the natural representation, using SVD",,1,0,,,,CC BY-SA 4.0 +6140,2,,6138,5/14/2019 8:41,,3,,"

This is certainly how theorists think of this being done. I don't know if there's an experimental reality to compare this to. Whether they actually decompose it in terms of the eigenvectors, or find some other terms to decompose it as.

+ +

Just as an example of what I mean, let +$$ +W=\left(\begin{array}{cccc} +1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 +\end{array}\right). +$$ +As it happens, this is just a swap gate, but ignore this for now. +You might find the eigenvectors $|00\rangle,|11\rangle,(|01\rangle\pm|10\rangle)/\sqrt{2}$ and measure those expectation values directly. Or, you might write +$$ +W=(\mathbb{I}+Z\otimes Z+X\otimes X+Y\otimes Y)/2, +$$ +and them you might go off and measure the 3 separate observables $ZZ$, $XX$ and $YY$, those being particularly natural, accessible, things.

+ +

Note that there's no problem using $W$ to define a measurement. The partial transpose is irrelevant; it's still a Hermitian matrix. The partial transpose just means it might not be a valid state, but being a valid state is irrelevant as a measurement: if we say ""do a Z measurement"", the Z matrix certainly has nothing to do with being a state. It's just a Hermitian matrix.

+",1837,,,,,5/14/2019 8:41,,,,0,,,,CC BY-SA 4.0 +6141,2,,6134,5/14/2019 12:02,,4,,"

I'll give a couple of methods to do this:

+
    +
  1. (Using matrix inequalities) The idea is to use CS inequality in the form +$$\newcommand{\tr}{\operatorname{Tr}}\lvert \sum_{ij}A_{ij}^* B_{ij}\rvert\le\sqrt{\sum_{ij} \left\lvert A_{ij}\right\rvert^2}\sqrt{\sum_{ij}\left\lvert B_{ij}\right\rvert^2},$$ which in matrix formalism reads $$\lvert\tr(A^\dagger B)\rvert\le\sqrt{\tr(A^\dagger A})\sqrt{\tr(B^\dagger B)}.$$ +Therefore, +$$\lvert\tr(AU)\rvert=\lvert\tr(\lvert A\rvert VU)\rvert +=\lvert\tr(\lvert A\rvert^{1/2} \underbrace{\lvert A\rvert^{1/2} VU}_{D})\rvert +\le\sqrt{\tr(\lvert A\rvert^{1/2}\lvert A\rvert^{1/2})}\sqrt{\tr(D^\dagger D)}, +$$ +and putting in the explicit expression for $D$ you get the result.

    +
  2. +
  3. (Via SVD) Another approach is to leverage the SVD of the operators. Notice that, if the SVD of $A$ reads +$$A = \sum_i a_i |a_i^L\rangle\!\langle a_i^R|,$$ +then, for any unitary $U$, $AU$ is an operator which has the same singular values and left singular vectors as $A$. Similarly, $A$ and $UA$ have the same singular values and right singular vectors. +The question to maximise $\lvert {\rm Tr}(AU)\rvert$ thus amounts to maximising +$$\lvert{\rm Tr}(AU)\rvert = \left\lvert \sum_i a_i \langle u_i,a_i^L\rangle\right\rvert$$ +over the sets of orthonormal bases $\{\lvert u_i\rangle\}_i$. The connection with the above is via $|u_i\rangle=U^\dagger \lvert a_i^R\rangle$. +From the above expression, it is clear that Cauchy-Schwarz implies +$$\lvert{\rm Tr}(AU)\rvert \le \sum_i a_i = {\rm Tr}|A|,$$ +and that the maximum is achieved when $|u_i\rangle=|a_i^L\rangle$, that is, $U=\sum_i |a_i^R\rangle\!\langle a_i^L\rvert$.

    +
  4. +
  5. (Via SVD, generalised result) Let us try now for a more general result. Relax the constraint of $U$ being unitary, and let it by an arbitrary (squared) matrix. The only difference compared to the previous case is that we can now have non-unit singular values, call these $u_i$. The trace we are interested in now reads +$$\lvert{\rm Tr}(AU)\rvert = \left\lvert\sum_i a_i u_i \langle u_i,a_i^L\rangle\right\rvert.$$ +We can again use Cauchy-Schwarz to get an upper bound, but this time the singular values $u_i$ are in the way. That is not that big of a problem though: observe that $\|U\|_{\rm op}=\max_i u_i$, and thus we can write +$$\lvert{\rm Tr}(AU)\rvert \le \|U\|_{\rm op}{\rm Tr}|A|.$$ +We can also, if we want, characterise the $U$ that achieves the maximum: this will be the (or a) unitary operator connecting right and left singular vectors of $A$, as in the previous case.

    +
  6. +
+ +",55,,55,,6/5/2021 20:56,6/5/2021 20:56,,,,0,,,,CC BY-SA 4.0 +6142,2,,6139,5/14/2019 14:03,,6,,"

As matrices, the natural representation and Choi representation of a map $\Phi$ have exactly the same entries, but arranged into matrices in different ways. One way to express this is like this: +$$ +\langle k,\ell | K(\Phi) | i,j \rangle = \langle k | \Phi(|i\rangle\langle j|) | \ell \rangle = \langle k,i | J(\Phi) | \ell,j \rangle, +$$ +where $K(\Phi)$ denotes the natural representation, $J(\Phi)$ denotes the Choi representation, $i$ and $j$ index into the input system, and $k$, $\ell$ index into the output system. It appears to me that applying the singular value decomposition to $K(\Phi)$ in the particular way the question describes is equivalent to applying the singular value decomposition to $J(\Phi)$ for this reason. Of course, we do not need to use the singular value decomposition to write $J(\Phi) = \sum_a u_a v_a^{\dagger}$, but it is one way to obtain this form (and as a bonus to get $\{u_a\}$ and $\{v_a\}$ to be orthogonal sets, in case that is useful).

+ +

I do not understand the statement in the question about information being hidden if the singular values are absorbed into the Kraus operators. The sets $\{A_a\}$ and $\{B_a\}$ are both orthogonal sets, and this does not change when their elements are multiplied by scalars.

+ +

In my view, the main advantage in starting from the Choi representation is that it works better for completely positive maps. In this case, $J(\Phi)$ is positive semidefinite, so we can use the spectral decomposition rather than the singular value decomposition to obtain $A_a = B_a$ for all $a$. Indeed, equation (1) in the question would be considered by many to be a generalized type of Kraus representation, whereas a proper Kraus representation would require $A_a = B_a$, and therefore only exists when $\Phi$ is completely positive.

+ +

In general, the Choi representation $J(\Phi)$ is nice because its properties as an operator translate to properties of $\Phi$ (particularly $J(\Phi)\geq 0$ if and only if $\Phi$ is completely positive). In some sense the natural representation $K(\Phi)$ ignores the operator structure of the inputs and outputs of $\Phi$, which makes it a less useful representation.

+",1764,,,,,5/14/2019 14:03,,,,0,,,,CC BY-SA 4.0 +6143,2,,2047,5/14/2019 17:11,,1,,"

Direct proof

+

We want to prove that a channel given in the form +$$\Phi(\rho) = \sum_a A_a \rho A_a^\dagger\tag1$$ +can equivalently be represented as a unitary evolution in an enlarged space. I'll actually consider the more general case of an arbitrary (CP) map of the form (1) (that is, I won't assume the normalisation $\sum_a A_a^\dagger A_a=I$).

+

A direct way to do this is to define the operator $V$ with action +$$V|\psi\rangle\equiv \sum_a (A_a|\psi\rangle)\otimes |a\rangle.$$ +If $\Phi$ is a channel, that is, $\sum_a A_a^\dagger A_a=I$, then $V$ is an isometry. The vectors $|a\rangle$ are here an (arbitrary) orthonormal basis in an auxiliary space. The auxiliary space needs to have dimension equal to the number of Kraus operators for this expression to work.

+

With this $V$, we can see that the map can be equivalently written as +$$\Phi(\rho) = \operatorname{Tr}_2[V\rho V^\dagger].\tag2$$ +This is the so-called Stinespring representation of the map/channel. We can then also equivalently write (2) as +$$\Phi(\rho) = \operatorname{Tr}_2[U(\rho\otimes |u\rangle\!\langle u|)U^\dagger)],$$ +for any pure state $|u\rangle$ living in the auxiliary space, defining $U$ as such that $U(|i\rangle\otimes|u\rangle)=V|i\rangle$. +This can always be done, and if $\Phi$ is a channel, then $V$ is an isometry, and $U$ is a unitary.

+

Proof with explicit componentwise expressions

+

From the Kraus representation, $\Phi(\rho)=\sum_a A^a \rho A^{a\dagger}$, making the indices explicit, we get +$$\Phi(\rho)_{ij}=\sum_{a,k,\ell}A^a_{ik}A^{a*}_{j\ell}\rho_{k\ell}.\tag1$$

+

On the other hand, unravelling the second expression we have for a generic $\sigma$ (let me here use numbers instead of latin letters for the indices, for better clarity, as well as Einstein's notation for repeated indices), +$$[U(\rho \otimes \sigma) U^\dagger]_{1234}=U_{1256}U^{*}_{3478}\rho_{57}\sigma_{68}.$$ +Note that here the first two indices, ($1$ and $2$) correspond to the "output space" of the operator $\Phi(\rho)$, while the other two ($3$ and $4$) correspond to its "input space". Similarly, $2$ and $4$ live in the second Hilbert space, while $1$ and $3$ live in the first one.

+

Tracing with respect to the second Hilbert space amounts to introducing a $\delta_{24}$ factor, and we thus get

+

$$\left\{\mathrm{Tr}_B\left[ U(\rho \otimes \sigma) U^\dagger \right]\right\}_{13} +=U_{1256}U^{*}_{3478}\rho_{57}\sigma_{68} \color{red}{\delta_{24}} +=U_{1256}U^{*}_{3278}\rho_{57}\sigma_{68}.$$

+

If we take $\sigma$ to be a pure state, for example $\sigma=\lvert0\rangle\!\langle0\rvert$, so that $\sigma_{68}=\delta_{60}\delta_{80}$, then we have

+

$$\left\{\mathrm{Tr}_B\left[ U(\rho \otimes \lvert0\rangle\!\langle0\rvert) U^\dagger \right]\right\}_{13} +=U_{1250}U^*_{3270}\rho_{57}.$$ +Going back to using the standard notation for the indices, and making explicit the sums, we have

+

$$\left\{\mathrm{Tr}_B\left[ U(\rho \otimes \lvert0\rangle\!\langle0\rvert) U^\dagger \right]\right\}_{ij} +=\sum_{a,k,\ell}U_{iak0}U^*_{ja\ell0}\rho_{k\ell}.\tag2$$ +This expression is equivalent to (1), defining $A^a_{ik}\equiv U_{iak0}$ and $A_{j\ell}^{a*}\equiv U^*_{ja\ell0}$.

+",55,,55,,5/13/2022 8:49,5/13/2022 8:49,,,,0,,,,CC BY-SA 4.0 +6144,1,14587,,5/14/2019 17:59,,3,101,"

We know that a map $\Phi\in\mathrm T(\mathcal X,\mathcal Y)$ being completely positive is equivalent to its Choi representation being positive: $J(\Phi)\in\operatorname{Pos}(\mathcal Y\otimes\mathcal X)$, as shown for example in Watrous' book, around pag. 82.

+ +

The proof for the completely positive case relies on writing the Choi representation $J(\Phi)$ of $\Phi$ as

+ +

$$J(\Phi)=(\Phi\otimes\mathbb1_{\mathrm L(\mathcal X)})(\operatorname{vec}(\mathbb1_{\mathcal X})\operatorname{vec}(\mathbb1_{\mathcal X})^*),$$

+ +

and noting that because $\operatorname{vec}(\mathbb1_{\mathcal X})\operatorname{vec}(\mathbb1_{\mathcal X})^*\ge0$ and $\Phi\otimes\mathbb1_{\mathrm L(\mathcal X)}$ is a positive map, then $J(\Phi)\ge0$. +It is not obvious whether this sort of argument can give interesting results about $J(\Phi)$ when $\Phi\otimes\mathbb1_{\mathrm L(\mathcal X)}$ is not positive.

+ +

In other words, how does $\Phi$ being ""only"" positive reflect on $J(\Phi)$ (if any such simple characterisation is possible)?

+",55,,55,,11/11/2020 15:01,11/11/2020 15:01,"How does a map being ""only"" positive reflect on its Choi representation?",,1,1,,,,CC BY-SA 4.0 +6145,1,,,5/14/2019 19:49,,7,205,"

Would there be any disadvantages of using inner product, that is, $\mathrm{Tr}(A^{\dagger}B)$ (say making it, $\mathrm{Tr}(\sqrt A \sqrt B)$ to normalise) to quantify how far two quantum states are instead of fidelity, which is $\mathrm{Tr}(\sqrt{\sqrt A B \sqrt A})$?

+ +

Apart from losing the relationship with trace distance.

+",2832,,55,,2/14/2021 18:57,2/14/2021 18:57,Are there disadvantages in using the inner product between states instead of the fidelity?,,2,0,,,,CC BY-SA 4.0 +6146,1,6147,,5/14/2019 21:25,,6,2593,"

I am reading John Watrous' notes from his course CPSC 519 on quantum computing. In a pre-discussion before presenting Deutsch's algorithm to determine whether a function is constant or not, the author presents a function $B_f |x \rangle |y \rangle = |x \rangle |y \oplus f(x) \rangle $, and the diagram: +

+ +

The inital state is $|0 \rangle |1 \rangle$, and after the first two Hadamard transforms, will be $$\big(\frac {1} {\sqrt 2} |0\rangle +\frac {1} {\sqrt 2} |1\rangle\big)\big(\frac {1} {\sqrt 2} |0\rangle-\frac {1} {\sqrt 2} |1\rangle\big) .$$

+ +

Up to this far I understand. The author then writes: ""After performing the $B_f$ operation the state is transformed to:

+ +

$$\frac {1} {2} |0 \rangle \big(|0 \oplus f(0)\rangle - |1 \oplus f(0)\rangle\big) + \frac {1} {2} |1 \rangle \big(|0 \oplus f(1)\rangle) - |1 \oplus f(1) \rangle\big).$$

+ +

I am not sure how this was obtained, from what I understand, the operation should be +$$\frac {1} {\sqrt 2} \big( |0\rangle + |1\rangle\big) \otimes \big|(\frac {1} {\sqrt 2} |0\rangle +\frac {1} {\sqrt 2} |1\rangle) \oplus f(\frac {1} {\sqrt 2} |0\rangle +\frac {1} {\sqrt 2} |1\rangle) \big\rangle$$ (simply subbing in $x,y$ to $B_f$). Any insights appreciated as this subject is completely new to me, although I have a decent mathematics and computer science background.

+",7481,,26,,5/15/2019 9:34,5/15/2019 9:34,Understanding the oracle in Deutsch's algorithm,,1,0,,,,CC BY-SA 4.0 +6147,2,,6146,5/14/2019 21:50,,9,,"

Remember that when you define the oracle effect as $B_f |x \rangle |y \rangle = |x \rangle |y \oplus f(x) \rangle $, $f(x)$ is a classical function of a classical 1-bit argument, so you do not have a way to compute $f(\frac {1} {\sqrt 2} |0\rangle +\frac {1} {\sqrt 2} |1\rangle)$ (a function of a quantum state).

+ +

The quantum oracles that implement classical functions are defined as follows:

+ +
    +
  1. Define the effect of the oracle on all basis states for $|x\rangle$ and $|y\rangle$: $B_f |x \rangle |y \rangle = |x \rangle |y \oplus f(x) \rangle $.

  2. +
  3. This will automatically define the effect of the oracle on all superposition states: the oracle is a quantum operation and has to be linear in the state on which it acts. So if you start with a state $\frac{1}{2} (|00\rangle + |10\rangle - |01\rangle - |11\rangle)$ (which is the state after applying Hadamard gates) and apply the oracle, you need to apply oracle to each basis state separately. You'll get

  4. +
+ +

$$B_f \frac{1}{2} (|00\rangle + |10\rangle - |01\rangle - |11\rangle) = \frac{1}{2} (B_f|00\rangle + B_f|10\rangle - B_f|01\rangle - B_f|11\rangle) =$$

+ +

$$ = \frac{1}{2} (|0\rangle|0 \oplus f(0)\rangle + |1\rangle|0 \oplus f(1)\rangle - |0\rangle|1 \oplus f(0)\rangle - |1\rangle|1 \oplus f(1)\rangle)$$

+ +

Which is the same as the expression in the notes, up to a different grouping or terms.

+ +
+ +

The part about the oracles being defined by their effect on basis states is implicit in a lot of sources I've seen, and is a frequent source of confusion. If you need more mathematical details on this, we ended up writing it up here.

+",2879,,,,,5/14/2019 21:50,,,,3,,,,CC BY-SA 4.0 +6149,2,,6107,5/15/2019 0:25,,2,,"

The Quantum Volume is a benchmark for near term, noisy quantum systems. Indeed, like other random unitary benchmarks, you need to be able to sample the ideal distribution. This distribution comes from classical simulations, so your limited to about the ~40 or so qubit limit. However, the Quantum Volume itself was designed to benchmark not only the quantum device itself, but also things like control electronics, measurements, circuit compilation methods, etc, while encoding all of this in a single numerical value. Currently, IBM has shown Quantum Volume numbers for at most four qubits, 2^4=16.

+",332,,,,,5/15/2019 0:25,,,,1,,,,CC BY-SA 4.0 +6150,2,,6132,5/15/2019 3:50,,3,,"

Dariusz Chruscinski has provided me with an example of a particular such entanglement witness. It takes the form +\begin{equation} +\left( +\begin{array}{cccccccccccccccc} + 1 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & -1 \\ + 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + -1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & -1 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + -1 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 & -1 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ + -1 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & -1 & 0 & 0 & 0 & 0 & 1 \\ +\end{array} +\right) +\end{equation}

+ +

Additionally, he has informed me that a second entanglement witness can be obtained by the replacement of the sixteen diagonal entries of the above matrix by +\begin{equation} +{2, 1, 0, 0, 0, 2, 1, 0, 0, 0, 2, 1, 1, 0, 0, 2}. +\end{equation}

+",3089,,3089,,5/16/2019 10:22,5/16/2019 10:22,,,,2,,,,CC BY-SA 4.0 +6151,2,,6145,5/15/2019 11:31,,4,,"

A few thoughts:

+ +

It mostly depends on what you are trying to quantify.

+ +

The inner product of states, $\text{Tr}(\rho\sigma)$, is used to quantify the distance in state space. More precisely, the squared distance between two states is commonly defined as +$$D(\rho,\sigma)^2\equiv \|\rho-\sigma\|_2^2=1-\text{Tr}(\rho\sigma).$$ +This is useful and used for example to understand the geometrical features of the space of states (think Bloch representations of states). +For pure states, the definitions coincide, as you have $\text{Tr}(\rho\sigma)=\lvert\langle\psi_\rho\rvert\psi_\sigma\rangle\rvert^2$ if $\rho=\lvert\psi_\rho\rangle\!\langle\psi_\rho\rvert$ and same for $\sigma$. For mixed states, however, I don't know if there is a direct physical interpretation of $\text{Tr}(\rho\sigma)$.

+ +

On the other hand, the fidelity quantifies the indistinguishability between states (equivalently, the probability of finding one state to equal the other, in an appropriate measurement choice). In the case of mixed states, you have to decide what is meant by this, as there are potentially many possible pure states that are compatible with any given mixed state, and comparing the pure states corresponding to $\rho$ and $\sigma$ might give different results depending on such choice. The state fidelity considers the worst-case scenario in terms of distinguishability: as shown by Uhlmann's theorem (see also this question and links therein), $\text{Tr}(\lvert\sqrt\rho\sqrt\sigma\rvert)$ equals the maximum fidelity among the purifications of $\rho$ and $\sigma$: +$$\text{Tr}(\lvert\sqrt\rho\sqrt\sigma\rvert)=\max_{\psi_\rho,\psi_\sigma}\lvert\langle\psi_\rho\rvert\psi_\sigma\rangle\rvert,$$ +where the maximisation is performed over all possible purifications $\psi_\rho,\psi_\sigma$ of $\rho,\sigma$, respectively.

+",55,,55,,5/15/2019 13:41,5/15/2019 13:41,,,,0,,,,CC BY-SA 4.0 +6152,2,,6145,5/15/2019 11:54,,5,,"

The quantity $\text{Tr}(\sqrt{A}\sqrt{B})$ that you defined there is actually referred to as the ""just-as-good fidelity"" (see 1801.02800) because it does have a relationship with the trace distance very similar to the standard fidelity and is therefore ""just as good"" for quantifying the distinguishability of states. There is no intrinsic reason to prefer the standard fidelity, but the latter gets used a lot because it is often useful to use Uhlmann's theorem, as glS points out in the other answer.

+",7495,,,,,5/15/2019 11:54,,,,0,,,,CC BY-SA 4.0 +6154,2,,39,5/15/2019 18:56,,1,,"

After introducing Shor's algorithm to an audience, in many of Scott Aaronson's publicly available lectures from the mid-2000's until the early-mid 2010's he would often emphasize the gap between the theoretical capabilities of a quantum computer vs. the engineering difficulties of constructing a quantum computer by stating something to the effect of ""a quantum computer has determined that $15$ factors into $3\times5$... with high probability.""

+ +

It's a good line especially with Aaronson's well-timed beat, and the audience always seemed to chuckle at least a little bit, but of course we all know that that's a small oversimplification of the probabilistic nature of Shor's algorithm.

+ +

That is, it's rather that Shor's algorithm would tell us that ""a factor of $15$ is $3$ with high probability, and another factor of $15$ is $5$ with high probability."" We can classically confirm that $15=3\times 5$, now that Shor's algorithm has told us what some factors are (with high probability).

+ +

In other words, as suggested in Niel de Beaudrap's answer, $\mathsf{FACTORING}$, like many problems to which we believe a quantum computer will be useful, are in $\mathrm{BQP}\cap\mathrm{NP}$. We might rely on the randomness of $\mathrm{BQP}$ to generate candidate solutions but we can always test classically whether the quantum computer's putative solutions are correct.

+ +

There are, however, many problems which are in $\mathrm{BQP}$ but are not known to be, and are suspected not to be, in $\mathrm{NP}$ - for example, evaluating a Jones polynomial of a knot diagram.

+ +

(I know that there are two great answers already; however, the question does allow exposition/clarification on Aaronson's quote/anectdote.)

+",2927,,2927,,5/16/2019 11:45,5/16/2019 11:45,,,,0,,,,CC BY-SA 4.0 +6155,1,,,5/15/2019 20:41,,5,203,"

Assume $f(x)$ is an $n$ bits to $m$ bits function and we want to use Grover's search algorithm to find $x$ such that $f(x) = a$, where $a$ is some $m$-bit predetermined value.

+ +

When using the algorithm, can we separate the calls to $f(x)$ and $f(x)=a$? +That is, instead of querying $F(x) \equiv (f(x) = a)$ around $2^{n/2}$ times (interleaved with amplification), is it possible to query $f(x)$ once at the begining and then repeat $2^{n/2}$ times $f(x)=a$ (interleaved with amplification) ?

+",7498,,7498,,5/16/2019 0:22,5/26/2019 14:47,Grover search with single query to $f(x)$ and multiple queries to $f(x) = a$,,1,6,,,,CC BY-SA 4.0 +6157,1,6221,,5/16/2019 4:49,,25,4100,"

I found it a little difficult to understand it using Wikipedia and some mathematical documents. How to understand the Haar measure from a quantum information theory perspective? Are there any materials that explain it?

+",4178,,55,,2/14/2021 18:51,1/13/2023 6:50,How to understand the Haar measure from a quantum information perspective?,,1,2,,,,CC BY-SA 4.0 +6159,2,,6136,5/16/2019 6:49,,4,,"

If you're told about an operation on a single qubit, then to convert it into an operation on both qubits, you just include the identity matrix on the other qubit. So, contrast the single qubit state $|\psi\rangle$ going through the bit-flip channel +$$ +|\psi\rangle\rightarrow(1-p)|\psi\rangle\langle\psi|+pX|\psi\rangle\langle\psi|X +$$ +with what happens on two qubits +$$ +|\beta\rangle\rightarrow(1-p)|\beta\rangle\langle\beta|+p(\mathbb{I}\otimes X)|\beta\rangle\langle\beta|(\mathbb{I}\otimes X). +$$

+",1837,,,,,5/16/2019 6:49,,,,0,,,,CC BY-SA 4.0 +6160,1,6161,,5/16/2019 10:52,,3,861,"

I would like to know how the unitary matrix for this circuit looks like: +

+ +

I'm not sure but I would try something like this:

+ +

First part:

+ +

$\begin{pmatrix}1&0\\0&0\end{pmatrix}\otimes H_1=\begin{pmatrix}\frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}&0&0\\\frac{1}{\sqrt{2}}&-\frac{1}{\sqrt{2}}&0&0\\0&0&0&0\\0&0&0&0\end{pmatrix}$

+ +

Second part:

+ +

$\begin{pmatrix}0&0\\0&1\end{pmatrix}\otimes I_1=\begin{pmatrix}0&0&0&0\\0&0&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}$

+ +

putting them together:

+ +

$\begin{pmatrix}\frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}&0&0\\\frac{1}{\sqrt{2}}&-\frac{1}{\sqrt{2}}&0&0\\0&0&0&0\\0&0&0&0\end{pmatrix}+\begin{pmatrix}0&0&0&0\\0&0&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}=\begin{pmatrix}\frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}&0&0\\\frac{1}{\sqrt{2}}&-\frac{1}{\sqrt{2}}&0&0\\0&0&1&0\\0&0&0&1\end{pmatrix}$

+ +

I'm not sure if that's right, that's just a consideration of mine.

+ +

Assuming the circuit would look like that, what does the matrix look like?

+ +

+",4974,,26,,5/16/2019 10:55,11/30/2021 18:31,Matrix representation of multiple qubit gates (Hadamard transform on single wire),,1,0,,,,CC BY-SA 4.0 +6161,2,,6160,5/16/2019 11:05,,3,,"

Your matrix representation is incorrect. In the first case, a $\mathbf H$ gate is applied to the first qubit $A$ and an identity gate $\Bbb I$ is applied to the second qubit $B$. So the effective quantum gate acting on the two-qubit system is $\mathbf H\otimes \Bbb I$. This is precisely because $(\mathbf H|0\rangle_A) \otimes (\Bbb I|0\rangle_B) = (\mathbf H\otimes \Bbb I)(|0\rangle_A \otimes |0\rangle_B)$ as explained here. Similarly, for the second case, the effective quantum gate is $\Bbb I\otimes \mathbf H$. If you know the matrix representations of $\mathbf H$ and $\Bbb I$, simply calculate the two Kronecker products, to get the corresponding matrix representations.

+",26,,,,,5/16/2019 11:05,,,,1,,,,CC BY-SA 4.0 +6163,1,6166,,5/16/2019 16:03,,3,235,"

I have these two classical-quantum states:

+ +

$$\rho = \sum_{a} \lvert a\rangle \langle a\lvert \otimes q^a \\ + \mu = \sum_{a} \lvert a\rangle \langle a\lvert \otimes r^a $$

+ +

Where $a$ are the classical basis vectors, $q^a, r^a$ are arbitrary matrices dependent on $a$.

+ +

Now, we can take the trace distance of these two classical-quantum states, which would be:

+ +

$$T(\rho, \mu) = \frac{1}{2} ||\rho - \mu||_1 \\ += \frac{1}{2} || \sum_a \lvert a\rangle \langle a\lvert \otimes(q^a - r^a)||_1$$

+ +

Now, my question is, can we rewrite the above expression in the following way?

+ +

$$T(\rho, \mu) = \frac{1}{2} \sum_a ||q^a - r^a||_1$$ +I.e. just pulling the summation out of the norm.

+",2403,,55,,7/5/2021 8:24,7/5/2021 8:24,Trace distance of two classical-quantum states,,1,0,,,,CC BY-SA 4.0 +6166,2,,6163,5/16/2019 18:30,,6,,"

Yes, since the trace norm is the sum of the absolute value of the singular values, and the singular values can be found for each of the $a$ blocks independently.

+",491,,491,,5/16/2019 19:50,5/16/2019 19:50,,,,3,,,,CC BY-SA 4.0 +6167,1,6168,,5/16/2019 18:51,,1,133,"

I want to implement a controlled operation that involves the following: we have the following qubits: $|x_0\rangle,|x_1\rangle,|0\rangle,|1\rangle,|z_0\rangle,|z_1\rangle$. I want to add the first four qubits as $|x_0x_1\rangle$ and $|01\rangle$ where each $x_i\in\{0,1\}$ conditioned on the $|z_1\rangle$ being $0$. If the control is $1$ then do not perform the adder mod operation. So the circuit for this that I constructed is given in the figure:

+ +

+ +

Is this circuit correct?

+ +

Edit: Just to elaborate what this circuit does. It takes $3$ non-negative integer inputs $x=|x_0x_1\rangle$, $1=|01\rangle$, $z=|z_0z_1\rangle$ and adds the first two integers that are stored in the register $|x_0x_1\rangle$ and $|10\rangle$. The third integer $|z\rangle$ gives a remainder of $2$ when divided by $4$, but this can be thought of as the least significant bit being equal to $0$. Is the problem statement and circuit construction matching?

+",6070,,26,,5/17/2019 14:13,5/17/2019 14:13,Implementing a controlled sum operation,,1,3,,,,CC BY-SA 4.0 +6168,2,,6167,5/16/2019 20:06,,2,,"

The second from the top wire should probably be marked $|x_1 \rangle$ instead of $|x_0 \rangle$ (right now you have two $|x_0 \rangle$s). Other than that, the circuit looks correct for the described task.

+",2879,,2879,,5/16/2019 20:27,5/16/2019 20:27,,,,1,,,,CC BY-SA 4.0 +6170,1,6171,,5/17/2019 3:23,,5,568,"

Say we have the Shor 9 qubit code

+ +

$$|\psi_L\rangle=\tfrac{1}{\sqrt{2^3}}((|000\rangle+|111\rangle)^{\otimes3}+(|000\rangle-|111\rangle)^{\otimes3}),$$

+ +

and we have a bit flip error. My lecture notes say that error syndromes are obtained by measuring the observables:

+ +

$$Z_1Z_2,Z_2Z_3,Z_4Z_5,Z_5Z_6, Z_7Z_8,Z_8Z_9.$$

+ +

Which will give eigenvalues +1 if the two adjacent qubits in the block are the same and -1 if they are different.

+ +

I have two questions about this:

+ +
    +
  1. How does one measure the observables?

  2. +
  3. How are the eigenvalues obtained?

  4. +
+",6254,,26,,5/17/2019 13:09,5/17/2019 18:46,Shor 9 qubit code — how are the observables measured and eigenvalues obtained during syndrome measurement?,,2,1,,,,CC BY-SA 4.0 +6171,2,,6170,5/17/2019 7:45,,6,,"

Note that measuring an observable is equivalent to projecting the quantum state into a particular eigenspace of the operator, and the measurement result tells you which eigenspace. So, in the case of measuring an observable on an eigenstate of that observable, you just project the state onto itself, and the outcome tells you the eigenvalue. So, (2)is equivalent to (1).

+ +

In terms of how to actually measure an observable, there's a standard technique if the observable $O$ is such that $O^2$ is the identity (such as a tensor product of Pauli matrices, as is the case here). I described this in a previous answer, but add it here for completeness: + +Basically, you add an ancilla (the top qubit)for each observable, perform the circuit, and then measure the ancilla in the 0/1 basis. 0 corresponds to the +1 eigenvalue of the operator $O$, while 1 corresponds to the -1 eigenvalue.

+",1837,,,,,5/17/2019 7:45,,,,2,,,,CC BY-SA 4.0 +6172,1,,,5/17/2019 10:46,,8,474,"

One of the possible ways to improve the results of an experiment on the IBM machine using the Qiskit language is to use the measurement calibration methods. This is the link to the documentation.

+ +

I understood that the calibration matrix is made looking at when a qubit in a determined state is measured in one other state. But I didn't get how this calibration matrix is applied to the results to obtain the mitigated results.

+ +

This is the command used: +mitigated_results = meas_filter.apply(my_results, method).

+",7513,,26,,5/17/2019 14:10,6/5/2019 11:51,How does measurement calibration work?,,1,3,,,,CC BY-SA 4.0 +6174,2,,6170,5/17/2019 16:57,,1,,"

So say we have the encoded single qubit

+ +

$$|\psi_L\rangle=\tfrac{c_0}{\sqrt{2^3}}(|000\rangle+|111\rangle)^{\otimes3}+\tfrac{c_1}{\sqrt{2^3}}(|000\rangle-|111\rangle)^{\otimes3},$$

+ +

And then say a bit flip occurs on the 4th qubit so now we have

+ +

$$|\psi_L \rangle=\tfrac{c_0}{\sqrt{2^3}}((|000\rangle+|111\rangle)\otimes(|100\rangle+|011\rangle)\otimes(|000\rangle+|111\rangle))+\tfrac{c_1}{\sqrt{2^3}}((|000\rangle-|111\rangle)\otimes (|100\rangle-|011\rangle)\otimes (|000\rangle-|111\rangle))$$

+ +

Then we add the ancilla qubit $|0\rangle$, giving

+ +

$$|\psi_i \rangle=\tfrac{c_0|0\rangle}{\sqrt{2^3}}((|000\rangle+|111\rangle)\otimes(|100\rangle+|011\rangle)\otimes(|000\rangle+|111\rangle))+\tfrac{c_1|0\rangle}{\sqrt{2^3}}((|000\rangle-|111\rangle)\otimes (|100\rangle-|011\rangle)\otimes (|000\rangle-|111\rangle))$$

+ +

Performing the first Hadamard gate in your diagram gives

+ +

$$|\psi_i \rangle=\tfrac{c_0(|0\rangle+|1\rangle)}{\sqrt{2}\sqrt{2^3}}((|000\rangle+|111\rangle)\otimes(|100\rangle+|011\rangle)\otimes(|000\rangle+|111\rangle))+\tfrac{c_1(|0\rangle+|1\rangle)}{\sqrt{2}\sqrt{2^3}}((|000\rangle-|111\rangle)\otimes (|100\rangle-|011\rangle)\otimes (|000\rangle-|111\rangle))$$

+ +

Performing $Z_4Z_5$ gives

+ +

$$|\psi_i \rangle=\tfrac{c_0(|0\rangle+|1\rangle)}{\sqrt{2}\sqrt{2^3}}((|000\rangle+|111\rangle)\otimes(-|100\rangle+|011\rangle)\otimes(|000\rangle+|111\rangle))+\tfrac{c_1(|0\rangle+|1\rangle)}{\sqrt{2}\sqrt{2^3}}((|000\rangle-|111\rangle)\otimes (-|100\rangle-|011\rangle)\otimes (|000\rangle-|111\rangle))$$

+ +

Performing the second Hadamard gate gives

+ +

$$|\psi_i \rangle=\tfrac{c_0|0\rangle}{\sqrt{2^3}}((|000\rangle+|111\rangle)\otimes(|100\rangle+|011\rangle)\otimes(|000\rangle+|111\rangle))+\tfrac{c_1|0\rangle}{\sqrt{2^3}}((|000\rangle-|111\rangle)\otimes (|100\rangle-|011\rangle)\otimes (|000\rangle-|111\rangle))$$

+ +

Now we take a measurement in the $\{|0\rangle, |1\rangle\}$ basis. At this point I'm confused. Does it mean that we use a projective operator, say for $|1\rangle$, $P_1=|1\rangle \langle1|$, then we see what the probability of this is using $\langle\psi| P_1 |\psi\rangle$? And if the probability is 1 then the eigenvalue is -1, and if its zero the eigenvalue is +1.

+ +

Note: When I understand it fully I'll edit this so it's a complete answer.

+",6254,,26,,5/17/2019 18:46,5/17/2019 18:46,,,,3,,,,CC BY-SA 4.0 +6176,1,6181,,5/17/2019 18:53,,2,326,"

A POVM, as defined for example in (Peres and Wooters 1991), is defined by a set of positive operators $\mu(a)$ satisfying $\sum_a \mu(a)=\mathbb 1$. We do not require the $\mu(a)$ to be projectors, nor commuting operators, like is done in the case of projective measurements. +The probability of getting the $a$-th outcome when the state is $\lvert\psi\rangle$ is then $\langle\psi\rvert \mu(a)\rvert\psi\rangle$.

+ +

One way to understand the significance of such a general kind of measurement operation is via Naimark's theorem. Following the notation (sorta) used in Watrous' book (chapter 5), we can write +$$\mu(a)=A^\dagger(\mathbb 1_{\mathcal X}\otimes E_{a,a})A,$$ +where $A$ is an isometry, satisfying $A^\dagger A=\mathbb 1$, whose action we can write as +$$AX=\sum_a\sqrt{\mu(a)}X\otimes\lvert a\rangle.$$ +Should I understand this to be saying that the measurement $(\mu(a))_a$ corresponds to correlating $\lvert\psi\rangle$ with a bigger system, and then ""looking at the enlarged system"" (that is, performing a standard projecting measurement)?

+ +

If so, it should be sensible to write the state in the enlarged system where the projective measurement actually occurs as +$$A\lvert\psi\rangle=\sum_a[\sqrt{\mu(a)}\lvert\psi\rangle]\otimes\lvert a\rangle.$$ +However, writing the spectral decomposition of $\mu(a)$ as $\mu(a)=\sum_k\lambda^a_k\lvert\lambda^a_k\rangle\!\langle\lambda^a_k\rvert$, we would have +$$A\lvert\psi\rangle=\sum_{a,k}\sqrt{\lambda^a_k}\lvert\lambda^a_k\rangle\!\langle\lambda^a_k\rvert\psi\rangle\otimes\lvert a\rangle.$$ +But is such an object a proper state? The normalisation reads +$$\|A\lvert\psi\rangle\|^2=\sum_a \|\sqrt{\lambda^a_k}\lvert\lambda^a_k\rangle\!\langle\lambda^a_k\rvert\psi\rangle\|^2=\sum_{a,k} \lambda^a_k \lvert\langle\lambda^a_k\rvert\psi\rangle\rvert^2,$$ +and it does not seem so obvious whether this always sums to one (and intuitively I would say it doesn't, due to its dependence on $\lvert\psi\rangle$).

+ +

Is it wrong to think of $A\lvert\psi\rangle$ as a proper state? Or if not, how can we see that it is always normalised?

+",55,,55,,8/22/2020 7:56,3/11/2021 15:38,Does the dilation in Naimark's theorem produce a state?,,2,0,,,,CC BY-SA 4.0 +6177,1,,,5/17/2019 19:10,,3,1836,"

The definition of spectral decomposition is as follows:

+ +

Assume the eigenvectors of $\hat{A}$ define a basis $\beta=\{|\psi_j\rangle\}$. Then $$A_{kj}=\langle\psi_k|\hat{A}|\psi_j\rangle=\alpha_j\delta_{jk},$$ +and $$\hat{A}=\sum_{kj}A_{kj}|\psi_k\rangle\langle\psi_j|=\sum_{j}\alpha_{j}|\psi_j\rangle\langle\psi_j|.$$ +But when I try to do this for the bit flip gate $X$, it doesn't seem to work. The eigenvectors are $|0\rangle+|1\rangle$ and $|0\rangle-|1\rangle$. Then if we take

+ +

\begin{align} +X&=(\langle0|+\langle1|)X(|0\rangle+|1\rangle)\,\,\times\big[(|0\rangle+|1\rangle)(\langle0|+\langle1|)\big] \\ +&+(\langle0|-\langle1|)X(|0\rangle-|1\rangle)\,\,\times\big[(|0\rangle-|1\rangle)(\langle0|-\langle1|)\big]. +\end{align}

+ +

I don't get anything close to the $X$ matrix I was looking for. Could anyone please explain this to me?

+",6254,,55,,5/29/2019 8:51,5/29/2019 8:51,What is the spectral decomposition of the Pauli $X$ gate?,,3,0,,,,CC BY-SA 4.0 +6178,2,,6177,5/17/2019 19:58,,2,,"

TL;DR: You forgot to normalize the eigenvectors!

+ +

Your description of the spectral theorem is incomplete; it requires you to use an orthonormal basis i.e. the basis $\beta=\{|\psi_j\rangle\}$ must be orthonormal, as I previously discussed here. When normalized, the eigenvectors of the $X$ gate form the basis $\left\{{\frac{|0\rangle+|1\rangle}{\sqrt{2}}},{\frac{|0\rangle-|1\rangle}{\sqrt{2}}}\right\}$. Now let's evaluate the terms $\color{red}{\left(\frac{\langle 0|+\langle 1|}{\sqrt{2}}\right)X\left(\frac{|0\rangle+|1\rangle}{\sqrt{2}}\right)}$ and $\color{blue}{\left(\frac{\langle 0|-\langle 1|}{\sqrt{2}}\right)X\left(\frac{|0\rangle-|1\rangle}{\sqrt{2}}\right)}$. These are actually the eigenvalues of $X$ corresponding to the two eigenvectors, because if $|\psi\rangle$ is a normalized eigenvector (i.e. $\langle \psi|\psi\rangle = 1$ ) of $X$, and $\lambda$ is the corresponding eigenvalue, then $$X|\psi\rangle = \lambda |\psi\rangle \implies \langle \psi|X|\psi\rangle = \langle \psi|\lambda|\psi\rangle= \lambda\langle \psi|\psi\rangle =\lambda.1=\lambda.$$

+ +

Now you know that $X$ is the ""bit-flip"" gate, so it performs $|0\rangle \mapsto |1\rangle$ and $|1\rangle\mapsto|0\rangle$.

+ +

$$\therefore \color{red}{\left(\frac{\langle 0|+\langle 1|}{\sqrt{2}}\right)X\left(\frac{|0\rangle+|1\rangle}{\sqrt{2}}\right)} = \left(\frac{\langle 0|+\langle 1|}{\sqrt{2}}\right)\left(\frac{|1\rangle+|0\rangle}{\sqrt{2}}\right)$$ +$$=\frac{1}{2}(\langle 0|1\rangle + \langle0|0\rangle+\langle 1|1\rangle + \langle 1|0\rangle)$$ +$$=\frac{1}{2}(0+1+1+0)=\color{red}{1} \ (\because \text{$|0\rangle$ and $|1\rangle$ are orthonormal})$$

+ +

$$\therefore \color{blue}{\left(\frac{\langle 0|-\langle 1|}{\sqrt{2}}\right)X\left(\frac{|0\rangle-|1\rangle}{\sqrt{2}}\right)} = \left(\frac{\langle 0|-\langle 1|}{\sqrt{2}}\right)\left(\frac{|1\rangle-|0\rangle}{\sqrt{2}}\right)$$ +$$=\frac{1}{2}(\langle 0|1\rangle - \langle0|0\rangle-\langle 1|1\rangle + \langle 1|0\rangle)$$ +$$=\frac{1}{2}(0-1-1+0)=\color{blue}{-1} \ (\because \text{$|0\rangle$ and $|1\rangle$ are orthonormal})$$

+ +

So now according the spectral decomposition theorem you can represent the $X$ gate as:

+ +

$$\boxed{\color{blue}{-1}\left(\frac{|0\rangle-|1\rangle}{\sqrt{2}}\right)\left(\frac{\langle 0|-\langle1|}{\sqrt{2}}\right) + \color{red}{1}\left(\frac{|0\rangle+|1\rangle}{\sqrt{2}}\right)\left(\frac{\langle 0|+\langle1|}{\sqrt{2}}\right)}\tag{*}\label{*}$$ +$$\require{cancel}=-\frac{1}{2}\left(\cancel{|0\rangle\langle0|}-|0\rangle\langle1|-|1\rangle\langle0|+\cancel{|1\rangle\langle1|}\right)+\frac{1}{2}\left(\cancel{|0\rangle\langle0|}+|0\rangle\langle1|+|1\rangle\langle0|+\cancel{|1\rangle\langle1|}\right)$$ +$$=\color{green}{|1\rangle \langle0| + |0\rangle \langle1|}$$

+ +

To convince you that this result is correct let's apply it on an arbitrary qubit state $|\Psi\rangle=\alpha|0\rangle+\beta|1\rangle$:

+ +

$$\color{green}{(|1\rangle \langle0| + |0\rangle \langle1|)}(\alpha|0\rangle+\beta|1\rangle)$$ +$$=\alpha|1\rangle\langle0|0\rangle+\beta|0\rangle\langle 1|1\rangle$$ +$$=\alpha|1\rangle + \beta|0\rangle$$

+ +

So yes, the bits $|0\rangle$ and $|1\rangle$ of $|\Psi\rangle$ are flipped and our representation $\eqref{*}$ of the $X$ gate is indeed correct!

+",26,,26,,5/17/2019 22:56,5/17/2019 22:56,,,,0,,,,CC BY-SA 4.0 +6179,2,,6177,5/17/2019 19:59,,4,,"

Continue simplifying from what you've given

+ +

\begin{eqnarray*} +X&=&(\langle0|+\langle1|)X(|0\rangle+|1\rangle)(|0\rangle+|1\rangle)(\langle0|+\langle1|)\\ +&+&(\langle0|-\langle1|)X(|0\rangle-|1\rangle)(|0\rangle-|1\rangle)(\langle0|-\langle1|)\\ +(\langle0|+\langle1|)X(|0\rangle+|1\rangle) &=& 0 + 1 + 1 + 0 = 2\\ +(|0\rangle+|1\rangle)(\langle0|+\langle1|) &=& | 0 \rangle \langle 0 | + | 1 \rangle \langle 0 | + | 0 \rangle \langle 1 | + | 1 \rangle \langle 1 |\\ +(\langle0|-\langle1|)X(|0\rangle-|1\rangle) &=& 0 - 1 - 1 + 0 = -2\\ +(|0\rangle-|1\rangle)(\langle0|-\langle1|) &=& | 0 \rangle \langle 0 | - | 1 \rangle \langle 0 | - | 0 \rangle \langle 1 | + | 1 \rangle \langle 1 |\\ +X &=& 2 (| 0 \rangle \langle 0 | + | 1 \rangle \langle 0 | + | 0 \rangle \langle 1 | + | 1 \rangle \langle 1 |) \\&+& (-2) ( | 0 \rangle \langle 0 | - | 1 \rangle \langle 0 | - | 0 \rangle \langle 1 | + | 1 \rangle \langle 1 |)\\ +X &=& 4 | 1 \rangle \langle 0 | + 4 | 0 \rangle \langle 1 | +\end{eqnarray*}

+ +

But there should be no factor of 4 there. So what was wrong? You didn't normalize your eigenvectors. That means you should divide all your vectors by $\sqrt{2}$.

+ +

In each of the 2 summands in your expression at the very top, there are 4 vectors. So each summand should be divided by $(\sqrt{2})^4=4$. Follow that through and the simplification works and you get $X=X$ rather than $X=4X$

+",434,,26,,5/17/2019 20:58,5/17/2019 20:58,,,,0,,,,CC BY-SA 4.0 +6180,2,,6177,5/17/2019 19:59,,6,,"

The eigenvectors are $|\psi_1 \rangle = \frac{1}{\sqrt 2} (|0\rangle + |1\rangle)$ and $|\psi_2 \rangle = \frac{1}{\sqrt 2} (|0\rangle - |1\rangle)$ (remember to keep them normalized), with eigenvalues $a_1 = 1$ and $a_2 = -1$, respectively.

+ +

Now the spectral decomposition in terms of the outer product representation is:

+ +

$$X = a_1 |\psi_1 \rangle \langle \psi_1| + a_2 |\psi_2 \rangle \langle \psi_2| = $$

+ +

$$ = \frac{1}{2} (|0\rangle + |1\rangle)(\langle 0| + \langle 1|) - \frac{1}{2} (|0\rangle - |1\rangle)(\langle 0| - \langle 1|) = $$

+ +

$$ = \frac{1}{2} (\color{red}{|0\rangle\langle0|} + |0\rangle\langle1| + |1\rangle\langle0| + \color{red}{|1\rangle\langle1|}) - \frac{1}{2} (\color{red}{|0\rangle\langle0|} - |0\rangle\langle1| - |1\rangle\langle0| + \color{red}{|1\rangle\langle1|})$$

+ +

The red parts cancel out, so you're left with $X = |0\rangle\langle1| + |1\rangle\langle0|$.

+",2879,,,,,5/17/2019 19:59,,,,0,,,,CC BY-SA 4.0 +6181,2,,6176,5/17/2019 20:30,,3,,"

First of all, $\|A|\psi\rangle\|^2 = (A|\psi\rangle)^\dagger(A|\psi\rangle) = \langle \psi | A^\dagger A|\psi\rangle = 1$.
+To see why your last expression equals to $1$ note that +$$ +\langle\psi\rvert \mu(a)\rvert\psi\rangle = \sum_{k} \lambda^a_k \lvert\langle\lambda^a_k\rvert\psi\rangle\rvert^2 ~~\text{and}~~ \sum_a \mu(a) = \mathbb 1 +$$

+ +

So, it's perfectly legal state from mathematical point of view. Just like in the case of purification.

+",5870,,5870,,5/17/2019 20:41,5/17/2019 20:41,,,,0,,,,CC BY-SA 4.0 +6183,1,6184,,5/18/2019 0:55,,2,198,"

A QuTiP novice here. It's easy to prepare a pure state in QuTiP. For example, to prepare $\frac{1}{\sqrt{2}}(|0,0\rangle + |1,1\rangle)$:

+ +
psi = (ket('00') + ket('11')).unit()
+psi = (tensor(basis(2,0), basis(2,0)) + tensor(basis(2,1), basis(2,1))).unit()
+
+ +

But what code would you use to prepare a statistical mixture of $ |0,0\rangle $ and $ |1,1\rangle $?

+",7520,,55,,5/19/2019 12:16,5/19/2019 12:16,"How to prepare a statistical mixture of $|0,0\rangle $ and $ |1,1\rangle $ in QuTiP?",,1,0,,,,CC BY-SA 4.0 +6184,2,,6183,5/18/2019 4:05,,2,,"

Mixed states are represented by density matrices cf. Density matrices for pure states and mixed states. This is the QuTiP documentation for density matrices; check the 4th example. The ket2dm function takes input a ket or bra vector and returns density matrix formed by the outer product. So say for a 50-50 mixture the following code should work:

+ +
from qutip import *
+0.5*ket2dm(tensor(basis(2,0), basis(2,0))) + 0.5*ket2dm(tensor(basis(2,1), basis(2,1)))
+
+ +

This returns the required density matrix representing a 50-50 statistical mixture of $|0,0\rangle$ and $|1,1\rangle$.

+ +
Quantum object: dims = [[2, 2], [2, 2]], shape = (4, 4), type = oper, isherm = True
+Qobj data =
+[[0.5 0.  0.  0. ]
+ [0.  0.  0.  0. ]
+ [0.  0.  0.  0. ]
+ [0.  0.  0.  0.5]]
+
+",26,,26,,5/18/2019 4:19,5/18/2019 4:19,,,,0,,,,CC BY-SA 4.0 +6186,1,6190,,5/18/2019 13:36,,4,681,"

To my understanding, most of the qubits we use today are just Josephson junctions coupled to a resonator that is triggering the qubits to go to different states by using microwave pulses. The same resonators are also used to read the information form qubits. As shown in this picture: +So I was wondering how does a qubit readout, when we measure it, gets read and how it is interpreted. How does raw information from qubit look like?

+",7375,,26,,5/18/2019 16:40,5/18/2019 22:39,How is a physical qubit measured and how is the result interpreted?,,1,3,,,,CC BY-SA 4.0 +6187,1,6212,,5/18/2019 17:19,,1,421,"

+ +

I have made the above quantum circuit that gives the mod $8=2^3$ +operation between $|x\rangle$ and $|y\rangle$. Now I want to write its corresponding program using some language. Where can I do that i.e. online or on my hardware? And what programming language can I use for this purpose? Also please check my circuit for correctness.

+",6070,,119,,5/21/2019 16:00,5/21/2019 23:08,How do I translate a quantum circuit for computing x + y mod 8 into a program?,,1,6,,,,CC BY-SA 4.0 +6188,1,6191,,5/18/2019 18:22,,4,145,"

Suppose I have integers and encode them as binary strings for example: $$|0\rangle=|00\rangle,|1\rangle= |01\rangle,|2\rangle=|10\rangle,|3\rangle=|11\rangle.$$

+ +

Now an $n$ bit integer, say $x$, is encoded as a state $|x_0x_1....x_{n-1}\rangle$ with $x_0$ being the most significant bit. To check the remainder by $4$ we only care about the two least significant bit i.e. $x_{n-2}x_{n-1}$. If the remainder is $0$ or $2$ then the least significant bit is $0$, and hence for a controlled operation that executes whether the remainder is $2$ or $0$ can be triggered only by the least significant bit being $0$. But my question is if I want to execute a controlled operation conditioned on the remainder being $3$ or $1$ what should be done? Since $|3\rangle=|11\rangle$ and $|0\rangle=|00\rangle $, should this be the circuit for the control?

+ +

+",6070,,26,,5/18/2019 23:29,5/18/2019 23:29,Circuit construction for execution of conditional statements using least significant bit,,1,0,,,,CC BY-SA 4.0 +6190,2,,6186,5/18/2019 22:28,,5,,"

What follows turned out to be a rather technical explanation, so I'll start with the main point: The qubit state can change the resonator's state, and the resonator's state can be easily measured only if there is a large different in frequencies between the qubit and the resonator.

+ +

Let's model a qubit as a two-level system and a resonator as a harmonic oscillator. We need to give both a characteristic frequency, so let's call the qubit frequency $\omega_q$ and the resonator frequency $\omega_r$. We also need to characterize the strength of the interaction (how fast energy is transferred from one thing to another), and that's usually called $g$.

+ +

Now we need to describe the dynamics of the qubit and resonator together. That's done by breaking the Hamiltonian down into three parts: qubit energy, resonator energy, and interaction strength.

+ +

$$H_{\text{qubit}} = \frac{1}{2} \hbar \omega_q \sigma_z $$

+ +

$$H_{\text{resonator}} = \hbar \omega_r \ a^\dagger a $$

+ +

$$H_I = \hbar g ( \sigma_+a + a^\dagger \sigma_-)$$

+ +

$$ H = H_{\text{qubit}} + H_{\text{resonator}} + H_I $$

+ +

This is the Jaynes-Cummings Hamiltonian. Note that the rotating wave approximation was used. Pauli operators are given by $\sigma$, and creation and annihilation operators are $a^\dagger$ and $a$.

+ +

Now, if the frequencies of the resonator and the qubit are the same (that's called the ""resonance condition""), then they will exchange energy back and forth, much like an LC circuit or potential and kinetic energy in a pendulum. That's not ideal for measuring a qubit (you want to avoid as much as possible the measurement apparatus influencing the qubit state), so we make the frequency of the resonator very far away from the qubit's. This is a called a dispersive interaction.

+ +

Formally, if $\omega_r - \omega_q = \Delta$, the Hamiltonian (now in the interaction picture) can be expressed as

+ +

$$ H = \hbar \frac{g^2}{\Delta} ( |1\rangle \langle 1| + a^\dagger a \sigma_z ) $$

+ +

If the interaction between the qubit and the resonator is dispersive, and if the resonator is driven to a coherent state $|\alpha\rangle$, then the qubit states of $|0\rangle$ and $|1\rangle$ can be distinguished.

+ +

Examine the evolution of two initial states, $|0\rangle|\alpha\rangle$ and $|1\rangle|\alpha\rangle$:

+ +

$$ e^{-iHt/\hbar}|0\rangle|\alpha\rangle = |0\rangle|\alpha e^{-i\frac{g^2}{\Delta}t } \rangle $$

+ +

$$ e^{-iHt/\hbar}|1\rangle|\alpha\rangle = |1\rangle|\alpha e^{i\frac{g^2}{\Delta}t } \rangle $$

+ +

This is the point of the dispersive interaction: the coherent state of the resonator changes according to the state of the qubit, without having energy exchanged directly. You can see that the coherent state gets shifted counterclockwise for a 0 and clockwise for a 1. Furthermore, it's a simple matter to measure the state of a coherent resonator, since it can be described classically.

+ +

This is only an outline of the complete answer. I've assumed knowledge of basic quantum mechanics, changing reference frames (interaction picture, Schrodinger picture, etc), coherent states, and the rotating wave approximation. I also glossed over the derivation of the dispersive Hamiltonian, which you can find in ""Introductory Quantum Optics"" by Gerry and Knight.

+",1867,,26,,5/18/2019 22:39,5/18/2019 22:39,,,,1,,,,CC BY-SA 4.0 +6191,2,,6188,5/18/2019 23:11,,5,,"

I would use a circuit that looks like:

+ +

+ +

Where $|0\rangle$ is an ancillary output bit. Assume the initial state of the system is in the standard basis.

+ +

Here, the first $\land_2(X)$ (CCNOT) applies the $X$ gate to the target qubit for all states that have their two least significant bits set to 1. Note that if none of the states have $|x_{n-1}\rangle=|1\rangle$ and $|x_{n-2}\rangle=|1\rangle$ then the $X$ gate is never applied to the ancilla.

+ +

We then negate both of the control bits, so that if they were previously 1 they are then set to 0, and vice versa. This results in the next $\land_2(X)$ gate only being applied if originally, $|x_{n-1}\rangle=|0\rangle$ and $|x_{n-2}\rangle=|0\rangle$. The final two $X$ gates uncompute the original negation, so that the original states of the two least significant bits are preserved.

+ +

Therefore, the only states that will have the ancillary bit set to $|1\rangle$, are those for which the two least significant bits were either $|00\rangle$ or $|11\rangle$. Satisfying the requirements of your question.

+ +

Please let me know if I can clarify further.

+",5157,,5157,,5/18/2019 23:21,5/18/2019 23:21,,,,0,,,,CC BY-SA 4.0 +6192,1,6194,,5/19/2019 10:53,,4,358,"

Context:

+ +

In quantum complexity theory and quantum information, there are several papers which study the implications of closed timelike curves (CTCs). In 2008, Aaronson and Watrous published their legendary paper on this topic which shows that certain forms of time travel can make classical and quantum computing equivalent i.e. quantum computers provide no computational advantage if they can send information to the past through closed-timelike curves. In the paper's abstract they specifically mention:

+ +
+

While closed timelike curves (CTCs) are not known to exist, studying their consequences has led to nontrivial insights in general relativity, quantum information, and other areas.

+
+ +

Now, this sounds pretty interesting, although I haven't really read any of the papers related to CTCs.

+ +

Questions:

+ +
    +
  1. In brief, what really are closed timelike curves?
  2. +
  3. Would it be possible to give a general idea about why this ""time travel"" of information can make quantum computing equivalent to classical computing, without diving too much into the details?
  4. +
  5. What other non-trivial insights have the study of CTCs provided us in the context of quantum information?
  6. +
+ +

I do intend to work through some of the papers on CTCs myself and perhaps also write an answer to this question at some point. But the aim of this thread is to gather some ideas about the ""big picture"" regarding why quantum information theorists and complexity theorists are interested in CTCs.

+ +
+ +

†: The abstract says that ""given any quantum circuit (not necessarily unitary), a fixed-point of the circuit can be (implicitly) computed in polynomial space"". I'm not sure how this relates to sending information via CTCs, causing quantum computing to be no more efficient than classical computing.

+",26,,55,,7/5/2021 8:24,7/5/2021 8:24,CTCs and information time travel — what non-trivial insights do they lead to?,,1,0,,,,CC BY-SA 4.0 +6194,2,,6192,5/19/2019 13:26,,4,,"

I just recently have been watching a series great YouTube lectures by Ryan O'Donnell at Carnegie Mellon. The last one in particular has some answers to the above question - especially the last 10 minutes or so.

+ +

I will summarize my limited understanding. Misunderstandings are my own...

+ +
    +
  • A ""closed timelike curve"" (CTC) may be something akin to a wormhole in spacetime. Ends of the wormhole may connect disparate regions of space.
  • +
  • We can put a circuit in the CTC - with inputs on one end, and outputs on another end.
  • +
  • Suppose our circuit is a $\mathsf{NOT}$ gate.
  • +
  • If we put a classical $0$ into one mouth of the wormhole, then we get out a $1$ on the other end. But because the wormhole is closed, this can create a contradiction - as if we went back in time to kill our grandfather
  • +
  • But David Deutsch says we shouldn't put in a classical bit into the mouths of the wormhole! And further the operation performed in the wormhole shouldn't just be a classical $\mathsf{NOT}$ operation, but can be any quantum gate.
  • +
  • Indeed we can put in a qubit in a uniform superposition of $\vert 0\rangle+\vert 1\rangle$.
  • +
  • If we through such a qubit into the mouth of a CTC we won't get a contradiction - the negation of $\frac{1}{\sqrt{2}}\vert 0\rangle+ \frac{1}{\sqrt{2}}\vert 1\rangle$ is also $\frac{1}{\sqrt{2}}\vert 0\rangle+ \frac{1}{\sqrt{2}}\vert 1\rangle$
  • +
  • Thus $\frac{1}{\sqrt{2}}\vert 0\rangle+ \frac{1}{\sqrt{2}}\vert 1\rangle$ is a fixed point of the $\mathsf{NOT}$ gate.
  • +
  • Deutsch showed that any circuit has such a fixed point, that avoids such a violation/grandfather paradox
  • +
  • However, even though it's likely computationally difficult to determine what the fixed point of a circuit is, Deutsch and Aaronson and Watrous take it as a given that consistency of causality requires a CTC to automagically give the fixed point.
  • +
  • For example, if we have a CTC, and we feed it a $\mathrm{SAT}$ problem framed in the correct way, then the fixed points would correspond to only those solutions to the $\mathrm{SAT}$ problem.
  • +
  • O'Donnell describes how followups of Aaronson and Watrous leads to positive results with reference to sampling problems/quantum supremacy
  • +
  • That is, O'Donnell outlines a proof that if approximate sampling on a quantum computer were equivalent to approximate sampling on classical computer, then the polynomial time hierarchy collapses
  • +
  • The proof relies on the work of Aaronson and Watrous in ways that I'm not entirely sure of.
  • +
  • The net is that if quantum supremacy is achieved via approximate sampling, then under some reasonable hypothesis we can say that the ""proof"" as it were is related to non-trivial insights about the power of closed timelike curves.
  • +
+",2927,,2927,,5/20/2019 15:39,5/20/2019 15:39,,,,1,,,,CC BY-SA 4.0 +6195,1,6196,,5/19/2019 20:57,,4,290,"

I've been working through the great introduction to quantum computing on Quantum Country. One exercise there is to find a possible quantum gate matrix that is not the $X,I$ or $H$ matrix.

+ +

I thought of $B = \frac{1}{\sqrt2}\begin{bmatrix}i & 1\\1 & i\end{bmatrix}$. However, I cannot find any article / paper mentioning this quantum gate.

+ +

From what I understood, all quantum gates must be $2\times2$, unitary matrices. I have even checked whether $B$ is indeed unitary, and yes, it is.

+ +

Why does this gate $B$ not have any useful applications? Or is it just not a valid gate?

+",7539,,2927,,5/20/2019 5:29,5/20/2019 14:33,"What applications does the quantum gate [(i,1),(1,i)] have?",,1,4,,,,CC BY-SA 4.0 +6196,2,,6195,5/20/2019 6:38,,5,,"

That's not the right way to look at it. In quantum mechanics, time evolutions are considered to be unitary and any unitary evolution can be written as a sequence of unitary operators $U_1, U_2, U_3,\ldots$ acting on a quantum state $|\Psi\rangle$. Any single-qubit unitary operation is a $2\times 2$ matrix of the form:

+ +

$$U=\begin{pmatrix}a&b\\-e^{i\phi}b^*&e^{i\phi} a^*\end{pmatrix}, |a|^2+|b|^2=1.$$

+ +

In your case, $a=\frac{i}{\sqrt{2}}$, $b=\frac{1}{\sqrt{2}}$ and $\phi=\pi$. Now, $B$ isn't one of the ""popular"" quantum gates like the Pauli or the Hadamard, but that doesn't mean it can't be a valid evolution operator! The Hadamard and the Pauli are generally chosen because they have some neat properties; for instance, the Pauli matrices form a basis for all $2\times 2$ Hermitian matrices. For more, read the Wikipedia pages on Hadamard matrix and Pauli matrices. Moreover, note that some gates can be easier to engineer than others; I had written an answer about this before. Also see: Why do we use the standard gate set that we do?.

+ +

So for drawing quantum circuits we generally try to choose a universal gate set that's also relatively easy to physically implement. Now any unitary evolution can be replicated with an $\epsilon>0$ precision, with a sufficient number of elementary quantum gates which form a universal set. Niel de Beaudrap also wrote a nice answer on this topic. Perhaps, as an exercise, you can try to write the $B$ gate in terms of the elementary quantum gates listed here?

+ +

If you notice carefully, $\sqrt{\operatorname{NOT}}=\frac{1-i}{\sqrt{2}}B$. That is, $B$ differs from the $\sqrt{\operatorname{NOT}}$ (or $\sqrt{X}$) by a simple phase factor! Thus, $\sqrt{\operatorname{NOT}}$ and $B$ are essentially the same gate cf. Norbert Schuch's answer. For a physical implementation of $\sqrt{\operatorname{NOT}}$ check Jones, Hansen & Mosca (1998).

+ +

I suggest playing around with it a bit on Quirk. The Bloch sphere intuition should help:

+ +

                         

+ +

You see, both $\sqrt{X}$ and $B$ rotate a qubit state around $\hat{x}$ by $90^{\mathrm{o}}$, albeit with different phase factors.

+",26,,26,,5/20/2019 14:33,5/20/2019 14:33,,,,3,,,,CC BY-SA 4.0 +6198,1,,,5/20/2019 8:34,,8,1486,"

What feature of a quantum algorithm makes it better than its classical counterpart? Are quantum computers faster than classical ones in all respects?

+",5806,,55,,9/23/2020 9:34,9/10/2021 10:41,What exactly makes quantum computers faster than classical computers?,,3,4,,,,CC BY-SA 4.0 +6199,1,6200,,5/20/2019 9:32,,3,1613,"

I would like to implement a variational algorithm (similar to VQE but with another cost function, no expectation of a Hamiltonian involved) from zero. Is there any tutorial explaining how to implement a VQE or similar variational algorithm in QISKit tutorial? This means creating the ansatz, implementing the cost function and running on the real quantum computer. I haven't seen it. Thank you!

+",7543,,26,,5/20/2019 10:15,5/21/2019 15:23,IBM QISKit: creating a variational algorithm from zero,,2,0,,,,CC BY-SA 4.0 +6200,2,,6199,5/20/2019 9:53,,3,,"

In this Qiskit Aqua tutorial, they show how to use the Variational Quantum Eigensolver (VQE) for solving a ground state energy problem. Here's another in the context of the travelling salesman problem. Note that both use the Aer simulators as backend and not the real IBMQ devices. You might also want to go through their documentation on VQE, Variational Forms, Optimizers and Initial States.

+ +

In +Quantum Algorithm Implementations for Beginners (Coles et al., 2018) there's a nice discussion about the theory of VQE and how it's used to simulate a transverse Ising model. However, due to the communication bottlenecks when the quantum device and classical computers are not physically co-located, it could not be run on real quantum processors like the ones on IBMQ Cloud.

+",26,,26,,5/20/2019 10:22,5/20/2019 10:22,,,,2,,,,CC BY-SA 4.0 +6201,1,,,5/20/2019 13:21,,14,6762,"

While writing this answer I realized it would be really helpful if I could show the OP a video or .gif of how qubit states in Bloch spheres transform under certain unitary operations. I googled up a bit and could find only these two simulators:

+ + + +

Both involve some messy software installations and I don't really want to do that. The second one apparently doesn't even allow the user to input arbitrary 2×2 operators!

+ +

P.S: It would be great if Craig Gidney could add a full-fledged Bloch sphere simulator within Quirk at some point (ideally, by making the already existing Bloch sphere views of the qubit states clickable and enlargeable). :)

+",26,,26,,5/20/2019 19:23,10/10/2022 22:23,Is there any online Bloch sphere simulator?,,5,0,,,,CC BY-SA 4.0 +6202,2,,6201,5/20/2019 16:00,,5,,"

I used this last time I needed to look up something about Bloch sphere. It's not perfect, since it doesn't allow entering the exact values of angles, let alone 2x2 matrices, but it has the benefit of being available online.

+ +

This one looks promising in that it allows to enter matrices (and is also online), but I haven't tried it.

+",2879,,26,,5/20/2019 17:08,5/20/2019 17:08,,,,3,,,,CC BY-SA 4.0 +6205,1,,,5/21/2019 9:45,,4,82,"

To make the partial transpose a complete positive and therefore physical map, one has to mix it with enough of the maximally mixed state to offset the negative eigenvalues.

+ +

The most negative eigenvalue is obtained when partial transpose is applied on the maximally entangled state which is $-\frac{1}{2}$.

+ +

Therefore, +$$\widetilde{I \otimes \Lambda} = (1-p)(I \otimes \Lambda) \rho + p\frac{I \otimes I}{4}$$ +where $p = \frac{2}{3}$ will sufficiently offset the values. However, in this paper by Horodecki and Ekert, they say $p$ needs to be greater than $\frac{8}{9}$, which I can't understand why.

+",2832,,55,,3/9/2021 22:06,3/9/2021 22:06,Structural Physical Approximation of Partial Transpose,,1,0,,,,CC BY-SA 4.0 +6206,2,,6199,5/21/2019 15:23,,2,,"

For a more high-level interface to coding and running variational quantum algorithms, you can also check out the PennyLane Python library, which has a Qiskit plugin available for using Qiskit simulators and IBM hardware as a backend.

+ +

For example, a variational quantum algorithm in PennyLane using qiskit looks like this:

+ + + +
import pennylane as qml
+
+dev = qml.device('qiskit.basicaer', wires=2)
+# use 'qiskit.ibm' instead to run on hardware
+
+@qml.qnode(dev)
+def circuit(x, y, z):
+    qml.RX(x, wires=0)
+    qml.RY(y, wires=1)
+    qml.RZ(z, wires=0)
+    qml.CNOT(wires=[0, 1])
+    return qml.expval.PauliZ(0)
+
+def cost(x, y, z):
+    return (1-circuit(x, y, z))**2
+
+# optimization follows
+
+ +

You can use NumPy, TensorFlow, or PyTorch to do the optimization - check out some of the tutorials.

+ +

Disclaimer: I am one of the developers on PennyLane.

+",371,,,,,5/21/2019 15:23,,,,1,,,,CC BY-SA 4.0 +6207,2,,6205,5/21/2019 16:17,,4,,"

In the paper that you refer to, they are essentially asking ""when can we implement the partial transpose map $\Theta=I_2\otimes\Lambda$?"". So, that means the SPA of this map must be positive. What you have calculated, by comparison, is to ask when the SPA of the transpose map $\Lambda$ can be made positive. It might sound like these ought to be the same answer, but adding identity to the transpose map and then extending the Hilbert space is different from extending the Hilbert space and adding identity.

+ +

So, you need to be finding the value $p$ such that +$$ +(1-p)(I_4\otimes \Theta)\rho+p\frac{I_4\otimes I_4}{16} +$$ +is positive. As you did, you need to consider the maximally entangled state, but of course it's of larger dimension now. You'll find there's an eigenvalue $(9p-8)/16$.

+",1837,,1837,,5/22/2019 7:33,5/22/2019 7:33,,,,3,,,,CC BY-SA 4.0 +6208,1,,,5/21/2019 16:43,,4,588,"

This question is about Lemma $7.1.2$ in Kaye, Laflamme, and Mosca's textbook:

+ +
+

Let $\omega = \frac{x}{2^n} = 0.x_1x_2\ldots x_n$ be some fixed number. The phase estimation algorithm applied to the input state $|\psi\rangle = \frac{1}{\sqrt{2^n}}\sum_{y=0}^{2^n-1}e^{2\pi i \omega y}|y\rangle$ outputs the integer $x$ with probability $$p(x) = \frac{1}{2^{2n}}\frac{\sin^2(\pi(2^n\omega-x))}{\sin^2(\pi(\omega-x/2^n))}$$

+
+ +

Is there a mistake here? I thought that the phase estimation algorithm outputs the integer $x$ with 100% certainty, since that's the whole point of the algorithm.

+ +

By definition, the quantum Fourier transform is the map:

+ +

$$\mathrm{QFT}_m^{-1} : \frac{1}{\sqrt{m}}\sum_{y=0}^{m-1}e^{2\pi i \frac{x}{m} y}|y\rangle \mapsto|x\rangle$$

+ +

Why is this not 100% successful?

+",6118,,26,,6/23/2019 13:44,3/17/2021 18:00,Phase estimation error analysis,,3,6,,,,CC BY-SA 4.0 +6209,1,6210,,5/21/2019 17:06,,3,173,"

While reading the Quantum algorithm Wikipedia entry, I noticed that the sentence ""A quantum circuit consists of simple quantum gates which act on at most a fixed number of qubits"", was annotated with a ""why?"".

+",362,,362,,5/21/2019 18:03,5/21/2019 18:03,Why does a quantum circuit consist of simple quantum gates which act on at most a fixed number of qubits?,,1,1,0,,,CC BY-SA 4.0 +6210,2,,6209,5/21/2019 18:01,,5,,"

Quantum circuits are a way to visualize a quantum operation/algorithm. As such, they are constrained by what you can reasonably express in a drawing. Simple algorithms on a small number of qubits are easy to express - for example, the ubiquitous teleportation circuit.

+ +

Algorithms on a variable number of qubits or algorithms that mix classical processing with quantum get harder to express, and the more complicated the algorithm is, the harder it gets.

+ + + +

This is similar to flow charts for classical algorithms - you can use them to visualize a small algorithm, maybe for educational purposes, or a high-level structure of a big algorithm, but you just can't express the internals of, say, a web-browser as a flow chart.

+",2879,,,,,5/21/2019 18:01,,,,4,,,,CC BY-SA 4.0 +6211,1,6217,,5/21/2019 18:05,,2,294,"

I have a state $$ |\tilde{\Phi_2}\rangle =\dfrac{1}{2^{3l/2}}\sum_{x=0}^{2^l-1}\sum_{y=0}^{2^l-1}\sum_{z=0}^{2^l-1}|0\rangle^{\otimes q}\otimes |x\rangle^{\otimes l}\otimes |y\rangle^{\otimes l}\otimes |z\rangle^{\otimes l} +$$ +Now I want to change the state $|z\rangle$ using the states $|x\rangle$ and $|y\rangle$. The controls originally $|x\rangle $ and $|y\rangle$ are originally in states $|x_0x_1...x_{l-1}\rangle$ and $|y_0x_1...y_{l-1}\rangle$, then if $$ |x_0\rangle=|y_0\rangle=|1\rangle$$ then the state $|z\rangle$ has to be changed. And the state $|z\rangle$ is changed to $|00....z_{l-3}\rangle$.

+ +

Since the $|0\rangle^{\otimes q}$ is unaltered we just operate an identity operator $I^{\otimes q}$.

+ +

The next thing I understand is that we have to break the summation into two parts where in the first part the summation indexes of $i,j$ go from $0$ to $\lfloor \dfrac{2^l-1}{2}\rfloor$.

+ +

But after that I am unable to write deduce further. +Can somebody help me in writing the Dirac notation for this operator?

+ +

Edit: The transformation on the $z$ register is the right shift by $2$ operator $|z,0\rangle \to |z, \frac{z}{4}\rangle$

+",6070,,26,,5/25/2019 17:00,5/25/2019 17:00,Circuit construction and Dirac notation of the following operation,,1,0,,,,CC BY-SA 4.0 +6212,2,,6187,5/21/2019 22:53,,2,,"

I'm not sure if you are trying to represent $x$ and $y$ in little-endian or big-endian format, but either way the circuit does not look correct.

+ +

Let's consider the case of $x = 2$ and $y = 2$: they are conveniently represented the same way in LE and BE formats, as $010$, so the encoding will only matter when reading out the answer.

+ +
    +
  • You start with $|010\ 010\ 0\rangle$ (writing the states of the qubits in top-to-bottom order).
  • +
  • After the first 3 gates you'll get $|010\ 010\ 1\rangle$ - indeed, OR of these wires is 1.
  • +
  • The next three gates are controlled on the first qubit, which is in state $|0\rangle$, so we can ignore them: still $|010\ 010\ 1\rangle$.
  • +
  • The second-to-last CNOT is executed: $|010\ 000\ 1\rangle$.
  • +
  • The last CNOT has no effect again, so the final answer is $000$ - no matter whether you read it as little-endian or big-endian, it yields an incorrect sum of 0.
  • +
+ +

I believe this circuit doesn't handle the second carry bit properly.

+ +
+ +

For reference, here is the Q# code I wrote to test this circuit and find a test case for which it fails (you mentioned in the chat that you tried Quantum Development Kit, so this might be helpful):

+ +
// Allocate x, y and auxiliary qubits
+using ((x, y, a) = (Qubit[3], Qubit[3], Qubit())) {
+    for (xint in 0..7) {
+        for (yint in 0..7) {
+            // x and y qubits start in |0⟩ state; set them to their starting values - in little-endian
+            ApplyPauliFromBitString(PauliX, true, IntAsBoolArray(xint, 3), x);
+            ApplyPauliFromBitString(PauliX, true, IntAsBoolArray(yint, 3), y);
+
+            // Calculate x + y mod 8 using the circuit
+            // (assume the wires top to bottom are x0, x1, x2, y0, y1, y2, a)
+            CCNOT(x[1], y[1], a);
+            CNOT(x[1], a);
+            CNOT(y[1], a);
+            Controlled X([x[0], y[0], a], y[2]);
+            CCNOT(x[0], y[0], y[1]);
+            CNOT(x[0], y[0]);
+            CNOT(x[1], y[1]);
+            CNOT(x[2], y[2]);
+
+            // Read out the result from y register (still as LE)
+            let sum = MeasureInteger(LittleEndian(y));
+            if (sum != (xint + yint) % 8) {
+                Message($""Incorrect sum for x = {xint}, y = {yint}: sum = {sum}"");
+            }
+
+            // Reset all qubits before next iteration
+            ResetAll(x);
+            ResetAll(y);
+            Reset(a);
+        }
+    }
+}
+
+ +

You can switch it to using big-endian by wrapping IntAsBoolArray and y register in measurement line in Reverse function to reverse the order of qubits.

+ +
+ +

As a side note, Q# has a library implementation of an adder, you can look it up here.

+",2879,,2879,,5/21/2019 23:08,5/21/2019 23:08,,,,2,,,,CC BY-SA 4.0 +6213,1,,,5/22/2019 1:11,,5,721,"

I am trying to transform this matrix into a combination of quantum gates but I cannot find any such functionality on Qiskit or anywhere else. I have tried to use Quirk but I do not understand it.

+ +

$$\begin{bmatrix}0 & 1 & 0 & 0\\1 & 0&0&0\\0 & 0&0&1\\0 & 0&1&0\end{bmatrix}$$

+",7558,,26,,5/25/2019 16:56,5/26/2019 14:54,Transform matrix into a combination of simple quantum gates,,2,2,,,,CC BY-SA 4.0 +6214,2,,6213,5/22/2019 2:08,,3,,"

This matrix is a tensor product of two simpler matrices, $I \otimes X$, which you represent by applying an $X$ gate to the second qubit and doing nothing with the first one.

+",2879,,,,,5/22/2019 2:08,,,,0,,,,CC BY-SA 4.0 +6215,2,,6213,5/22/2019 2:43,,5,,"

Math:

+ +

If you are familiar with tensor products, observe that $I \otimes X$ gives the desired matrix. Showing the steps of this computation,

+ +

$I \otimes X = \begin{pmatrix}1 &0\\0 & 1 \end{pmatrix} \otimes \begin{pmatrix}0 &1\\1 & 0 \end{pmatrix} = \begin{pmatrix}1\begin{pmatrix}0 &1\\1 & 0 \end{pmatrix} & 0 \begin{pmatrix}0 &1\\1 & 0 \end{pmatrix} \\0\begin{pmatrix}0 &1\\1 & 0 \end{pmatrix} & 1\begin{pmatrix}0 &1\\1 & 0 \end{pmatrix} \end{pmatrix} = \begin{pmatrix}0 & 1 & 0 & 0\\1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1\\0 & 0 & 1 & 0 \end{pmatrix}$

+ +

To obtain the corresponding circuit, note that this tensor represents two gates applied at the same circuit depth on two qubits. That is, you would have an identity gate applied to the top qubit (equivalently, not applying any gate), and you would have the $X$ gate applied on the bottom qubit.

+ +

Shown as a circuit diagram:

+ +

+ +

Qiskit:

+ +

Using the following import, you can decompose a two qubit gate to a sequence of single qubit gates, as long as the input gate does not create entanglement.

+ +
from qiskit.quantum_info.synthesis import TwoQubitBasisDecomposer
+
+ +

You can find the code for this file here: https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/quantum_info/synthesis/two_qubit_decompose.py (qiskit-terra/qiskit/quantum_info/synthesis/two_qubit_decompose.py).

+ +

However, as input to the gate decomposer, you need to create a 2-qubit gate corresponding to the matrix given. I am not sure how to do so, and will update my answer when I find out.

+ +

Further note that at the current time, n-qubit gate decomposition is not supported; you can only decompose 2-qubit gates.

+",5157,,5157,,5/26/2019 14:54,5/26/2019 14:54,,,,1,,,,CC BY-SA 4.0 +6217,2,,6211,5/22/2019 6:51,,6,,"

As you say, any register on which you do nothing, use the identity, $I$. This is also going to be the case on $x_1,x_2,\ldots$ and $y_1,y_2,\ldots$.

+ +

When you want to control something, use the projectors $P_0=|0\rangle\langle 0|$ and $P_1=|1\rangle\langle 1|$. So, controlled-$U$ looks like $P_0\otimes I+P_1\otimes U$. For controlled-controlled-$U$, you can make this notation a bit more concise: +$$ +I\otimes I\otimes I+P_1\otimes P_1\otimes(U-I). +$$ +This is essentially what you're going to be doing for your operation, where the two controls are $x_0$ and $y_0$.

+ +

So, the next question is what the $U$ looks like for transforming the register $z$. If I understand correctly, you basically want to introduce an additional register $|0\rangle^{\otimes(l-2)}$ and to perform the joint transformation +$$ +|z_0z_1z_2\ldots z_{l-1}\rangle|0\rangle^{\otimes(l-2)}\rightarrow|z_0z_1z_2\ldots z_{l-1}\rangle|z_0z_1z_2\ldots z_{l-3}\rangle +$$ +This is achieved in a straightforward manner. Let $C_i$ denote the controlled-not gate controlled off qubit $i$ of the first register, and targetting qubit $i$ on the second register (and identity on everything else). Then, +$$ +U=\prod_{i=0}^{l-3}C_i. +$$ +I remain unclear if that target register is supposed to be the one that starts $|0\rangle^{\otimes q}$, or not. I'm assuming not.

+ +

Overall, you would thus be left with +$$ +\prod_{i=0}^{l-3}I^{\otimes q}\otimes(I^{\otimes (4l-2)}+P_1\otimes I^{\otimes(l-1)}\otimes P_1\otimes I^{\otimes(l+i-1)}\otimes P_1\otimes I^{\otimes (l-1)}\otimes(X-I)\otimes I^{\otimes(l-3-i)}). +$$ +Note, the first two $P_1$s are the controls off $x_0$ and $y_0$. The third is the control off $z_i$, and the $(X-I)$ term should be acting on the target, $i$ of the extra register. +Now you can express each of these operators in Dirac notation if you really want to.

+",1837,,1837,,5/23/2019 7:57,5/23/2019 7:57,,,,5,,,,CC BY-SA 4.0 +6218,2,,6201,5/22/2019 14:09,,10,,"

This doesn't really answer the question as it's not an online simulator. It might still be relevant though as it is a way to produce this sort of gifs if one has access to the software.

+ +

It is relatively easy to do this sort of things using Wolfram Mathematica.

+ +

As a quick and dirty example, if we just define a couple of relevant helper functions:

+ +
pauliX = PauliMatrix[1];
+pauliY = PauliMatrix[2];
+pauliZ = PauliMatrix[3];
+ClearAll@decomposeInPauliBasis;
+decomposeInPauliBasis[matrix_?MatrixQ] := {
+    Tr[matrix.pauliX], Tr[matrix.pauliY], Tr[matrix.pauliZ]
+    }/2;
+decomposeInPauliBasis[vec_?VectorQ] := Re@{
+    Dot[Conjugate@vec, pauliX, vec], Dot[Conjugate@vec, pauliY, vec], 
+    Dot[Conjugate@vec, pauliZ, vec]
+    };
+ClearAll[simulateStateEvolution, smallestEigenvectors];
+smallestEigenvectors[matrix_, howmany_Integer] := With[
+   {nn = Norm@Flatten@matrix},
+   Eigenvalues[matrix - nn IdentityMatrix[Dimensions@matrix], 
+     howmany] + nn
+   ];
+simulateStateEvolution[H : (_Symbol | _Function | _CompiledFunction), 
+   time_: 1., initialState_: None] := Module[{t},
+   Module[{\[DiamondSuit]initialState, \[DiamondSuit]H},
+    If[initialState === None,
+     \[DiamondSuit]initialState = 
+      First@smallestEigenvectors[H[0], 1],
+     \[DiamondSuit]initialState = initialState
+     ];
+    (* protect from symbolic evaluation *)
+    \[DiamondSuit]H[
+      t_?NumericQ] := H[t];
+    NDSolveValue[{
+       \[Psi][0] == \[DiamondSuit]initialState,
+       \[Psi]'[t] == -I \[DiamondSuit]H[t].\[Psi][t]
+       }, \[Psi], {t, 0, time}
+      ][time]
+    ]
+   ];
+
+ +

we can then visualise the evolution in the Bloch sphere with

+ +
hamiltonian[t_] := pauliZ + 2 pauliX;
+initialState = {1, 0};
+With[{points = Table[
+    decomposeInPauliBasis@
+     simulateStateEvolution[hamiltonian, t, initialState],
+    {t, 0, 1, 0.01}
+    ]},
+ Graphics3D[{
+   {Orange, Opacity@0.2, Sphere[{0, 0, 0}, 1]},
+   {Red, PointSize@0.02, Point@points[[1]]},
+   {Blue, PointSize@0.02, Point@points[[-1]]},
+   Dashed, Thickness@0.005, Arrow@points
+   }, Axes -> True, AxesOrigin -> {0, 0, 0}, AxesStyle -> Black, 
+  Ticks -> None, Boxed -> False]
+ ]
+
+ +

which gives

+ +

+ +

We can also use a time-dependent Hamiltonian, for example:

+ +
hamiltonian[t_] := pauliZ + t pauliX;
+initialState = {1, 0};
+With[{points = Table[
+    decomposeInPauliBasis@
+     simulateStateEvolution[hamiltonian, t, initialState],
+    {t, 0, 4, 0.01}
+    ]},
+ Graphics3D[{
+   {Orange, Opacity@0.2, Sphere[{0, 0, 0}, 1]},
+   {Red, PointSize@0.02, Point@points[[1]]},
+   {Blue, PointSize@0.02, Point@points[[-1]]},
+   Dashed, Thickness@0.005, Arrow@points
+   }, Axes -> True, AxesOrigin -> {0, 0, 0}, AxesStyle -> Black, 
+  Ticks -> None, Boxed -> False]
+ ]
+
+ +

+ +

If you want something a bit more fancy, you can take the code I used in this answer to draw a better looking Bloch sphere, which would give something like the following:

+ +

+ +

Finally, if you want some animation, you can try something like the following (where I'm also adding the green line to denote the instantaneous eigenvector of the Hamiltonian):

+ +
hamiltonian[t_] := pauliZ + t pauliX;
+initialState = {1, 0};
+timesList = Range[0, 4, 0.01];
+With[{points = Table[
+    decomposeInPauliBasis@
+     simulateStateEvolution[hamiltonian, t, initialState],
+    {t, timesList}
+    ]},
+ Animate[
+  Graphics3D[{
+    {Orange, Opacity@0.2, Sphere[{0, 0, 0}, 1]},
+    {Red, PointSize@0.02, Point@points[[1]]},
+    {Purple, PointSize@0.02, Point@points[[idx]]},
+    {Darker@Green, Thickness@0.01, 
+     InfiniteLine@{-#, #} &@
+      decomposeInPauliBasis@
+       First@Eigenvectors@hamiltonian@timesList[[idx]]},
+    {Dashed, Thickness@0.005, Tube@points[[;; idx]]}
+    }, Axes -> True, AxesOrigin -> {0, 0, 0}, AxesStyle -> Black, 
+   Ticks -> None, Boxed -> False],
+  {idx, 1, Length@points, 1}
+  ]
+ ]
+
+ +

+ +

(quality and smoothness can definitely be improved here)

+",55,,55,,5/23/2019 14:08,5/23/2019 14:08,,,,0,,,,CC BY-SA 4.0 +6219,1,6223,,5/23/2019 0:13,,5,644,"

Proposed experiments in achieving quantum supremacy, such as with BosonSampling or using random circuits, have been described as using a (not necessarily Turing complete) quantum computer to perform some sampling problem.

+ +

An example would be to sample the distribution of, say, $72$ qubits after application of, say, $1000$ random $2$-qubit gates.

+ +

Starting from the all-zeroes ket $\vert 000\cdots\rangle$ on $n$ qubits, a quantum computer would randomly draw from the output distribution after the application of some reasonably-sized unitary $U\vert 000\cdots\rangle$ (of, say, $m=O(n^2)$ gates).

+ +

Classically it is very unlikely that one could draw from the same distribution. It may take time $O(\exp(m\times n))$ to draw from this distribution

+ +

Because such sampling problems are not likely to be in $\mathcal{NP}$, approaches to validation of quantum supremacy experiments are being researched.

+ +

The HOG problem - heavy output generation - has been proposed as a test to validate quantum supremacy. Apparently the HOG test can be performed in time $O(\exp(n))$, which is much better than $O(\exp(m))$, and may be feasible for supercomputers.

+ +

But what, exactly, is this test? After a random unitary acts on the all-zeroes ket, the coefficients should be pointing in all different ways asunder - like a Brownian walk. The vast majority of outputs should have a low probability of occurrence, and would never be sampled (even if there are a large number of bases having a low probability $p_\epsilon$ of occurrence, if $p_\epsilon$ is small enough then no .)

+ +
+

How does the HOG test work? Is my understanding close to correct?

+
+ +

EDIT

+ +

Some links on the characterization of sampling problems:

+ +

Aaronson - ""Aspects of Certified Randomness from Quantum Supremacy"" Powerpoint

+ +

Bouland, Fefferman, Nirkhe, Vazirani - ""Quantum Supremacy and the Complexity of Random Circuit Sampling"" - arxiv

+",2927,,2927,,6/27/2019 1:16,6/27/2019 1:16,What is the HOG test and how would it help proving quantum supremacy?,,1,0,,,,CC BY-SA 4.0 +6220,2,,6208,5/23/2019 14:42,,1,,"

First point: in most of the cases, the QPE algorithm cannot output the integer $x$. That is why $w$ is introduced in the algorithm: to represent the closest approximation of $x$ that can be returned by the QPE.

+ +

About your question, no the QPE is not always 100% successful (in this case successful means that the algorithm returns $w$, the closest approximation of $x$ possible on $n$ qubits).

+ +

The final state of the QPE before measurement is given by (according to Wikipedia):

+ +

$$ +\frac{1}{2^{n}} \sum_{x=0}^{2^n - 1} \sum_{k=0}^{2^n - 1} e^{-\frac{2\pi i k}{2^n} \left ( x-w \right )} e^{2 \pi i \delta k} |x\rangle \otimes |\psi\rangle. +$$ +where:

+ +
    +
  1. $n$, $w$, and $x$ are defined as in your question.
  2. +
  3. $\delta = \left\vert \frac{x}{2^n} - w \right\vert = \left\vert \frac{x}{2^n} - \text{round}\left(\frac{x}{2^n}\right) \right\vert$ is the error due to the finite representation of $w$.
  4. +
+ +

I will not rewrite all the calculations, but you can check on the intermediate results on the Wikipedia page.

+ +

The probability of getting the right result $w$ when measuring is then

+ +

$$ +\Pr(w) = \left | \left \langle w \underbrace{\left | \frac{1}{2^{n}} \sum_{x=0}^{2^n-1} \sum_{k=0}^{2^n-1} e^{\frac{-2\pi i k}{2^n}(x-w)} e^{2 \pi i \delta k} \right |}_{\text{State of the first register}} x \right \rangle \right |^2 = \frac{1}{2^{2n}} \left | \sum_{k=0}^{2^n-1} e^{2 \pi i \delta k} \right |^2 = \begin{cases}1 & \delta = 0\\ & \\ \frac{1}{2^{2n}} \left | \frac{1- {e^{2 \pi i 2^n \delta}}}{1-{e^{2 \pi i \delta}}} \right|^2 & \delta \neq 0 \end{cases} +$$

+ +

So:

+ +
    +
  • if the result $x$ can be represented exactly on $n$ qubits (i.e. $\delta$, the error, is $0$), the QPE succeed with a probability of $1$,
  • +
  • but if $n$ bits are not enough to represent exactly $x$, the QPE might fail.
  • +
+ +

I tried quickly to derive the expression of your book from the one found on Wikipedia, without success but when the error $\delta$ tends to $0$, both formulas have the same behaviour: the probability of error is $ \sim \mathcal{O}\left( \frac{1}{2^{2n} \delta^2} \right)$.

+ +

We can simplify further this big-$\mathcal{O}$ notation by noticing that, by construction, $\delta \leqslant \frac{1}{2^{n+1}}$. The final probability of error is then +$$ +\Pr(\text{measurement not returning } \vert w \rangle) \sim \mathcal{O}\left( \frac{1}{2^{4n+1}} \right) +$$

+ +

This means that, when you increase the number of qubits $n$ used to represent the solution by $1$, the probability of the QPE returning a bad result is divided by $16$[1].

+ +
+ +

[1]: There are constants ignored by the big-$\mathcal{O}$ notation that change this value of $16 = 2^4$ to something like $\frac{2^5}{\pi^2} = \frac{32}{\pi^2}$. The additional factor of $2$ in the previous constant is needed to bound the expression $\left\vert 1- {e^{2 \pi i 2^n \delta}} \right\vert$ found for $\Pr(w)$ above but is not needed for the expression given in your book.

+",1386,,,,,5/23/2019 14:42,,,,0,,,,CC BY-SA 4.0 +6221,2,,6157,5/23/2019 15:53,,34,,"

Computations in quantum information processing are implemented by means of unitary operations. Sometimes, we need to think not about a specific unitary operation required to execute a specific computation, but about the whole space of unitary transformations. (Examples will be given below). For a single $n$-dimensional qudit, (which can also be a tensor product of a number of qubits), this space is the unitary group $U(n)$.

+

$U(n)$ is a compact Lie group; all the matrix element magnitudes of its elements are less or equal to one, thus it can be mapped into a hypersurface occupying finite region in some Euclidean space, given by the orthonormality constraints of its raw vectors. In particular, this implies that its Euclidean volume is finite.

+

Spaces of finite volume can be naturally turned into probability spaces, basically by normalizing their volume to $1$. This is the starting point where they become useful in probabilistic analysis, in our case in quantum probability. Probability spaces are equipped with a measure assigning a number between $0$ and $1$ to subsets, which in the continuous cases, can be taken as the normalized volume of the subset.

+

For the group $U(n)$, the normalized Euclidean volume element mentioned above is such a measure. This measure is not invariant, in general, under the group action. The normalized volume of a subset changes if we rotate the subset by means of a group element $u$. However, if we define a new measure by averaging the volumes obtained by rotating the subset by all group elements, the resulting averaged measure will be invariant under the group action. This is the Haar measure.

+

The method described above for the construction of the Haar measure is not practical, since we need to average over an infinite number of elements. More practical methods will be described below. A non-rigorous but reasoned account of the Haar measure of the unitary group U(n), in view of quantum information theory applications, will be given. The sketchy reasoning presented here can be used as a starting point for a more rigorous treatment. The explanations will refer specifically to the unitary group. Their quite straightforward generalized to other classical compact groups, will not be treated.

+

Properties of the Haar measure

+

The (volume element of the) Haar measure will be denoted by $d\mu_H(u)$, $u\in U(n)$. The Haar measure has the following properties:

+
    +
  1. It has a finite volume
  2. +
+

$$\int_{U(n)} d\mu_H(u) < \infty$$ +2. It is (right and left) invariant under the group action: Given an integrable function $f(u)$, then +$$ \int_{U(n)} f(vu) d\mu_H(u) = \int_{U(n)} f(u) d\mu_H(u) , \quad v\in U(n) $$ +$$ \int_{U(n)} f(uv) d\mu_H(u) = \int_{U(n)} f(u) d\mu_H(u) , \quad v\in U(n) $$ +3. It is unique up to a multiplication by a scalar: Any another invariant measure $d\mu(u)$ satisfies: +$$ d\mu(u) = \mathrm{const.} d\mu_H(u) $$

+

For $U(n)$, these properties can be proved by the explicit constructions which will be described below; however, it is worthwhile to show an explicit method to modify any non-invariant measure into a Haar measure, for example the Euclidean measure mentioned above:

+

Since $U(n)$ is a manifold, it can be covered by coordinate patches in bijection with open subsets in $\mathbb{R}^n$: +$$U(n) \supset U\ni u \mapsto x(u) \in \mathbb{R}^n$$ +In order to change the Euclidean volume element $d^nx$ into a Haar measure, we need to evaluate the action of a general group element $u$ on an element $u_{\epsilon} = 1 + \epsilon$, $|\epsilon|<<1$ close to the identity; we get, +$$x(u u_{\epsilon } )= B(x(u)) + A(x(u))x(u_{\epsilon}) + O(|\epsilon|^2), B(u) \in \mathbb{R}^n , A(u )\in \text{Mat}(n)$$ +Then the measure: +$$ d\mu(u(x)) = |\det A(x)|^{-1} d^nx$$

+

Is a Haar measure. The proof is not a very difficult exercise, please see the following post in mathematics stackexchange for the details.

+

A similar construction is based on the fact that the Haar measure can be induced by a metric - The Cartan-Killing metric. If we take the other side of the bijection above:

+

$$\mathbb{R}^n \ni x \mapsto u(x) \in U \subset U(n) $$

+

The metric: +$$G_{ij}(x) = \mathrm{Tr}\left (\frac{\partial u(x) ^{-1}}{\partial x^i} \frac{\partial u(x) }{\partial x^j} \right)$$

+

Induces a Haar measure, through:

+

$$ d\mu_H(u(x)) = \sqrt{\det G(x)} d^nx$$

+

The existence of this metric allows to define a Dirac delta function by means of the solutions of the time independent Schrödinger equation on U(n). +$$\Delta \psi = E \psi$$ +Where $\Delta$ is the Laplacian on $U(n)$: +$$\Delta = \frac{1}{\sqrt{\det G(x)}} \sum_{i, j} \frac{\partial}{\partial x^i}\left( \sqrt{\det G(x)} G^{ij} \frac{\partial}{\partial x^j}\right)$$

+

($G^{ij}$ is the reciprocal matrix of $G_{ij}$)

+

Let $\{f_E(u)\}$, be an orthonormal set (with respect to the Haar measure) of solutions of the Schrödinger equation for all possible energies (I am skipping the issue of the existence of solutions), then due to the completeness property, the function: +$$\delta_H(u, v) = \sum_E \bar{f_E}(u) f_E(v)$$ +is an invariant Dirac delta function over the square integrable functions, satisfying the properties: +$$\delta_H(u, v) = \delta_H(kg, kh)$$ +$$ \int_{U(n)} \delta_H(u, v) d\mu_H(u) = 1$$ +and +$$ \int_{U(n)} f(u) \delta_H(u, v) d\mu_H(u) = f(v) $$

+

The delta function can be used to sketch the proof of the Haar measure uniqueness up to a factor. Suppose that there exists a second invariant measure $d\mu(u)$ on $U(n)$. +Denote by: +$$\langle f \rangle_{\mu} = \int_{U(n)} f(u) d\mu_H(u) $$ +and +$$\langle f \rangle = \int_{U(n)} f(u) d\mu(u) $$ +Then: +$$ \int_{U(n)} \int_{U(n)} f(u) \delta_H(u, v) d\mu_H(u) d\mu(v) = <f> $$ +Changing the integration order (Fubini's theorem): +$$ \int_{U(n)} f(u) \left (\int_{U(n)} \delta_H(u, v) d\mu(v) \right) d\mu_H(u) = <f> $$ +Using the invariance property of the delta function +$$ \int_{U(n)} f(u) \left (\int_{U(n)} \delta_H(e, u^{-1}v) d\mu(v) \right) d\mu_H(u) = <f> $$ +Using the invariance property of the measure:

+

$$ \int_{U(n)} f(u) \left (\int_{U(n)} \delta_H(e, v) d\mu(v) \right) d\mu_H(u) = <f> $$ +Thus +$$ (\int_{U(n)} \delta_H(e, v) d\mu(v) ) \int_{U(n)} f(u) d\mu_H(u) = <f> $$ +Therefore +$$ \mathrm{const.} <f>_{\mu} = <f> $$ +(To be precise, in the above, we assumed that $f$ is both $L^1$ and $L^2$)

+

Some explicit constructions

+

The explicit construction of the Haar measure in coordinates requires the parametrization of U(n), one possibility is by means of Euler angles, please see for example the following article by Tilma and Sudarshan.

+

The normalization of the Haar measure to a unit volume, requires the computation of its volume for the purpose of normalization, please see the review Zhang and Boya, Sudarshan and Tilma for computation techniques which do not require explicit parametrizations.

+

Just to give a taste of how these computations are performed, I'll describe how the volume of $U(n)$ can be computed a product of volumes of spheres: +The first row in the matrix representing a group element $u$ is a normalized $n$ dimensional complex vector, thus it spans a sphere $S^{2n-1}$ as $u$ spans the whole unitary group. The second row is also a normalized $n$ dimensional complex vector, but it must be orthogonal to the first one, thus it lives in an $n-1$ dimensional space, thus it spans a sphere $S^{2n-3}$, the third should be orthogonal tom the first two thus it spans a sphere $S^{2n-5}$, etc. Thus, the Haar volume of $U(n)$ is given by: +$$\text{Vol}(U(n)) = \text{Vol}(S^{2n-1}) \text{Vol}(S^{2n-3})…\text{Vol}(S^1) $$ +Using the volume formula of the n-sphere: +$$\text{Vol}(S^{2n-1}) = \frac{2 \pi^n}{\Gamma(n)},$$ +the $U(n)$ volume is obtained: +$$\text{Vol}(U(n)) = \frac{(2 \pi)^{n^2+n}}{\prod_{m=1}^{n-1} m!}$$

+

These constructions have already applications to quantum information theory: Tilma and Sudarshan apply their results to the computation of the volumes of unitary orbits of density matrices, while Zhang reviews the computation of the Hilbert-Schmidt volume of the space of density matrices. +It should be mentioned that the integration of class functions i.e. functions which are invariant under the conjugation map: +$$f(u) = f(v^{-1}uv),$$ +over the unitary group $U(n)$ can be simplified to an integration over its maximal torus: +$$ \int_{U(n)} f(u) d\mu_H(u) = \frac{1}{n!}\int_{T_n} f(t) V(t)^2 dt$$ +where $t = [t_1, t_2, …, t_n]^T$ are the eigenvalues of $u$ and the integration is over the maximal torus $U(1)^n$ and $V(t)$ is the Vandermonde determinant (the determinant of the Vandermonde matrix). This is the Weyl integration formula, please see the following lecture note by: Nico Sprong.

+

Measures induced from the Haar measure

+

Homogeneous spaces of the unitary group possess measures induced from the Haar measure. One of the most important of such spaces in quantum information theory is the complex projective space: $\mathbb{C}P^n = \frac{U(n+1)}{U(n)}$ which is the space of pure states in $n+1$ dimensions. The induced measure on the space of pure states is called the Fubini-Study measure, please see Bengtsson and Życzkowski section 4.7. Sometimes the induced measure is also called a Haar measure.

+

Any $n+1$ dimensional state vector can be obtained by the application of a unitary matrix on some fixed vector. Thus, in order to construct a $\mathbb{C}P^n$-random pure state vector, we can apply a random $U(n)$ matrix drawn from a Haar distributed ensemble.

+

For mixed states, unitary orbits of density matrices are generalized flag manifolds. These spaces are also homogeneous spaces, therefore equipped with measures induced by the Haar measure. The five-dimensional case is explicitly elaborated also in Boya, Sudarshan and Tilma in section 7.

+

Some applications in quantum information

+
    +
  1. Identification of unknown quantum channels
  2. +
+

As discussed above, the generation of a Haar-random state vector can be obtained by acting on a fixed vector by a Haar distributed unitary matrix. Please see the following article by Francesco Mezzadri describing the random matrix generation algorithm. Randomly generated state vectors can be used to identify or at least gain information about unknown quantum channel.

+

To give a motivation of this approach, let's consider first a classical channel modeled as a damped harmonic oscillator: +$$m \ddot{x} + c \dot{x} + kx = F(t)$$ +And we want to estimate the channel parameters $m$, $c$ and $k$. If we knew in advance that our channel is a damped harmonic oscillator we could subject it to two sinusoidal inputs with different frequencies and extract the coefficients from its frequency response. But if we no a-priori idea what the channel dynamics is (except that it is linear), we can use a white noise random signal to identify its spectral density function: +$$\langle |x(\omega)|^2 \rangle = \frac{\frac{1}{m^2}}{(\omega^2-\frac{k}{m})^2 + (\frac{c \omega}{m})^2}$$ +The analysis of the spectral density response can be used to identify all the system degree and all of its model coefficients.

+

In the quantum case, by analogy we place random state vectors at the input and measure the outer state. We can gain information about the channel. Please see the following thesis by Easwar Magesan. For example, given a channel $\mathcal{E}$, approximating a unitary channel $\mathcal{U}$, then the fidelity of $\mathcal{E}$, with respect to $\mathcal{U}$, is given by (Equation 2.12 in the thesis). +$$F(\mathcal{E} , \mathcal{U} ) = \int_{\psi} d\psi \mathrm{tr} \left( \mathcal{U} (|\psi\rangle\langle\psi|)\mathcal{E} (|\psi\rangle\langle\psi|)\right)$$ +Where the integration is over the Fubini-Study measure. The quantum case is much more difficult than the classical one: Experimentally, on needs to input the channel with randomly generated vectors as described above; each time, perform a full tomography of the output state a perform the averaging with the ideal channel output. Both the generation of the random inputs and the full tomography are hard. One can reduce the complexity by cleverly selecting a specific set of random vectors called a design capable of estimating well behaved classes of channels; and averaging the channel over a group of unitarities called twirling which allows extracting partial information in a scalable way.

+
    +
  1. Quasi-probability functions on the group manifold.
  2. +
+

In the above applications, the group manifold is utilized as a classical probability space. But in fact, we can encode the full quantum information in functions over the $U(n)$ group manifold. This can be done by transforming the density matrix $\rho$ into a function $\chi$ of positive type over the group manifold (which is a generalization of the Wigner function on the phase space): +$$\chi(u) = \mathrm{Tr}(\rho u), \quad u \in U(n)$$ +Please see Anillo.

+

This function has the following properties stemming from the density matrix properties:

+
    +
  1. Normalization +$$\chi(e) =1$$
  2. +
  3. Symmetry +$$\bar{\chi}(u) =\chi(u^{-1})$$
  4. +
  5. Positive definiteness (Bochner's theorem} +$$\sum_{j,k } \chi(g_j^{-1}g_k) \ge 0$$
  6. +
+

For any set of group elements ${g_1, g_2, \dots, g_n}$.

+

The function $\chi(u)$ can be regarded as a generalized Fourier transform of the density matrix or a characteristic function. Several types of quantum channels can be implemented on the group manifold, for example if we multiply two different functions $\chi(u)$ of positive type, we get a function of positive type because the Hadamard product of two positive definite matrices is also a function of positive type, thus the multiplication implements a quantum channel.

+

A second use of this representation is to find the probability density function of a set of commuting observables (since a set of commuting observables can be characterized by a classical probability density function), which can be computed as an inverse Fourier transform: +Defining +$$v = e^{i\sum_i T_i v_i}, $$ +where $\{T_i\}$ is a set of commuting observables +$$f_{\{T_i\}}({t_i}) = \prod_n \left(\int_0^{2\pi} \right) d^nv e^{-i\sum_i t_i v_i} \chi(v)$$

+

I have given an explicit example of this computation in my answer on this question.

+",4263,,20169,,1/13/2023 6:50,1/13/2023 6:50,,,,1,,,,CC BY-SA 4.0 +6222,1,,,5/23/2019 17:45,,8,231,"

In superconducting quantum computers, we use mostly superconducting qubits or trapped ions. However, those systems are quite large because their environment either requires near absolute zero temperature (for superconducting to happen), or vacuum (to trap ions). Also, they need a lot of shielding from the outside world. So I was wondering why aren't we manufacturing QCs with silicon photonics, which would reduce the system size to possibly today's sizes? There is an optical equivalent to Josephson effect (since we use Josephson Junction's effect for superconducting QC) shown here, but why haven't we built more QCs around that? I get that light is harder to interfere with than electrons, so could that result in potential higher qubit error rate?

+ +

Edit: I was made aware of Xanadu, but the question still stands. Why are more companies pursuing other forms of quantum computation?

+ +

Thanks.

+",7375,,26,,5/25/2019 16:51,5/25/2019 16:51,What are the main obstacles to overcome to build silicon-photonic quantum computers?,,0,3,,,,CC BY-SA 4.0 +6223,2,,6219,5/23/2019 21:41,,6,,"

There are a couple variants of the HOG test.

+ +

""Old HOG"" computed the proportion of unique samples whose probability is larger than the median probability of the distribution. It then compares that proportion to a threshold, e.g. 2/3. If you have enough larger-than-median outputs, you pass the test.

+ +

""New HOG"" instead computes the mean of the probabilities of the unique samples. Again you pick some threshold that this mean must exceed in order to pass the test.

+ +

There's also ""cross entropy fidelity (XEB)"", which computes the mean of the logarithms of the probabilities.

+ +

The basic idea behind all these quantities is that a random quantum circuit will have a distribution of probabilities known as a Porter Thomas distribution, and this distribution has known medians and means and so forth which are different from the ones you'd get in a uniform distribution. This allows you to determine whether you're seeing larger or smaller probability samples as often as should be the case, which allows you to define a statistical test that is difficult to pass without the ability to sample from the correct distribution.

+",119,,,,,5/23/2019 21:41,,,,3,,,,CC BY-SA 4.0 +6224,1,,,5/24/2019 0:58,,6,393,"

When we use the formula to calculate two-qubit entanglement, like these:

+ +
+

$$ +C(\rho)=\max \left\{\sqrt{e_{1}}-\sqrt{e_{2}}-\sqrt{e_{3}}-\sqrt{e_{4}}, 0\right\}\tag{18} +$$

+ +

with the quantities $e_{i}\left(e_{1} \geq e_{2} \geq e_{3} \geq e_{4}\right)$ are the eigenvalues of the operator

+ +

$$ +R=\rho\left(\sigma^{y} \otimes \sigma^{y}\right) \rho^{*}\left(\sigma^{y} \otimes \sigma^{y}\right),\tag{19} +$$

+ +

where $\rho^*$ is the complex conjugate of the reduced density matrix $\rho$ given by Eq. (12), and $\sigma^y$ is the Pauli operator.

+
+ +

Why do we use the complex conjugate of the density matrix instead of its complex conjugate transpose?

+",6155,,10480,,1/27/2021 18:50,2/17/2022 23:07,Why do we use complex-conjugate instead of complex-conjugate-transpose when calculating the concurrence?,,1,1,,,,CC BY-SA 4.0 +6225,1,6226,,5/24/2019 5:11,,5,467,"

I am trying to implement arXiv:1802.06002. I do not understand how to take the data set from MNIST and apply it to a quantum circuit.

+ +

[†]: Classification with Quantum Neural Networks on Near Term Processors (Farhi & Neven, 2018)

+",6253,,26,,5/25/2019 16:40,5/25/2019 16:40,How to encode MNIST data set on a quantum circuit to study supervised learning with QNN?,,1,0,,,,CC BY-SA 4.0 +6226,2,,6225,5/24/2019 7:51,,3,,"

First, they reduce the size from 28*28 to 4*4 images (by downsampling), then convert into binary values for pixels by just comparing to a value. Then, they encode the data in a quantum uniform superposition (with computational basis representing a bitstring data image with its label).

+",4127,,,,,5/24/2019 7:51,,,,1,,,,CC BY-SA 4.0 +6227,1,,,5/24/2019 20:09,,3,113,"

Suppose I have an initial state: $$|A\rangle=\dfrac{1}{2^{3l/2}}\sum_{x=0}^{2^l-1}\sum_{y=0}^{2^l-1}\sum_{z=0}^{2^l-1} |x\rangle^{\otimes l}|y\rangle^{\otimes l}|z\rangle^{\otimes l}|0\rangle^{\otimes l}|0\rangle^{\otimes l}|0\rangle^{\otimes l}.$$

+ +

Now this state is an equal superposition of all states $\{0....2^l-1\}^3$.

+ +

Now I transform this state such that registers $|0\rangle^{\otimes l}|0\rangle^{\otimes l}|0\rangle^{\otimes l}$ contains all the states $\{0....2^l-1\}^3$, but not in the traditional order i.e each state say $(|3\rangle |7\rangle |8\rangle) |0\rangle |0\rangle |0\rangle \to (|3\rangle |7\rangle |8\rangle)|8\rangle|9\rangle|16\rangle$. If I keep doing this to all the initial states then I get all the states just in a permuted manner.

+ +

Also since the new permuted states are done obtained using a reversible transform I don't need the first three registers so I want to just make them $0$. Basically what I want is just the permutation of indexes for example I have $1,2,3,4$ then i want $4,1,3,2$. Consider without the $z$ state $$|A\rangle= (|0\rangle|0\rangle ) |0\rangle|0\rangle + (|0\rangle|1\rangle ) |0\rangle|0\rangle + (|1\rangle|0\rangle ) |0\rangle|0\rangle + (|1\rangle|1\rangle ) |0\rangle|0\rangle.$$

+ +

Now this state transforms into +$$|B\rangle= (|0\rangle|0\rangle ) |0\rangle|1\rangle + (|0\rangle|1\rangle ) |1\rangle|0\rangle + (|1\rangle|0\rangle ) |1\rangle|1\rangle + (|1\rangle|1\rangle ) |0\rangle|0\rangle.$$

+ +

The output state that I want is $$ |C\rangle= (|0\rangle|1\rangle ) |0\rangle|0\rangle + (|1\rangle|0\rangle ) |0\rangle|0\rangle + (|1\rangle|1\rangle ) |0\rangle|0\rangle + (|0\rangle|0\rangle ) |0\rangle|0\rangle$$

+ +

Edit: Classically I have three numbers say $x,y,z$ and I want to transform them to $(x'y'z')$ using a function $f$ that is invertible.

+ +

$$\begin{eqnarray} + x'=f(x,y,z)\\ +y'=f(x,y,z)\\ +z'=f(x,y,z) +\end{eqnarray}$$

+ +

So my states $|x\rangle|y\rangle|z\rangle$ is the original and the result $x',y',z'$ is stored in the registers $|0\rangle|0\rangle|0\rangle$.

+",6070,,26,,5/25/2019 16:37,5/25/2019 16:37,Permutation of initialized states,,1,3,,,,CC BY-SA 4.0 +6228,1,6229,,5/25/2019 0:42,,1,136,"

Which is the correct depiction of a qubit state showing the possibilities before it collapses? Is it like:

+ +
+ +

MODEL 1:

+ +

1000 0100 0010 0001

+ +
+ +

MODEL 2:

+ +

1000 0100 0010 0001

+ +

0111 1011 1101 1110

+ +
+ +

MODEL 3:

+ +

0000 0000 0000 0000

+ +

1000 1000 1000 1000

+ +

1100 1100 1100 1100

+ +

1110 1110 1110 1110

+ +

1111 1111 1111 1111

+ +
+ +

Or some other way?

+ +
+ +

I find the spherical diagrams, XOR gates and | difficult to conceptualize concretely. +Thanks!

+",7602,elsa,55,,5/29/2019 8:48,5/29/2019 8:48,Which is the correct depiction of a qubit before it collapses?,,1,2,,,,CC BY-SA 4.0 +6229,2,,6228,5/25/2019 3:00,,2,,"

I'm going to go out on a limb and say that it sounds like you're having trouble to know what's meant by $4$ qubits in a uniform superposition.

+ +

Remember with $4$ qubits, the dimension of the Hilbert space is $2^4=16$. Thus we will be in a superposition of $16$ potential kets.

+ +

If we apply a Hadamard gate to each of the $4$ qubits initially in $\vert 0\rangle$, then after Hadamarding the entire qubits will be in the state:

+ +

$\frac{1}{4}(\vert 0000\rangle+\vert 0001\rangle+\vert 0010\rangle+\vert 0011\rangle+\vert 0100\rangle+\vert 0101\rangle+\vert 0111\rangle+\vert 1000\rangle+\vert 1001\rangle+\vert 1010\rangle+\vert 1011\rangle+\vert 1100\rangle+\vert 1101\rangle+\vert 1110\rangle+\vert 1111\rangle)$

+ +

That is, each potential $4$-bit vector is part of the superposition.

+ +

EDIT

+ +

Reading the above, the $\frac{1}{4}$ coefficient is the ""normalizing coefficient."" This is used to determine the probrability that any of the particular states are measured. According to Born's rule we square the amplitude to determine the probabilities. Because there are $16$ states, and because it sounds like the OP wants the states to be uniformly distributed with an equal chance of collapsing to any vector, we have $(\frac{1}{4})^2=\frac{1}{16}$.

+ +

Additionally the Dirac bra-ket notation, $\vert \cdots\rangle$, is how, in the quantum world, we describe vectors. The OP posted her/his vectors without the surrounding notation, which is maybe OK when you're just starting out and you want to grok the point of a superposition. But the Dirac notation has a lot of advantages later on when you start looking at things like inner/outer products and density matrices.

+",2927,,2927,,5/26/2019 14:15,5/26/2019 14:15,,,,8,,,,CC BY-SA 4.0 +6230,1,6232,,5/25/2019 3:21,,10,1493,"

I was very inspired by Michio Kaku's explanation on the possibilities of quantum computing and also listening to Talia Gershon's talk on it.

+ +

As I come from a business & analytics background, what materials can I begin exploring to prepare to learn more about the field of quantum computing? Eg. what would I need to study to understand Peter Shor's algorithm, Siraj's video on physics, etc.

+",7580,,26,,5/25/2019 16:23,5/25/2019 18:26,What are the basics needed to learn quantum computing?,,1,2,,,,CC BY-SA 4.0 +6231,2,,6227,5/25/2019 9:08,,3,,"

To sum up, you have an unitary operation $P$ such that +$$ +P \ \vert x \rangle \vert y \rangle \vert z \rangle \vert 0 \rangle \vert 0 \rangle \vert 0 \rangle \mapsto \vert x \rangle\vert y \rangle\vert z \rangle\vert 0 \oplus p_1(x, y, z) \rangle\vert 0 \oplus p_2(x, y, z) \rangle\vert 0 \oplus p_3(x, y, z) \rangle +$$ +with $f$, $p_2$ and $p_3$ already implemented, invertible and you want to create a unitary operation $P'$ such that +$$ +P' \ \vert x \rangle \vert y \rangle \vert z \rangle \vert 0 \rangle \vert 0 \rangle \vert 0 \rangle\mapsto\vert p_1(x, y, z) \rangle\vert p_2(x, y, z) \rangle\vert p_3(x, y, z) \rangle\vert 0 \rangle \vert 0 \rangle \vert 0 \rangle . +$$

+ +

This can be achieved easily by using the fact that the XOR ($\oplus$) operation is its self inverse and $S$, defined as the operation that swap the content of the registers given as input: +$$ +S \vert x_1 \rangle\vert x_2 \rangle\vert x_3 \rangle\vert x_4 \rangle\vert x_5 \rangle\vert x_6 \rangle \mapsto \vert x_4 \rangle\vert x_5 \rangle\vert x_6 \rangle\vert x_1 \rangle\vert x_2 \rangle\vert x_3 \rangle. +$$ +The $S$ operation can be implemented with CNOT gates.

+ +

The gate you are trying to implement is then given by $P' = P^\dagger S P$ (I'm not 100% sure that $P^\dagger$ implements the inverses of $p_1$, $p_2$ and $p_3$, you may need to check that, if it's not the case then replace $P^\dagger$ by the unitary operation inverting $p_1$, $p_2$ and $p_3$):

+ +

$$ +\begin{split} +P^\dagger SP \ \vert x \rangle \vert y \rangle \vert z \rangle \vert 0 \rangle \vert 0 \rangle \vert 0 \rangle &= P^\dagger S \ \vert x \rangle\vert y \rangle\vert z \rangle\vert 0 \oplus p_1(x, y, z) \rangle\vert 0 \oplus p_2(x, y, z) \rangle\vert 0 \oplus p_3(x, y, z) \rangle \\ +&= P^\dagger S \ \vert x \rangle\vert y \rangle\vert z \rangle\vert p_1(x, y, z) \rangle\vert p_2(x, y, z) \rangle\vert p_3(x, y, z) \rangle \\ +&= P^\dagger \ \vert p_1(x, y, z) \rangle\vert p_2(x, y, z) \rangle\vert p_3(x, y, z) \rangle \vert x \rangle\vert y \rangle\vert z \rangle \\ +&= \vert p_1(x, y, z) \rangle\vert p_2(x, y, z) \rangle\vert p_3(x, y, z) \rangle \vert x \oplus x \rangle\vert y \oplus y \rangle\vert z \oplus z \rangle \\ +&= \vert p_1(x, y, z) \rangle\vert p_2(x, y, z) \rangle\vert p_3(x, y, z) \rangle\vert 0 \rangle \vert 0 \rangle \vert 0 \rangle +\end{split} +$$

+",1386,,,,,5/25/2019 9:08,,,,3,,,,CC BY-SA 4.0 +6232,2,,6230,5/25/2019 15:26,,7,,"

General background:

+

Quantum computing (theory) is at the intersection of math, physics and computer science. (Experiment also can involve electrical engineering.) Eventually you will want to learn aspects of all of these fields, but when starting you can use any for an entry into the field. Within each field, the subjects you will want to know are:

+

Physics:

+
+

First learn quantum mechanics. At more advanced levels, various +aspects of quantum information overlap with AMO, condensed matter and +high energy.

+
+

More

+ +

Math:

+
+

First linear algebra and probability. Later my preferences would be to +learn some group and representation theory, random matrix theory and +functional analysis, but eventually most fields of math have some +overlap with quantum information, and other researchers may emphasize +different areas of math.

+
+

Computer Science:

+
+

Most theory topics are relevant although are less crucial at first: +i.e. algorithms, cryptography, information theory, error-correcting +codes, optimization, complexity, machine learning. If you haven't had +any CS theory exposure, undergrad algorithms is a good place to start +because it will show you CS-theory ways of thinking, including ideas +like asymptotic analysis.

+
+

More:

+ +
+

General quantum computing texts:

+

Here is a very partial list of resources for learning more about quantum computing and quantum information.

+ +
+
+

If you want to get a flavor of what research is currently hot, then +one place to look is at the program of the last few QIP workshops. A +less curated list of interesting papers can be found at scirate.com , +where looking at the most scited papers in the last year should bring +up some interesting work.

+
+
+

Specialized sources:

+

Some more specialized books/lecture notes are here. These are more modern and in-depth than the general resources above.

+ +

NOTE: +The above information is based on this MIT page.

+
+

Other StackExchange Questions.

+ +

Credits : @SanchayanDutta

+",7567,,-1,,6/18/2020 8:31,5/25/2019 18:26,,,,5,,,,CC BY-SA 4.0 +6233,2,,6224,5/25/2019 18:26,,1,,"

I believe the question is:

+ +
+

""why does Eq. 19 use $\rho^*$ instead of $\rho^\dagger$?""

+
+ +

I believe this is because $\rho^* = \rho^\dagger$ for Hermitian matrices such as $\rho$, so it can be written either way.

+",7583,,,,,5/25/2019 18:26,,,,2,,,,CC BY-SA 4.0 +6234,2,,6198,5/25/2019 18:52,,9,,"
+

"What feature of a quantum algorithm makes it better than its classical +counterpart?"

+
+

First, a classical algorithm can be thought of as a quantum algorithm that makes no use of quantum superpositions. Therefore a quantum algorithm can be at least as good as its classical counterpart. No classical algorithm can be "better" than quantum algorithms can do, because one example of a quantum algorithm is the classical algorithm itself.

+

What is a feature of quantum algorithms that make them better than classical algorithms? The feature of quantum entanglement and superposition, which allows us to answer the Deutsch-Jozsa problem with 1 query instead of $2^n$.

+
+

"Are quantum computers faster than classical ones in all respects?"

+
+

I believe we do not know much about "speed". We know that we can factor the number $n$ with $log^3(n)$ operations instead of $n$ operations, but how fast are those operations going to be? We only know the answer to this question for quantum computers that have < 10000 qubits, and these have not been able to factor numbers larger than about 7 digits. You can see in WolframAlpha that factoring any number with ~10 digits finishes instantly, so even if the IBM quantum computer is faster, it is insignificantly faster. We need millions of physical qubits (100s of logical qubits) to make a real comparison, and what that million-qubit architecture will look like (if it's even possible to make) is something we don't yet know. Maybe to make a device with a million qubits will come at the sacrifice of gate fidelities or gate speeds.

+

The answer is "no" quantum algorithms are not better in "all respects" because they are harder to implement physically!

+",7583,,2927,,9/8/2021 23:35,9/8/2021 23:35,,,,0,,,,CC BY-SA 4.0 +6235,1,6346,,5/25/2019 21:22,,3,1036,"

I am using Qiskit language, and I am working with IBM devices via Quantum Experience beta. How can I find how many credit points I have used and how much there are left till they fill back 24 hour's later? And for each backend, number of qubits and number of shots - how much credit points does the system require per experience with those data?

+ +

I would like to have a summary mentioning all is known about those credit points.

+",4524,,26,,5/26/2019 0:02,6/5/2019 7:43,How do the credit points work in IBM quantum experience?,,2,0,,,,CC BY-SA 4.0 +6236,1,6240,,5/26/2019 2:35,,11,4146,"

In IBM Qiskit and Quantum Experience, the custom U3 gate is defined as

+ +

$$ +U(\theta, \phi, \lambda) = +\begin{pmatrix} +\cos\left(\frac{\theta}{2}\right) & -e^{i\lambda} \sin\left(\frac{\theta}{2}\right) \\ +e^{i\phi} \sin\left(\frac{\theta}{2}\right) & e^{i(\lambda + \phi)} \cos\left(\frac{\theta}{2}\right) +\end{pmatrix} +$$

+ +

Is there any way to quickly obtain the parameters $\theta, \phi$ and $\lambda$ for any arbitrary $2\times 2$ unitary $X$? I know it's possible to write up a lengthy program which could do this, but is there already a similar program out there? Any of the common programming languages would be fine.

+ +
+ +

Related: What are theta, phi and lambda in cu1(theta, ctl, tgt) and cu3(theta, phi, lam, ctl, tgt)? What are the rotation matrices being used?

+",26,,26,,5/26/2019 3:39,9/11/2022 18:17,"How to quickly calculate the custom U3 gate parameters $\theta, \phi$ and $\lambda$ for any unitary?",,3,0,,,,CC BY-SA 4.0 +6237,2,,6236,5/26/2019 3:37,,3,,"

Mathematica

+ +

With help from Mathematica SE, I managed to put this together (assuming Z is our 2 × 2 unitary):

+ +
U = {{Cos[\[Theta]/
+     2], -E^(I \[Lambda]) Sin[\[Theta]/
+      2]}, {E^(I \[Phi]) Sin[\[Theta]/2], 
+   E^(I (\[Lambda] + \[Phi])) Cos[\[Theta]/2]}};
+FullSimplify[
+ Reduce[Z == U && 0 <= \[Phi] < 2 Pi && 0 <= \[Theta] <= Pi && 
+   0 <= \[Lambda] < 2 Pi, {\[Theta], \[Phi], \[Lambda]}]]
+
+ +

Note that you'll need to define Z beforehand. Say, if $Z=\begin{pmatrix}-\frac{1}{\sqrt 2} & \frac{i}{\sqrt 2} \\ \frac{i}{\sqrt 2} & -\frac{1}{\sqrt 2} \end{pmatrix}$, the corresponding code is:

+ +
Z = {{-1/Sqrt[2], I/Sqrt[2]}, {I/Sqrt[2], -1/Sqrt[2]}};
+Z = Z/Sqrt[Det[Z]];
+Z = Simplify[Z/Exp[I Arg[Z[[1, 1]]]]];
+U = {{Cos[\[Theta]/
+     2], -E^(I \[Lambda]) Sin[\[Theta]/
+      2]}, {E^(I \[Phi]) Sin[\[Theta]/2], 
+   E^(I (\[Lambda] + \[Phi])) Cos[\[Theta]/2]}};
+FullSimplify[
+ Reduce[Z == U && 0 <= \[Phi] < 2 Pi && 0 <= \[Theta] <= Pi && 
+   0 <= \[Lambda] < 2 Pi, {\[Theta], \[Phi], \[Lambda]}]]
+
+ +

and the solution is:

+ +
2 \[Theta] == \[Pi] && 2 \[Phi] == 3 \[Pi] && 2 \[Lambda] == \[Pi]
+
+ +

Note that the matrix $U(\pi/2,3\pi/2,\pi/2)$ differs by a phase factor from $Z$. This is because of the transformation due to

+ +
Z = Z/Sqrt[Det[Z]];
+Z = Simplify[Z/Exp[I Arg[Z[[1, 1]]]]];
+
+ +

which is meant to deal with those cases where $Z_{11}$ exceeds the range of $\cos(\frac{\theta}{2})$. I've discussed about this here. Remember that $0\leq \theta \leq \pi$ and $0 \leq \phi <2\pi$ according to the documentation.

+ +
+ +

P.S: You can run this code on Mathematica Cloud now cf. Wolfram Releases the Wolfram Engine for Developers!!

+",26,,26,,6/4/2019 15:19,6/4/2019 15:19,,,,2,,,,CC BY-SA 4.0 +6238,1,6246,,5/26/2019 10:50,,5,980,"

The Grover algorithm allows you to search for multiple elements. Assuming my search space contains four elements, if I only search for one element, I get the one I'm looking for with a probability of 100%. So far so good.

+ +

Assuming I search for two elements within the four elements, then the probability is only found at 50% of the searched element. It gets even more interesting. Suppose I search exactly three within the four elements, then the probability increases to measure a state that does not correspond to the solution state.

+ +

So my question is, how does one behave in such a situation? and is it possible to recognize these situations in advance? Are there any other problems that can occur when searching for multiple items?

+ +
+ +

Calculations (success probabilities):

+ +

$M$ is the number of searched elements, $N$ is the size of the search space. +$$M=1, N =4$$ +$$\sin^2\left((2\cdot 1 + 1)\cdot\sin^{-1}\left(\sqrt{\frac{1}{4}}\right)\right)=1$$

+ +

$$M=2, N =4$$ +$$\sin^2\left((2\cdot 1 + 1)\cdot\sin^{-1}\left(\sqrt{\frac{2}{4}}\right)\right)=\frac{1}{2}$$

+ +

$$M=3, N =4$$ +$$\sin^2\left((2\cdot 1 + 1)\cdot\sin^{-1}\left(\sqrt{\frac{3}{4}}\right)=\frac{1}{2}\right)=0$$

+",4974,,55,,5/27/2019 9:19,5/27/2019 9:19,Success probability in Grover's algorithm where there are multiple targets,,1,4,,,,CC BY-SA 4.0 +6240,2,,6236,5/26/2019 14:42,,5,,"

Python - Sympy

+ +

It could be done in python using sympy. I am not really an expert and maybe there could be ways to optimize this, but the following works fine for me. +Assuming you have the matrix +$$\begin{bmatrix}a & b\\ c & d\end{bmatrix}$$

+ +

My program

+ + + +
from sympy import *
+
+def get_angles(a, b, c, d):
+    if im(a) == 0:
+        print(""Not phasing"")
+        s = _compute_angles(a, b, c, d)
+        res = _final_constraint(s)
+        if len(res) != 0:
+            return res
+    print(""Phasing by first element..."")
+    matr = Matrix([[a, b], [c, d]])
+    ph = arg(matr[0])
+    matr_phased = simplify(matr/(cos(ph) + I*sin(ph)))
+    s = _compute_angles(matr_phased[0], matr_phased[1], matr_phased[2],
+                        matr_phased[3])
+    return _final_constraint(s)
+
+
+def _compute_angles(a, b, c, d):
+    theta, phi, lamb = symbols('\\theta \\phi \\lambda', real=True)
+    a_eq = Eq(cos(theta / 2), a)
+    b_eq = Eq(-exp(I * lamb) * sin(theta / 2), b)
+    c_eq = Eq(exp(I * phi) * sin(theta / 2), c)
+    d_eq = Eq(exp(I * (phi + lamb)) * cos(theta / 2), d)
+    return solve([a_eq, b_eq, c_eq, d_eq], [theta, phi, lamb], dict=True)
+
+
+def _final_constraint(result):
+    res = []
+    for sol in result:
+        to_add = True
+        for k, v in sol.items():
+            if str(k) == '\\theta' and (v < 0 or v > pi):
+                to_add = False
+                break
+            elif str(k) == '\\phi' and (v < 0 or v >= 2 * pi):
+                to_add = False
+                break
+        if to_add:
+            res.append(simplify(sol))
+    return res
+
+ +

Note that for Qiskit U matrix you should only check if the first number is imaginary and, if it so, you could divide the whole matrix by it. It is not really necessary to divide by the determinant, provided that the matrix represent indeed a valid quantum gate (or, said differently, the magnitude are all less than 1).

+ +

To avoid Python evaluation of fractions, instead of simply using 1/2 a common trick is to use S(1)/2 or Rational(1,2)

+ +

Examples

+ +

A generic unitary

+ +

get_angles(sqrt(S(1)/5), sqrt(S(4)/5), -sqrt(S(4)/5), sqrt(S(1)/5)) +returns

+ +

$$ +\left[ \left\{ \lambda : \pi, \ \phi : \pi, \ \theta : 2 \operatorname{acos}{\left(\frac{\sqrt{5}}{5} \right)}\right\}\right] +$$

+ +

Pauli-Y matrix

+ +

$$\begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix}$$

+ +

get_angles(0, -I, I, 0) returns +$$ +\left[ \left\{ \lambda : \frac{\pi}{2}, \ \phi : \frac{\pi}{2}, \ \theta : \pi\right\}\right] +$$

+ +

$\sqrt{NOT}$

+ +
sqnot = Matrix([[1+I, 1-I], [1-I, 1+I]]) * Rational(1,2)
+get_angles(sqnot[0], sqnot[1], sqnot[2], sqnot[3])
+
+ +

$$ +\left[ \left\{ \lambda : \frac{\pi}{2}, \ \phi : \frac{3 \pi}{2}, \ \theta : \frac{\pi}{2}\right\}\right] +$$

+ +

Matrix of Sanchayan Dutta answer

+ +

get_angles(-1/sqrt(2), I/sqrt(2), I/sqrt(2), -1/sqrt(2)) +$$ +\left[ \left\{ \lambda : \frac{\pi}{2}, \ \phi : \frac{3 \pi}{2}, \ \theta : \frac{\pi}{2}\right\}\right] +$$

+",4848,,4848,,8/29/2019 10:12,8/29/2019 10:12,,,,14,,,,CC BY-SA 4.0 +6241,2,,6155,5/26/2019 14:47,,2,,"

It sounds like you want a state given to you as $\vert x\rangle\vert f(x)\rangle$, and you wish to only conditionally rotate when $f(x)=a$, diffuse over $x$, conditionally rotate when $f(x)=a$, diffuse over $x$, ... conditionally rotate when $f(x)=a$, diffuse over $x$, and measure.

+ +

If I understand your question, then I think the issue is in the ""diffuse over $x$.""

+ +

Because you can't simply diffuse over the mixed state $\vert x\rangle$, but you must diffuse over the pure state $\vert x\rangle\vert f(x)\rangle$.

+ +

If $\vert f(x)\rangle$ has not been uncomputed back to $\vert 0\rangle$, then the diffusion will not lead to constructive/destructive interference in the first register. Even if you are diffusing only over the first register $\vert x\rangle$, the second register $\vert f(x)\rangle$ gets in the way.

+",2927,,,,,5/26/2019 14:47,,,,1,,,,CC BY-SA 4.0 +6242,1,,,5/26/2019 19:45,,7,238,"

Assume we are given an $n$-qubit system and complex numbers $a_0, \ldots, a_{m-1}$ with $m = 2^n$. Assume further we start with the initial state $|0 \ldots 0\rangle$ and want to make the transformation +$$|0 \ldots 0\rangle \rightarrow \frac{1}{\sqrt{\sum_{i=0}^{m-1} |a_i|^2 }}\sum_{i=0}^{m-1} a_i |i\rangle$$ +for arbitrary $a_i$. +My question is now: What is the most efficient way (fewest gates resp. smallest circuit depth resp. best robustness on a noisy intermediate-scale quantum computer) currently known to implement that transformation?

+",6192,,6192,,5/27/2019 9:22,6/10/2019 16:14,Most efficient way for general state generation,,1,4,,,,CC BY-SA 4.0 +6244,2,,5787,5/27/2019 2:40,,4,,"

The point is that, for a search algorithm to be fulfilling its purpose, you want $\lvert\langle\psi_k^x\rvert x\rangle\rvert^2>1/2$. +Note that here $\lvert \psi_k^x\rangle$ is the output of the algorithm after $k$ steps if we are using the oracle to mark the $\lvert x\rangle$ state. If this condition is not verified, then by definition the algorithm is not giving as output the state we asked it to find.

+ +

What one can do then is to show that, if $\lvert\langle\psi_k^x\rvert x\rangle\rvert^2>1/2$ holds for all $x$, then $D_k=\Omega(N)$, meaning that there is some positive $c$ such that, for large enough $N$, $D_k\ge cN$. +Intuitively, this is saying that a high probability of success means that the algorithm must be moving $\lvert\psi\rangle$ towards different states, and therefore $D_k$, which quantifies how much $\lvert\psi\rangle$ is moved by the algorithm, must be lower bounded.

+ +

On the other hand, one can also prove that $D_k=O(k^2)$, and more specifically that $D_k\le4k^2$, simply using the definitions of $\lvert\psi_k\rangle$ and $\lvert\psi_k^x\rangle$.

+ +

We then conclude that, if the algorithm is successfully retrieving the requested states, we must have $cN\le D_k\le 4k^2$, and thus +$$k\ge\sqrt{cN/4}.$$ +This means that the sole assumption that the algorithm is working leads to the conclusion that the oracle must be used $\Omega(\sqrt N)$ times.

+",55,,,,,5/27/2019 2:40,,,,3,,,,CC BY-SA 4.0 +6245,1,6247,,5/27/2019 5:25,,3,860,"

Michael Nielsen posted on Twitter about a proof on a circuit for quantum teleportation.

+
+

Had some fun this afternoon re-analyzing the circuit for quantum teleportation. Here's a proof I found that the circuit works.

+

The circuit to be verified: top two qubits are Alice's, including the state psi to be teleported. Bottom qubit is Bob's - want to show it outputs psi.

+

+
+

I would appreciate if someone can explain and elaborate on the steps for the proof? Also what do the $X^x$ and $Z^z$ gates mean?

+",914,,-1,,6/18/2020 8:31,5/27/2019 20:39,Can someone walk us through Nielsen's proof on a circuit for quantum teleportation?,,1,0,,,,CC BY-SA 4.0 +6246,2,,6238,5/27/2019 5:59,,3,,"

Indeed, applying Grover in the case $ M \ge N / 2 $ will show this issue. Yet you can use a simple trick to overcome this. You just have to increase the search space by adding N new elements which you won't consider solutions. You end up doing more iterations but you will still get a quadratic speedup.

+ +

One way to recognize these situatons in advance is either you just are not getting better during your search or you just use quantum counting to get the number of solutions $M$ before doing the search.

+ +

Last question : no other problems.

+",4127,,,,,5/27/2019 5:59,,,,2,,,,CC BY-SA 4.0 +6247,2,,6245,5/27/2019 8:39,,6,,"

$x$ and $z$ are just numbers $0$ or $1$, so $X^x = I$ or $X$, and $Z^z = I$ or $Z$.

+ +

The explanatiton goes as follows

+ +
    +
  1. The first step is to note that in our case CNOT operation on the 1st and 2nd qubits has the same effect as CNOT on the 1st and 3rd qubits. That is +$$ +CNOT_{12} |\psi\rangle(|00\rangle+|11\rangle)\frac{1}{\sqrt{2}} = CNOT_{13} |\psi\rangle(|00\rangle+|11\rangle)\frac{1}{\sqrt{2}} +$$ +To see why, just define $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$ and compute +$$ +CNOT_{12} |\psi\rangle(|00\rangle+|11\rangle)\frac{1}{\sqrt{2}} = CNOT_{12}(\alpha|0\rangle + \beta|1\rangle)(|00\rangle+|11\rangle)\frac{1}{\sqrt{2}} = +$$ +$$ +=CNOT_{12}(\alpha|000\rangle + \alpha|011\rangle + \beta|100\rangle + \beta|111\rangle )\frac{1}{\sqrt{2}} = +$$ +$$ += (\alpha|000\rangle + \alpha|011\rangle + \beta|110\rangle + \beta|101\rangle )\frac{1}{\sqrt{2}}, +$$ +$$ +CNOT_{13} |\psi\rangle(|00\rangle+|11\rangle)\frac{1}{\sqrt{2}} = CNOT_{13}(\alpha|000\rangle + \alpha|011\rangle + \beta|100\rangle + \beta|111\rangle )\frac{1}{\sqrt{2}} = +$$ +$$ +=(\alpha|000\rangle + \alpha|011\rangle + \beta|101\rangle + \beta|110\rangle )\frac{1}{\sqrt{2}} +$$ +So, we can transform the circuit by switching $CNOT_{12}$ to $CNOT_{13}$. +
  2. +
  3. In the second step we note that in our new circuit the second qubit has only one operation that affects it – the measurement. So we can apply it before all other operations. The result of this operation is $x=0$ or $1$, and 2nd and 3rd qubits after this measurement will be $|xx\rangle = |00\rangle$ or $|11\rangle$. +
  4. +
  5. Since the 3rd qubit is $|0\rangle$ or $|1\rangle$ at this step, we can swap the order of operations $CNOT_{13}$ and $X^x$ on it. But $X^x|x\rangle = |0\rangle$, so what is left is to analyze the circuit
  6. +
  7. At this step you can directly compute the effect of the CNOT and H gates +$$ +H\otimes I \cdot CNOT_{12} \cdot |\psi\rangle|0\rangle = H\otimes I \cdot CNOT_{12} \cdot (\alpha|00\rangle + \beta|10\rangle) = +$$ +$$ += H\otimes I (\alpha|00\rangle + \beta|11\rangle) = \frac{1}{\sqrt{2}}\left( \alpha(|0\rangle+|1\rangle)|0\rangle + \beta(|0\rangle-|1\rangle)|1\rangle \right) = +$$ +$$ + = \frac{1}{\sqrt{2}}\left( \alpha|00\rangle+\alpha|10\rangle + \beta|01\rangle-\beta|11\rangle \right) = \frac{1}{\sqrt{2}}\left( |0\rangle(\alpha|0\rangle+\beta|1\rangle) + |1\rangle(\alpha|0\rangle-\beta|1\rangle) \right) +$$
  8. +
  9. Now if we measure 1st qubit the result will be $z=0$ or $1$, and the state will be $|0\rangle(\alpha|0\rangle+\beta|1\rangle)$ or $|1\rangle(\alpha|0\rangle-\beta|1\rangle)$ correspondingly. So if we apply $Z^z$ on the last qubit it will be in the state $\alpha|0\rangle+\beta|1\rangle = |\psi\rangle$
  10. +
+ +

Update
+His second way to prove last circuit (from step 3) is basically by using equality +$$ +\alpha|00\rangle+\beta|11\rangle = \frac{1}{\sqrt{2}}(|+\rangle(\alpha|0\rangle + \beta|1\rangle) + |-\rangle(\alpha|0\rangle - \beta|1\rangle)) +$$

+ +

After applying $CNOT$ on $|\psi\rangle|0\rangle$ we will get the state $\alpha|00\rangle+\beta|11\rangle$. Now instead of applying $H$ and measuring the 1st qubit in $|0\rangle, |1\rangle$ basis we can measure in $|+\rangle, |-\rangle$ basis right away. The result will be $z=0$ with the state $|+\rangle(\alpha|0\rangle + \beta|1\rangle)$ or $z=1$ with the state $|-\rangle(\alpha|0\rangle - \beta|1\rangle)$. So $Z^z$ corrects the state of the last qubit.

+",5870,,5870,,5/27/2019 12:04,5/27/2019 12:04,,,,2,,,,CC BY-SA 4.0 +6248,1,6937,,5/27/2019 17:08,,3,694,"

I have two gates here for the Grover diffusion operator. The first gate is completely understandable for me, so I implemented it myself after submitting some papers that I read. +This is the first gate (understandable for me):

+ +

+ +

Recently, however, I have seen an implementation of the Grover algorithm in which the diffusion operator still uses the oracle qubit. My question is, what does this circuit do? And why does it work?

+ +

+",4974,,55,,10/21/2021 8:42,10/21/2021 8:42,Understanding the implementation of Grover's diffusion operator using the oracle qubit,,1,0,,,,CC BY-SA 4.0 +6249,1,,,5/27/2019 17:32,,1,83,"

Suppose I have the state $|A\rangle=|x\rangle^l\otimes |y\rangle^l \otimes |z\rangle^l \otimes |0\rangle_x^l\otimes |0\rangle_y^l\otimes |0\rangle_z^l$. I perform the transformation between the $|x\rangle$ register and first $0_x$ register that is $$U|x,0\rangle\to |x,(2x)~\text{mod}~l\rangle$$ +Suppose if $|x\rangle=|x_0x_1x_2...x_{l-1}\rangle$ and $|0\rangle=|0_00_1000..0_{l-1}\rangle$ then the result is $|x\rangle|x_1x_2x_3....x_{l-1}0\rangle$. +So the tensorial notation for this operator on state $A$ is +\begin{align} +U=\prod_{i=0}^{l-2} \left( I^{\otimes 1+i}\otimes P_0\otimes I^{\otimes 3l-2}\otimes I\otimes I^{l-1-i}\otimes I^{\otimes 2l} \right. \\\left.+I^{\otimes 1+i}\otimes P_1\otimes I^{\otimes 3l-2}\otimes X\otimes I^{l-1-i}\otimes I^{\otimes 2l}\right) +\end{align} +Is this operator correct for the operation that I want to perform?

+",6070,,55,,7/26/2020 18:11,7/26/2020 18:11,Kronecker notation of an operator,,0,1,,,,CC BY-SA 4.0 +6250,1,,,5/27/2019 18:44,,5,132,"

I tried to look for the resource constraints but so far haven't been able to find them. They are not present in the GitHub repository that usually provides the hardware information for the different devices.

+ +

I mean resource constraints as in:

+ +
    +
  • Can any single qubit gates be applied on different qubits simultaneously?
  • +
  • Can any two-qubit gates be applied on different links simultaneously?
  • +
  • Can measurements be performed on different qubits simultaneously?
  • +
  • Combinations of the above, etc.
  • +
+ +

Additionally, I'd also like to know the duration of the measurement operations.

+",201,,26,,5/28/2019 5:39,8/5/2021 7:39,IBM Q devices' hardware/resource constraints,,1,5,,,,CC BY-SA 4.0 +6251,1,,,5/27/2019 20:42,,1,156,"

Is it an open question whether we can do reinforcement learning where the quantum agent is not present in the environment, that is, doesn't contribute noise to the environment? In a classical environment, it seems that the agent is observing the universe while also contributing to it simultaneously. Most papers in this field seem to analyze quantum speed-ups and quantum-inspired algorithms, but I wonder more about classical improvements of the architecture in general.

+ +

My aim is to understand if there is a way to arrange an environment where an agent is in a quantum state. The purpose is to separate the agent (actor-critic) from the system. For example, through superposition. In other words, can we do learning with a passive agent?

+",2215,,2215,,6/13/2019 13:40,6/13/2019 13:40,Reinforcement learning with a quantum agent,,0,4,,6/5/2019 7:17,,CC BY-SA 4.0 +6253,1,6257,,5/28/2019 8:16,,3,287,"

I have the following exercise to solve:

+ +
+

Consider the Boolean function $f(x_1 . . . x_n) = x_1 \oplus \dots \oplus x_n$ + where $x_1 \dots x_n$ is an nbit string and $\oplus$ denotes addition mod $2$. + Describe a circuit of $2$-qubit gates on $n + 1$ qubits that implements the + transformation $| x_1 \dots x_n \rangle | 0 \rangle \mapsto | x_1 \dots x_n \rangle | x_1 \oplus \dots \oplus x_n\rangle$

+ +

By considering a relationship between $f$ and the $n$-qubit Hamiltonian + $Z \otimes \dots \otimes Z$, show that $V = \exp(i Z \otimes \dots \otimes Z t)$, for any + fixed $t > 0$, may be implemented on n qubit lines (with possible use + of further ancillary lines) by a circuit of size $O(n)$ of $1$- and + $2$-qubit gates.

+
+ +

My circuit for the first part of the question is just $n$ CNOT gates controlled by the first register and acting on the $1$-qubit register. So far so good. However, for the second part of the question, I don't understand the relation to the Hamiltonian. I understand that I could use $H^{\otimes n}$ to convert $X$ into $Z$ gates but still.

+ +

Any help appreciated.

+",5322,,26,,5/28/2019 14:11,5/28/2019 14:11,Implement a Hamiltonian in O(n) - exercise question,,1,0,,,,CC BY-SA 4.0 +6254,2,,6236,5/28/2019 8:45,,3,,"

Qiskit

+ +

You can also do this directly from Qiskit using this piece of code

+ + + +
from qiskit.quantum_info.synthesis import euler_angles_1q 
+from scipy.linalg import sqrtm 
+import numpy as np 
+
+x_matrix = np.array([[0, 1], [1, 0]]) 
+x_90_matrix = sqrtm(x_matrix)
+# Returns (theta, phi, lambda) 
+euler_angles_1q(x_90_matrix)                                                                                 
+Out[4]: (1.5707963267948966, -1.5707963267948966, 1.5707963267948966)
+
+an_matr = np.array([[-1/sqrt(2), 1j/sqrt(2)], [1j/sqrt(2), -1/sqrt(2)]]
+euler_angles_1q(an_matr)                                                                                                      
+Out[14]: (1.5707963267948966, 4.71238898038469, 1.5707963267948966
+
+
+ +

Thanks to the Qiskit slack channel for this hint. For those interested, here there is the source code of the euler_angles_1q function.

+",4848,,4848,,5/28/2019 9:12,5/28/2019 9:12,,,,0,,,,CC BY-SA 4.0 +6255,1,,,5/28/2019 8:51,,15,2924,"

I am currently working through some papers related with approximations of more general quantum channels such as amplitude and phase damping channels to Pauli channels. The reason to do so is so that the Gottesman-Knill theorem is fulfilled and efficient Monte Carlo simulations can be performed for Quantum Error Correction codes.

+ +

In such reading, I reach to some papers that use the so-called Twirling in order to justify this channel approximation, but I have not found much literature specifically talking about the topic, as I have found the information to be scattered and not so well distinguished. My principal doubt is the difference between Pauli and Clifford twirls, and if both of them can be applied to the same channel without losing too much on the approximation. For example:

+ + + +

I am wondering if someone can give me some insight about this topic, or provide specific literature about the topic of Twirling in Quantum Information Theory. Also ideas or references to the use of those techniques as approximations for error correction is interesting for me and welcome.

+",2371,,55,,2/22/2021 16:00,2/22/2021 16:00,Twirling Quantum Channels: Pauli and Clifford Twirling,,1,0,,,,CC BY-SA 4.0 +6256,1,,,5/28/2019 10:11,,4,124,"

Suppose I have registers $|a\rangle^{l}|b\rangle^{l} |c\rangle^{l}$ and want an adder mod $l$ gate between the $a$ and $c$ registers. Let $R$ be the adder mod $l$ gate. So is this the correct notation for an operator $U$ that implements this $$ U=R\otimes I_b^{\otimes l}.$$ But how do I convey that $R$ is between $a$ and $c$ and $I$ is for the register $b$?

+",6070,,26,,5/28/2019 14:10,5/28/2019 17:36,Writing the notation when gates act on non successive registers,,2,0,,,,CC BY-SA 4.0 +6257,2,,6253,5/28/2019 10:13,,5,,"

Note: I'm deliberately leaving a few gaps here. Hopefully I'm saying enough to let you piece te rest together!

+ +

Let's say that you want to implement $V$ on some state +$$ +\sum_{x\in\{0,1\}^n}\alpha_x|x\rangle +$$ +You can fairly easily write down what that state produces. Think about the Hamiltonian $Z^{\otimes n}$. What eigenvalues does it have? $\lambda=\pm 1$. What are the eigenvectors? The computational basis states $|x_1\ldots x_n\rangle$. So, the output of $V$ is +$$ +\sum_{x:\lambda_x=1}\alpha_xe^{i t}|x\rangle+\sum_{x:\lambda_x=-1}\alpha_xe^{-i t}|x\rangle +$$ +Hence, can you use your function $f$ to determine which eigenvalue a particular $x$ has? How do you then use tha to apply the correct phase for the evolution? Don't forget that if you use an ancilla qubit, you must undo any entanglement you may have created with it.

+",1837,,,,,5/28/2019 10:13,,,,2,,,,CC BY-SA 4.0 +6258,2,,6256,5/28/2019 11:48,,3,,"

As always with notation there is not a ""correct"" way of doing things: it's just arbitrary conventions.

+ +

The most readable notation I see for your example involves separating the unitary $R$ into 2 virtual unitary matrices:

+ +
    +
  • $R_a$ the portion that acts on $\vert a \rangle^l$.
  • +
  • $R_c$ the portion that acts on $\vert c \rangle^l$.
  • +
+ +

and ""defining"" $R$ as +$$ +R = R_a \otimes R_c. +$$

+ +
+

I called the matrices $R_a$ and $R_c$ ""virtual unitaries because it is likely that they do not exist: the decomposition $R = R_a \otimes R_c$ will probably be impossible to compute because the matrix $R$ cannot be split as 2 separate transformations on $\vert a \rangle^l$ and $\vert c \rangle^l$.

+
+ +

Warning with this kind of non-standard notation: as the matrices involved are not really matrices (they are introduced just for the notation and might not exist), it may add more complexity/confusion than it helps.

+ +

In the end, your operation on $\vert a \rangle^l\vert b \rangle^l\vert c \rangle^l$ may be written as +$$ +U = R_a \otimes I \otimes R_c. +$$

+",1386,,1386,,5/28/2019 17:36,5/28/2019 17:36,,,,0,,,,CC BY-SA 4.0 +6259,2,,5128,5/28/2019 15:50,,2,,"

You can still use the get_counts() function:

+ +
result = job_exp.result()
+result.get_counts(arg)
+
+ +

The key here is that that function takes different arguments: simply an integer representing the index of the circuit on the Circuits list, the circuit object itself, and the circuit.name attribute (I think). You can check this on the documentation.

+ +

So even if you have the same circuit several times in the the Circuits list, you can still correctly identify each circuit by using the index referring to its position on the said list.

+ +

This goes a bit late, but might still be useful for someone.

+",201,,,,,5/28/2019 15:50,,,,0,,,,CC BY-SA 4.0 +6260,2,,6256,5/28/2019 15:52,,4,,"

Personally, I would just define $R_{ac}$ to be the unitary that acts $R$ between registers $a$ and $c$, and acts as identity everywhere else.

+",1837,,,,,5/28/2019 15:52,,,,0,,,,CC BY-SA 4.0 +6261,1,6264,,5/28/2019 16:42,,2,181,"

I am trying to get a better understanding of what is the idea behind quantum contextuality. Quoting from the wikipedia page (emphasis mine):

+ +
+

Quantum contextuality is a foundational concept in quantum mechanics stating that the outcome one observes in a measurement is dependent upon what other measurements one is trying to make. More formally, the measurement result of a quantum observable is dependent upon which other commuting observables are within the same measurement set.

+
+ +

I am a bit confused by the phrasing here. If I have two commuting observables, $[A,B]=0$, that means that they do not interfere with one another, or, quoting from the relevant Wikipedia page, that ""the measurement of one observable has no effect on the result of measuring another observable in the set"".

+ +

Is this just bad phrasing (or a typo) on Wikipedia's side, or am I missing something?

+",55,,55,,1/20/2020 16:56,1/20/2020 16:56,How does quantum contextuality relate to mutually commuting observables?,,1,2,,,,CC BY-SA 4.0 +6262,1,6288,,5/28/2019 18:27,,6,409,"

I was researching how optical quantum computers work and discovered a KLM protocol that allows for building quantum gates using linear optics elements like mirrors, beam splitters, and phase shifters. However, I was wondering how would we get the same functionality as with superconducting QCs. +With superconducting QCs, we have Josephson Junctions - JJs. Those JJs are being interacted with differently so they form a specific gate when that gate operation is needed.

+ +

Besides optical JJ, what would be the optical equivalent to Josephson Junction that we could apply quantum gates to? What are the QCs like the ones from Xanadu running on when it comes to physical qubit implementation?

+",7375,,26,,5/29/2019 2:15,5/30/2019 21:15,Physical qubit of optical quantum computer,,1,0,,,,CC BY-SA 4.0 +6263,1,6265,,5/28/2019 18:51,,3,110,"

Following this answer by @DaftWullie, I give what I think of different cases of the CC-NOT gate:

+ +
    +
  1. $I\otimes I\otimes I+ P_0\otimes P_0\otimes(U-I)$ is the CC-NOT operator when the first two controls are $0$.

  2. +
  3. $I\otimes I\otimes I+ P_0\otimes P_1\otimes(U-I)$ is the CC-NOT operator when the first control is $0$ and second is $1$.

  4. +
  5. $I\otimes I\otimes I+ P_1\otimes P_0\otimes(U-I)$ is the CC-NOT operator when the first control is $1$ and second is $0$.
  6. +
  7. $I\otimes I\otimes I+ P_1\otimes P_1\otimes(U-I)$ is the CC-NOT operator when both controls are $1$.
  8. +
+ +

What I understood from these cases is the following:

+ +

Consider the second case of $I\otimes I\otimes I+ P_0\otimes P_1\otimes(U-I)$. The first part of this operator does not check states of the first and second qubit i.e whether they are $00,01,10,11$ and operates the identity on the third qubit, which it did have to do when the states were $00,10,11$, but because of the Identity operated when the controls were $01$ is not what was intended so we add the extra part with projection operators $P_0$ and $P_1$ with the target qubit being acted by $(U-I)$ to negate the effect produced when we did not check the states and acted on the third qubit with the identity operator. I have similar arguments for the rest of the cases. Are they correct?

+ +

Here, $U$ is the unitary transform that I want to implement on the third register controlled by the first two, that is, the $X$ gate. +$P_0$ and $P_1$ are the projection operators onto $|0\rangle$ and $|1\rangle$.

+",6070,,55,,5/29/2019 8:47,5/29/2019 8:47,Are these notations for the CCNOT gate with different controls correct?,,1,0,,,,CC BY-SA 4.0 +6264,2,,6261,5/28/2019 19:45,,3,,"
+

Is this just bad phrasing (or a typo) on Wikipedia's side, or am I missing something?

+
+ +

It does sound like bad phrasing. The idea here is that our set of observables is not necessarily mutually (pairwise) commuting. If you have three observables $A$, $B$ and $C$, and $[A,B]=0$ and $[B,C]=0$, then you're right that the measurement of $A$ will have no effect on $B$ and the measurement of $B$ will have no effect on the measurement of $C$. But the measurement statistics of $B$ will still be context-dependent if you have a two observable set i.e. it'll depend on whether you have $A$ or $C$ in your set.

+ +

Now if you have all three, then there's some uncertainty in the joint measurement statistics. In other words, given well-defined marginal distributions $P(a,b|A,B)$ and $P(b,c|B,C)$, you cannot have a well-defined joint probability distribution $P(a,b,c|A,B,C)$ in this case (although interestingly, the uncertainty can be lower bounded in many cases).

+ +

There are some nice lectures on this topic:

+ + +",26,,26,,5/28/2019 20:03,5/28/2019 20:03,,,,2,,,,CC BY-SA 4.0 +6265,2,,6263,5/28/2019 20:42,,4,,"

Yes.

+ +

Both $I \otimes I \otimes I + P_0 \otimes P_1 \otimes (U-I)$ etc and the various CC-NOT are linear so in order to check equality of the operators, you only need to check on a basis. That is what you have done with the computational basis.

+",434,,,,,5/28/2019 20:42,,,,0,,,,CC BY-SA 4.0 +6266,1,,,5/28/2019 21:33,,2,82,"

Suppose I have the state $\frac{1}{2^l/2}\sum_{i=0}^{2^l-1}|0\rangle^{\otimes q}\otimes |i\rangle^{\otimes}|0\rangle_i^{\otimes l}$.

+ +

I perform some unitary transformation between the registers $|i\rangle^{\otimes}$ and $|0\rangle_i^{\otimes l} $.

+ +

That unitary operation is just the permutation, i.e. for each $|i\rangle^{\otimes l}|$ $0\rangle_i^{\otimes l}$ stores the permutation of $ |i\rangle^{\otimes l} $. Originally each $|0\rangle^{\otimes q}$ corresponded to each $ |i\rangle^{\otimes}$.

+ +

But now I want that $|0\rangle^{\otimes q}$ be associated to the permuted value stored in $ |0\rangle_i^{\otimes l}$ correspinding to $|i\rangle^{\otimes l}$.

+ +

For example initially I have the pairs $(5,0), (10,1), (45,2), (59,3)$ + Now I perform the permutation on the second coordinate to obtain $0\to 1$, $1\to 3$, $2\to 0$, $ 3 \to 2$. So now I want pairs to be $ (5,1), (10,3), (45,0), (59,2)$.

+ +

How can this be obtained? Can someone help me out?

+ +

Edit: I give what i think of the solution. Consider an example of $4$ states as ignore the normalizing factor. $$|A\rangle= |5\rangle |0\rangle|0\rangle+|10\rangle |1\rangle|0\rangle+|45\rangle |2\rangle|0\rangle+|59\rangle |3\rangle|0\rangle$$ Now i apply the permutation on the second register to store the result in the third register to get +$$|B\rangle= |5\rangle |0\rangle|1\rangle+|10\rangle |1\rangle|3\rangle+|45\rangle |2\rangle|0\rangle+|59\rangle |3\rangle|2\rangle$$ Now i swap the second and third qubits to get $$|C\rangle= |5\rangle |1\rangle|0\rangle+|10\rangle |3\rangle|1\rangle+|45\rangle |0\rangle|2\rangle+|59\rangle |2\rangle|3\rangle$$ Now since the third register is just the Hadamard on $2$ qubits, so i apply Hadamard on the third register of state $|C\rangle$ to get $$|D\rangle= |5\rangle |1\rangle|0\rangle+|10\rangle |3\rangle|0\rangle+|45\rangle |0\rangle|0\rangle+|59\rangle |2\rangle|0\rangle$$ Is this reasoning correct?

+",6070,,6070,,5/29/2019 15:26,5/29/2019 15:26,Quantum operation involving permutation,,0,1,,,,CC BY-SA 4.0 +6268,1,6270,,5/29/2019 4:38,,2,321,"

What happens when an operator is applied only to some bits of a mixed state? +For instance, assume $\vert x\rangle\vert f(x)\rangle$ is entangled. Then what is the result of $\vert Ux\rangle\vert f(x)\rangle$ (how to compute the amplitudes) ? +What if U is Grover's diffusion? Will it still work (without uncomputing $f(x)$) ?

+ +

Update $y$ replaced with $f(x)$

+",7607,,7607,,5/29/2019 9:13,5/29/2019 9:13,What happens when an operator is applied only to some bits of a mixed state?,,2,0,,,,CC BY-SA 4.0 +6269,2,,6268,5/29/2019 6:35,,3,,"

$\newcommand{\ket}[1]{|#1\rangle}\ket{x}\ket{y}$ is a pure state, not mixed, and is a product state, which is not entangled by definition, so your example is rather confusing.

+ +

To answer the question in your first sentence, applying a unitary operator $U_A$ to one subsystem of a bipartite system is equivalent to applying the operator $U_A\otimes\mathbb{1}_B$ to the whole system, where $\mathbb{1}_B$ is the identity for subsystem $B$, so you can treat $U_A\otimes\mathbb{1}_B$ as one big unitary and apply it how you normally would. If you have a pure state $\ket\psi = \sum_i \psi_i \ket{i}_A \otimes \ket{i}_B$, this means that applying such unitary gives $\sum_i \psi_i (U_A \ket{i}_A) \otimes \ket{i}_B$, and analogously for a mixed state.

+",7495,,,,,5/29/2019 6:35,,,,1,,,,CC BY-SA 4.0 +6270,2,,6268,5/29/2019 7:03,,3,,"

$|x\rangle|y\rangle = |x\rangle\otimes |y\rangle$ is the notation for disentangled state. Entangled state can't be written this way. In general, every pure state (entangled or disentangled) on a bipartite system is a linear combination of disentangled states +$$ +|\phi\rangle_{AB} = \sum_i \alpha_i |x_i\rangle_A\otimes|y_i\rangle_B +$$

+ +

Application of $U$ on the first subsystem is equivalent to application of $U \otimes I$ on the whole system. The result will be +$$ +(U\otimes I) |\phi\rangle_{AB} = \sum_i \alpha_i U|x_i\rangle_A\otimes|y_i\rangle_B +$$ +Mixed state is a different thing (do not confuse it with entangled state). Mixed state can be seen as probability distribution over pure states: $\{\{p_i,|\phi_i\rangle\}\}, p_i>0, \sum_ip_i=1$. It has the corresponding density matrix $\rho=\sum_ip_i|\phi_i\rangle\langle\phi_i|$. Note that every $|\phi_i\rangle$ can be entangled.
+The result of application of $U$ on the first subsystem of a mixed state is the probability distribution $\{\{p_i,(U\otimes I)|\phi_i\rangle\}\}$, or, in terms of density matrices, $(U\otimes I) \rho (U^\dagger\otimes I)$.

+",5870,,5870,,5/29/2019 7:29,5/29/2019 7:29,,,,2,,,,CC BY-SA 4.0 +6271,1,6272,,5/29/2019 12:17,,2,238,"

So I always had this idea in my mind that unitary evolution in quantum mechanics conserves information (or in other words von Neumann entropy) because unitary evolution preserves the trace. But this cannot be true because general evolution with a superoperator ($\$\rho \rightarrow \rho'$) of a mixed state does not preserve information and is also trace preserving!

+ +

So what property of unitary evolution preserves the von Neumann entropy? As it is defined as $S = -tr(\rho \log \rho)$ and we can always bring this in diagonal form $S= -\sum_i \lambda_i \log \lambda_i$, I would expect unitary evolution to preserve the eigenvalues? But I don't find any thing related to this online... Does unitarity imply that ""eigenvalues"" are conserved or what property makes sure that the entropy is conserved?

+",6276,,10480,,3/20/2021 6:10,3/20/2021 6:10,What property ensures that von Neumann entropy is conserved?,,1,0,,,,CC BY-SA 4.0 +6272,2,,6271,5/29/2019 13:11,,2,,"

Yes, unitarity preserves eigenvalues. This is because the definition of eigenvalues is that any Hermitian matrix $H$ can be brought into diagonal form by a unitary $V$, +$$ +VHV^\dagger=D, +$$ +and the diagonal elements of $D$ are the eigenvalues. So, now consider $UHU^\dagger$. This can be diagonalised by a unitary $VU^\dagger$ into the same matrix $D$: +$$ +(VU^\dagger)UHU^\dagger(VU^\dagger)^\dagger=VU^\dagger UHU^\dagger UV^\dagger=VHV^\dagger=D. +$$ +Hence the eigenvalues are the same, and the von Neumann entropy is the same.

+ +

Having a constrant trace is a necessary condition for preserving the eigenvalues, but is not sufficient - it only ensures that $\sum_i\lambda_i$ is constant.

+",1837,,,,,5/29/2019 13:11,,,,0,,,,CC BY-SA 4.0 +6273,2,,6235,5/29/2019 14:57,,4,,"

For experiments run on the simulator, ibmq_qasm_simulator, no credits are used. For all real devices available, running any experiment uses credits. The different amount of credits used depends on the amount of shots requested. Currently, there are only 4 options for amount of shots when running a circuit in the composer in the new IBM Q Experience beta. You can choose between 1, 1024, 4096, or 8192 shots. I believe if you choose 1 or 1024, it will require 3 credits. If you choose 4096 or 8192, it will require 5 credits.

+ +

I do not believe there is any indication on the beta as to how many credits you have/have used. You can view credits used on specific jobs by going to their respective results page, though.

+ +

The platform is still in beta, so these are features that can be added in the future as well.

+ +

Also, credits refresh upon the greater of the following: 24 hours or until your most recent job execution has completed.

+",6180,,,,,5/29/2019 14:57,,,,0,,,,CC BY-SA 4.0 +6274,1,6275,,5/29/2019 17:38,,2,705,"

How can one construct a CCY gate using gates which are native to Qiskit (CCX and single qubit gates). I was able to find the answer for CCZ gates, however guessing and testing until I can figure out CCY seems like a bad way to go.

+",7609,,7609,,6/5/2019 18:11,6/5/2019 18:11,How to construct a CCY gate in Qiskit,,1,1,,,,CC BY-SA 4.0 +6275,2,,6274,5/29/2019 17:53,,5,,"

For $\mathrm{CC} Y$, given that you have a decomposition for $\mathrm{CC} Z$ (or for $\textrm{CC} X = \mathrm{Toffoli}$), all you need is the relationship between $ X$, $Y$, and $Z$: +$$ Y = R_z (-\tfrac\pi2) X R_z (\tfrac\pi2) = R_x (\tfrac\pi2) Z R_x(-\tfrac\pi2) $$ +Then, given $Y = U P U^\dagger$ for some $P$ for which you know a decomposition for $\mathrm{CC} P$, simply do the analogous decomposition: +$$ \mathrm{CC}Y = (\mathbf 1 \otimes \mathbf 1 \otimes U) \mathrm{CC} P (\mathbf 1 \otimes \mathbf 1 \otimes U)^\dagger. $$ +You can do this for any self-inverse unitary $V$ in place of $Y$ as well.

+",124,,,,,5/29/2019 17:53,,,,0,,,,CC BY-SA 4.0 +6276,1,6278,,5/29/2019 18:22,,3,275,"

So this is about something from Preskill's notes on Quantum Computation and Information, Chapter 4, page 3.

+ +

Imagine we have a maximally entangled state (Bell state). We can identify the Bell state by measuring the phase and parity bit with the commuting operators

+ +

$$\sigma_1^A \otimes \sigma_1^B \\ +\sigma_3^A \otimes \sigma_3^B$$

+ +

Now they want to show that you cannot do this locally, so when Alice and Bob both are spacelike separated and can only do measurements on their own qubit A and B.

+ +

Following Preskill, they can start by measuring $\sigma_3^A$ and $ \sigma_3^B$ each on their own, and because this commutes with $\sigma_3^A \otimes \sigma_3^B$, this does not disturb the parity bit. So they prepared a simultaneous eigenstate of $\sigma_3^A$ and $ \sigma_3^B$. These eigenstates do not commute with $ \sigma_1^A \otimes \sigma_1^B$ so they disturbed the phase bit so they cannot measure it. Conclusion: they cannot read the information that is in the entanglement.

+ +

But my real question now is: why do the first two observables $ \sigma_1^A \otimes \sigma_1^B$ and $ +\sigma_3^A \otimes \sigma_3^B$ commute, when $\sigma_3^A$ and $ \sigma_3^B$ will not commute with $ \sigma_1^A \otimes \sigma_1^B$. Because in my opinion, we can write the effect of the measurement of Alice and Bob on the state as;

+ +

$$\sigma_3^A \otimes I^B \\ +I^A \otimes \sigma_3^B$$

+ +

which, when measured after each other will have the effect on $|\psi\rangle$:

+ +

$$(\sigma_3^A \otimes I^B) +(I^A \otimes \sigma_3^B) |\psi\rangle = \sigma_3^A \otimes \sigma_3^B |\psi\rangle$$

+ +

which is the original measurement that can be done when both qubits are at the same place? So what is the difference, why is this not the same eigenstate? I must be missing something, but I don't see where I make an error. Can someone please explain.

+",6276,,55,,7/3/2021 13:30,7/3/2021 13:30,Simultaneous eigenstate of commuting observables and their tensor product,,1,9,,,,CC BY-SA 4.0 +6277,2,,3786,5/29/2019 18:34,,3,,"

@DrHamed : you could have done this.

+ +
from sklearn import datasets
+
+ +

A lot of datasets are available in that import. https://scikit-learn.org/stable/datasets/index.html

+",7344,,,,,5/29/2019 18:34,,,,0,,,,CC BY-SA 4.0 +6278,2,,6276,5/29/2019 21:42,,4,,"
    +
  1. Measuring an observable does not mean applying the observable operator to a quantum state but rather measuring the state in the eigenbasis of the operator. A measurement will basically produce an eigenvalue of that observable operator and the system will collapse to a subspace corresponding to all states having that eigenvalue. For example, if you're measuring in the $\sigma_1$ basis, then you'll get either $+1$ corresponding to the eigenstate $|+\rangle$ or $-1$ corresponding to the eigenstate $|-\rangle$. Similarly, if you measure in the $\sigma_3$ basis then you'll either get $+1$ corresponding to the eigenstate $|0\rangle$ or $-1$ corresponding to the eigenstate $|1\rangle$.

  2. +
  3. The fact that $\sigma_3^A$ and $\sigma_3^B$ do not commute with $\sigma_1^A\otimes \sigma_1^B$ is a purely mathematical artefact and it's easy to prove along these lines. There's also a technical mistake in your sentence: ""These eigenstates do not commute with $\sigma_1^A\otimes \sigma_1^B$ so they disturbed the phase bit so they cannot measure it.""; it's meaningless to say that a state doesn't commute with an operator — commutators are only defined for operators.

  4. +
+",26,,26,,5/29/2019 22:56,5/29/2019 22:56,,,,0,,,,CC BY-SA 4.0 +6279,1,,,5/30/2019 4:14,,1,127,"

I'm working on QSVM to know the difference between SVM and QSVM. How much better quantum machine learning can do when compared to classical machine learning algorithms?

+ +

Part of my code:

+ +
backend = BasicAer.get_backend('qasm_simulator', hub=None)
+quantum_instance = QuantumInstance(backend, shots=1024, seed=seed, 
+                                     seed_transpiler=seed)
+result = qsvm.run(quantum_instance) 
+print(""test accuracy: "", result['testing_accuracy'])
+
+ +

With the above code, I can get the accuracy of the test.

+ +

I'm trying to know whether I can draw a decision boundary and classify results from QSVM just like how classical SVM does.

+ +
print(result.keys())
+
+    dict_keys(['svm', 'kernel_matrix_testing', 'test_success_ratio', 'kernel_matrix_training', 'testing_accuracy'])
+
+print (result['svm'].keys())
+
+    dict_keys(['bias', 'alphas', 'support_vectors', 'yin'])
+
+ +

Given only these are the keys that result has, how can I look at QSVM results into two classes graphically? I could get the prediction results though! +my new_test_data= 2d array to classify between these two classes : good=1/ bad=0

+ +
predictions = qsvm.predict(new_test_data,quantum_instance)
+print(predictions)
+    [1 0 0 0 0 0 0 0 1 1 0 1 1 0 1 0]
+
+ +

Given I don't see how get decision function and be able to plot decision boundary and margins? Like this as we do in classical SVM:

+ +

+ +

Any help in clarifying how to read the results to plot a graph like this from running QSVM would be much appreciated.

+",7344,,26,,5/30/2019 14:29,5/30/2019 14:29,How to plot decision boundary with support vectors when running quantum SVM algorithm?,,0,0,,,,CC BY-SA 4.0 +6281,1,,,5/30/2019 4:41,,5,152,"

The Pauli Z gate inverts the phase of $\lvert1\rangle $ while leaving $\lvert0\rangle$ unaffected.

+ +

When I think about how $\lvert1\rangle $ and $\lvert0\rangle$ are physically realized, however, as in the Physical Implementations section here, there tends to be a physical symmetry between the physical realizations of the two.

+ +

It would seem, then, that a Z gate would need to be realized as some experiment which selectively delays the tuning of only spin-up electrons or nuclei, for example. Given the physical symmetry I expect between physical realizations of $\lvert1\rangle$ and $\lvert0\rangle$, this seems counterintuitive.

+ +

Is the fact that a physical $\lvert0\rangle$ cannot have phase delay, and a physical $\lvert1\rangle$ can, a matter of convention? If not, why can't I describe a single $\lvert0\rangle$ in a multi-qubit system as phase delayed relative to the others? E.g., $(I \otimes Z)\lvert10\rangle$ seems to be a perfectly reasonable experiment that delays my right qubit relative to my left, why is only the converse experiment allowed?

+ +

Is it, in fact, the case that the $Z$ gate is implemented as an experiment that only affects, e.g., spin-up nuclei but not spin-down nuclei? As background, I'd find an overview of how phase is physically implemented very helpful.

+",7610,,26,,5/30/2019 14:34,2/24/2020 20:02,How do physical implementations of Z gate selectively affect $\lvert1\rangle $ basis vector?,,1,0,,,,CC BY-SA 4.0 +6282,2,,6108,5/30/2019 7:02,,1,,"

Numerators and denominators of convergents of continued fractions are always co-prime. If $s$ and $r$ have a common factor, the $r'$ returned by the continued fractions algorithm would be a factor of $r$.
+For example, $r=60$, provided the phase estimation step gives a good approximate to $40/60$ (i.e. $s=40$), you'll get $2/3$ as a convergent. Performing the phase estimation again might give you a good approximate to $21/60$ (i.e. $s=21$), and you'll get $7/20$ as a convergent. $lcm(3,20)=60$ will give you the correct $r$.
+Although doing phase estimation-CF twice doesn't guarantee the correctness of resultant $r$ (e.g. if we got $40/60=2/3$ and $28/60=7/15$ in our two attempts, $lcm(3,15)=15$ does not give us the correct $r$), some number theoretic theorem guarantees that we succeed with probability at least $1/4$ (see the last remark on the last page of Prof Jozsa's Part II QI&C Notes).
+(P.S. I'll update my answer with the aforementioned theorem of number theory when I find it)

+",7460,,,,,5/30/2019 7:02,,,,0,,,,CC BY-SA 4.0 +6283,1,6299,,5/30/2019 9:33,,8,167,"

I'm having trouble accepting, intuitively, that $-\rvert1\rangle \otimes \rvert1\rangle = -\rvert11\rangle = \rvert1\rangle \otimes -\rvert1\rangle$.

+ +

It's my understanding that $ -\rvert1\rangle$ is just $\rvert1\rangle $ but time or space delayed in phase, where what ""phase"" means here depends on the hardware realization.

+ +

But $-\rvert1\rangle \otimes \rvert1\rangle = -\rvert11\rangle $ suggests that, if I take 2 independent systems, with the first completely out-of-phase relative to the second because (by, e.g., a Z gate), and I look at these two systems together, the composite system is completely out of phase with $\rvert11\rangle $ Somehow, I delayed one qubit, looked at it together with others, and suddenly all N of them are delayed.

+ +

All the more, if I have $\rvert111\rangle$, phase delay the first qubit with a Z gate, I get $-\rvert1\rangle \otimes \rvert11\rangle$, but now I can reassign this phase delay to any qubit and say I have $\rvert11\rangle \otimes -\rvert1\rangle$ . I.e., it's like saying qubits A-B are in phase together and collectively out of phase with qubit C, but that's the same as qubits B-C are in-phase and collectively out of phase with qubit A. This is a transitivity-violation contradiction of what we expect from equality!

+ +

My picture of phase is electrons precessing, or some other periodic process where physical objects corresponding to qubits are time delayed with definite time to each other. In this picture, phase can't be reassigned as will in the seeming contradiction I mentioned above. Is this picture incorrect?

+",7610,,26,,5/30/2019 14:35,6/1/2019 15:09,How to interpret $-\rvert1\rangle \otimes \rvert1\rangle = -\rvert11\rangle$?,,2,1,,,,CC BY-SA 4.0 +6284,2,,6283,5/30/2019 11:08,,-1,,"

Maybe this is a suboptimal answer, which doesn't fully answer your question, but maybe it helps you understant why the global phase doesn't matter from a computational point of view (actually, it does matter from a physical point of view). In quantum computing, we manipulate states in the Hilbert space, represented by the Bloch sphere. And this sphere is not sensitive to global phases, i.e. phases multiplying by whole state. This is surely better explained here.

+ +

As for the visualization of that global phase introduced, picture the case of one qubit in the block sphere, in the |1> state. A Z gate introduces a rotation over the Z axis, but in this case, the state is already fully projected over the Z axis, so no effect is noticeable (it would be like the state vector rotating over itself, which doesn't change the position in the Bloch sphere).

+ +

Something similar would happen for a 2 qubit system, except it is harder to visualize because it is high-dimensional.

+ +

As referred in the link I shared, this doesn't mean that the global phase doesn't have physical meaning. It does. But that physical meaning isn't captured by the Hilbert space formalism ($C^2$ for a single qubit), on which quantum computation relies. To detect a global phase you would have to look at the $C^3$ formalism, I think.

+ +

Disclaimer: I work in quantum computing, and my advanced quantum physics knowledge is not as good as before...

+",201,,,,,5/30/2019 11:08,,,,1,,,,CC BY-SA 4.0 +6286,2,,6281,5/30/2019 18:55,,1,,"

You're exactly right about the physical symmetry of $|0\rangle$ and $|1\rangle$. If I handed you a spin-1/2 particle in complete vacuum, the question of whether its in $|0\rangle$ or $|1\rangle$ is meaningless without a preferred coordinate system. So there needs to be some physically preferred direction to even set up computation.

+ +

Now say I have the ability to turn on an external magnetic field $\vec{B}$. When its turned on, its direction automatically sets a preferred coordinate system, and $|0\rangle$ and $|1\rangle$ are now defined as alignments of spins parallel or antiparallel to the field. Physically, this is because a spin-1/2 particle with some dipole moment $\vec{\mu}$ interacts with the field $\vec{B}$ according to the Hamiltonian

+ +

$$ +H = - \vec{\mu} \cdot \vec{B} +$$

+ +

which really just tells us how much energy our particles will have in the external field. Then, we'll choose a convention that $|0\rangle$ is the low-energy state (say $E_0=0$ for simplicity) and we're ready to compute!

+ +

In this case a Z-gate would just be flipping on the external field for some known time $\tau$, which corresponds to a time-evolution of $e^{-i H \tau/\hbar}$. This has the effect:

+ +

\begin{align} +|0\rangle &\rightarrow |0\rangle \\ +|1\rangle &\rightarrow -|1\rangle +\end{align}

+ +

Not only does this describe spin qubits, but also simple superconducting qubits like charge qubits. Charge qubits were originally called ""Cooper Pair Box"" because they work by trapping a cooper pair (of charge $2e$) on a superconducting island separated from the grounded material by some distance. In a toy geometry, we'll say this distance is $x$, so that the trapped CP creates an electric dipole $|\vec{d}| = 2ex$. Now just add an external field to interact with this dipole and you're ready to apply quantum gates.

+",1939,,,,,5/30/2019 18:55,,,,0,,,,CC BY-SA 4.0 +6287,1,,,5/30/2019 19:45,,4,87,"

Say I have an algorithm over N qubits and I want to find the expectation value of an operator $O$ composed of a sum of mterms, each of which is the tensor product of some number of single-qubit Pauli operators:

+ +

$$ + O = \sum_{i=1}^m \alpha_i \prod_{j=1}^N \sigma_{\beta(i,j)}^{(j)} +$$

+ +

where $\beta(i,j) \in \{{0,1,2,3}\}$ determines the identity of the j-th Pauli operator in the i-th product in the sum ($\sigma_0 \equiv I$, $\sigma_1 \equiv X$, ...) and $\sigma^{(j)}$ denotes a Pauli operator acting on the j-th qubit. The goal is to determine the following:

+ +
    +
  1. What is the minimum number of circuit experiments needed to completely evaluate $\langle O \rangle$ (a ""circuit experiment"" means as many measurements as I want for a given configuration of measurement bases over all N qubits)
  2. +
  3. How do I find the elements of the maximally reduced set of measurement bases that accomplish (1).
  4. +
+ +

Example a: +$$ +O = Z_1 + Z_2 + Z_3 + Z_1 Z_2 +$$

+ +
    +
  1. The minimum number of experiments is 1.

  2. +
  3. The maximally reduced set of measurement operators is $\{Z_1 Z_2 Z_3\}$, which corresponds to measuring all three qubits in the Z-basis. From outcomes of these measurement bases, I can separately compute $\langle Z_1 \rangle $, $\langle Z_2 \rangle $, $\langle Z_3 \rangle $, and $\langle Z_1 Z_2 \rangle $ and then add the results to find $\langle O \rangle$. In general, I'm allowed to combine terms that have identical Pauli products on their overlapping subspace.

  4. +
+ +

Example b: +$$ +O = X_1 Y_2 + Y_1 X_2 + X_1 X_2 + Y_1 Y_2 +$$

+ +
    +
  1. The minimum number of experiments is 4.
  2. +
  3. The maximally reduced set is $\{ X_1 Y_2 , Y_1 X_2 , X_1 X_2 , Y_1 Y_2\}$. Even though in the course of measuring $\langle X_1 Y_2 \rangle$ and $\langle Y_1 X_2\rangle$ I measured both qubits in both bases, I cannot reuse the results from those measurements to determine $\langle X_1 X_2 \rangle$ because I lose any information about classical correlations in the outcomes of $X_1$ and $X_2$ (i.e. entanglement) if I try to combine their outcomes taken in two separate experiments.
  4. +
+ +

So, given an arbitrary $O$ how do I find the minimum number of experiments and the corresponding maximally reduced set of measurements

+",1939,,26,,5/30/2019 19:47,5/30/2019 19:47,How to determine the minimum number of experiments needed to compute m-many k-local Pauli expectations?,,0,8,,,,CC BY-SA 4.0 +6288,2,,6262,5/30/2019 21:15,,6,,"

At Xanadu, we're using integrated quantum photonics to build our photonic quantum computing chips. In this case, we have integrated chips containing waveguides --- these are coupled to lasers to generate input resource states, undergo manipulation on the chip, and then are measured via a variety of detectors available in quantum optics. These can include photon number resolvers, homodyne detectors, or even heterodyne detectors.

+ +

One thing to note is that there are several formulations for optical quantum computing:

+ +

Non-universal formulations:

+ + + +

Universal formulations:

+ + + +

At Xanadu, our focus is on the last approach, the continuous-variable formulation. In this approach, we are outside the regime of linear photonics, and actually include non-linear quantum photonic operations in our basic gate set.

+ +

Finally, we also differ from the KLM protocol in that we do not depend on single photon resource states, which can typically only be produced with a certain probability. Our resource states are instead squeezed states of light, which can be produced deterministically.

+ +

For more details on continuous-variables, the gates we use, and the algorithms available, check out our documentation!

+",371,,,,,5/30/2019 21:15,,,,1,,,,CC BY-SA 4.0 +6289,1,,,5/30/2019 22:16,,4,61,"

Hobbyist quantum programmer here and just getting back into the swing of things by speccing out some fun apps in my head and trying to build them to learn more about the whole ecosystem which is fascinating. I have a reasonable physics background but not the depth that some of the answers here go to.

+ +

I am getting some conflicting information and I suppose the crux of this is my understanding of the difference between observed and measured and what can actually collapse an entangled state Vs what can be understood. I am thinking through an Alice and Bob scenario where they share 2 entangled qubits and go about their separate ways. Alice goes and does something to her qubit (e.g a spin change or something similar). Does Bob know that something happened without making a measurement (which collapses the entanglement) or without Alice calling him to tell him what happened? My question here: Is Bob aware that something has happened? In the sense that he can detect/observe that something has happened but can't figure it out without one of the 2 scenarios above. I'm thinking of this as a pager kind of app, so Bob gets a notification that something has happened and he should call/expect a call from Alice.

+ +

Are there any possible entanglement scenarios where the above is feasible? I have read about weak entanglement, no-communication theorem and several articles on entanglement and measurement/observation. Every second search is giving me conflicting results, some say you can detect something. I'm less concerned about a perfect state being maintained, just that the overall entanglement remains in place.

+",4210,,26,,5/31/2019 0:01,5/31/2019 7:13,Observing that some action has happened in an entanglement scenario,,1,1,,,,CC BY-SA 4.0 +6290,1,,,5/31/2019 1:19,,5,51,"

Assume $f(x)$ is n-bit to n-bit function. Let $F(x)$ be defined as $T$ iterations of $f(x)$, i.e. $F(x) = f^T(x)$.

+ +

Quantum algorithm relies on $F(x)$; it calls it $R$ times. +What is the best query complexity of the algorithm in terms of calls to $f(x)$:

+ +
    +
  1. Can we do better than $R \cdot T$ queries while maintaining negligible quantum memory complexity?

  2. +
  3. Can we do better than $R \cdot T$ queries with additional quantum memory? If so, then how much? Can we do less than $T$?

  4. +
+",7371,,26,,5/31/2019 1:22,5/31/2019 6:57,Best query and memory complexity for iterated function,,1,0,,,,CC BY-SA 4.0 +6291,2,,6290,5/31/2019 6:57,,2,,"

That really depends on the function $f$ and the size of $R\cdot T$. Generically, I don't think that you can expect improvements over $R\cdot T$, but improvements are possible in some special cases.

+ +

For example, with the function $f$, there's a similar question in classical, and there are instances where speedups are possible, such as modular exponentiation: $f(x)=x\text{ mod }N$. There are better ways of calculating $x^a\text{ mod }N$ than just calculating $F^a(x)$, but it's specific to that function.

+ +

If you want really large $R\cdot T$, or non-integer values, there are quantum algorithms based on phase estimation. You want to have a look at this paper.

+",1837,,,,,5/31/2019 6:57,,,,3,,,,CC BY-SA 4.0 +6292,2,,6289,5/31/2019 7:13,,4,,"
+

the difference between observed and measured

+
+ +

Is there a difference? What you observe is what you measure. There are no other observations. (That said, what you know about a state is a combination of what you personally know about what measurements have been performed and their results, and the preparation procedure. Different people can have different knowledge, and hence different descriptions of the state.

+ +
+

I am thinking through an Alice and Bob scenario where they share 2 + entangled qubits and go about their separate ways. Alice goes and does + something to her qubit (e.g a spin change or something similar). Does + Bob know that something happened without making a measurement (which + collapses the entanglement) or without Alice calling him to tell him + what happened?

+
+ +

Bob cannot know anything about what Alice has done without inputs. He has to gain information from somewhere. Think of this transmission of information as messages. Either messages that are sent from measurement apparatus saying ""I got measurement result X"", or messages from Alice saying ""I did Y"". But those messages have to come from somewhere.

+ +

The crucial thing here is actually the message from Alice. Whatever measurements Bob performs on his qubit, he cannot tell what Alice did; his measurement results are consistent with Alice also having done nothing.

+",1837,,,,,5/31/2019 7:13,,,,0,,,,CC BY-SA 4.0 +6293,1,6296,,5/31/2019 15:06,,2,81,"

I have a basic question about the encoding of logical information into physical qubits.

+ +

I only know the 3 qubit code (I have very limited knowledge in QEC).

+ +

The 3 qubit code is usually presented as: we have a data defined on a single qubit, we want to protect it.

+ +

To do it, we encode it on 3 physical qubits :

+ +

$$a|0\rangle + b |1\rangle \rightarrow a|000\rangle + b |111\rangle $$

+ +

And then by using ancillas, we check the parity and we know if a bit flip-occurred (in very short summary).

+ +

My question is:

+ +

In practice when we have a quantum computer, we encode the input in physical qubits (3 in this example), and then if we want to run a quantum algorithm, it will apply unitary on these 3 physical qubits?

+ +

Or is it more: we do everything with the single qubit and then at the end of the algorithm we protect by encoding the result on physical qubits.

+ +

For me, it would make sense that it is the first explanation but I would like to check this, like how and where are implemented Q.E.C in a quantum computer.

+ +
+ +

An example :

+ +

For example imagine that my quantum algorithm is just applying a unitary $U$ on an input $a|0\rangle + b |1\rangle$, would it work as :

+ +
    +
  • I apply $U$ on $a|0\rangle + b |1\rangle$ : $U a|0\rangle + b |1\rangle = c |0\rangle + d |1\rangle $
  • +
  • I encode and protect it with QEC
  • +
+ +

or

+ +
    +
  • I encode : $a|0\rangle + b |1\rangle \rightarrow a|000\rangle + b |111\rangle $
  • +
  • I apply the ""logical equivalent"" $U_L$ to the encoded data : $U_L a|000\rangle + b |111\rangle = c |000\rangle + d |111\rangle $
  • +
+",5008,,26,,5/31/2019 15:11,6/1/2019 5:50,Where (in the algorithm) is the logical qubit encoded in Q.E.C?,,1,0,,,,CC BY-SA 4.0 +6294,2,,4411,5/31/2019 17:52,,2,,"

There is currently no way to check the status of a job in Qiskit Aqua:

+ +

https://github.com/Qiskit/qiskit-aqua/issues/545

+ +

However, it looks like it is a feature that is coming.

+",332,,,,,5/31/2019 17:52,,,,0,,,,CC BY-SA 4.0 +6295,1,,,6/1/2019 3:32,,2,1069,"

I'm trying to run QSVM algorithm in IBMQ experience, want to run in one of those real quantum computers.

+ +
 from qiskit import IBMQ
+ IBMQ.load_accounts()
+ print(""Available backends:"")
+ IBMQ.backends()
+
+ [<IBMQSimulator('ibmq_qasm_simulator') from IBMQ(ibm-q, open, main)>,
+  <IBMQBackend('ibmqx4') from IBMQ(ibm-q, open, main)>,
+  <IBMQBackend('ibmqx2') from IBMQ(ibm-q, open, main)>,
+  <IBMQBackend('ibmq_16_melbourne') from IBMQ(ibm-q, open, main)>,
+  <IBMQSimulator('ibmq_qasm_simulator') from IBMQ()>]
+
+
+backend = BasicAer.get_backend('ibmq_qasm_simulator')
+
+ +

With the BasicAer I realize I'm using IBMQ's simulator and not the actual IBMQ device. if I chose 'ibmq_qasm_simulator', it works!!!

+ +
 device = IBMQ.get_backend('ibmq_16_melbourne') # ibmx4
+ #Choose a real - device
+
+ quantum_instance = QuantumInstance(device, shots=100, seed=seed, 
+                                      seed_transpiler=seed)
+ result = qsvm.run(quantum_instance)
+
+ +

The above code which is supposed to use real Quantum computer ""ibmq_16_melbourne"" throws me a

+ +
---------------------------------------------------------------------------
+KeyError                                  Traceback (most recent call last)
+<ipython-input-19-b7c0ec9bc7c4> in <module>
+  1 
+----> 2 result = qsvm.run(quantum_instance)
+  3 print(""testing success ratio: "", result['testing_accuracy'])
+  4 end = timer()
+  5 print(""timedelta: "" , timedelta(seconds=end-start))
+
+/opt/conda/lib/python3.7/site- 
+ packages/qiskit/aqua/algorithms/quantum_algorithm.py 
+ in run(self, quantum_instance, **kwargs)
+ 62                 quantum_instance.set_config(**kwargs)
+ 63             self._quantum_instance = quantum_instance
+ ---> 64         return self._run()
+ 65 
+ 66     @abstractmethod
+
+/opt/conda/lib/python3.7/site- 
+packages/qiskit/aqua/algorithms/many_sample/qsvm/qsvm.py in _run(self)
+306 
+307     def _run(self):
+--> 308         return self.instance.run()
+309 
+310     @property
+
+/opt/conda/lib/python3.7/site- 
+packages/qiskit/aqua/algorithms/many_sample/qsvm/_qsvm_binary.py in run(self)
+127     def run(self):
+128         """"""Put the train, test, predict together.""""""
+--> 129         self.train(self._qalgo.training_dataset[0], 
+self._qalgo.training_dataset[1])
+130         if self._qalgo.test_dataset is not None:
+131             self.test(self._qalgo.test_dataset[0], 
+self._qalgo.test_dataset[1])
+
+/opt/conda/lib/python3.7/site- 
+packages/qiskit/aqua/algorithms/many_sample/qsvm/_qsvm_binary.py in train(self, 
+data, labels)
+ 71         """"""
+ 72         scaling = 1.0 if self._qalgo.quantum_instance.is_statevector else 
+None
+---> 73         kernel_matrix = self._qalgo.construct_kernel_matrix(data)
+ 74         labels = labels * 2 - 1  # map label from 0 --> -1 and 1 --> 1
+ 75         labels = labels.astype(np.float)
+
+/opt/conda/lib/python3.7/site- 
+packages/qiskit/aqua/algorithms/many_sample/qsvm/qsvm.py in 
+construct_kernel_matrix(self, x1_vec, x2_vec, quantum_instance)
+243                                     
+num_processes=aqua_globals.num_processes)
+244 
+--> 245             results = self.quantum_instance.execute(circuits)
+246 
+247             if logger.isEnabledFor(logging.DEBUG):
+
+/opt/conda/lib/python3.7/site-packages/qiskit/aqua/quantum_instance.py in 
+execute(self, circuits, **kwargs)
+192         qobjs = compile_circuits(circuits, self._backend, 
+self._backend_config, self._compile_config, self._run_config,
+193                                  
+show_circuit_summary=self._circuit_summary, circuit_cache=self._circuit_cache,
+--> 194                                  **kwargs)
+195 
+196         if self._measurement_error_mitigation_cls is not None:
+
+/opt/conda/lib/python3.7/site-packages/qiskit/aqua/utils/run_circuits.py in 
+compile_circuits(circuits, backend, backend_config, compile_config, run_config, 
+show_circuit_summary, circuit_cache, **kwargs)
+195                     transpiled_sub_circuits = 
+compiler.transpile(sub_circuits, backend, **backend_config,
+196                                                                  
+**compile_config)
+--> 197                     qobj = 
+circuit_cache.load_qobj_from_cache(transpiled_sub_circuits, i, 
+run_config=run_config)
+198                 else:
+199                     qobj = circuit_cache.load_qobj_from_cache(sub_circuits, 
+i, run_config=run_config)
+
+/opt/conda/lib/python3.7/site-packages/qiskit/aqua/utils/circuit_cache.py in 
+load_qobj_from_cache(self, circuits, chunk, run_config)
+178                 if not hasattr(compiled_gate, 'params') or 
+len(compiled_gate.params) < 1: continue
+179                 if compiled_gate.name == 'snapshot': continue
+--> 180                 cache_index = self.mappings[chunk][circ_num][gate_num]
+181                 (uncompiled_gate, regs, _) = raw_gates[cache_index]
+182 
+
+KeyError: 0
+
+ +

This is my qiskit version via pip: qiskit 0.10.1 +qiskit-aer 0.2.0 +qiskit-aqua 0.5.0 +qiskit-chemistry 0.5.0 +qiskit-ibmq-provider 0.2.2 +qiskit-ignis 0.1.1 +qiskit-terra 0.8.0

+",7344,,7344,,6/2/2019 7:35,6/2/2019 7:35,How to run quantum SVM algorithm from Qiskit in real IBM Quantum Computer using IBMQ?,,0,7,,,,CC BY-SA 4.0 +6296,2,,6293,6/1/2019 5:50,,2,,"

The whole point of encoding in an error correcting code is to protect against errors. You only get that protection while encoded. So you want to apply any unitaries on the encoded state.

+",1837,,,,,6/1/2019 5:50,,,,2,,,,CC BY-SA 4.0 +6297,1,,,6/1/2019 6:46,,2,64,"

I have $n$ states in superposition $|A\rangle=\dfrac{1}{2^{l/2}}\sum_{i=0}^{2^l-1}\sum_{j=0}^{2^l-1}|0\rangle^{\otimes q}|i\rangle^{\otimes l}|j\rangle^{\otimes l}$. Now I have to apply the transform in batches of $4$ i.e for example Let $l=2$, then $$A= \dfrac{1}{2^{2/2}}\left( |0\rangle^{\otimes q}|00\rangle|00\rangle+ |0\rangle^{\otimes q}|00\rangle|01\rangle+|0\rangle^{\otimes q}|00\rangle|10\rangle+|0\rangle^{\otimes q}|00\rangle|11\rangle+|0\rangle^{\otimes q}|01\rangle|00\rangle+|0\rangle^{\otimes q}|01\rangle|01\rangle+|0\rangle^{\otimes q}|01\rangle|10\rangle+|0\rangle^{\otimes q}|01\rangle|11\rangle+|0\rangle^{\otimes q}|10\rangle|00\rangle+|0\rangle^{\otimes q}|10\rangle|01\rangle+|0\rangle^{\otimes q}|10\rangle|10\rangle+|0\rangle^{\otimes q}|10\rangle|11\rangle+|0\rangle^{\otimes q}|11\rangle|00\rangle+|0\rangle^{\otimes q}|11\rangle|01\rangle+|0\rangle^{\otimes q}|11\rangle|10\rangle+|0\rangle^{\otimes q}|11\rangle|11\rangle\right)$$Now as there are $16$ states in superposition here, I need to apply a unitary transform to $4$ states at at a time i.e the first $4$, then the second $4$ , then the third $4$ , then the last $4$. The transform that I apply every time on the four states is on the first register $0\rangle^{\otimes q}$ of each state. The unitary transform between these states is $P$. How would the tensorial notation of this state look like is my question? How do I give the right notation that the operator acts on $4$ states and then the next four is my doubt.

+",6070,,26,,6/1/2019 9:58,7/10/2019 5:02,Quantum operation in blocks,,1,3,,,,CC BY-SA 4.0 +6299,2,,6283,6/1/2019 14:14,,5,,"

First of all note that, strictly speaking, quantum states are defined up to multiplication by complex scalars (that is, they are elements of the associated projective space $\mathbb{CP}^n$). +This means that it is not true that ""$-\lvert1\rangle$ is just $\lvert1\rangle$ but time or space delayed in time"". The vectors $-\lvert1\rangle$ and $\lvert1\rangle$ are simply two different ways to write the same exact physical state.

+ +

Regardless, that is not the correct way to describe the sort of physical scenario you seem to be having in mind. If a particle is freely propagating in space, its state will change, and you can describe this change as an accumulating phase factor. Note that this is a phase factor between the different spatial modes occupied by the particle. In other words, you have a state with two possible degrees of freedom (say, position one and position two), and you accumulate a phase factor between them.

+ +

However, if you consider two particles, the situation is a bit different. If particle $1$ is in position/state $a$ and particle $2$ is in position/state $b$, you can write your state as $\lvert 1a\rangle\otimes\lvert2b\rangle$. If particle one goes through a delay line, or other kind of change of its internal state that results in a phase accumulation, then what you would get is something like +$$\lvert1a\rangle\otimes\lvert 2b\rangle\to\lvert1a'\rangle\otimes\lvert 2b\rangle,\tag1$$ +where $\langle a\rvert a'\rangle=e^{i\phi}$. In other words, the accumulated phase factor is in the internal state of the first particle, not in the overall state. +This phase factor will be detectable if you then make the particles interfere, for example by joining the two positions $\lvert1\rangle$ and $\lvert2\rangle$ with something such as a beamsplitter$^{(1)}$.

+ +

Another way to understand the question might be: why is the following true?

+ +

+ +

Again, if you interpret $Z\lvert1\rangle=-\lvert1\rangle$ as ""$Z$ evolving the state $\lvert1\rangle$ into the state $-\lvert1\rangle$"" then this identity would not make much sense. Instead, what is going on is that $\lvert1\rangle$ (as well as $\lvert0\rangle$) is a state that is not affected by $Z$. The phase factor brought by $Z$ only has physical meaning when it acts on a different state $\alpha\lvert0\rangle+\beta\lvert1\rangle$, which is not stable under the action of $Z$.

+ +
+ +

${}^{(1)}$ In this kind of situation, you would most probably also have to take into account the type of particles you are dealing with. If these were photons (or more generally bosons), then the correct state would be the symmetrised version of Eq. (1). Equivalently, you could use second quantisation formalism to describe the state and its evolution, which would read as +$$a_{1a}^\dagger a_{2b}^\dagger\lvert\mathrm{vac}\rangle +\to a_{1a'}^\dagger a_{2b}^\dagger\lvert\mathrm{vac}\rangle.$$ +Interfering the spatial modes $1$ and $2$ on a beamsplitter would correspond to writing +\begin{align} +a_{1\alpha}^\dagger&\to \frac{1}{\sqrt2}(a_{1\alpha}^\dagger+a_{2\alpha}^\dagger), \\ +a_{2\alpha}^\dagger&\to \frac{1}{\sqrt2}(a_{1\alpha}^\dagger-a_{2\alpha}^\dagger). +\end{align}

+",55,,55,,6/1/2019 15:09,6/1/2019 15:09,,,,0,,,,CC BY-SA 4.0 +6302,1,,,6/2/2019 8:09,,6,440,"

Why is the application of an oracle function not a measurement, causing the collapse of the system? How can you know the state of the system (the input of the oracle function) without measurement?

+",7626,,55,,8/16/2019 18:57,8/16/2019 18:57,Why is the application of an oracle function not a measurement?,,3,3,,,,CC BY-SA 4.0 +6303,2,,6302,6/2/2019 9:35,,3,,"

Since this question seems to be in the context of Grover's search, I will explain using what happens in Grover's search, however, this is way more general.

+ +

The oracle function $f$ itself can be thought of a specification as to what should happen given various basis states (in fact, just classical bit strings to classical bit strings). +For example, $f$ can be: +$$ |00\rangle \rightarrow |0\rangle \\ +|01\rangle \rightarrow |1\rangle \\ +|10\rangle \rightarrow |0\rangle \\ +|11\rangle \rightarrow |0\rangle \\$$

+ +

At this point, you need not think about implementation. However, when we do implement it, we want to ensure there is no reduction in qubits, and the gate is unitary, so we make a unitary version of any function as follows:

+ +

$$U(|x\rangle \otimes |y\rangle) = |x\rangle \otimes |\bar x \oplus f(x)\rangle $$

+ +

Now we have a unitary gate with a specification of what happens to every basis state, so we implement it as we would a unitary.

+ +

I don't know the exact physics of how a unitary gate is implemented, but it is not a state-dependent process, so it is not necessary to know the state before applying the gate, hence, knowing the input state, or measuring it beforehand is not necessary.

+ +

Hence application of an oracle does not cause the state to collapse.

+",2832,,2832,,6/3/2019 7:22,6/3/2019 7:22,,,,2,,,,CC BY-SA 4.0 +6304,2,,6302,6/2/2019 13:49,,2,,"

It's hard to know what are you referring to without context, but a ""quantum oracle"" is just a type of (generally unitary) gate. As such, it does not provide information about the system, and neither it induces collapse. You can find more details about oracles in this other question (and links therein).

+ +

You cannot know the state of the system without measurement, that is true, but that is not what an oracle does. A measurement will most probably be performed at some stage after the oracle was applied.

+",55,,55,,6/3/2019 11:35,6/3/2019 11:35,,,,0,,,,CC BY-SA 4.0 +6305,2,,6302,6/2/2019 18:02,,3,,"

An application of an oracle does not return a value; rather, it modifies the state of the system in a non-collapsing way. The oracles are a bit similar to controlled gates in this respect (in fact, a lot of oracles rely on controlled gates for their implementation). Consider, for example, CNOT gate: it does not measure the control qubit and apply an X gate to the target qubit based on measurement results, but rather it is a unitary gate described by a matrix

+ +

$$\mathrm{CNOT} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}$$

+ +

The oracles are the same: they do not return any value; instead they are unitary transformations which implement classical functions in the following way:

+ +
    +
  1. Define the effect of the oracle on all basis states, using the classical function it implements.
  2. +
  3. This will automatically define the effect of the oracle on all superposition states: the oracle is a quantum operation and has to be linear in the state on which it acts. The oracle will be applied to superposition states - this is what ""calculating the value of the function on all inputs at once"" formulation you sometimes see refers to.
  4. +
+ +

CNOT is an example of an oracle which implements classical function $f(x) = x$: you can check that its effects on basis states follow the rule $\mathrm{CNOT} |x \rangle |y \rangle = |x \rangle |y \oplus x \rangle = |x \rangle |y \oplus f(x) \rangle$, which is the definition of the oracle effect.

+ +
+ +

The second part - about the oracles being defined by their effect on basis states using linearity - is implicit in a lot of sources I've seen, and is a frequent source of confusion - the definition of oracle effects on basis states makes it very tempting to try and measure the input state. If you need more mathematical details on this, we ended up writing it up here.

+ +

There are also lots of questions about quantum oracles on this site - it is a bit weird that there is no ""oracle"" tag, but if you look for Deutsch, Deutsch-Jozsa or Grover algorithms, a lot of the questions are about the oracles.

+",2879,,26,,6/2/2019 21:11,6/2/2019 21:11,,,,0,,,,CC BY-SA 4.0 +6306,1,,,6/2/2019 18:18,,3,504,"

I tried to implement the Deutsch's problem on IBM Q but didn't get the results as expected.

+ +

So here is the circuit for the Deutsch algorithm

+ +

+ +

and this is my implementation on the composer:

+ +

+ +

so let me explain to you what I did/thought:

+ +

$|x\rangle$ is qubit q(1)

+ +

$|y\rangle$ is q(2)

+ +

with qubit q(0) I wanted to realize the oracle function $f(x)$, which has - as implemented - the properties that $f(0) = 0$ and $f(1) = 1$. As I used the cnot gate on the initial $|0\rangle$ state of q(0) -> so $f$ is balanced on q(0) I should have f(x) after the first CNOT gate. q(0) (which is $f(|x\rangle)$ now determines what happens with q(2) using a flipped CNOT, as it is technically not possible to use the normal CNOT gate.

+ +

Then I measure $|x\rangle$ i.e. q(1) which should be in a pure state (here $|0\rangle$ as $f$ is balanced) - but it is not:

+ +

+ +

so any ideas what went wrong here? Maybe (probably) my implementation of $U_{f}$ is wrong, but how can this be realized then?

+",7632,,26,,6/2/2019 19:49,6/4/2019 20:10,Implementing Deutsch's problem on IBM Q composer,,1,0,,,,CC BY-SA 4.0 +6307,1,,,6/2/2019 19:56,,3,73,"

Suppose I have this quantum XOR circuit; this is a quantum circuit for the classical XOR operation $$\begin{eqnarray*} +x_1'= x_1\oplus x_2\oplus x_3\oplus x_4,\\ +x_2'=x_2\oplus x_3\oplus x_4\oplus x_5,\\ +x_3'=x_3\oplus x_4\oplus x_5\oplus x_6. +\end{eqnarray*}$$ +Now suppose I had $l$ quibts instead of $3$. What would be tensorial notation for this generalized circuit, what I think is $$U=\prod_{i=0}^{2}\prod_{k=0}^{q-1}I^{\otimes k}\otimes X\otimes I^{\otimes i}\otimes P_1\otimes I^{\otimes l-2-i-k}$$ is this the correct notation. The first $I$ tells how many qubits will be unaltered, the second $I$ adjusts the correct control, $P_1$ is the projection operator, and last $I$ does nothing on the remaining qubits. Ignore the part of this operator when the state is $0$ i.e. projection operator $P_0$ is omitted.

+",6070,,26,,6/3/2019 15:10,6/3/2019 15:10,Tensorial notation for this quantum XOR circuit,,0,1,,,,CC BY-SA 4.0 +6308,1,6310,,6/2/2019 23:37,,3,80,"

I was told that qubits don't have a value, they have a ""state"". What does that mean? What are the different ""states"" that a qubit can have (like bits can be either 1 or 0)?

+",5889,,26,,6/3/2019 0:12,6/4/2019 10:39,"What ""states"" can a qubit have if it doesn't have values?",,1,1,,,,CC BY-SA 4.0 +6309,1,,,6/3/2019 8:03,,6,500,"

I'm a beginner with Qiskit and the Python language at all.

+ +

Here is my question: +One of the VQE function arguments is qubit operator (qubitOp). +I saw some examples where the qubitOp object was produced by some already existing Qiskit module.

+ +

For example, in the following fragment:

+ +
qubitOp, offset = max_cut.get_max_cut_qubitops(w)
+
+ +

qubitOp is an Ising Hamiltonian produced from the connection weights matrix.

+ +

But how can I define the qubitOp entirely by myself, from the very beginning? +(My actual goal is to enrich the Ising Hamiltonian with spin's interactions with the external magnetic field). +Thanks!

+",7637,,26,,6/3/2019 15:00,6/3/2019 15:02,Defining qubit operator from scratch,,1,2,,,,CC BY-SA 4.0 +6310,2,,6308,6/3/2019 11:20,,4,,"

It strongly depends on your definition of have a value.

+ +

What you might be referring to is the fact that qubits (and more in general quantum systems) can be in a state that, when measured in specific ways, gives probabilistic outcomes. +Here, with state I don't mean anything technical. A physical state is here meant as simply whatever set of property characterises the system under consideration.

+ +

For example, if the quantum system under consideration is a qubit in the following superposition state: +$$\frac{1}{\sqrt2}(\lvert0\rangle+\lvert1\rangle),$$ +then measuring in the so-called computational basis results $50\%$ of the time in finding the outcome corresponding to $\lvert0\rangle$, and $50\%$ of the time in finding the outcome corresponding to $\lvert1\rangle$.

+ +

A possible physical realisation of this situation is a photon that is sent through a balanced beamsplitter. In this case, $\lvert0\rangle+\lvert1\rangle$ describes the fact that the photon is in a superposition of the two output ports of the beamsplitter. +Measuring in the computational basis then corresponds here to ""asking in which of the two output ports the photon came out from"", which you can do by putting photon detectors in the two output ports and seeing which one ""clicks"".

+ +
+

What are the different ""states"" that a qubit can have (like bits can be either 1 or 0)?

+
+ +

Yes. It should be noted however that, like bits, what ""$0$"" and ""$1$"" corresponds to physically depends on the situation. In the example above, ""$0$"" meant ""photon on the first output port"" while ""$1$"" meant ""photon on the second output port"". In a different situation ""$0$"" and ""$1$"" might instead represent two different states of the polarisation of the photon. Or one might be studying an entirely different physical scenario which has nothing to do with light.

+ +

Moreover, there are many situations in which a system can be in more than two possible states (in fact, arguably, almost all situations are like this). In this case one talks of a qudit (or in case of continuous systems sometimes of qumodes). +For example, in the quantum optical scenario with the beamsplitter that I used above, if there are instead many output ports, then the output state should be described as a more general superposition of the form $\sum_{k=1}^N c_k \lvert k\rangle$, with $N$ the number of output ports of the interferometer.

+ +

You might also have a look at the answers to this related question: How can a quantum logic gate produce a value other than $0$ or $1$?.

+",55,,55,,6/4/2019 10:39,6/4/2019 10:39,,,,0,,,,CC BY-SA 4.0 +6311,1,,,6/3/2019 12:12,,3,63,"

A bipartite state $\newcommand{\ket}[1]{\lvert #1\rangle}\rho_{AB}$ is said to be $n$-sharable when it is possible to find an extended state $\rho_{AB_1\cdots B_n}$ such that partial tracing over any subset of $n-1$ systems $B_i$ we recover $\rho_{AB}$. +More formally, if there exists a $\rho_{AB_1\cdots B_n}$ such that +$$\rho_{AB_k}\equiv \mathrm{Tr}_{B_j\forall j\neq k}[\rho_{AB_1\cdots B_n}]=\rho_{AB},\quad \forall k.$$

+ +

In other words, it is a state shared by $n+1$ parties, that will look like $\rho_{AB}$ when looked from any pair of parties $A$ and $B_k$ (I took this form of the definition from Yang (2006)).

+ +

As proven in (I think) Doherty et al. (2003), a bipartite state is separable if and only if it is $n$-sharable for all $n$.

+ +

A trivial example of $n$-sharability is the maximally mixed state: if $\rho_{AB}\equiv1/d^2\sum_{ij}\lvert ij\rangle\!\langle ij\rvert$, then I can extend it by writing +$$\rho_{AB_1\cdots B_n}=\frac{1}{d^{n+1}}\sum_{i_1,...,i_{n+1}}\left(\lvert i_1\rangle\!\langle i_1\rvert\otimes \dots\otimes \lvert i_{n+1}\rangle\!\langle i_{n+1}\rvert\right).$$ +In this case, I don't even have to consider subsystems of the form $A, B_k$, as any pair of subsystems will give the same result.

+ +

What are nontrivial examples of $n$-sharability? In particular, what is an example of a non-separable state that is sharable up to some point, but cannot be shared by too many parties?

+",55,,55,,4/26/2021 15:42,4/26/2021 15:42,What are nontrivial examples of $n$-sharable bipartite states?,,1,0,,,,CC BY-SA 4.0 +6312,2,,6309,6/3/2019 12:24,,5,,"

The question refers to the VQE, so let's start with this and Max_Cut; they can be built on the VQE. There used to be a vqe.ipynp but I can't find, look for an example.

+ +

The VQE algorithm doesn't need much input. You can fill it with the paulis_dict. This could be a simple Z gate for finding the eigenvalues= -1.

+ +
pauli_dict = {
+    'paulis': [{""coeff"": {""imag"": 0.0, ""real"": 1}, ""label"": ""Z""}]
+}
+
+qubitOp = Operator.load_from_dict(pauli_dict)
+print(qubitOp)
+
+ +

I will publish my VQE test on github soon. I want to compare Rigetti and IBM VQE.

+",1773,,26,,6/3/2019 15:02,6/3/2019 15:02,,,,0,,,,CC BY-SA 4.0 +6314,1,,,6/3/2019 15:38,,11,572,"

How to calculate the distance of the stabilizer code [[n,k,d]]? It's better if you can make a 3-qubit example. And what's the relationship between d and Pauli group?

+",7361,,26,,6/3/2019 15:48,8/16/2022 20:52,How to calculate the distance of stabilizer code?,,2,0,,,,CC BY-SA 4.0 +6315,1,,,6/3/2019 16:48,,2,514,"

According to the OPENQASM 2.0 documentation, it's possible to define custom unitary gates using the format:

+ +
gate name(params) qargs
+{
+body
+}
+
+ +

where the optional parameter list params is a comma-separated list of variable parameter names, and the argument list qargs is a comma-separated list of qubit arguments.

+ +

In my specific case, I'm trying to implement a single-qubit controlled unitary which will act on two qubits. So is there a way to define a custom controlled unitary gate in OPENQASM 2.0? It should work on the new IBM Quantum Experience Beta.

+",26,,,,,6/6/2019 12:22,How to define custom controlled unitaries in OPENQASM 2.0?,,1,2,,,,CC BY-SA 4.0 +6316,1,6318,,6/3/2019 18:01,,6,791,"

In the vein of this question, say I have a 2-qubit unitary gate $U$ which can be represented as a finite sequence of (say) single qubit gates, CNOTs, SWAPs, cXs, cYs and cZs. Now I need to implement a controlled-$U$ gate and hence need its decomposition in terms of simple one- and two-qubit gates. Is there a standard method to get this decomposed circuit?

+ +

In Nielsen and Chuang they deal with the general recipe for decomposing $C^n(U)$ gates where $U$ is a single qubit unitary, but not where $U$ is a $k$-qubit unitary cf. glS's answer.

+",26,,,,,6/3/2019 19:41,How to decompose a controlled unitary $C(U)$ operation where $U$ is a 2-qubit gate?,,1,0,,,,CC BY-SA 4.0 +6317,1,8298,,6/3/2019 19:02,,5,646,"

I was trying to figure out how scheduling works in IBM devices.

+ +

The thing that's bugging me is that in the quantum computer implementations I had seen before, the cycle concept is used. Say, for example, a cycle = 20ns. And all operations take that time or multiples of that time. +This is handy because things like parallelism and depth can then be defined using this cycles concept, which makes things like scheduling very clear.

+ +

With IBM machines, however, the duration of the primitivies can vary a lot, as seen on IBM's Github repo containing this information. We can see that the time it takes to perform a CNOT gate varies a lot, depending on the link. Let's have an example to motivate the question. If I define the following circuit in Qiskit:

+ +
q = QuantumRegister(14, 'q')
+c = ClassicalRegister(14, 'c')
+circ = QuantumCircuit(q, c)
+circ.cx(q[1], q[0])
+circ.cx(q[1], q[0])
+circ.h(q[3])
+circ.h(q[3])
+circ.h(q[3])
+print(circ)
+
+ +

The output of the print command will be (with the tracks for q[x>=4] trimmed since nothing was happening on those qubits): +

+ +

In IBM's Q16 Melbourne device, the duration of each Hadamard gate is 100ns (+ 20ns buffer) and for this specific CNOT gate (q[1], q[0]) is 678ns (+80ns buffer). These values can be checked on the repository mentioned before. +If may look, from the printed circuit, that the 3 Hadamards on q[3] would take more than the 2 CNOTs, but that is not the case. This raises some questions regarding how gates are actually scheduled on the device:

+ +

1 - Which gates were executed in parallel? The 3 Had gates can be executed faster than a single CNOT gate. Or was each Hadamard gate synchronized with the CNOT? If it's the 1st then this circuit output is pretty misleading, if the 2nd, when there's a lot of lost time for qubit q[3].

+ +

So reformulating the question: would the gates on q[3] be executed asynchronously?

+ +

2 - Defining depth as the number of gates in the longest track, as compared to the number to cycles, or time to the circuit to end can be misleading. In this case, the depth of the circuit is 3, even though the upper track takes much more time. Is there a way to extract a circuit runtime?

+ +

3 - How does this synchrony / asynchrony gets translated when compiling to a OPENQasm file?

+",201,,1386,,9/18/2019 8:09,9/23/2019 18:30,IBM Q devices scheduling of gates with different durations,,1,0,,,,CC BY-SA 4.0 +6318,2,,6316,6/3/2019 19:41,,5,,"

By giving U as that sequence you have reduced the problem to controlled SWAPs, cXs, cYs and cZs already. The single qubit gates you already know how to make controlled.

+ +

You can reduce further to controlled SWAPs and cXs by putting in the appropriate $U$ such that $UXU^\dagger=Y$ or $Z$. That gets rid of dealing with the controlled cYs and cZs separately.

+ +

So now just have to reduce Toffoli and Fredkin gates to 1 and 2 qubit gates. A Fredkin can be built with 3 Toffoli's just like how a SWAP is built from CNOTs, but with an extra control.

+ +

So now all that remains is decomposing a Toffoli gate into single qubit and 2-qubit gates. That is answered here.

+",434,,,,,6/3/2019 19:41,,,,3,,,,CC BY-SA 4.0 +6319,1,,,6/3/2019 20:06,,3,466,"

I've started getting into quantum computing in the last few days. +As part of the learning, I've figured it would be fun to implement some circuits on IBMQ Experience as I learn. So now I'm stuck with implementing a 2-qubit QFT. +My first try was this:

+ +

+ +

Where in red is my implementation of a controlled-phase rotation by pi. I did it based on some paper I found which explains how to construct a universal controlled gate. +On 00 input it gave a 1/4 1/4 1/4 1/4 probability as expected. Then for sanity check, I figured I might try a 'DC' input (hence the Hadamard gates at the start) so the output would be 100% 00 but it failed. After some reading on the internet, I came by this question. The answer there is basically that the 'controlled' phase shift need only use a simple phase rotation on the MSB qubit. His explanation seemed sound and it did work for the 'DC' case. +So, my final question is - why my implementation is wrong? I've tried doing the math and it seems ok: when q[2] is 0, q[1] isn't rotated, and when q[2] is 1 q[1] is rotated by pi (+ a global -pi/2 phase).

+ +

Can I get some explanation, please? I think I'm missing something.

+",7642,,55,,6/4/2019 10:33,6/6/2019 18:11,2-qubit QFT in IBMQ: controlled phase rotation,,1,2,,,,CC BY-SA 4.0 +6320,1,,,6/4/2019 0:27,,1,34,"

Non-super-slow review process and non-super-slow publication should take precedence.

+",7644,,26,,6/4/2019 2:22,6/4/2019 2:22,Which journals and conferences would be most appropriate for new number-theoretic quantum algorithms?,,0,3,,6/5/2019 7:10,,CC BY-SA 4.0 +6321,2,,6314,6/4/2019 8:02,,8,,"

There are various ways that you might go about computing the distance. I'll give a fairly general strategy here, although I'm sure here are imprvements that can be made.

+ +

Your starting point is a set of stabilizers $\{K_n\}$ on $N$ qubits, satisfying $K_n^2=I$ and $[K_n,K_m]=0$. Generically, you want to consider the full set of $4^N$ possible tensor products of Pauli operators $\{I,X,Y,Z\}$ across all $N$ sites. Go through each of these in turn. If it does not commute with each and every $K_n$, discard it. If it can be written as a product of some subset of the $K_n$, discard it. From the set that you have left, find the term with the smallest weight (i.e. the number of terms that are not $I$). That's the distance.

+ +

For example, consider the stabilizers +$$ +K_1=Z\otimes Z\otimes Z,\qquad K_2=X\otimes X\otimes I +$$ +I'm not writing out all 64 possible terms here, but stare at it for a minute. You'll realise that $I\otimes I\otimes Z$ commutes with both and cannot be written as a product of the two, so the distance is 1. The problem is that $N=3$ is a bit too simple an example to be able to show you too much.

+ +

A brief comment on how I would do the maths: I'd set up a computer to do it, using binary matrices. I'd describe each stabilizer generator by a row of $2N$ elements. The first $N$ are a binary string showing where the $Z$s are, and the second $N$ are a binary string showing where the $X$s are. Commutation is a simple linear algebra check, and similarly, we can check for the containment of stabilizers in a term by using an inner product. All calculations are performd modulo 2.

+",1837,,,,,6/4/2019 8:02,,,,1,,,,CC BY-SA 4.0 +6322,1,,,6/4/2019 10:53,,3,65,"

Let me first tell my problem statement. Suppose I have a uniform superposition of states $$|A\rangle=\dfrac{1}{2^{9}}\sum_{i,j,k=0}^{2^6-1}|0\rangle^{\otimes 8}|i\rangle|j\rangle|k\rangle,$$ where $|0\rangle^{\otimes 8}$ is pre-defined for each $i,j,k$. So suppose for a particular instance in this superposition state we have the $|0\rangle^{\otimes 8}$ register as $|b_7b_6b_5b_4b_3b_2b_1b_0\rangle$ where each $b_i\in\{0,1\}$. Now I want to transform this register by a certain rule and that rule is: +$$|b_7b_6b_5b_4b_3b_2b_1b_0\rangle\to |b_6~ b_5 b_4 (b_3\oplus b_7) (b_2\oplus b_7)~b_1~(b_1\oplus b_7) ~b_7\rangle$$ so for this transform I initialize a register $|0\rangle^{\otimes 8}$. So to do this computation I first

+ +
    +
  1. Modify my original superposition state as $\displaystyle |\tilde{A}\rangle=\dfrac{1}{2^{9}}\sum_{i,j,k=0}^{2^6-1}|0\rangle^{\otimes 8}|0\rangle_B^{\otimes 8}|i\rangle|j\rangle|k\rangle$, then

  2. +
  3. I start the transformation process by first applying the controlled NOT gate operation between the working register and the output register i.e $|b_7b_6b_5b_4b_3b_2b_1b_0\rangle$ and $0\rangle_B^{\otimes 8}$. This C-NOT gate changes the 3 qubit of $0\rangle_B^{\otimes 8}$ from the right to $b_7$. To do this I apply the transform $$U_1= P_1\otimes I^{\otimes 12}\otimes X\otimes I^{\otimes 2}\otimes I^{\otimes 3l}+P_0\otimes I^{\otimes 15+3l}$$ So after this step i have the superposition state as $$\displaystyle\dfrac{1}{2^{9}}\sum_{i,j,k=0}^{2^6-1}|b_7b_6b_5b_4b_3b_2b_1b_0\rangle|00000b_700\rangle|i\rangle|j\rangle|k\rangle.$$

  4. +
  5. Next, I apply controlled not operation between the working and output registers to change the state of the output register as $ |000b_7b_70b_7b_7\rangle $, the operator I define is $$ U_2=\prod_{i=0}^{4}(P_1\otimes I^{\otimes 10+i}\otimes X\otimes I^{\otimes 4-i}\otimes I^{\otimes 3l}+ P_0\otimes I^{\otimes 10+i}\otimes I\otimes I^{\otimes 4-i}\otimes I^{\otimes 3l})$$ +At the end of this step I have the working register as $ |b_7b_6b_5b_4b_3b_2b_1b_0\rangle$ and the output register as $|000b_7b_70b_7b_7\rangle$.

  6. +
+ +

The final step is I apply the C-NOT between these two registers with control starting from $b_6$. So I define the operator $$U_3=\prod_{i=1}^{8}I^{\otimes i}\otimes P_1\otimes I^{\otimes 6}\otimes X\otimes I^{\otimes 8-i}\otimes I^{\otimes 3l}$$ after this step I have the state as $$\dfrac{1}{2^{9}}\sum_{i,j,k=0}^{2^6-1}|b_7b_6b_5b_4b_3b_2b_1b_0\rangle~ |b_6~ b_5 b_4 (b_3\oplus b_7) (b_2\oplus b_7)~b_1~(b_1\oplus b_7) ~b_7\rangle~\rangle|i\rangle~|j\rangle~|k\rangle$$ So the overall operation need to reach the desired state would be $\mathbf{U}=U_3U_2U_1$ operated on $|\tilde{A}\rangle$. Now I have a few question about this whole transformation process:

+ +

Q1. Are the transformation that I have written correct? Can somebody check?

+ +

Q2. If it is correct, then am I able to convey the operation that I am trying to do, by the explanations including the quantum computing terms like qubit, register, working, output register?

+ +

Q3. As we can see, the classical transformation is itself invertible, since given $$|b_6~ b_5 b_4 (b_3\oplus b_7) (b_2\oplus b_7)~b_1~(b_1\oplus b_7) ~b_7\rangle$$ we can get $|b_7b_6b_5b_4b_3b_2b_1b_0\rangle$ but for this to be done via quantum computation we had to introduce the ancillary register $|0\rangle_B$ to store the output, but given the output since I can always get back the input, why do I keep that working register now so is there some unitary/non unitary transform that does resets the first register to the state $|00000000\rangle$ and after that to get the superposition as $$ |B\rangle=\dfrac{1}{2^{9}}\sum_{i,j,k=0}^{2^6-1}|0\rangle^{\otimes 8}|i\rangle|j\rangle|k\rangle$$ where the register $|0\rangle^8$ here has the modified output from the transform $\mathbf{U}$.

+ +

Edit: Do i just measure the first register and then throw them away ?

+",6070,,6070,,6/4/2019 15:50,6/4/2019 15:50,Restoring an initial state after computation,,0,2,,,,CC BY-SA 4.0 +6325,1,8451,,6/4/2019 14:40,,8,1689,"

I have been trying to understand what could be the advantage of using Grover algorithm for searching in an arbitrary unordered database D(key, value) with N values instead of a classical search.

+ +

I assumed that the oracle function is a function f(key)=y, where y is the index of the corresponding value in the classical database.

+ +

My problem is related to the oracle. The oracle circuit has to be modified for each search is performed in the database because the key is specified in the oracle. Let's assume this is a negligible operation for simplicity.

+ +

Supposing that the oracle circuit has to be calculated classically, it would require to produce a circuit which behaves like the function f(key)=y. This function would be obtained in at least O(N) steps (except for some special cases). The oracle function circuit has to be recalculated each time a database entry is being modified/added/removed, with a cost of O(N).

+ +

Many papers such as Quantum Algorithm Implementations for Beginners, Quantum Algorithms for Matching and Network Flows seem to not consider the oracle at all.

+ +

I don't know if I have to consider a quantum database for obtaining a real advantage or not (this and the unreliability of quantum results convinced me is not a very good idea, but it is just conjecture).

+ +

So, where is considered the complexity for building the oracle? Have I misunderstood something?

+ +

Is ""The oracle function circuit has to be recalculated each time a database entry is being modified/added/removed, with a cost of O(N)"" a wrong assumption?

+",6201,,55,,6/4/2019 19:11,10/10/2019 7:03,Grover algorithm for a database search: where is the quantum advantage?,,4,3,,,,CC BY-SA 4.0 +6326,1,6361,,6/4/2019 17:50,,7,1794,"

For example, I want to calculate the fidelity of a 1-qubit and 2-qubit gates (similar to the result shown in figure 2 in this paper). Is there any way to do that in Qiskit? I've gone through the Qiskit Ignis documentation, but I didn't see if it's relevant.

+",7648,,26,,6/4/2019 17:58,6/19/2019 9:05,How to calculate the fidelity of a certain gate of a IBMQ device in Qiskit using randomized benchmarking/tomography?,,1,2,,,,CC BY-SA 4.0 +6327,2,,6325,6/4/2019 18:10,,6,,"

You are right to recognize the complexity of building the oracle to use it with Grover's search - it is indeed the tricky part of solving the problem, and indeed a lot of sources don't consider this complexity.

+ +

I like to think about the oracle as a tool to recognize the answer, not to find it. For example, if you're looking to solve a SAT problem, the oracle circuit will encode the Boolean formula for a specific instance of a problem you're trying to solve. The circuit size in this case depends on the size of the formula, and not on the size of the search space. You can find an example of implementing an oracle for an instance of SAT problem in my tutorial.

+ +

If you were to use Grover's algorithm for database search, the oracle would have to encode the condition you're searching for, but also the criteria of whether the element is in a database. For example, if you're looking for a name starting with A, the oracle needs to recognize all strings starting with A, but it also needs to recognize which of the strings are present in the database - otherwise the algorithm will yield a random string starting with A, which is probably not what you were looking for. (This was not an issue with the SAT problem example, since any variables assignment that satisfies the formula is a valid variable assignment.)

+ +

I don't know of a good example of using Grover's search for searching through an unstructured database - to the best of my understanding this algorithm is suited for searches that have some structure. It is worth checking out other questions on Grover on this site, since a lot of them will consider oracle implementations.

+",2879,,,,,6/4/2019 18:10,,,,1,,,,CC BY-SA 4.0 +6328,1,6345,,6/4/2019 18:14,,5,258,"

I'm learning Q#. Is there any way to see the QASM code of a Q# function I write, the same way I can see the disassembly of a C# function?

+",7649,,26,,6/4/2019 18:27,6/5/2019 15:52,How to see the QASM code corresponding to compiled Q# function?,,1,0,,,,CC BY-SA 4.0 +6329,2,,6325,6/4/2019 18:21,,6,,"

The problem is with your initial assumption: the oracle for Grover's is based on a function f(value)=0/1, where 1 indicates that the value meets your search criteria and 0 indicates that it doesn't. This means that you do have to build a new oracle for each different search, but not for each different database.

+ +

That said, Grover's algorithm and a quantum database don't make a good replacement for classical database lookup methods. Take a look at this paper for a discussion of the practicalities of Grover's algorithm in this context.

+ +

Grover's algorithm has practical application when generalized to amplitude amplification, which shows up as a component of many other quantum algorithms. Amplitude amplification is a way of improving the success likelihood of a probabilistic quantum algorithm.

+",4265,,,,,6/4/2019 18:21,,,,2,,,,CC BY-SA 4.0 +6330,1,,,6/4/2019 19:49,,1,323,"

In Q#, How do I store a qubits state in a binary-based disk / hard drive for use by regular digital programs? Is this even possible?

+",5889,,26,,11/2/2019 6:55,11/2/2019 6:55,Converting a qubit's state to a binary value in Q#,,2,2,,,,CC BY-SA 4.0 +6331,2,,6306,6/4/2019 20:10,,2,,"

TL;DR: There are 8 possible outcomes, each with equal probability of being read. The final state has q[1] read as 0 in 4 of the outcomes, and read as 1 in the other 4 outcomes. Since you are only measuring q[1], you only see the two results, one with q[1] as 0 and one with q[1] as 1. They are both around 50% because each outcome had an equal probability of being read.

+ +

Let's go through your circuit and what the state should be at each step.

+ +

X-Gate on q[2]

+ +

The state will now be |100$\rangle$

+ +

Just a simple bit flip on q[2], from 0 to 1.

+ +

H-Gate on q[2] and H-Gate on q[1]

+ +

After these gates, the state will be $\frac{1}{\sqrt4}$|000$\rangle$ + $\frac{1}{\sqrt4}$|010$\rangle$ + $\frac{1}{\sqrt4}$|100$\rangle$ + $\frac{1}{\sqrt4}$|110$\rangle$

+ +

q[2] and q[1] both get put into superposition. They both can be either 0 or 1, leading to 4 possible outcomes.

+ +

CNOT from q[1] to q[0]

+ +

After this gate, the state will be $\frac{1}{\sqrt4}$|000$\rangle$ + $\frac{1}{\sqrt4}$|011$\rangle$ + $\frac{1}{\sqrt4}$|100$\rangle$ + $\frac{1}{\sqrt4}$|111$\rangle$

+ +

q[1] and q[0] become entangled. q[0]'s outcome depends on q[1]. The two will either be 00 or 11, and since q[2] is still in superposition, there are still 4 possible outcomes.

+ +

H-Gate on q[2] and H-Gate on q[0]

+ +

After these gates, the state will be $\frac{1}{\sqrt4}$|100$\rangle$ + $\frac{1}{\sqrt4}$|101$\rangle$ + $\frac{1}{\sqrt4}$|110$\rangle$ + $\frac{1}{\sqrt4}$|111$\rangle$

+ +

The H-Gate on q[2] cancels the first one out, leaving q[2]'s outcome as 1. The H-Gate on q[0] puts it in superposition, meaning it can be either 0 or 1. There are still 4 outcomes, because although we lost two possible outcomes with q[2] going back to just being 1, we gained two possible outcomes since q[0] can be either 0 or 1.

+ +

CNOT from q[2] to q[0]

+ +

After this gate, the state will still be $\frac{1}{\sqrt4}$|100$\rangle$ + $\frac{1}{\sqrt4}$|101$\rangle$ + $\frac{1}{\sqrt4}$|110$\rangle$ + $\frac{1}{\sqrt4}$|111$\rangle$

+ +

This gate essentially does not change the state. What ends up happening is when q[2] is 1, a bit flip will be applied to q[0]. However, at the moment q[2] is always 1, so each possible outcome will have q[0]'s bit flipped. Since each outcome has an equal probability of being read, the bit flip just provides us with the state possible outcomes, each with the same probabilities.

+ +

H-Gate on q[2] and H-Gate on q[0]

+ +

After these gates, the state will be $\frac{1}{\sqrt4}$|000$\rangle$ + $\frac{1}{\sqrt4}$|011$\rangle$ + $\frac{1}{\sqrt4}$|100$\rangle$ + $\frac{1}{\sqrt4}$|111$\rangle$

+ +

The H-Gate on q[2] puts it back in superposition, meaning it can be either 0 or 1. The H-Gate on q[0] cancels out the first one, meaning it is either 0 or 1 depending on q[1]. q[0] and q[1] will either be 00 or 11, and q[2] will either be 0 or 1, providing us with 4 possible outcomes.

+ +

H-Gate on q[1]

+ +

After this gate, the state will be $\frac{1}{\sqrt8}$|000$\rangle$ + $\frac{1}{\sqrt8}$|001$\rangle$ + $\frac{1}{\sqrt8}$|010$\rangle$ + $\frac{1}{\sqrt8}$|011$\rangle$ + $\frac{1}{\sqrt8}$|100$\rangle$ + $\frac{1}{\sqrt8}$|101$\rangle$ + $\frac{1}{\sqrt8}$|110$\rangle$ + $\frac{1}{\sqrt8}$|111$\rangle$

+ +

This final H-gate sets q[1]'s outcome as either 0 or 1, and this change won't affect q[0]'s outcome. q[0]'s outcome is still either 0 or 1 depending on what q[1] at the CNOT gate. q[2] is still in superposition, so it is either 0 or 1 as well. Since all 3 of the qubits can be either 0 or 1, there are $2^3$, or 8, possible outcomes.

+ +

The last H-Gate on q[1] does not cancel out the first H-Gate (which would end up setting q[1] to only be 0) because of the entanglement between q[0] and q[1].

+ +

Unfortunately, I do not know exactly how to fix your circuit to have it do what you want it to, as I am not very knowledgable on the algorithm itself. However, this article may provide some more information on the topic.

+",6180,,,,,6/4/2019 20:10,,,,0,,,,CC BY-SA 4.0 +6332,1,,,6/4/2019 21:03,,0,152,"

Is there a way to revert two entangled qubits to a separate state without using code...like restarting a quantum computer?

+ +

Note: By ""restarting a quantum computer"", I do not mean restarting a virtual machine/simulator; I mean restarting a physical quantum computer with physical qubits.

+",5889,,26,,6/5/2019 1:57,6/5/2019 12:02,Can entangled qubits be disentangled without using code or software?,,1,3,,,,CC BY-SA 4.0 +6333,2,,6330,6/4/2019 21:04,,1,,"

No, it is not possible. Consider simply counting the number of possibilities. You have N bits so can only differentiate $2^N$ possibilities. How many possible states are there for 1 qubit if you don't do any approximation?

+ +

If you do some approximation, then you may want to store the circuit that produced the given state starting from $| 0 \rangle$. But that would have had gates like rotation by some angle $\theta$ in which case storing $\theta$ would be using the floating point approximation of real numbers in order to turn it into something representable with finite amount of bits.

+ +

Don't make the type error of floats vs reals.

+",434,,,,,6/4/2019 21:04,,,,0,,,,CC BY-SA 4.0 +6334,2,,6330,6/4/2019 21:14,,1,,"

What use case do you have in mind?

+ +

Q# allows you to produce human-readable dump of wave function using DumpMachine operation (see this question for more details). However, this does not give you an exact representation, since the floating-point numbers used for storing the amplitudes internally are by definition not exact.

+",2879,,,,,6/4/2019 21:14,,,,0,,,,CC BY-SA 4.0 +6335,1,6356,,6/4/2019 22:38,,3,457,"

It is well known that the state of a (pure) qubit can be described as a point on a two-dimensional sphere, the so-called Bloch sphere.

+ +

The mapping $\lvert\psi\rangle\mapsto \boldsymbol r_\psi$ that sends each state into its representative in the Bloch sphere has the peculiarity of sending pairs of states that are orthogonal in the original Hilbert space (e.g. $\lvert0\rangle$ and $\lvert1\rangle$) into collinear points in the Bloch sphere. For example, $\lvert0\rangle$ and $\lvert1\rangle$ are sent to the nadir and zenith of the Bloch sphere.

+ +

More generally, $d$-dimensional systems can also be represented geometrically, using a generalised Bloch representation (see e.g. this question for how this works). However, on such systems, systems of orthogonal states come in more than pairs, so the property outlined above that held in the Bloch sphere doesn't work anymore.

+ +

How (if at all) does this property generalise for $D$-dimensional systems? More precisely, considering a set of orthogonal states (e.g. $\{\lvert k\rangle\}_{k=1}^D$), are the corresponding points in the generalized Bloch representation arranged into some kind of geometrical structure?

+",55,,55,,6/5/2019 12:52,6/6/2019 18:06,How are orthogonal sets of pure states arranged in state space?,,3,2,,,,CC BY-SA 4.0 +6338,1,6344,,6/4/2019 23:00,,3,926,"

A possible way to implement the 2 qubit Heisenberg XYZ model using a Quantum computer is to decompose the Hamiltonian as follows: $$H_{XYZ} = H_{XY} + H_{YZ} + H_{XZ}$$. In this case, these operators commute so we can apply the trotter formula to get the unitary evolution $$U = e^{-iH_{XY}t}e^{-iH_{XZ}t}e^{-iH_{YZ}t}$$

+ +

Further, using appropriate rotations on the single qubits, $H_{XZ}$ and $H_{YZ}$ can be expressed using single qubit gates and $H_{XY}$, meaning that the evolution $U$ should be able to be simulated using only single qubit rotations and the XY interaction ($H_{XY} = \sigma_1^X\sigma_2^X + \sigma_1^Y\sigma_2^Y$)

+ +

Given this, how can the XY interaction be implemented in IBMQ/Qiskit? Preferably it would be good to be able to do this without the use of an ancillary qubit.

+",7609,,26,,6/5/2019 1:58,4/16/2022 9:35,How to implement the XY Heisenberg interaction using IBMQ and Qiskit?,,2,0,,,,CC BY-SA 4.0 +6339,1,6342,,6/5/2019 0:30,,6,1255,"

While reading the paper ""Compiling basic linear algebra subroutines for quantum computers"", here, in the Appendix, the author/s have included a section on quantum inner product estimation.

+ +

Consider two vectors $x,y \in \mathbb{C}^n, x= (x_1, \dots , x_n), y= (y_1, \ldots, y_n)$, we want to estimate the inner product $\langle x | y \rangle$. Assume we are given a state $|\psi \rangle = \frac {1} {\sqrt 2} \big(|0 \rangle |x \rangle + |1 \rangle |y \rangle \big)$, after applying a Hadamard transform to the first qubit, the result is:

+ +

$$|\psi \rangle = \frac {1} {2} \big(|0 \rangle (|x \rangle + |y \rangle) + |1 \rangle(|x \rangle - |y \rangle) \big).$$

+ +

The author then states that after measuring the first qubit in the computational basis, the probability to measure $|0 \rangle$ is given by $p = \frac {1} {2} \big(1 + \mathrm{Re}(\langle x | y \rangle) \big)$. I do not understand this statement. From what I understand, after applying a partial measurement to the first qubit, the probability of measuring $|0 \rangle$ is given by +$\frac {1} {4} \sqrt { \sum_{i=0}^{n}(\overline{(x_i+y_i)}(x_i+y_i)) }^2$ (in other words the norm of the vector squared), so I am not sure why these formulas are equivalent, or if I am mistaken.

+",7481,,55,,6/5/2019 10:47,6/5/2019 10:47,Understanding a quantum algorithm to estimate inner products,,1,2,,,,CC BY-SA 4.0 +6340,1,6343,,6/5/2019 1:08,,3,139,"

In chapter 7, equation 7.6 says CNOT works as follows:

+ +

CNOT: $\frac{1}{\sqrt{2}} (|0\rangle + |1\rangle )\otimes |x\rangle \rightarrow +\frac{1}{\sqrt{2}} (|0\rangle + (-1)^x |1\rangle ) \otimes |x\rangle$, where it acts trivially if the target is $x=0$ state, and it flips the control if the target is the $x=1$ state.

+ +

I've looked at a few other resources about CNOT and this is the first time I encountered the $(-1)^x$ term.

+ +

Could someone explain to me where that term comes from?

+ +

Given that the matrix representation of CNOT is $$ +\begin{pmatrix} +1 & 0 &0 &0 \\ +0 & 1 & 0 & 0\\ +0 & 0 & 0 & 1\\ +0 & 0 & 1 & 0 +\end{pmatrix}$$ I don't see how that $(-1)^x$ came about.

+",4399,,55,,6/5/2019 10:46,6/5/2019 10:46,Expressing CNOT in the eigenbasis of $X$ (Preskill lecture notes eq. 7.6),,2,0,,,,CC BY-SA 4.0 +6341,2,,6340,6/5/2019 2:05,,1,,"

Here Preskill is using a physics convention that the states $|x\rangle$ are the eigenstates of the $X$ operator. So $|x\rangle$ with $x=0$ actually means $|+\rangle$ and with $x=1$ actually means $|-\rangle$.

+",483,,483,,6/5/2019 2:10,6/5/2019 2:10,,,,0,,,,CC BY-SA 4.0 +6342,2,,6339,6/5/2019 2:31,,6,,"

You just need to do a bit more algebra: Note that +$$ \sum_{i=0}^n (\overline{x_i+y_i})(x_i+y_i)=\langle x+y|x+y\rangle$$

+ +

and then you can distribute the right-hand side to get

+ +

$$\langle x|x\rangle+\langle x|y\rangle+\langle y|x\rangle+\langle y|y\rangle.$$

+ +

Since $| x\rangle$ and $| y\rangle$ are normalized, we know that $\langle x|x\rangle=\langle y|y\rangle=1$. We also know a property of inner products:

+ +

$$\langle x|y\rangle=\overline{\langle y|x\rangle}$$

+ +

Further, if you add a complex number to its conjugate, you get twice its real part, so we have +$$\langle x|y\rangle+\langle y|x\rangle=2 Re(\langle x|y\rangle)$$

+ +

Thus, altogether, we have +$$\langle x|x\rangle+\langle x|y\rangle+\langle y|x\rangle+\langle y|y\rangle=2+2Re(\langle x|y\rangle)$$

+ +

I think the probability you computed is off by a factor of 2: There is a $\frac{1}{2}$ as a coefficient of $|0\rangle$, so since the norm is squared, this will give a factor of $\frac{1}{4}$. This gives the answer you are supposed to get.

+",4517,,,,,6/5/2019 2:31,,,,1,,,,CC BY-SA 4.0 +6343,2,,6340,6/5/2019 3:00,,5,,"

Expanding on Jalex

+ +

Look at what happens on the possible terms.

+ +

\begin{eqnarray*} +\mid 0 \rangle \otimes \mid + \rangle &\to& \mid 0 \rangle \otimes \mid + \rangle\\ +\mid 0 \rangle \otimes \mid - \rangle &\to& \mid 0 \rangle \otimes \mid - \rangle\\ +\mid 1 \rangle \otimes \mid + \rangle &\to& \mid 1 \rangle \otimes \mid + \rangle\\ +\mid 1 \rangle \otimes \mid - \rangle &\to& (-1) \mid 1 \rangle \otimes \mid - \rangle\\ +\end{eqnarray*}

+ +

where the first 2 are unchanged because the control is $0$ so nothing happens. The third is unchanged because NOT applied to $\mid + \rangle$ just gives back $\mid + \rangle$. The last is the only one with change because NOT applied to $\mid - \rangle$ gives $(-1) \mid - \rangle$.

+ +

We can summarize these possibilities by knowing that $\mid + \rangle$ goes with $x=0$ and $\mid - \rangle$ with $x=1$ as:

+ +

\begin{eqnarray*} +\mid 0 \rangle \otimes \mid x \rangle &\to& \mid 0 \rangle \otimes \mid x \rangle\\ +\mid 1 \rangle \otimes \mid x \rangle &\to& (-1)^x \mid 1 \rangle \otimes \mid x \rangle\\ +\end{eqnarray*}

+ +

The first two become the first one above. And third and fourth, the second above.

+ +

Now add the two together along with a $\frac{1}{\sqrt{2}}$ prefactor to give

+ +

$$ +\frac{1}{\sqrt{2}} ( \mid 0 \rangle + \mid 1 \rangle ) \otimes \mid x \rangle \to \frac{1}{\sqrt{2}} ( \mid 0 \rangle + (-1)^x \mid 1 \rangle ) \otimes \mid x \rangle +$$

+",434,,,,,6/5/2019 3:00,,,,0,,,,CC BY-SA 4.0 +6344,2,,6338,6/5/2019 6:09,,4,,"

First, let's use the fact that $\sigma^X_1 \sigma^X_2$ and $\sigma^Y_1 \sigma^Y_2$ commute. This means

+ +

$$e^{-i H_{XY} t} = e^{-i ~\sigma^X_1 \sigma^X_2~ t} ~ e^{-i ~\sigma^Y_1 \sigma^Y_2~ t}$$

+ +

Using appropriate single qubit rotations, $e^{-i ~\sigma^Y_1 \sigma^Y_2~ t}$ can be expressed using $e^{-i ~\sigma^X_1 \sigma^X_2~ t}$. So now we've reduced the problem to simply implementing $e^{-i ~\sigma^X_1 \sigma^X_2~ t}$.

+ +

To do this, the important relation to note is that,

+ +

$${CX}_{j,k} ~ e^{-i~\sigma^X_j~t} ~ {CX}_{j,k} = e^{-i ~\sigma^X_j \sigma^X_k~t}$$.

+ +

So all you need is a couple of cnots, and an appropriate single qubit rotation $e^{-i~\sigma^X_j~t}$ implemented on their control qubit. In Qiskit code, here's a two qubit circuit that would implement this (here I named the qubits as $0$ and $1$ instead of $1$ and $2$, to reflect the Python indexing convention)

+ +
    qc = QuantumCircuit(2)
+    qc.cx(0,1)
+    qc.rx(t,0)
+    qc.cx(0,1)
+
+ +

Following this method would mean using 12 cnots to implement the whole Hamiltonian, which is quite a lot given the fidelities of current devices. Fancier methods are doubtless possible.

+",409,,,,,6/5/2019 6:09,,,,0,,,,CC BY-SA 4.0 +6345,2,,6328,6/5/2019 6:45,,5,,"

Q# is not compiled into QASM, so that would be tricky. Q# compilation and execution process is approximately as follows:

+ +
    +
  • Q# code is parsed into an internal data structure representing an abstract syntax tree. This data structure undergoes some transformations (for example, to generate adjoint and controlled versions of operations used in the code). I don't know a way to see this representation directly.
  • +
  • Next, to execute the code on a simulator this data structure is used to generate C# code. This code doesn't look particularly assembly-like, since it maintains a lot of high-level language constructs. If your Q# code was stored in file MyCode.qs in folder A, the C# result of code generation will be found in A\obj\qsharp\src\MyCode.g.cs.
  • +
  • C# compiler compiles this generated code into a classical executable and runs it.
  • +
+ +
+ +

Having said that, it is possible to write a separate tool that will convert a subset of Q# operations into OpenQasm; this example by Rolf Huisman shows a way to do that.

+",2879,,2879,,6/5/2019 15:52,6/5/2019 15:52,,,,1,,,,CC BY-SA 4.0 +6346,2,,6235,6/5/2019 7:43,,1,,"

I get a way to count the maximal, and the remaining credits. +the maximal credits that was shown is 15, although I have made 10 runs and for each 3 credits till the program crushed due to lack of credits, so there is a Lack of coordination from what they write to what you can run for each 24 hours in practice.

+ +

there is packege that needed to be installed for each program, using your IBM account token +and give you a dictionary type: {'remaining': x, 'promotional': 0, 'maxUserType': 15} +when x is the remaining number of credits, the code that needed to be written is:

+ +
 ! pip install IBMQuantumExperience
+from IBMQuantumExperience import IBMQuantumExperience
+api = IBMQuantumExperience(""YOUR TOKEN"", config = {""url"":'https://quantumexperience.ng.bluemix.net/api'}, verify=False)
+api.get_my_credits()
+
+ +

In addition for what I saw there is no influence for the number of shots nor the number of qubits (till 5 because that I reached) influence on the number of credits the program consuming, this is an equal number usually equal to 3.

+",4524,,,,,6/5/2019 7:43,,,,0,,,,CC BY-SA 4.0 +6347,2,,6311,6/5/2019 7:52,,1,,"

I've never thought about this before, and certainly not done any in-depth calculations, but see if this gets you started....

+ +

Obviously you want to do two different things: show that there are $n$-sharable states, and show that these states are not $m$-shareable for some $m>n$ (and hopefully get $n$ and $m$ as close as possible).

+ +

Let +$$ +|\psi\rangle=\frac{1}{\sqrt{2}}(|01\rangle+|10\rangle) +$$ +and +$$ +\rho(p)=p|\psi\rangle\langle\psi|+\frac{1-p}{2}(|00\rangle\langle 00|+|11\rangle\langle 11|). +$$ +I believe that we will be able to do this for this state, for a whole range of values of $p$ (yielding different $n$ values).

+ +

First, to prove $n$-sharability, and to relate $p$ and $n$. I would start with a state such as +$$ +|\Psi\rangle=\frac{1}{\sqrt{2}}(|\Psi^n_{(n-3)/2}\rangle+|\Psi^n_{(n+3)/2}\rangle) +$$ +where $|\Psi^n_m\rangle$ is the $n$-qubit symmetric state with $m$ 1s in it (so $|\Psi^3_1\rangle$ is the standard $W$-state), and I'm assuming $n$ is odd. Since this state is invariant under all permutations, every two-qubit reduced density matrix is the same, and I believe it's of the form $\rho(p)$, although I haven't calculated the value of $p$. (As a partial verification, note that $|\Psi\rangle$ in ivariant under $X^{\otimes n}$, which severely limits the possible structure of the reduced density matrix.)

+ +

Now, to prove that it isn't $m$-sharable, I point you towards my paper here. (If you want to be fussy, that paper contains a conjecture, which was only closed in the follow-up). Basically, it says that the amount of a single in a two-qubit density matrix (the parmeter $p$ here) obeys a monogamy relation, so if you want one party to share the same amount of single with $m-1$ other parties, there's a maximum size that $p$ can be.

+ +

If I get some time later, I'll try to fill in some of the concrete numbers.

+",1837,,,,,6/5/2019 7:52,,,,1,,,,CC BY-SA 4.0 +6348,2,,6332,6/5/2019 11:49,,1,,"

Well, there's more than one way.

+ +
    +
  • You can perform a measurement, though I suppose this doesn't comply +with your definition of 'without code' (since you actually have to +perform a command)?
  • +
  • Since quantum states are fragile and (at the moment) still not error-corrected, you can just wait for the state to decohere/dephase... if you look at the IBM's device summary information here, you can see that those times (T1, T2) are on the order of the tenth's of microseconds... you you wait a couple hundred microseconds, it's pretty likely that they are unentangled now (though of course, they probably assumed some random quantum state and nothing resembling what you initially programmed.)
  • +
+ +

Whatever restarting a quantum computer may mean, it probably takes more time/steps than just waiting less than a milisecond.

+ +

The entanglement was created with a quantum operation. If you wish to undo and return to the previous state this you have to perform again a quantum operation, which involve hardware actions, which are directed by code. Or you just let the quantum states degrade/get destroyed with non-coherent effects, like noise, etc.

+ +

Not sure where your question comes from though, and why you'd want to do something without code, since even the restarting operations probably has some commands being executed. Why would you want to operate a computer without code?

+",201,,201,,6/5/2019 12:02,6/5/2019 12:02,,,,0,,,,CC BY-SA 4.0 +6349,2,,6172,6/5/2019 11:51,,3,,"

There are two methods, when you look at the code you'll see their names: pseudo_inverse and least_squares (https://github.com/Qiskit/qiskit-ignis/blob/master/qiskit/ignis/mitigation/measurement/filters.py). pseudo_inverse is the simpler one, it applies the inverse of the calibration matrix on the measurement results. However it has some issues, which require the usage of the least_squares method, which finds valid mitigated results, such that: +$$\text{min}_{P_{\rho}} ||\tilde{P}_{\rho}-\mathbf{A}\cdot P_{\rho}||$$ +where $\mathbf{A}$ is the calibration matrix and $\tilde{P}_{\rho}$ are the measurement results. Please see more details in the last section of https://github.com/Qiskit/qiskit-tutorials/blob/master/community/ignis/measurement_error_mitigation.ipynb. In particular about the issues related to the pseudo inverse.

+",7659,,,,,6/5/2019 11:51,,,,1,,,,CC BY-SA 4.0 +6350,2,,6335,6/5/2019 15:04,,4,,"

""Generalized Bloch"" manifolds are synonyms to coherent state manifolds. The points of these manifolds do not correspond, in general, to orthonormal vectors, as there are much more points than the dimension of the system's Hilbert space. Points on the manifold correspond rather to generalized coherent states.

+ +

These states are actually classical, they satisfy properties analogous to the ordinary coherent states of the harmonic oscillator such as (appropriately defined) minimal uncertainty (please see for example, Ali, Antoine, Gazeau and Mueller). More, importantly, they satisfy Bell's inequality upon splitting, please see Brief Mann and Revzen. However, they do span the full Hilbert space: Uncountable number of orthonormal bases can be constructed from linear combinations of these states.

+ +

The question is, given a coherent state manifold; does it contain a set of special points whose corresponding coherent states form an orthonormal basis of the corresponding Hilbert space. In the case of an $N+1$-level system (qudit), there is a coherent state manifold for which the answer is positive: The complex projective space: $\mathbb{C}P^N$ (as well as other coherent state manifolds where the answer is negative).

+ +

For an $N+1$-level system, a coherent state vector parametrized by $\mathbb{C}P^N$ has the following explicit expression: +$$|\psi(z, \bar{z}) \rangle= \frac{1}{\sqrt{1 + \bar{z}_1z_1+ … +\bar{z}_N z_N}} +\begin{bmatrix} +1\\ +z_1\\ +.\\ +.\\ +.\\ +z_N\\ +\end{bmatrix}$$ +Where the coordinates, $z_i$ are global coordinates of $\mathbb{C}P^N$ : $z_i\in \mathbb{C}\cup \{\infty\}$.

+ +

Now please observe that the coherent state vectors corresponding to the $N+1$ points:

+ +

\begin{matrix} +[z_1=0,...,z_N=0]\\ +[z_1=0,z_2=\infty,...,z_N=0]\\ +[z_1=0,z_2=0, z_3=\infty,...,z_N=0]\\ +.\\ +.\\ +.\\ +[z_1=0,...,z_N=\infty]\\ +\end{matrix} +form the standard orthonormal vector spanning the $N+1$ dimensional Hilbert space.

+ +

These special points enjoy unique geometric properties on $\mathbb{C}P^N$, please see Berceanu: Taking the first point as the origin, then the rest of the points

+ +

1) Form a cut locus, whose points are the first on the geodesic joining them to the origin beyond which the geodesic ceases to minimize the arc length (i.e., it maximizes it).

+ +

2) They form also the conjugate locus which is the set of points which can be connected to the origin with an infinite number of geodesics.

+ +

3) In addition, since $\mathbb{C}P^N$, is an $SU(N+1)$, homogeneous space. The transformations which exchange a pair of points are just the matrices which exchange a pair of rows: These transformations generate a discrete group called the Weyl group. The order of the Weyl group for $SU(N+1)$ is $(N+1)!$, and its action on the orthonormal basis is just by permutations.

+ +

4) In addition, the $\mathbb{C}P^N$ has a cell structure, i.e., it can be decomposed into a disjoint set of affine spaces: +$$\mathbb{C}P^N = \mathbb{C}^N \cup \mathbb{C}^{N-1}…\cup \mathbb{C} \cup \{0\}$$ +Such that each special point resides on a different cell.

+ +

There are other choices of coherent state manifolds which do not allow an orthonormal basis of coherent states. For example, we can span an $N+1$ Hilbert space by the Bloch sphere $\mathbb{C}^1=S^2$ as follows: +$$|\psi(z, \bar{z}) \rangle= \frac{1}{\sqrt{(1 + \bar{z}z)^N}} +\begin{bmatrix} +1\\ +\sqrt{N} z\\ +.\\ +.\\ +.\\ +\sqrt{\begin{pmatrix} N\\ i \end{pmatrix}}z^i\\ +.\\ +.\\ +.\\ +z^N\\ +\end{bmatrix}$$ +Where: $z\in \mathbb{C}\cup \{\infty\}$ isthe stereographic projection coordinate of the Bloch sphere.

+ +

In this case (for $N>2$), we can only generate an orthonormal basis by forming linear combinations of the coherent vectors for different values of $z$.

+",4263,,4263,,6/6/2019 12:05,6/6/2019 12:05,,,,4,,,,CC BY-SA 4.0 +6351,1,,,6/5/2019 15:44,,5,130,"

I have found this implementation of HHL, and I don't understand why the controlled unitary operation is expressed in the form of $\exp(i t_0 A/2)$ and $\exp(i t_0 A/4)$.

+ +

The rotation of $\pi$ and $\pi/2$ are derived by the use of $\exp(i t_0 A/2)$ and $\exp(i t_0 A/4)$, in particular using the diagonal matrix which contains the eigenvalues. But usually, the controlled operations of QPE step is done using the matrices $A^{2^0}, A^{2^1}, … , A^{2^k}$. Where am I wrong?

+ +

I have also another question about the representation of the unitary operation: we can we express the unitary operation using only the matrix of the eigenvalues because $b$ is expressed on the same (standard) basis of the eigenvectors, is that correct?

+",6310,,26,,6/7/2019 13:46,6/7/2019 13:46,How can I express controlled unitary operation in QPE of this implementation of HHL?,,0,1,,,,CC BY-SA 4.0 +6352,1,,,6/5/2019 16:28,,3,43,"

How much power do quantum computers use based on the number of qubits being allocated? If it's not based on qubits, What determines how much power quantum computers use?

+ +

Note: A similar question was asked about 1 year ago, and therefore relatively outdated.

+",5889,,26,,6/7/2019 13:52,6/7/2019 13:52,How much power do quantum computers use based on the number of qubits being allocated?,,0,1,,,,CC BY-SA 4.0 +6353,1,,,6/5/2019 17:20,,5,144,"

I'm experiencing an issue while using Qiskit where the counts from a job return vastly different values when ran in a loop or as an array of circuits as opposed to single experiments when run by themselves. This is an issue because I'm in the process of tracking decoherence time.

+ +

For instance, when I run the following code (where N is the number of qubits in a 20-qubit architecture and gates_list is an array containing the number of identity gates to be implemented in each iteration of a circuit), the counts for the last circuit in the array becomes worse as I increase the number of entries in the list prior to that particular circuit.

+ +
q = QuantumRegister(N, 'q')
+c = ClassicalRegister(N, 'c')
+qc = QuantumCircuit(q,c)
+circuit=[]
+
+for i in range(N):
+    qc.x(q[i])
+    qc.barrier()
+
+measure = QuantumCircuit(q,c)
+measure.measure(q[0:N], c[0:N])
+
+for j in gates_list:
+    i = 1
+    while i < j+1:
+        for k in range(N):
+            qc.iden(q[k])
+        qc.barrier()
+        i += 1
+    circuit.append(qc+measure)
+
+for j in range(len(circuit)):
+    print(""Executing job"", j+1, ""of"", len(circuit))
+    s = ""T2_Decoherence_i={}_t.csv"".format(gates_list[j])
+
+    qobj = assemble(circuit[j], shots=8192)
+    job = backend.run(qobj)
+    job_monitor(job)
+    res = job.result().get_counts()
+
+    ibmqf.Write_Data(s,res)
+
+ +

However, when I attempt to run each individual circuit by itself, I receive the expected output.

+ +

Any ideas as to what the issue might be?

+",7666,,26,,6/7/2019 14:09,6/7/2019 14:09,Results from looped experiments on IBM Q different than individual experiments,,0,6,,,,CC BY-SA 4.0 +6354,1,6355,,6/6/2019 2:50,,5,56,"

In trying to understand a method outlined here (page 3, subroutine 1). Consider +$$R_3 = +\begin{bmatrix} 0 & 0 & 1 \\ +0 & 0 & 0 \\ +0 & 0 & 0 +\end{bmatrix} .$$ +Let $A$ be a square matrix over $\mathbb{C}$. Define $X_3(A) = R_3 \otimes A + R_3^{\dagger} \otimes A^{\dagger}$, a.k.a +$$X_3(A) = \begin{bmatrix} 0_n & 0_n & A \\ +0_n & 0_n & 0_n \\ +A^{\dagger} & 0_n & 0_n \end{bmatrix}$$ +where $0_n$ is the $n$-dimensional zero matrix. $X_3(A)$ is Hermitian, and the author refers to this as embedding $A$ in a Hermitian matrix.

+ +

Next the author makes the assumption that for two square matrices $A_1, A_2$ of the same dimension, we have access to unitary operators $e^{iX_3(A_1) \tau},e^{iX_3(A_2)\tau}$ (this is possible since $X_3(A_i)$ is Hermitian), for $t$ some ""simulation time"", and $n$ a positive integer designated as the number of applications. This is described in ""input assumption #1"" (with $\tau$ a time-parameter). In order to obtain an estimate of $e^{iX_3(A_1 + A_2)t}$ , the procedure is described as:

+ +

Procedure: Sequentially apply $e^{iA_1 t/n}, e^{iA_2 t/n}$ for a total of $n$ consecutive times , defining

+ +

$u_{add}(t) = (e^{iX_3(A_1)t/n} e^{iX_3(A_2) t/n})^n$ where the number of applications of the unitaries with $\tau = t/n$ is proportional to $n = O(t^2 / \epsilon)$, where $\epsilon$ is the error term.

+ +

From what I understand for two matrices $A,B$, $e^A e^B = e^{A+B}$ is generally true only if $A,B$ commute, so the above expression say for $n=2$ would be +$ e^{iX_3(A_1)t/2} e^{iX_3(A_2)t/2} e^{iX_3(A_1)t/2} e^{iX_3(A_2)t/2}$, what I'm imagining the procedure shows is :

+ +

$ e^{iX_3(A_1)t/2} e^{iX_3(A_2)t/2} e^{iX_3(A_1)t/2} e^{iX_3(A_2)t/2} = +e^{iX_3(A_1)t/2} e^{iX_3(A_1)t/2}e^{iX_3(A_2)t/2} e^{iX_3(A_2)t/2} = +e^{iX_3(A_1)t} e^{iX_3(A_2)t}=e^{iX_3(A_1+A_2)t} $,

+ +

but this assumes that $X_3(A_1)$ and $X_3(A_2)$ commute? I'm also not sure what the author means by ""apply"" these operators.

+",7481,,55,,6/6/2019 10:51,6/6/2019 10:51,Clarification of a procedure to compute the product of the exponential of two matrices,,1,0,,,,CC BY-SA 4.0 +6355,2,,6354,6/6/2019 6:41,,6,,"

Your reasoning is correct if your two Hamiltonians commute. But, as you say, it doesn't work if they don't commute. In that case, the trick is to find something that approximates the the thing you want.

+ +

So, what you should really be thinking about is taking terms in the opposite order: +$$ +e^{iH_1t/2}e^{iH_2t/2}e^{iH_1t/2}e^{iH_2t/2}\approx(e^{i(H_1+H_2)t/2})(e^{i(H_1+H_2)t/2})\approx e^{i(H_1+H_2)t}. +$$ +To understand this, be more explicit. Take the first term and compare it to the claimed approximation +$$ +e^{iH_1\delta t}e^{iH_2t\delta t}-e^{i(H_1+H_2)\delta t} +$$ +in the limit that $\delta t$ is small. You can perform a Taylor expansion. Thus, +$$ +(1+iH_1\delta t+\frac12H_1^2\delta t^2+\ldots)(1+iH_2\delta t+\frac12H_1^2\delta t^2+\ldots)-(1+i(H_1+H_2)\delta t+\frac12(H_1+H_2)^2\delta t^2+\ldots). +$$ +The terms of order $\delta t^0$ and $\delta t^1$ all cancel, so this approximation is accurate up to $O(\delta t^2)$. Now, to get a full evolution of time $t$, I need $t/\delta t$ time steps. All those $\delta t^2$ sized errors could add up, of which there are $t/\delta t$, so the overall error is $O(\delta t)$ for the full sequence. Thus, make $\delta t$ small enough and you've got a fairly accurate simulation.

+",1837,,,,,6/6/2019 6:41,,,,1,,,,CC BY-SA 4.0 +6356,2,,6335,6/6/2019 7:37,,3,,"

One natural generalization of that property is that Bloch vectors for a basis set must sum to 0 vector. Though, this property is not a criterion for basis sets in dimensions higher than 2.

+ +

If $\rho_i$, $i=1 .. d,$ are corresponding density matrices for a basis set, then +$$ +\sum_{i=1}^d \rho_i = I +$$ +Now if $\sigma_i,$ $i=1 .. d^2-1,$ are generalized Pauli matrices then +$$ +\rho_i = \frac{1}{d}\left(I + \sum_{j=1}^{d^2-1} r_{ij}\sigma_j\right), r_{ij}=\text{Tr}(\rho_i\sigma_j^\dagger) +$$ +If we add we'll have +$$ +\frac{1}{d}\sum_{j=1}^{d^2-1}\left(\sum_{i=1}^d r_{ij}\right)\sigma_i = 0 +$$ +Hence +$$ +\sum_{i=1}^d \boldsymbol r_i = 0 +$$

+ +

Update

+ +

Actually, we can also calculate scalar products between vectors $\boldsymbol r_i$
+(here I assume that $\text{Tr}(\sigma_i\sigma_i^\dagger)=d$, i.e. $\sigma_i$ are normalized in a sense. Also they are orthogonal, so $\text{Tr}(\sigma_i\sigma_j^\dagger)=0, i\neq j$, and traceless $\text{Tr}(\sigma_i)=0$). +$$ +\delta_{kl} = \text{Tr}(\rho_k\rho_l^\dagger) = \frac{1}{d^2}\text{Tr}\left(\left(I + \sum_{j=1}^{d^2-1} r_{kj}\sigma_j\right)\left(I + \sum_{i=1}^{d^2-1} \bar{r}_{li}\sigma_i^\dagger\right)\right) = +$$ +$$ += \frac{1}{d^2}\left(\text{Tr}I + \sum_{j=1}^{d^2-1} r_{kj}\bar{r}_{lj}\text{Tr}(\sigma_j\sigma_j^\dagger)\right) = \frac{1}{d}\left(1 + \sum_{j=1}^{d^2-1} r_{kj}\bar{r}_{lj}\right) +$$ +Hence +$$ +(\boldsymbol r_k, \boldsymbol r_l) = d\delta_{kl} - 1 +$$

+ +

Now if we add another condition that all $\boldsymbol r_i$ correspond to pure states (this condition can be extracted from equations $Tr(\rho_i)=1$ and $\rho_i^2=\rho_i=\rho_i^\dagger$) then all those properties of $\boldsymbol r_i$ will form a criterion for a generalized Bloch vectors to be corresponding to some basis set of states.

+",5870,,5870,,6/6/2019 18:06,6/6/2019 18:06,,,,0,,,,CC BY-SA 4.0 +6357,1,,,6/6/2019 11:10,,4,1617,"

I'm using Qiskit in Visual Studio 2019. I want to draw quantum circuits, but it only shows their sizes with text instead of figures. The output on the interactive window is like this.

+ +
>>> from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
+   ...: import numpy as np
+   ...: %matplotlib inline
+
+In [2]: qr = QuantumRegister(1)
+   ...: cr = ClassicalRegister(1)
+   ...: circuit = QuantumCircuit(qr, cr)
+   ...: circuit.h(qr[0])
+Out [2]: <qiskit.extensions.standard.h.HGate at 0x2c9b16b8e80>
+
+In [3]: circuit.draw(output=""mpl"")
+Out [3]: <Figure size 240.8x138.46 with 1 Axes>
+
+ +

Is there any way to draw circuits correctly, or is it simply that Qiskit doesn't work in Visual Studio?

+ +
+ +

<edited> the qiskit version

+ +
In [6]: print(qiskit.__version__)
+0.8.1
+
+",7671,,7671,,6/11/2019 10:22,1/19/2022 8:37,Can't draw figures with Qiskit in Visual Studio,,3,1,,,,CC BY-SA 4.0 +6358,2,,6335,6/6/2019 11:52,,3,,"

This other answer already gave a nice proof that orthogonal bases are mapped into vectors $r_i$ such that $\sum_i r_i=0$. Here I'll work out explicitly the coordinates in a few cases, to show what kind of geometrical figure exactly comes out.

+ +

I'll consider in particular the computational basis in $d$ dimensions: $\{\lvert 1\rangle,...,\lvert d\rangle\}$. Any other orthonormal basis is just a rotation away from the computational basis anyway, so the geometrical features should be the same.

+ +

I'll consider the following standard basis of traceless Hermitians operators: +$$Z^{(j)}\equiv\sqrt{\frac{d}{j(j+1)}}\left(\sum_{k=1}^j\lvert j\rangle\!\langle j\rvert-j\lvert j+1\rangle\!\langle j+1\rvert\right), \,\, j=1,...,d-1,$$ +$$X^{(jk)}\equiv\sqrt{d/2}[\lvert j\rangle\!\langle k\rvert + \lvert k\rangle\!\langle j\rvert], +\quad +Y^{(jk)}\equiv i\sqrt{d/2}[\lvert j\rangle\!\langle k\rvert - \lvert k\rangle\!\langle j\rvert],\,\, j>k.$$

+ +

It is easy to check that for all the elements of this basis, we have +$$\langle X^{(jk)}\rangle=\langle Y^{(jk)}\rangle=0,$$ +while for the $z$ coordinates we have +\begin{align} +z_j(\lvert\ell\rangle) &=\sqrt{d/[j(j+1)]}, \text{ for all } j\ge\ell,\\ +z_{\ell-1}(\lvert\ell\rangle) &=-\sqrt{d(\ell-1)/\ell}, \text{ for all }, \\ +z_{j}(\lvert \ell\rangle) &=0, \text{ for all }j<\ell-1. +\end{align}

+ +

Explicit $d=3$ example

+ +

To get a better understanding of what this means, let us work out explicitly the $d=3$ case. We have two nonzero coordinates, corresponding to the operators $Z^{(1)}$ and $Z^{(2)}$. Remember that these matrices are +$$Z^{(1)}=\sqrt{3/2}\begin{pmatrix}1&0&0\\0& -1&0\\0&0&0\end{pmatrix},\qquad +Z^{(2)}=\sqrt{1/2}\begin{pmatrix}1&0&0\\0& 1&0\\0&0&-2\end{pmatrix}.$$ +so that the corresponding coordinates are: +\begin{array}{cc} + & z_1 & z_2 \\ \hline +\lvert1\rangle & \sqrt{3/2}& \sqrt{1/2}\\ +\lvert2\rangle & -\sqrt{3/2}& \sqrt{1/2}\\ +\lvert3\rangle & 0& -\sqrt2 +\end{array} +It is easier to recognise what these points represent by normalising the vectors, which gives +$$\lvert1\rangle\doteq\begin{pmatrix}\sqrt3/2 \\ 1/2\end{pmatrix}=\begin{pmatrix}\sin(\pi/3) \\ \cos(\pi/3)\end{pmatrix},\quad +\lvert2\rangle\doteq\begin{pmatrix}-\sqrt3/2 \\ 1/2\end{pmatrix}=\begin{pmatrix}\sin(2\pi/3) \\ \cos(2\pi/3)\end{pmatrix},\quad +\lvert3\rangle\doteq\begin{pmatrix}0 \\-1\end{pmatrix}.$$ +In other words, the states $\lvert1\rangle,\lvert2\rangle,\lvert3\rangle$ are mapped into an equilateral triangle: +

+ +

Explicit $d=4$ example

+ +

In four dimensions, we have

+ +

$$ +Z^{(1)}=\sqrt{2}\begin{pmatrix}1&0&0&0\\0& -1&0&0\\0&0&0&0\\0&0&0&0\end{pmatrix},\quad +Z^{(2)}=\sqrt{2/3}\begin{pmatrix}1&0&0&0\\0& 1&0&0\\0&0&-2&0\\0&0&0&0\end{pmatrix},\quad +Z^{(3)}=\sqrt{1/3}\begin{pmatrix}1&0&0&0\\0& 1&0&0\\0&0&1&0\\0&0&0&-3\end{pmatrix},$$ +and thus the computational basis is sent to

+ +

\begin{array}{ccc} + & z_1 & z_2 & z_3 \\ \hline +\lvert1\rangle & \sqrt{2}& \sqrt{2/3} & \sqrt{1/3} \\ +\lvert2\rangle & -\sqrt{2}& \sqrt{2/3} & \sqrt{1/3} \\ +\lvert3\rangle & 0& -2\sqrt{2/3} & \sqrt{1/3} \\ +\lvert4\rangle & 0 & 0 & -\sqrt3 +\end{array}

+ +

Renormalising the lengths and working out the angles we find that again the elements of the basis are mapped into a regular figure, in this case a tetrahedron (as in, the states are mapped into the vertices of a tetrahedron):

+ +

+ +

General $d$ case

+ +

The natural next step is to ask whether this feature (that is, that the computational basis is mapped into the regular $(d-1)$-dimensional $d$-vertices polytope in which the pairwise distance between vertices is constant) still holds increasing the number of dimensions. It seems almost obvious that it does, but I haven't found a nice way to show it yet.

+",55,,55,,6/6/2019 15:41,6/6/2019 15:41,,,,1,,,,CC BY-SA 4.0 +6360,2,,6315,6/6/2019 12:22,,1,,"

Unfortunately, I'm pretty sure that the functionality you desire does not exist. You'll need to do it by constructing the unitary yourself, for example via this method provided in the answer to another question.

+ +

For reference, the full specification for OpenQASM 2.0 can be found here.

+",409,,,,,6/6/2019 12:22,,,,0,,,,CC BY-SA 4.0 +6361,2,,6326,6/6/2019 12:53,,4,,"

Fidelity is a single-number measure of how good a gate is. Since there are many ways that a gate can go wrong, there are multiple ways that the fidelity can be defined. The exact answer to your question will therefore depend on which kind of fidelity you want.

+ +

Any measure of fidelity will typically involve comparing the gate that you wanted to the channel that actually happened. This channel can be described by a Choi matrix. More discussion of channels and Choi matrices can be found in the answer to this question.

+ +

For a concrete example in Qiskit, see the notebook on how to use the tomography tool from Qiskit Ignis. For example, here is the tomography of a single qubit Hadamard gate.

+ +
# Process tomography of a Hadamard gate
+q = QuantumRegister(1)
+circ = QuantumCircuit(q)
+circ.h(q[0])
+
+# Run circuit on unitary simulator to find ideal unitary
+job = qiskit.execute(circ, Aer.get_backend('unitary_simulator'))
+ideal_unitary = job.result().get_unitary(circ)
+# convert to Choi-matrix in column-major convention
+choi_ideal = outer(ideal_unitary.ravel(order='F'))
+
+# Generate process tomography circuits and run on qasm simulator
+qpt_circs = process_tomography_circuits(circ, q)
+job = qiskit.execute(qpt_circs, Aer.get_backend('qasm_simulator'), shots=4000)
+
+# Extract tomography data so that counts are indexed by measurement configuration
+qpt_tomo = ProcessTomographyFitter(job.result(), qpt_circs)
+qpt_tomo.data
+
+ +

Given the data, we can then find the best fit to a Choi matrix. For example, using the MLE Least-Squares tomographic reconstruction.

+ +
choi_lstsq = qpt_tomo.fit(method='lstsq')
+
+ +

By comparing this with the ideal Choi matrix, we can calculate the fidelity using the state_fidelity and process_fidelity tools. For the latter, we'll need to use require_cptp=False in case the Choi matrix doesn't quite describe a cptp map.

+ +
print('fit fidelity (state):', state_fidelity(choi_ideal / 2, choi_lstsq.data / 2))
+print('fit fidelity (process):', np.real(process_fidelity(choi_ideal, choi_lstsq.data, require_cptp=False)))
+
+ +

This should give an output that is something like

+ +
fit fidelity (state): 0.9976767994222256
+fit fidelity (process): 0.995358994837865
+
+",409,,409,,6/19/2019 9:05,6/19/2019 9:05,,,,0,,,,CC BY-SA 4.0 +6362,1,,,6/6/2019 13:59,,3,138,"

I am using Qiskit in an algorithm. In the end, I am measuring exactly a register of 4 qubits but the histograms show states with 5 qubits.

+ +

This is the code I used:

+ +
qwc = QuantumCircuit(qnodes, qnodes2, cqnodes, cqnodes2)
+qwc.measure(qnodes, cnodes)
+qwc.draw(output=""mpl"")
+
+ +

and finally qnodes2 is measured and represented in the plot as states qubits?

+ +

Any ideas what the problem might be?

+",7405,,26,,6/9/2019 8:20,6/9/2019 8:20,Measurement inconsistency in Qiskit,,0,5,,,,CC BY-SA 4.0 +6363,2,,6357,6/6/2019 14:07,,2,,"

If you are in the interactive window, it probably works similarly to Jupyter Notebooks. I would run %matplotlib inline, and then try calling circuit.draw(output='mpl') again.

+ +

You could also try running the line circuit.draw(output='mpl') twice, as that also will render the Figure in Jupyter Notebookes.

+",6180,,6180,,6/6/2019 18:34,6/6/2019 18:34,,,,5,,,,CC BY-SA 4.0 +6364,1,6369,,6/6/2019 14:40,,5,1869,"

Where does Qiskit put the rendered figure created by circuit.draw(output='mpl')?

+",7405,,26,,6/9/2019 8:21,1/19/2022 8:35,About the Qiskit draw function,,2,3,,,,CC BY-SA 4.0 +6365,1,6373,,6/6/2019 15:43,,6,504,"

I am trying to solve a minimum spanning tree problem using Grover's Algorithm. To accomplish this I would need to search a list for the minimum weight or edge for each point, for example:

+ +

Given the following list:

+ +

+ +

How would one use Grover's algorithm to search for the minimum weight ie. 1 and then return the values (C, G). I am trying to understand how this problem would be practically applied on either an actual quantum processor or the simulator. I know that an oracle is needed to give the values, but how would this be implemented. Any help is appreciated.

+",7674,,26,,6/7/2019 14:11,6/7/2019 14:11,Implementation of Grover's Algorithm (minimum spanning tree),,1,1,,,,CC BY-SA 4.0 +6366,2,,6319,6/6/2019 18:11,,1,,"

I think my circuit is wrong is as there is indeed a conditional phase shift on q[1], but as I said it also adds to him a 'global' phase which I didn't care for. This 'global' phase isn't actually global for the whole 2-qubits system, as it doesn't affect q[2].

+ +

A reminder for me of the necessity to look at the system as a whole when talking about qubits, as opposed to classical bit by bit examination.

+",7642,,,,,6/6/2019 18:11,,,,0,,,,CC BY-SA 4.0 +6367,1,6372,,6/6/2019 18:48,,5,899,"

I do not know if the question is not too easy, but I'll put it here, because I'm interested in it.

+ +

So the state of a qubit is often stated in this form: +$$|\psi\rangle=\alpha|0\rangle+\beta|1\rangle$$ +An example would be: +$$|\psi\rangle=\frac{1}{\sqrt{2}}|0\rangle+\frac{1}{\sqrt{2}}|1\rangle$$ +So now to my actual question. Suppose that in front of the $\alpha$ and/or $\beta$ would be an $i$.

+ +

About as:

+ +

$$|\psi\rangle=i\alpha|0\rangle+\beta|1\rangle$$

+ +

What would that say, what would be the meaning of it. In short what does that mean? What does this ""$i$"" say?

+ +

I hope my question is understandable.

+",4974,,55,,10/21/2021 8:20,10/21/2021 8:20,What would be the meaning of an $i$ in a qubit state $i\alpha|0\rangle+\beta|1\rangle$?,,2,0,,,,CC BY-SA 4.0 +6369,2,,6364,6/6/2019 19:30,,7,,"

Qiskit does not save the rendered Figure of the circuit anywhere, unless you provide a filename to the call.

+ +

For example: circuit.draw(filename='<file_path>').

+ +

In regards to having the Figure render and stay open, you simply need to remove a line of code. If you go to where qiskit is installed in your environment, go into the file qiskit/visualization/matplotlib.py, and go to line 436 you will see the line plt.close(self.figure). Comment this line out, and run your program again. You should see the Figure in a new window.

+",6180,,,,,6/6/2019 19:30,,,,2,,,,CC BY-SA 4.0 +6371,2,,6367,6/6/2019 20:08,,7,,"

You have applied a

+ +

$$ +U = \begin{pmatrix} +i &0\\ +0&1 +\end{pmatrix} +$$

+ +

gate.

+ +

You have not affected the probabilities of measuring $0$ or $1$ in the computational basis but you have affected other observables.

+ +

For example, consider the case you described already as

+ +

$$ +\mid \psi \rangle = \frac{1}{\sqrt{2}} \mid 0 \rangle + \frac{1}{\sqrt{2}} \mid 1 \rangle\\ +U \mid \psi \rangle = \frac{i}{\sqrt{2}} \mid 0 \rangle + \frac{1}{\sqrt{2}} \mid 1 \rangle\\ +$$

+ +

Before if you applied $X$ you would just get the same state back.

+ +

$$ +X \mid \psi \rangle = X \frac{1}{\sqrt{2}} \mid 0 \rangle + X \frac{1}{\sqrt{2}} \mid 1 \rangle\\ += \frac{1}{\sqrt{2}} \mid 1 \rangle + \frac{1}{\sqrt{2}} \mid 0 \rangle\\ += \frac{1}{\sqrt{2}} \mid 0 \rangle + \frac{1}{\sqrt{2}} \mid 1 \rangle\\ += \mid \psi \rangle\\ +X U \mid \psi \rangle = X \frac{i}{\sqrt{2}} \mid 0 \rangle + X \frac{1}{\sqrt{2}} \mid 1 \rangle\\ += \frac{i}{\sqrt{2}} \mid 1 \rangle + \frac{1}{\sqrt{2}} \mid 0 \rangle\\ +\neq U \mid \psi \rangle +$$

+ +

So before measuring X gave 1 with probability 1, but after applying $U$ it did not.

+ +

So even though it didn't affect the probabilities in the eigenbasis of the Z operator which gives the computational basis, if you do other transformations, you can see the effect.

+",434,,,,,6/6/2019 20:08,,,,3,,,,CC BY-SA 4.0 +6372,2,,6367,6/7/2019 1:23,,4,,"

Let's consider the state +$$|\psi\rangle=\alpha|0\rangle+\beta|1\rangle.$$ +As you said, the magnitudes $|\alpha|^2$ and $|\beta|^2$ give you the relative probabilities of finding the state in $|0\rangle$ and $|1\rangle$ if you make a measurement in the $\{|0\rangle,|1\rangle\}$ basis.

+ +

There is more to it than the magnitudes however, because quantum mechanics is based on the idea of waves, and waves have both a magnitude and a phase. Imagine two sine waves of equal amplitude, what happens when you interfere them with each other? The answer depends on if they are in-phase (they sum to something with double the amplitude), out-of-phase (the result has zero amplitude), or something in between (somewhere between zero and double amplitude).

+ +

Similarly, when you see $\alpha|0\rangle$, imagine $\alpha$ as a ray in the 2D complex plane. This ray has magnitude $|\alpha|$, but it also has a phase. If we interfere our qubit $|\psi\rangle$ with another $|\phi\rangle=\alpha'|0\rangle+\beta'|1\rangle$, the result will be +$$\frac{1}{\sqrt{2}}\left(|\psi\rangle+|\phi\rangle\right)=\frac{\alpha+\alpha'}{\sqrt{2}}|0\rangle+\frac{\beta+\beta'}{\sqrt{2}}|1\rangle.$$ +The coefficient of $|0\rangle$ is found by adding together the two rays $\alpha$,$\alpha'$, and similarly for $|1\rangle$ and $\beta$,$\beta'$. Even if $|\alpha|=|\alpha'|$, $|\beta|=|\beta'|$, the result will be very different depending on the phases.

+",452,,,,,6/7/2019 1:23,,,,2,,,,CC BY-SA 4.0 +6373,2,,6365,6/7/2019 7:58,,5,,"

Just giving two possibilities. There may be others more efficient but that can be a good start.

+ +

Let us take your case. You have a graph with 8 points. Say we index each point by an integer alphabetically: A=0,B=1,C=2,...H=7. You can represent them in supperposition using a 3-qubit register and the Hadamard transform. Add another 3-qubit register. This give us all possible connexions between points:

+ +

$$ \frac{1}{8} (| AA \rangle + | AB \rangle + | AC \rangle + ... + | GH \rangle) $$ +Of course, in that case, we consider we can have loops and we also have connexions that may not exist in our graph.

+ +

Then using another register, you can compute the edge value for a connexion (using for example a controlled-adder circuit to add the edge value depending on the connexion computational basis):

+ +

$$ \frac{1}{8} (| AA \rangle + | AB \rangle + | AC \rangle + ... + | GH \rangle) | 0\rangle \rightarrow +\frac{1}{8} (| AA \rangle | 0\rangle + | AB \rangle | 5\rangle + | AC \rangle | 7\rangle + ... + | GH \rangle | 6\rangle) +$$

+ +

Also, another way I can think of is to assign an integer index to the connexion/edges of the graph themselves , which lets you work on only one register for storing the index. You just need enough qubits to have all edges indices in superposition. And again, use another register to compute their values like above.

+ +

Now for the search, you would look at the edge value register when searching. +You can use Durr and Hoyer's adaptation of Grover search to find the minimum. Or in your case, directly implement an oracle that recognizes the value 1 in the edge/value register (imagine this would be your first check/try to find the minimum) and use a simple Grover search.

+",4127,,,,,6/7/2019 7:58,,,,0,,,,CC BY-SA 4.0 +6374,1,,,6/7/2019 17:49,,8,706,"

Question 1: The bell state for a 2-qubit system has been defined in Neilsen and Chuang's book as the set of maximally entangled states spanned by $\{|00\rangle + |11\rangle, |00\rangle - |11\rangle, |01\rangle + |10\rangle, |01\rangle- |10\rangle \}$. What is the higher dimensional definition of a Bell state for an n-qubits system?

+ +

Question 2: More specificity, Consider the toric code on a $L\times L$ lattice. There are $2L^2$ qubits on it. Consider the minimal case when $L=3$, ie. we have $18$ qubits. How does the code space look like? Is it some sort of ""bell-state"" for these qubits? Is it possible to explicitly write the code space for this as in the case of say, a repetition code.

+ +

Thanks!

+",7685,,26,,6/9/2019 8:19,6/10/2019 13:50,What is the definition of Bell state on a n-qubit system?,,1,3,,,,CC BY-SA 4.0 +6375,1,6377,,6/7/2019 21:39,,6,246,"

This question relates to exercise 10.4 in Nielsen and Chuang.

+ +

For syndrome diagnosis, the textbook provides an example where one has four projectors, by which, you can identify where a one qubit error has occurred. In this scheme, the syndrome measurement does not cause any change to the state.

+ +

The exercise asks you to write down the projectors for the eight computational basis states, which is easy enough. $|0/1 \,\, 0/1 \,\, 0/1 \rangle \langle0/1 \,\, 0/1 \,\, 0/1 |$.

+ +

I think the point of the question is for one to say that when you project these onto your one qubit corrupted state, you can tell where the one qubit error has occurred. However, I thought projective measurement needs to be repeated multiple times to be able to reconstruct your full state (for example, if my state is $\alpha |000\rangle + \beta|111\rangle$, in order for me to actually find out what $\alpha$ and $\beta$ are, I need to repeat projection of the state on to $|000\rangle$ and $|111\rangle$ multiple times to form a statistic.

+ +

So, the bottom line is, I don't see how projections on to the eight computational basis states can be used to diagnose the error syndrome. Since projecting your state onto any of the eight computational basis states will mess up your state.

+ +

(Even before getting to the question above, how does one perform the syndrome measurement without causing any change to the state? On page 428, it's claimed that if the corrupted state is $\alpha |100\rangle + \beta|011\rangle $, it remains $\alpha |100\rangle + \beta|011\rangle $ even after the syndrome measurement. I'm having a hard time wrapping my head around the idea of constructing such syndrome projectors in terms of designing an actual experiment.)

+",4399,,23,,6/8/2019 23:57,6/8/2019 23:57,Error syndromes and recovery procedure in bit flip code,,1,0,,,,CC BY-SA 4.0 +6376,1,6379,,6/7/2019 23:06,,6,213,"

Consider the following protocol.

+ +

We are given either + $|\psi\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$ or $|\phi\rangle = \alpha_{0} |0\rangle + \alpha_{1}|1\rangle$ where $\alpha_{0}^{2}$ is chosen uniformly at random from $[0, 1]$ and $\alpha_{1}^{2}$ is chosen accordingly to normalize the sum.

+ +

We measure in the computational basis and depending on the result, discriminate between $|\psi\rangle$ and $|\phi\rangle$.

+ +

It is intuitive to see that the protocol is highly likely to fail. But what might be a mathematical way to reach the same conclusion?

+",7688,,7688,,6/8/2019 4:54,6/10/2019 19:08,Question on state distinguishability,,1,7,,,,CC BY-SA 4.0 +6377,2,,6375,6/8/2019 2:51,,5,,"

You quoted the first part of the exercise; your question is exactly the second part of the exercise :-)

+ +

Exercise 10.4 (2) asks you to show that the described recovery procedure (the one which projects the state on one of the 8 basis states) works only for computational basis states.

+ +

Indeed, if you have a corrupted state $\alpha |100\rangle + \beta|011\rangle$, projecting it onto one of the basis states will yield $|100\rangle$ or $|011\rangle$, telling you that there was indeed an error on the first qubit, but at the same time destroying the superposition and ruining the calculation. This is why you have to do a smarter measurement than that to preserve superposition.

+ +
+ +

For the second part of the question, for me it is easier to think about these measurements in terms of measuring $Z_1Z_2$ and $Z_2Z_3$ observables (see page 430 and exercise 10.3). To measure an observable $Z_1Z_2$, you can do the following:

+ +
    +
  • allocate an extra qubit $a$ in state $|0\rangle$,
  • +
  • do a CNOT with $q1$ as control and $a$ as target,
  • +
  • do a CNOT with $q2$ as control and $a$ as target,
  • +
  • measure $a$ in computational basis.
  • +
+ +

If you do the math, you'll see that the measurement will give 1 if qubits 1 and 2 have different parity and 0 if they have the same parity (which is exactly what you're looking for) without destroying the superposition (since in each term of the superposition the parity of qubits 1 and 2 is the same, even if qubit states differ).

+",2879,,2879,,6/8/2019 3:00,6/8/2019 3:00,,,,2,,,,CC BY-SA 4.0 +6379,2,,6376,6/8/2019 14:26,,10,,"

This is a question from classical probability theory. I suppose $a_i$ are real (and $\alpha_i \ge 0$), though it's also possible to consider the complex case. The probability of obtaining $|0\rangle$ from the measurement of $\alpha_{0} |0\rangle + \alpha_{1}|1\rangle$ is $\alpha_0^2$. This probability is in fact a conditional probability $P(|0\rangle ~~\vert~~|\phi\rangle = \alpha_{0} |0\rangle + \alpha_{1}|1\rangle )$ of obtaining $|0\rangle$ from $|\phi\rangle$ where the condition is $|\phi\rangle = \alpha_{0} |0\rangle + \alpha_{1}|1\rangle$. In a discrete case (if $\alpha_0$ has only finite number of possible values) to calculate overall probability of obtaining $|0\rangle$ from $|\phi\rangle$ we could use the law of total probability +$$ +P(|0\rangle) = \sum_{a_0} P(|0\rangle ~~\vert~~|\phi\rangle = \alpha_{0} |0\rangle + \alpha_{1}|1\rangle )P(|\phi\rangle = \alpha_{0} |0\rangle + \alpha_{1}|1\rangle) +$$ +But we have a continuous case here with $P(|\phi\rangle = \alpha_{0} |0\rangle + \alpha_{1}|1\rangle) = 0$.
+So we need to take the integral. There is a theory of how to calculate such probabilities with integrals, but I think in our case it is the correct way just to assume that $\alpha_0^2$ is uniformly distributed on $\{\frac{k}{n}, k=1..n\}$, calculate probability $P_n(|0\rangle)$ and then take the limit for $n \rightarrow \infty$.

+ +

$$ +P_n(|0\rangle) = \sum_{k=1}^n P(|0\rangle ~~\vert~~|\phi\rangle = \sqrt{\frac{k}{n}} |0\rangle + \sqrt{\frac{n-k}{n}}|1\rangle )P(|\phi\rangle = \sqrt{\frac{k}{n}} |0\rangle + \sqrt{\frac{n-k}{n}}|1\rangle) = +$$ +$$ += \sum_{k=1}^n \frac{k}{n} \cdot \frac{1}{n} = \sum_{k=1}^n \frac{k}{n^2} = \frac{n(n+1)}{2}\cdot\frac{1}{n^2} = \frac{n+1}{2n} +$$

+ +

The limit is $\frac{1}{2}$, which coincides with the probability of obtaining $|0\rangle$ from measuring $|\psi\rangle = |+\rangle$

+ +

Remark
+Note that I assumed that you are given a lot of copies of $|\psi\rangle$ or a lot of samples of $|\phi\rangle$ (with varying $\alpha_0$) and you are asked to distinguish the case. If you are given only one copy of $|\psi\rangle$ or $|\phi\rangle$, then you can't distinguish it (with certainty) simply because the measurement of $|+\rangle$ will give random result.

+ +

Update
+Another approach is to calculate the expected density matrix of $|\phi\rangle$:
+$$ +E(|\phi\rangle\langle\phi|) = \int_0^1(\sqrt{x_0}|0\rangle+\sqrt{1-x_0}|1\rangle)(\sqrt{x_0}\langle 0|+\sqrt{1-x_0}\langle 1|)dx_0 = +$$ +$$ += \int_0^1x_0dx_0 \cdot |0\rangle\langle 0| + \int_0^1(1-x_0)dx_0 \cdot |1\rangle\langle 1| + $$ +$$ + \int_0^1\sqrt{x_0(1-x_0)}dx_0 \cdot |0\rangle\langle 1| + \int_0^1\sqrt{(1-x_0)x_0}dx_0 \cdot |1\rangle\langle 0| = +$$ +$$ += \frac{1}{2}(|0\rangle\langle 0| + |1\rangle\langle 1|) + \frac{\pi}{8}(|0\rangle\langle 1| + |1\rangle\langle 0|) +$$

+ +

Hence the overall probability of obtaining $|0\rangle$ from measuring $|\phi\rangle$ in computational basis is $\text{Tr}(E(|\phi\rangle\langle\phi|) \cdot |0\rangle\langle 0|) = \frac{1}{2}$.

+ +

Here we can see the difference with the complex case, since the expected density matrix will be $\frac{1}{2}I$.

+",5870,,5870,,6/10/2019 19:08,6/10/2019 19:08,,,,12,,,,CC BY-SA 4.0 +6380,1,,,6/8/2019 18:40,,7,55,"

I was wondering how to create generalized entangled superpositions of qubits when I came to need of an algorithm to generate the following:

+ +

Suppose we have two $n$ qubit states, $$|\psi\rangle = \sum_X \alpha_X\ |X\rangle$$ +and, $$|\phi\rangle = \sum_X \beta_X\ |X\rangle.$$

+ +

How do I come up with a state, $$|\psi'\rangle = \frac1{\sqrt N}\sum_X (\alpha_X+\beta_X)\ |X\rangle,$$ +where $N$ is the normalization factor?

+",7693,,26,,6/9/2019 8:17,6/9/2019 8:17,Summation of amplitudes,,0,3,,6/10/2019 14:48,,CC BY-SA 4.0 +6381,1,6407,,6/8/2019 19:32,,3,57,"

I am interested in a couple of books or arXiv links to learn how to develop quantum circuits for the purpose of simulating quantum multi-body systems. Moreover, I am interested in learning how to develop an ansatz from a quantum circuit.

+ +

Any suggestions will be very appreciated.

+ +

Thanks!

+",6253,,26,,6/9/2019 8:16,6/11/2019 12:18,Primer for learning about quantum circuits simulating systems,,1,4,,,,CC BY-SA 4.0 +6382,1,,,6/8/2019 20:02,,1,74,"

Let's say I have a circuit that given in the figure

+ +

As we can see that this circuit consists of $2$-Toffoli gates and $4$ C-NOT gates, and to construct this entire circuit using only single qubit gates I would require at least $12$ C-NOT gates $6$ for each of the step UMA and MAJ. That makes it a total of at least $16$ C-NOT Gates. Now my question is if I modify these circuits by putting two controls for each of them such that each of them operates if both controls are (say) $1$. Then I have $2$ CCCC-NOT gates and $4$ CCC-NOT gates. Now for this, I need at least $(8\times 4 + 10\times 2=52)$ C-NOT gates.

+ +

This is using an article that says to stimulate a $n$ qubit Toffoli gate we need at least $2n$ C-NOT gates.

+ +

Is my reasoning for my circuit correct? Can somebody help?

+",6070,,26,,6/9/2019 8:15,6/9/2019 8:15,Controlled controlled adder gates involved,,0,2,,,,CC BY-SA 4.0 +6383,1,,,6/8/2019 20:24,,7,402,"

Is it possible to run grover's diffusion step on a subset of the possible input space?

+ +

By this, I mean is it possible to do the diffusion process with a state space isn't in a total superposition of all states.

+ +

Let's say I have a 2 qubit system in a equal superposition of states $\left|00\right>$, $\left|01\right>$ and $\left|10\right>$, but have exactly a 0 probability of measuring a $\left|11\right>$. Also, let's say I have a function $f$ that only outputs a 1 for the input 00. Is there a modification to Grover's where I can do the diffusion only on the $\left|00\right>$, $\left|01\right>$ and $\left|10\right>$ states and leave the $\left|11\right>$ state unchanged?

+ +

If that is possible, does it speedup the diffusion? Say I have a state with $n$ qubits but $2^x$ non-zero states where $x < n$, does this modified grover's algorithm still run in $\mathcal O(2^{n/2})$, or can it run in $\mathcal O(2^{x/2})$?

+",7694,,26,,6/9/2019 8:14,3/4/2022 23:46,Grover's diffusion on subset of input space,,1,1,,,,CC BY-SA 4.0 +6384,2,,6383,6/9/2019 5:18,,6,,"

This can work. There's no reliance on powers of two or anything like that in the basic conception of the algorithm.

+

If $S$ is a subset of computational basis states with $N$ elements and you have a superposition: $$\left |\phi\right> = \frac{1}{\sqrt{N}}\sum_{x \in S}\left|x\right>$$ then basically all you need to do is change the classic Grover diffusion operator with the complete $n$-qubit uniform superposition $\left|\psi\right>$: $$2\left|\psi\right>\left<\psi\right| - I$$

+

into:

+

$$2\left|\phi\right>\left<\phi\right| - I$$

+

A common way of composing the Grover diffusion operator for an $n$-qubit system without fancy gates is to make it out of two Hadamards and some implementation of the diagonal matrix $2\left|0\right>\left<0\right| - I$ via:

+

$$H^{\otimes n}(2 \left|0\right>\left<0\right| - I)H^{\otimes n}$$.

+

To get our new diffusion operator, we just need to replace the left Hadamard gate with a gate $B$ and the right Hadamard with $B^{\dagger}$ (if they are not the same) where $B\left|0\right> = \left|\phi\right>$

+

From a fully general perspective, if determining whether something is in $S$ is itself difficult, implementing $B$ and having $\left|\phi\right>$ in the first place would void any advantage gained by subsetting.

+

Assuming no difficulty with $B$, it will run in $\mathcal{O}(\sqrt{N})$ with your new $N$. The ideal stopping point will also still be $\approx \frac{\pi}{4}\sqrt{N}$ iterations.

+",7680,,7680,,3/4/2022 23:46,3/4/2022 23:46,,,,2,,,,CC BY-SA 4.0 +6385,1,,,6/9/2019 6:42,,6,683,"

Why should we use inverse QFT instead of QFT in Shor's algorithm? When I tried to simulate Shor's algorithm for small numbers, I got an answer even when I used just QFT instead of inverse QFT.

+",5410,,2224,,6/11/2019 0:50,6/11/2019 0:50,Why should we use inverse QFT instead of QFT in Shor's algorithm?,,1,1,,,,CC BY-SA 4.0 +6386,1,6396,,6/9/2019 10:10,,12,784,"

Let's say, that we have an optimization problem in the form:

+ +

$$ \min_x f(x) \\ g_i(x) \leq 0, i = 1, ..., m \\ h_j(x) = 0, j = 1, ..., p, + $$

+ +

where $f(x)$ is an objective function, $g_i(x)$ are inequality constraints and $h_j(x)$ are equality constraints.

+ +

Recently I was reading about the adiabatic quantum computing. The Wikipedia says:

+ +
+

First, a (potentially complicated) Hamiltonian is found whose ground state describes the solution to the problem of interest. Next, a system with a simple Hamiltonian is prepared and initialized to the ground state. Finally, the simple Hamiltonian is adiabatically evolved to the desired complicated Hamiltonian. By the adiabatic theorem, the system remains in the ground state, so at the end the state of the system describes the solution to the problem. Adiabatic quantum computing has been shown to be polynomially equivalent to conventional quantum computing in the circuit model.

+
+ +

Is there some general method of expressing the optimization problem (e.g. as presented above) in the Hamiltonian formalism used in adiabatic quantum computing?

+",2098,,10480,,4/7/2021 17:27,4/7/2021 17:27,Is there a general method of expressing optimization problem as a Hamiltonian?,,1,3,,,,CC BY-SA 4.0 +6387,1,6415,,6/9/2019 11:11,,5,83,"

Let's say, that we have an optimization problem in the form:

+ +

$$ \min_x f(x) \\ g_i(x) \leq 0, i = 1, ..., m \\ h_j(x) = 0, j = 1, ..., p, + $$

+ +

where $f(x)$ is an objective function, $g_i(x)$ are inequality constraints and $h_j(x)$ are equality constraints.

+ +

In adiabatic quantum computing the solution of this problem can be expressed as the ground state of some Hamiltonian. But I think, that it is possible to construct two or more Hamiltonians, whose ground states are solutions to the same problem.

+ +

Summarizing, how to tell, if two Hamiltonians represent the same optimization problem (or rather their ground states are solutions to the same problem)?

+",2098,,2224,,6/11/2019 1:43,6/12/2019 18:16,How to tell if the ground states of two Hamiltonians are solutions of the same optimization problem?,,1,1,,,,CC BY-SA 4.0 +6388,1,6389,,6/9/2019 14:09,,2,302,"

The maximally mixed state on m qubits is defined to be the quantum state with associated density operator $\rho_m = \frac{1}{2^m} I$. Examples are

+ +
    +
  • On one qubit this is $\rho_1 = \frac{1}{2}(|0\rangle\langle0|+|1\rangle\langle1|) = \frac{1}{2}I$
  • +
  • On two qubits we have $\rho_2 = \frac{1}{4} (|00\rangle\langle00| +|01\rangle\langle01|+|10\rangle\langle10|+|11\rangle\langle11|$.
  • +
+ +

My question is the following: how can the corresponding state vector $|\phi_m\rangle$ be expressed in terms of the standard basis elements, eg. $|\phi_2\rangle = \sum_{i,j} a_{i,j}|ij\rangle$? What are the values of $a_{i,j}$?

+",5710,,26,,6/10/2019 17:19,6/10/2019 17:19,How can I write the maximally mixed state on m qubits as a linear combination of basis vectors?,,1,0,,,,CC BY-SA 4.0 +6389,2,,6388,6/9/2019 14:46,,2,,"

If by ""corresponding state vector"" you mean a pure state $\lvert\psi\rangle$ such that $\lvert\psi\rangle\!\langle\psi\rvert$ is maximally mixed, then the answer is that there isn't one.

+ +

A density matrix $\rho$ can be written as $\rho=\lvert\psi\rangle\!\langle\psi\rvert$ for some ket state $\lvert\psi\rangle$ if and only if it is pure. One easy way to check for this is to compute $\mathrm{Tr}(\rho^2)$, which is the so-called purity of the state, and equals $1$ if and only if the state is pure.

+ +

A maximally mixed state is as far away as possible from this situation, in the sense that it is the state (or one of the states) which corresponds to the minimal possible value of the purity.

+ +

You might also want to have a look at these related questions:

+ + +",55,,,,,6/9/2019 14:46,,,,3,,,,CC BY-SA 4.0 +6390,2,,6385,6/9/2019 19:59,,9,,"

For Shor's algorithm, it actually doesn't matter which one you use.

+ +

If you apply the QFT twice, it is equivalent to a classical multiplication by -1 modulo $2^n$ where $n$ is the size of the register. That is to say, it reverses the order of all of the computational basis states except for $|0\rangle$ which stays where it started. $|k\rangle$ becomes $|-k\rangle = |2^n - k\rangle$.

+ +

Now, in Shor's algorithm, the output of the QFT is a state with amplitudes whose magnitudes are approximately periodic with a period that divides $2^n$. This isn't a coincidence; it's crucial to how the whole algorithm works. Because the period is a divisor of the number of computational basis states, reversing their order has a negligible effect on the state. Therefore there is little difference between using the QFT and the inverse QFT, because $\text{QFT}^{-1} = \text{QFT} \cdot \text{QFT}^{-1} \cdot \text{QFT}^{-1} = \text{QFT} \cdot \text{Mul}(-1)$.

+ +

Example:

+ +

+ +

Note how the probability distributions are almost identical after an inverse QFT or after a QFT (in the above diagram the second qft is just to undo the inverse QFT). Since the output distribution is nearly identical the algorithm works either way.

+",119,,,,,6/9/2019 19:59,,,,0,,,,CC BY-SA 4.0 +6391,1,6398,,6/9/2019 22:27,,2,96,"

I am noticing some erroneous behavior coming from the visualizer in some circuits I was running. I am not sure how widespread the issue is, but see the attached image for some strange behavior with the cZ gate.

+ +

Is there a place to see the matrix each gate is implementing like before?

+ +

Has anyone found similar issues?

+ +

This issue does not persist when I actually click ""run"" and select simulator. It seems to only affect the visualizer.

+ +

+",7701,,26,,6/11/2019 8:50,6/11/2019 8:50,Visualizer error in IBM Q Experience Beta,,1,2,,,,CC BY-SA 4.0 +6392,2,,6374,6/10/2019 3:28,,4,,"

1) There are 4 Bell states, namely the ones you listed divided by $\sqrt{2}$. There is no ""the bell state"". The Bell states are only defined for 2 qubits, so there is no ""higher dimensional definition of a Bell state"". One of the key features of the Bell states is that they're maximally entangled. If this is what you'd like in a higher dimensional analog of the Bell states then you'll want the GHZ states as Mark S suggests. An analysis coming to this conclusion can be found here: https://arxiv.org/pdf/quant-ph/9804045

+ +

2) The code space for the toric code on a 3x3 lattice consists of 4 different, long, complex superpositions of kets which each have 18 elements in them. I doubt anyone is willing to write them out for you. However it wouldn't be too difficult for a computer algebra system to crunch them.

+ +

Beyond being discussed in entry level texts for clarity, the actual codespace of an error correcting code is rarely ever used. The codespace is uniquely determined as the mutual +1 eigenspace of the code's stabilizers. In fact the stabilizers encode everything about the code so it's common to think of them as the code itself. Compared to the codespace, the stabilizers are much cleaner, more concise and obey nice algebraic properties which makes them preferable to use.

+ +

For the toric code the stabilizers are strings of $X$ and $ I$ or $Z$ and $I$ derived from the topology of a torus. It would be a tedious but straight forward exercise to explicitly enumerate all the stabilizers for the 3x3 lattice then find the elements spanning their mutual +1 eigenspace (hint: there's 4 of them encoding $|00\rangle$, $|01\rangle$, $|10\rangle$ and $|11\rangle$)

+",7701,,7701,,6/10/2019 13:50,6/10/2019 13:50,,,,0,,,,CC BY-SA 4.0 +6393,2,,6297,6/10/2019 4:36,,1,,"

You'd need to apply $P$ controlled on the second register. I assume you want a different operation for each of the 4 sets? In terms of a tensor product you'd need operators like

+ +

$$P_1\otimes |00\rangle\langle00|\otimes I$$ +$$P_2\otimes |01\rangle\langle01|\otimes I$$ +$$P_3\otimes |10\rangle\langle10|\otimes I$$ +$$P_4\otimes |11\rangle\langle11|\otimes I$$

+",7701,,,,,6/10/2019 4:36,,,,0,,,,CC BY-SA 4.0 +6394,2,,6242,6/10/2019 5:35,,2,,"

For completely arbitrary coefficients you are out of luck. A simple counting argument says that because:

+ +

1) The coefficients are continuous parameters +2) gates implement discrete operations +$\to$ +There is no finite circuit to prepare the vast majority of states. However, if you're okay with an arbitrarily good approximation to your state, then it can be done with relatively short gate sequences by the Solovay–Kitaev theorem. An algorithm for doing this is given here: https://arxiv.org/pdf/quant-ph/0505030

+ +

The most efficient is hard to say since, as you point out, there are many different metrics to choose from and this is an intensive area of active research. So I'd say as long as you're not writing quantum compilers and if you want something that will work for completely arbitrary state preparation, then the Solovay–Kitaev algorithm is a solid choice. If you are writing a quantum compiler you'll need to do a months long, intensive literature review.

+ +

Here's a recent paper I read that is cutting edge: https://arxiv.org/pdf/1807.03206

+ +

IBM's documentation (IBM Arbitrary Initialization) says it uses the techniques from: https://arxiv.org/pdf/quant-ph/0406176.pdf to accomplish this

+ +

I'll also give a nod to dissipative state preparation since that's something I personally work on and it seems to have some promise - but it's still too early for it to be really practical.

+",7701,,7701,,6/10/2019 16:14,6/10/2019 16:14,,,,4,,,,CC BY-SA 4.0 +6395,1,6405,,6/10/2019 14:56,,3,134,"

Need help! I was working on a project when I required to use a projection operator. For an example case, I have the Bell state, $$|\psi\rangle = \frac1{\sqrt2}\left(\color{blue}{|0}0\rangle+|11\rangle\right)$$ +which now I want to take to the state, +$$|\psi'\rangle = |\color{blue}{0}0\rangle$$ +by weeding out the states with the leftmost qubit as $1$.

+ +

Another example would be, $$\frac1{2}\left(|\color{blue}{0}0\rangle+|\color{blue}{0}1\rangle+|10\rangle+|11\rangle\right)\rightarrow\frac1{\sqrt2}\left(|00\rangle+|01\rangle\right).$$

+ +

Edit: +Just putting another example to make my question clear. I want to weed out states when the third (leftmost) qubit is $1$ in the following example.

+ +

Suppose we have a three qubit state, $$|\psi\rangle=\displaystyle\frac1{N}\left(|\color{blue}{0}\rangle\otimes\left[|00\rangle+|01\rangle+|10\rangle\right] + |1\rangle\otimes|11\rangle\right)$$ +it should then get transformed to $$|\psi'\rangle = \frac1{N'}|\color{blue}{0}\rangle\otimes\left[|00\rangle+|01\rangle+|10\rangle\right].$$

+ +

Is this possible? If yes, how can I implement it in the IBM Quantum Experience?

+",7693,,7693,,6/10/2019 18:21,6/11/2019 8:51,Weeding out qubit states with leftmost qubit as 1,,1,10,,,,CC BY-SA 4.0 +6396,2,,6386,6/10/2019 18:29,,9,,"

As requested in the comments, here is a worked example. The main body deals with minimizing $f(x)$ for a specific problem. At the bottom follows a brief discussion of constraints then a brief discussion about the general case.

+ +

Let's solve the Weighted Maximum Cut problem since this

+ +
    +
  1. Is a relatively straight-forward example
  2. +
  3. Is hard classically
  4. +
  5. Is a relatively common example in the literature (e.g. https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.90.067903)
  6. +
  7. Has a clear connection to a physical Hamiltonian (Ising spin-glasses)
  8. +
+ +

To understand the problem, we start with an undirected graph of $n$ vertices $\{V\}$, where each vertex $v_i\in V$ has weight $w_i\geq0$ and each edge connecting $v_i$ and $v_j$ has a weight $w_{ij}\geq0$. We then cut the graph into two pieces. The cut need not be straight but must not self-intersect and cannot cut any edge twice. Then we calculate a ""payout"" $P$ for our cut. The payout is the sum of the weights of the edges we cut through, plus the sum of the weights of the vertices on one side of the cut.$^1$

+ +

Source

+ +

In this image, the payout would be, $1+4+3+3+2 = 13$ for the edges plus $5+6+1 = 12$ for the vertices $\to P=25$ (assuming the number inside each vertex is its weight). The optimization problem is to maximize $P$ for a given graph.$^2$

+ +

To write this mathematically, we can think in terms of bit strings. We define a cut by a string $s\in\{0,1\}^n$ where $s_i=0\to v_i$ is not counted in the sum and $s_i=1\to v_i$ is counted in the sum. To make the math a little cleaner, if the graph isn't fully connected, make the graph to be fully connected and set $w_{ij}=0$ for any unconnected pairs $v_i,v_j$.

+ +

For example, looking at the image above again, let's interpret the numbers inside the vertices to be the vertex index instead of the weight like we assumed above. Then the drawn cut corresponds to $s=100011$. $s_1=s_5=s_6=1\to v_1, v_5, v_6$ are on the ""good"" side of the cut and get counted, while $s_2=s_3=s_4=0$ are on the ""bad"" side of the cut and are not counted.

+ +

This then allows us to write $$P(s) = \sum_i s_i w_i + \sum_{i,j} s_i(1-s_j)w_{ij}$$

+ +

The first term just counts the weights of all the vertices on the ""good"" side of the cut. The second term counts the weight of an edge if the vertices it connects are on opposite sides of the cut. Note this doesn't double count since it only counts the edge when $s_i=1, s_j=0$ and not when $s_i=0, s_j=1$.

+ +

So now our optimization problem is find the string $s$ which maximizes $P(s)$. The idea here is to think of $P(s)$ as a measure of energy of a system and $s$ as the state of the system. This means we can relate $P(s)$ to our Hamiltonian. There's a slight subtly here that we're trying to maximize $P(s)$ but we usually talk about finding the ground state of a Hamiltonian. This isn't an issue but I wanted to point it out - we can instead look at the highest energy excited state (anti-ground state if you will) or use $-P(s)$ as our energy function then work with the ground state like normal. Let's work with the highest excited state and maximize $P$.

+ +

We'd like create a Hamiltonian such that its highest energy state is $|s_0\rangle$ such that $P(s_0)$ is maximal. Essentially we want to turn $P(s)$, an energy function, into $\hat{H}$, an energy operator. We do this by noting that for $|s\rangle\in\{|0\rangle,|1\rangle\}$ we have $$\frac{I-Z}{2}|s\rangle=s|s\rangle\to\text{ define } \hat{s}_i=\frac{I-Z_i}{2}$$

+ +

Where $Z_i$ is the Pauli $Z$ acting on qubit $i$. Now we get our Hamiltonian by replacing $s$ with $\hat{s}$ (and 1 with $I$) in $P$

+ +

$$H=\sum_i \hat{s}_i w_i + \sum_{i,j} \hat{s}_i(I-\hat{s}_j)w_{i,j}=\sum_i\frac{I-Z_i}{2} w_i + \sum_{i,j} \frac{I-Z_i}{2}\left(I-\frac{I-Z_j}{2}\right)w_{i,j}$$

+ +

This can be cleaned up by expanding and seeing $\sum_{i,j}(Z_i-Z_j)=0\to$

+ +

$$H=\sum_i \frac{w_i}{2}\left(I-Z_i\right) + \sum_{i,j} \frac{w_{ij}}{4}\left(I-Z_iZ_j\right)=\sum_i \frac{w_i}{2}\left(I-Z_i\right) + \sum_{i<j} \frac{w_{ij}}{2}\left(I-Z_iZ_j\right)$$

+ +

We can clean this up even further by multiplying by 2 and removing a constant energy shift (delete the $I$ terms). New Hamiltonian with same eigenstates with eigenvalues scaled and shifted (clearly the maximum energy is unaffected by these transformations)

+ +

$$H=-\sum_i w_iZ_i - \sum_{i<j} w_{ij}Z_iZ_j$$

+ +

If you're a condensed matter physicist you'll likely recognize this Hamiltonian as an Ising spin glass. Not really relevant to the problem, but I think it's cool.

+ +

So now we have a Hamiltonian whose (anti-)ground state encodes the bit string $s_0$ which maximizes $P(s)$ and solves the problem.

+ +

The last thing we need is an initial Hamiltonian $H_0$, which we slowly (adiabatically) transform into our final Hamiltonian $H$ so we can define the full Hamiltonian $$H_T(t)=(1-f(t))H_0 + f(t)H: f(0)=0, f(t_f)=1$$

+ +

As a starting point $f(t)\propto t$ is often used for simplicity. The minimum $t_f$ determined by the desired accuracy and the spectral gap$^3$. The spectral gap is the minimum energy difference, over all $t$, between the (anti-)ground state and the next energy state. The analysis of the gap is highly non-trivial (see https://arxiv.org/abs/quant-ph/0509162) and determines the complexity/efficiency of the algorithm. An algorithm with 0 gap is not guaranteed to work at all.

+ +

So we want an $H_0$ such that

+ +
    +
  1. We can easily find and prepare its (anti-)ground state
  2. +
  3. The spectral gap of $H$ is not exponentially small in the size of the problem
  4. +
+ +

For this problem, a good initial Hamiltonian is $H_0 = \sum_i X_i$ because it's highest energy state is easy to find, it's $|+\rangle^{\otimes n}$. It's easy to prepare, just apply $H^{\otimes n}$ to $|0\rangle^{\otimes n}$. I don't have time to get into the analysis of the spectral gap but this Hamiltonian is unlikely to be ideal in that regard (see https://arxiv.org/abs/1701.05584).

+ +

With this choice of $H_0$ and taking $f(t)=t/t_f$ we are done. Our Hamiltonian is

+ +

$$ H(t) = \left(1-f(t)\right)\sum_i X_i-f(t)\left[\sum_i w_iZ_i + \sum_{i<j} w_{ij}Z_iZ_j\right]$$

+ +

Starting in state $|\psi_0\rangle = H^{\otimes n}|0\rangle^{\otimes n}$, evolving according to the above Hamiltonian for time $t_f$ (choosing a suitable $t_f$ is, again, generally highly non-trivial) then measuring in the computational basis should return (with high probability) the string $s=s_0$ which maximizes $P(s)$.

+ +

$^1$ This is ambiguous since by symmetry either side will do. We can make this rigorous by, for example, making the cut directed then taking the vertices to the left of the cut when walking along the direction of the cut.

+ +

$^2$ I had said in the comment we minimize a cost function, if you like this better just take cost $=-$ payout and minimize cost.

+ +

$^3$ I'm sweeping some details about what ""slow"" means under the rug but can be related to the energy scale of the problem (i.e. multiplying $H$ by a constant will change the speed).

+ +

Constraints

+ +

Let's say we want to modify the problem above to require that exactly $5$ vertices are on the ""good"" side of our cut. Mathematically this is $\sum_i s_i-5=0$. To enforce this, we add a penalty term into our Hamiltonian for solutions that break this constraint. So we add a term like $H_c = -\alpha\left(\sum_i \hat{s}_i -5I\right)^2$ choosing $\alpha$ big enough to ensure a state violating this constraint can't be the highest energy state.

+ +

Let's say instead we want to require that there are no more than $5$ vertices on the ""good"" side of our cut. This, it seems, is rather hard to do. In https://arxiv.org/abs/1702.06248 they state that approximating an inequality constraint to order $k$ requires $\mathcal{O}\left(N^{2k}\right)$ $k$-spin couplings which would require even more overhead to break them down into 2-qubit couplings which is often necessary on a given architecture. Essentially the strategy is to approximate a step function using a $k^\text{th}$ order polynomial. This seems like a terrible way to go about it - but I can't think of better way. This is coming from Troyer in 2017 so it's relatively unlikely, though certainly possible, that a better way is currently known.

+ +

The general case

+ +

The question asks about a general method for encoding an optimization problem into a Hamiltonian. Specifically we want to minimize $f(x)$ subject to a set of constraints. In the section above I discussed adding the constraints to the Hamiltonian. So for a completely general $f(x)$, is there a way to encode it into a Hamiltonian? The general method for this in the literature is to assume we have access to an efficient quantum oracle that implements $f(x)$. We can think of this as having a black box operation (i.e. quantum oracle) $\hat{f}(x)$ such that $\hat{f}(x)|x\rangle=f(x) |x\rangle$. Then we may construct our Hamiltonian as +$$ +H = \sum_x \hat{f}(x)|x\rangle\langle x| +$$ +Of course this just pushes the difficult part into finding/constructing $\hat{f}(x)$. In fact, simple counting arguments show that almost all (in the mathematical sense) quantum oracles are exponentially inefficient to implement (see http://www.ar-tiste.com/imp-oracles/imps2.pdf). So while this is a general encoding of an optimization problem into a Hamiltonian - it's not really practical. It would seem to be the case that if you want to encode your optimization problem into a Hamiltonian in a useful way - you'll need to leverage some structure of $f(x)$. My understanding is that the specifics of exactly how to do this and how to do this in the best manner is not fully understood and is the subject of active research.

+",7701,,7701,,6/11/2019 15:45,6/11/2019 15:45,,,,6,,,,CC BY-SA 4.0 +6397,1,6403,,6/10/2019 19:30,,4,362,"

I am faced with the problem of teleporting certain gates using modified Bell states. For example, I have solved the problem with the $S$ gate, which is defined as following:

+ +

Alice and Bob share a qubit in the state $S|\Phi^+\rangle = (|00⟩ + i|11⟩) / \sqrt2$. Alice has a qubit in the state $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$ which she wants to send to Bob as $S|\psi\rangle = \alpha|0\rangle + \beta i|1\rangle$. The part that needs to be implemented is Bob's fix-up part, so he ends up with $S|\psi\rangle$. Bob is only allowed to use Pauli and H gates. After the teleportation, Bob has one of the four states $S|\psi\rangle$, $SX|\psi\rangle$, $SZ|\psi\rangle$ or $SZX|\psi\rangle$. We can find the decode circuit by rewriting those as $S|\psi\rangle$, $(SXS^\dagger)S|\psi\rangle$, $(SZS^\dagger)S|\psi\rangle$ and $(SZXS^\dagger)S|\psi\rangle$. From here, we can decode to $S|\psi\rangle$ by finding $SXS^\dagger = Y$ and $SZS^\dagger = Z$.

+ +

The problem comes with trying this with the $T$ gate. Alice and Bob share the state $T|\Phi^+\rangle = (|00⟩ + e^{i\pi / 4}|11⟩) / \sqrt2$. Alice wants to send her qubit in the state $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$ to Bob as $T|\psi\rangle = \alpha|0\rangle + \beta e^{i\pi / 4}|1\rangle$. Bob is only allowed to use Pauli, $H$ and $S$ gates. This gives the problem of finding a Pauli, $H$ and $S$ gate decomposition of $TXT^\dagger$ and $TZT^\dagger$. However, this seems impossible to me, given you can't create a $T$ gate from Pauli, $H$ and $S$ gates. Clearly $TZT^\dagger = Z$, but I can't seem to figure $TXT^\dagger$ out.

+",7712,,7712,,6/10/2019 20:46,6/11/2019 6:45,Quantum gate teleportation T gate,,1,3,,,,CC BY-SA 4.0 +6398,2,,6391,6/10/2019 20:38,,3,,"

Thank you for pointing out this! The matrix of the cZ gate has been corrected in the in-browser simulator for the visualizations. Simply retry by refreshing your browser.

+",7714,,,,,6/10/2019 20:38,,,,2,,,,CC BY-SA 4.0 +6399,1,,,6/10/2019 21:00,,7,796,"

The Quantum Fourier Transform from Nielsen and Chuang chapter 5 is pictured here: +

+ +

In the textbook the author refers to ""swap gates at the end of the circuit which reverse the order of the qubits"".

+ +

My questions are:

+ +
    +
  1. Is it possible to transform the circuit shown in some way to avoid the need for any SWAP gates while still using little-endian conventions. Naively, I might think I could ""flip the circuit upside down"" so that the first operation is H(n), then R2 on qubit n controlled by qubit (n-1), and so on...

  2. +
  3. The Wikipedia page on QFTs makes no reference to reordering or SWAP gates - does this imply a different bitstring convention between the sources, or an error in one of the sources?

  4. +
+",1939,,2224,,6/11/2019 1:43,12/19/2021 3:05,Quantum Fourier Transform without SWAPs,,3,3,,,,CC BY-SA 4.0 +6400,1,6404,,6/11/2019 1:32,,4,146,"

IBM's simulator allows the use of a reset gate ($|0\rangle$ gate) however when I try to run a circuit using this gate on the hardware it fails to execute. Is there a plan to physically realize this gate?

+ +

I am specifically interested in running dissipative algorithms which need to reset the ancilla. I can get around this by invoking extra ancilla to reset my original ancilla - but this requires a lot of qubits for anything but a modest circuit.

+ +

It looks like such things are possible, at least in principle: https://arxiv.org/abs/1801.07689

+",7701,,26,,6/11/2019 8:11,6/11/2019 8:11,Back End for Reset Gate,,1,0,,,,CC BY-SA 4.0 +6401,1,,,6/11/2019 4:15,,4,583,"

Let's consider the following Bell state:

+ +

$$\lvert \Phi^+\rangle = \frac{1}{\sqrt{2}} (\lvert00\rangle + \lvert11\rangle)$$

+ +

What would happen if I measure the first qubit in the standard basis and keep the other one intact? Is the following computation correct?

+ +

$$\langle 0I\lvert\Phi^+\rangle\langle\Phi^+\lvert0I\rangle = \frac{1}{2}\lvert0\rangle\langle0\lvert$$

+ +

I is the two dimensional identity matrix. And +$$\langle 1I\lvert\Phi^+\rangle\langle\Phi^+\lvert1I\rangle = \frac{1}{2}\lvert1\rangle\langle1\lvert$$

+ +

Shouldn't have I gotten the probability of measurement instead of states?

+",2403,,55,,11/13/2019 19:03,11/13/2019 19:03,What happens if I measure only the first qubit of a Bell state?,,1,2,,,,CC BY-SA 4.0 +6402,2,,6401,6/11/2019 6:38,,3,,"

Recall the measurement postulate (as applied to projective measurements): A measurement is described by a set of projectors $P_i$ satisfying $\sum_iP_i=1$. If a state $|\psi\rangle$ is being measured, the outcome $i$ is obtained with probability $p_i=\langle\psi|P_i|\psi\rangle$, and if outcome $i$ is obtained, the state after measurement is $P_i|\psi\rangle/\sqrt{p_i}$.

+ +

The problem is how to describe the projections. In your case, you want to project the first qubit on the standard basis, and do nothing on the second qubit. So, that means you need +$$ +P_0=|0\rangle\langle 0|\otimes1,\qquad P_1=|1\rangle\langle 1|\otimes1, +$$ +because we remember that ""do nothing to a qubit"" is described by the identity operation.

+ +

So, what's the probability of getting the answer 0? +$$ +\langle\Phi^+|P_0|\Phi^+\rangle=\frac{1}{2}, +$$ +and the two-qubit state after the measurement is +$$ +\sqrt{2}P_0|\Phi^+\rangle=|00\rangle +$$

+ +

(I think all that is actually missing from your calculation is a trace over all the systems, but there's some of the intermediate steps that are not quite right, at least in terms of notation, even though mathematically you appear to have done the right thing.)

+",1837,,,,,6/11/2019 6:38,,,,0,,,,CC BY-SA 4.0 +6403,2,,6397,6/11/2019 6:45,,4,,"

Think about the following sequence: +$$ +XT^\dagger X=\left(\begin{array}{cc} e^{-i\pi/4} & 0 \\ 0 & 1 \end{array}\right)=e^{-i\pi/4}T. +$$ +So, that lets us write +$$ +TXT^\dagger=e^{-i\pi/4}TTX=e^{-i\pi/4}SX +$$ +Up to some phase, you have the decomposition that you want. In this context, that phase should be an irrelevant global phase that you can ignore.

+",1837,,,,,6/11/2019 6:45,,,,2,,,,CC BY-SA 4.0 +6404,2,,6400,6/11/2019 7:56,,3,,"

I'm afraid that the current interface between the hardware and software does not allow for the reset gate to be performed. Currently the hardware is set up to perform a measurement on qubits simultaneously, and then do nothing else. This means that any operations that come after measurements (either explicitly or as part of operations like reset or if) cannot currently be run on hardware.

+ +

As you point out, such operations are indeed possible in principle, and have been done in certain cases in the lab. But making them possible for general use is a more difficult task. It will be done, and that's why the IBM Q Experience and Qiskit allow you to create quantum programs with such operations, but that functionality is not available yet.

+",409,,,,,6/11/2019 7:56,,,,2,,,,CC BY-SA 4.0 +6405,2,,6395,6/11/2019 8:38,,5,,"

I'm afraid it is not possible to remove states from a superposition that you do not want. At least, not easily. If it were, a lot of computationally hard problems would become much easier, since you could just create a huge superposition and then weed out all the non-solutions to your problem.

+ +

There are ways to do it, however. But they always come with a price. The easiest to implement is post-selection, as mentioned in a comment above. This means simply measuring whether a condition is satisfied (in your case, whether a certain qubit outputs 0). The outcome to this measurement will be random, but it will sometimes give the answer you want. You just need to repeat until that happens.

+ +

The easiest way to run this in the IBM Q Experience is to make a circuit in which you first measure whether the condition is satisfied, and then do everything you would do on the remaining state if that condition comes out as true. When you run the circuit, you'll get many bit strings as output: some in which your condition is satisfied and some in which it is not. You then simply discard all the latter, and the former are then the results you need.

+ +

A method that is unitary would be to run Grover's algorithm to search for states that satisfy your condition. The way you do this may depend on the specific application you have in mind.

+",409,,,,,6/11/2019 8:38,,,,2,,,,CC BY-SA 4.0 +6407,2,,6381,6/11/2019 12:18,,2,,"

Here's a fairly thorough overview: https://arxiv.org/abs/1308.6253

+ +

For completeness I'll include the paper from the comment: https://arxiv.org/abs/quant-ph/0108146

+",7701,,,,,6/11/2019 12:18,,,,0,,,,CC BY-SA 4.0 +6408,1,6414,,6/11/2019 17:42,,3,281,"

When I run a stabilizer simulator such as Scott Aaronson's CHP simulator (defined in https://arxiv.org/abs/quant-ph/0406196), one of the possible outputs is a stabilizer table.

+ +

For example:

+ + + +
sim = StabilizerSim(num_qubits=3)
+sim.hadamard(2)
+sim.cnot(2, 0)
+sim.cnot(2, 1)
+sim.phase(0)
+sim.phase(1)
+sim.hadamard(0)
+sim.hadamard(1)
+sim.hadamard(2)
+print(sim)
+
+ +

Prints:

+ +
-YII
+-IYI
++IIX
+----
++XIX
++IXX
++YYZ
+
+ +

Where each of the lines is the Pauli product at the start of the circuit that corresponds to a Z or X observable of a qubit at the end of the circuit.

+ +

I would like to convert this representation into an explicit state vector, like shown in the display at the end of this Quirk circuit:

+ +

+ +

I'd like to get the state vector without having to simulate the circuit in a state vector simulator, because sometimes the number of output qubits is significantly smaller than the number of intermediate qubits and in such cases it would be much cheaper to only convert the final stabilizer state into a state vector.

+ +

One possible solution is to take the output stabilizer state, perform a known decomposition into a circuit, then execute the circuit in a state vector simulator. But I doubt that's a particularly efficient approach.

+ +

Alternatively, I could perform a series of post-selected projective measurements in the vectir simulator. The initial state would be half of an entangled state, and each measurement (and its outcome) is determined by stabilizers from the table. Like this:

+ +

+ +

However, this requires doubling the qubit count which is a quadratic space and time overhead in the calculation.

+",119,,119,,6/11/2019 21:53,6/11/2019 22:32,Deriving a state vector from a stabilizer state's generators,,1,0,,,,CC BY-SA 4.0 +6409,1,6455,,6/11/2019 18:46,,4,134,"

I'm trying to obtain a more intuitive understanding of the notion of quantum coherence and how to mathematically represent it. I know that coherence has to do with the interaction of phases between the basis states, so, if I suppose that I have a qubit in some state $|\psi\rangle = a|0\rangle + b|1\rangle,$ where $a$ and $b$ are unknown values but $p_{1} = |a|^2$ and $p_{2} = |b|^2$ are known values.

+ +

Would I be correct in saying that, in this scenario, I have a state that exhibits decoherence? Would the density matrix for this state be diagonal?

+",7729,,,,,6/14/2019 8:17,Quantum state where phase information is unknown,,1,1,,,,CC BY-SA 4.0 +6410,1,,,6/11/2019 20:47,,7,141,"

Without feedback/loop how can we build a sequential circuit? The basic feature of sequential circuit is that is depends not only on the current inputs but also on the previous inputs/outputs. I've gone through few papers on reversible gates and I'm so confused. Is it possible to create a quantum circuit (which is obviously reversible) which is a sequential circuit?

+",7731,,26,,6/12/2019 2:59,6/12/2019 2:59,Sequential circuit using quantum gates,,0,5,,,,CC BY-SA 4.0 +6411,1,,,6/11/2019 21:19,,5,57,"

I have read many papers related to it but in every paper, they just show the circuit of order finding algorithm for N=15, but did not explain what is the procedure to make it.

+ +

It will be great if anyone who had done this can suggests a good reference or explain it here.

+ +

Thank you.

+",7732,,26,,6/12/2019 3:02,6/12/2019 3:02,Can anybody explain or suggest a good reference on how to make a modular exponentiation circuit for N=15 with any coprime base?,,0,0,,,,CC BY-SA 4.0 +6412,1,6419,,6/11/2019 21:50,,2,274,"

I am writing a program where I need to find the eigenstates of an operator that is a Kronecker product of conditional quantum gates. I am wondering how I would compute this product in matrix form as the conditional gates act on different qubits.

+ +

For example: Say I want to find the Kronecker product of some Pauli-X gate X_k that acts on qubit k and conditional phase gates CZ_i,j that have a control qubit i and target j:

+ +
X_1 ⊗ CZ_2,3 ⊗ CZ_3,4 ⊗ CZ_2,4
+
+ +

How would I compute this product so the result is a matrix? (Or in some form where I can find the eigenstates) For context, I am using Python and NumPy.

+",7734,,26,,6/12/2019 2:56,6/12/2019 22:14,How do I write a tensor product of conditional gates in matrix form?,,2,5,,,,CC BY-SA 4.0 +6413,1,6456,,6/11/2019 22:03,,7,281,"

I am reading this paper entitled ""Quantum algorithm for linear systems of equations"" and am trying to understand a portion of the algorithm described on page 2 and in more detail in the appendix starting at the bottom of page 10 (section 3. Phase Estimation calculations).

+ +

Suppose we have a hermitian matrix $A$ of dimension $n$ and a vector $b$ of size $n$ and denote by $|u_j \rangle$ the eigenvectors of $A$, which are also eigenvectors of $e^{iAt}$, and $\lambda_j$ the corresponding eigenvalues. Ultimately this algorithm aims to find $x$ such that $Ax = b$.

+ +

Assuming we have access to the state $\left|\Psi_{0} \right\rangle = \sqrt{\frac {2} {T} } \sum_{\tau = 0} ^{T - 1} \sin \left(\frac {\pi(\tau + 1/2)} {T}\right) |\tau \rangle$, the algorithm instructs to apply $\sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau |\otimes e^{iA \tau to/T}$ to $|\Psi_{0} \rangle |b \rangle$, the former being referred to as a conditional Hamiltonian evolution. The register $C$ initially contains $|\Psi_0 \rangle $, while the register $I$ contains $|b \rangle$.

+ +

The author/s then writes ""assume the target state is $|u_j \rangle$, so this becomes simply the condition phase $|\Psi_{\lambda_j t_o} \rangle = \sqrt{\frac {2} {T} } \sum_{\tau = 0} ^{T - 1} e^{\frac {i \lambda_j \tau t_{0}} {T}} \sin \left(\frac {\pi(\tau + 1/2)} {T}\right) |\tau \rangle |u_j\rangle$"", where now we have a superposition of $|\Psi_0 \rangle$ and the result of applying $e^{iA\tau t_{0}/T}$ to the eigenvector $|u_j \rangle$. My questions are:

+ +
    +
  1. Are we not applying the conditional Hamiltonian evolution to $|\Psi_0 \rangle |b \rangle$? I know that $b$ can be decomposed mathematically as $b= c_1u_1 + \cdots + c_nu_n$ since these eigenvectors form an orthonormal basis. Why only consider the effect on $|u_j \rangle$?

  2. +
  3. What is going on with the $\sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau|$ portion of the sum in the conditional Hamiltonian evolution? In this answer here, it +is described ""[...] a control part. It means that the operation will be controlled by the state of the first quantum register (the register C as the exponent tells us)"". I understand the ""gist"" of this statement but any reference to understand it more fully would be much appreciated.

    + +

    Edit: Is $\sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau|$, not simply the identity matrix of dimension $T$? In which case the result after tensoring is a block matrix with $e^{iA\tau t_{0}/T}$ on the main diagonal, and $0_n$ elsewhere. Do I have this right?

  4. +
  5. After this step, a Fourier transform is applied to the register $C$, but at this point what is contained in register $ C$? The state $|\Psi_{\lambda_j t_o} \rangle $ seems to describe the superposition of registers $C,I$.

  6. +
+ +

I would be happy to edit/add any information that can help decipher this. Thanks

+",7481,,26,,6/17/2019 9:01,6/17/2019 9:01,"Clarification of the ""Calculations"" section of the (HHL09) paper",,2,0,,,,CC BY-SA 4.0 +6414,2,,6408,6/11/2019 22:32,,2,,"

The post-selection idea can be made to work without involving an entangled state. All that matters is that the initial state, before post-selection, has some overlap with the correct final state.

+ +

I'm unsure how to find or prove that a specific easy-to-prepare state has overlap with every possible stabilizer state. It seems like just ensuring each qubit is individually not in a stabilizer state is sufficient. For example, by using a pair of non-stabilizer X and Z rotations:

+ +

+ +

Even if this specific initial state strategy does not work, in practice a random initial state would work just fine.

+ +

In summary, here is what you do.

+ +
    +
  1. Get the stabilizer table from the stabilizer simulator.

    + +

    Note that the table comes in two chunks, and you only want the chunk corresponding to the Z observables.

  2. +
  3. In a state vector simulator, create an initial state that overlaps every stabilizer state.

  4. +
  5. In the state vector simulator, measure each of the Z-observable stabilizers from the stabilizer table and post-select on the measurement results being False.

  6. +
  7. Output the state vector simulator's state vector.

  8. +
+ +

The running time of this procedure is $O(n 2^n)$ where $n$ is the number of qubits in the output state. It is unclear if it possible to save the factor of $n$. Space usage is $O(2^n)$, which is optimal because that's the output size.

+",119,,,,,6/11/2019 22:32,,,,0,,,,CC BY-SA 4.0 +6415,2,,6387,6/12/2019 0:08,,5,,"

Short Answer: It is potentially hard (as bRost03 indicates in the comments). To be precise, coNP-hard.

+ +

Longer Answer:

+ +

In adiabatic quantum computation, the ground-space of the final Hamiltonian is typically determined by the optimum solution to some constraint satisfaction problem (CSP). If the CSP is perfectly solvable, the ground-space is spanned by (standard basis states which encode) the assignments which satisfy the constraints. If the CSP is not perfectly satisfiable, the ground-space is spanned by all assignments which are closest to being satisfying. In this case, your question amounts just to a question of finding out when the set of satisfying assignments — or the set of optimal assignments — of a CSP are the same.

+ +

We can reduce any such CSP to a boolean formula. So what we're looking at in the case of asking whether the satisfying set of two CSPs are the same is whether a boolean formula of the form $$ \varphi_1(x) \iff \varphi_2(x) $$ +is a tautology, which is to say, whether that biconditional is true for all $x$, for some boolean formulae $\varphi_1$ and $\varphi_2$ provided as input. This makes it a special case of "" TAUTOLOGY "", the decision problem of whether a logical formula is a tautology.

+ +

The problem TAUTOLOGY is in coNP +— in fact, it is coNP complete, because it is in effect the complementary problem to the NP compete problem SATISFIABILITY. This shows that the special case of determining whether the satisfying solution sets of two CSPs are equivalent is no harder than coNP. But because we can test whether $\varphi_1$ is itself a tautology by setting $\varphi_2$ to the boolean formula 'TRUE', this special case is as hard as TAUTOLOGY is itself, so it is coNP hard.

+ +

The more general problem of equivalence of optimal solutions contains this problem as a subcase, so it is also coNP hard.

+",124,,124,,6/12/2019 18:16,6/12/2019 18:16,,,,2,,,,CC BY-SA 4.0 +6416,2,,6412,6/12/2019 0:37,,2,,"

pauli_X=[[0,1],[1,0]] +cz=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,-1]] +np.kron(np.kron(np.kron(pauli_X,cz),cz),cz)

+ +

This would compute $X_1 \otimes CZ_{2,3} \otimes CZ_{4,5} \otimes CZ_{6,7}$.

+ +

Addressing the confusion about what tensor product means. $A$ operating on $d_1$ qubits $(\mathbb{C}^2)^{\otimes d_1}$ and $B$ operating on $d_2$ qubits $(\mathbb{C}^2)^{\otimes d_2}$ means that $A \otimes B$ will operate on $(\mathbb{C}^2)^{\otimes d_1} \otimes (\mathbb{C}^2)^{\otimes d_2}$ which is $d_1 + d_2$ qubits. No overlapping indices between the $d_1$ and the $d_2$.

+ +

Edit: to address comment

+ +

In this case there are 7 qubits so the total Hilbert space is $(\mathbb{C}^2)^{\otimes 7} \simeq \mathbb{C}^{2^7}$ with basis indexed by the $2^7$ bit strings of length 7. From 0000000, 0000001, 0000010, etc all the way to 1111111.

+",434,,434,,6/12/2019 22:14,6/12/2019 22:14,,,,2,,,,CC BY-SA 4.0 +6417,1,,,6/12/2019 2:26,,2,93,"

I read ""...an $n$ qubit array can represent $2^n$ possible array elements.."" on this post. A classical $n$-bit array can represent $2^n$ possible array elements as well, so I'm confused about the difference. Does it mean that the $2^n$ possibilities represented by the $n$-qubit array are represented at the same time?

+",7736,,26,,6/12/2019 2:54,7/12/2019 12:00,"What does ""an $n$-qubit array can represent $2^n$ possible array elements"" mean?",,1,0,,,,CC BY-SA 4.0 +6418,1,,,6/12/2019 5:19,,4,772,"

Is there anyone who reproduced the Bloch sphere given in the paper QuTiP: An open-source Python framework for the dynamics of open quantum systems by J. R. Johansson, P. D. Nation, Franco Nori? I am trying to reproduce the Figure 10: Bloch sphere representation of the Landau-Zener transition. The code they used is given in the appendix of the paper.

+ +

But when I am trying to plot this, I am getting an error:

+ +

AttributeError: 'numpy.ndarray' object has no attribute 'indices'

+ +

Can anyone please help me to correct this one to get the exact Bloch sphere plot?

+",7502,,26,,6/12/2019 5:23,7/12/2019 11:02,Plotting Bloch sphere in QuTiP,,1,0,,,,CC BY-SA 4.0 +6419,2,,6412,6/12/2019 6:35,,2,,"

You can always write your operation as one gate at a time, and take the product. So, in your case, you'd be calculating a product +$$ +U=U_1U_2U_3U_4 +$$ +where, for example, $U_1=X_1=X\otimes 1\otimes 1\otimes 1$, +$$U_2=CZ_{2,3}=I\otimes I\otimes I\otimes I-I\otimes |1\rangle\langle 1|\otimes(Z-I)\otimes I,$$ and so on. In particular, you can start to use the formulation I've given you for $U_2$ to work out how to apply CZ on any pair of qubits. For instance, +$$ +U_4=CP_{2,4}=I\otimes I\otimes I\otimes I-I\otimes |1\rangle\langle 1|\otimes I\otimes(Z-I). +$$

+",1837,,,,,6/12/2019 6:35,,,,0,,,,CC BY-SA 4.0 +6420,1,,,6/12/2019 7:26,,3,69,"

I’m wondering that is there a way to separate phases of basis states from the magnitudes (namely putting phases on some new basis states with the same probability magnitude) if the exact values of phases and magnitudes are unknown? One way I can think of is the quantum phase estimation routine. But to me it seems this method can only estimate one single phase at a time, so if there are a lot of basis states it will take a lot of time to estimate all the phases.

+",7739,,26,,6/12/2019 12:44,6/12/2019 12:44,Obtaining phases of all basis states,,1,0,,,,CC BY-SA 4.0 +6421,2,,6420,6/12/2019 7:34,,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 instead of completely arbitrary values, you're either given $a|0\rangle+b|1\rangle$ or $a|0\rangle-b|1\rangle$. Your map would require these to be converted into the states $(|0\rangle\pm|1\rangle)/\sqrt{2}$, which are orthogonal. This means that your map would facilitate cloning of those two original states (because I can measure the outcome and know which state I had, so I can prepare many copies), which must be impossible because the two states are not orthogonal if $a^2\neq b^2$.

+",1837,,,,,6/12/2019 7:34,,,,3,,,,CC BY-SA 4.0 +6423,1,,,6/12/2019 8:44,,4,109,"

I tried to run Grover's search for basis states with complex coefficients, including the marked basis (complex coefficients because the states are obtained from inverse QFT), but it could not amplify the marked basis effectively. I think it has to do with the inverse-about-the-mean part since now the mean is complex but I'm not sure how to analyse the behavior exactly. Can someone help to explain why is that so and is there any way to salvage the situation? And also if I want to amplify multiple marked states concurrently what is the most optimal diffusion operator?

+ +

This is the circuit I used: +first I initialized the initial state (a four-qubit system) as

+ +

$$ +|x\rangle=\frac{1}{\sqrt{8}}(1,1,1,1,1,1,1 ,1,0,0,0,0,0,0,0,0)^T +$$

+ +

+ +

then I applied this inverse QFT circuit. The resultant state vector is

+ +

$$ +(0.707+0i, 0.088-0.444i, 0, 0.088-0.059i, 0, 0.088-0.132i, 0, 0.088-0.018i, 0, 0.088+0.018i, + 0, 0.088+0.132i, 0, 0.088+0.059i, 0, 0.088+0.444i)^T +$$

+ +

Note: values are rounded

+ +

+ +

Then I negated the states of interest $|0000\rangle$, $|0001\rangle$, $1111\rangle$ by using this circuit (I believe you guys can tell which part of it is for which states if now please let me know:

+ +

+ +

Then I applied the diffusion operator. Notice that I negated the phase of $|0000\rangle$ instead of the rest. This resulted in a $180^o$ global phase difference. In the Grover search case where all coefficients are real the result for measurement is identical to marking all the rest states but I'm not sure for complex-valued coefficient will there be any difference.

+ +

+ +

These are the qskit codes:

+ +
import numpy as np
+import math
+from qiskit import *
+%matplotlib inline
+
+import math
+from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit, execute, BasicAer
+
+
+#initialization
+q = QuantumRegister(5, ""q"")
+c = ClassicalRegister(4, 'c')
+circ = QuantumCircuit(q, c, name=""initializer_circ"")
+
+desired_vector = [
+   1 / math.sqrt(8),
+   1 / math.sqrt(8),
+   1 / math.sqrt(8),
+   1 / math.sqrt(8),
+   1 / math.sqrt(8),
+   1 / math.sqrt(8),
+   1 / math.sqrt(8),
+   1 / math.sqrt(8),
+   0,
+   0,
+   0,
+   0,
+   0,
+   0,
+   0,
+   0]
+
+
+circ.initialize(desired_vector, [q[0], q[1], q[2], q[3]])
+
+#circ.draw()
+
+
+#IQFT
+sub_q = QuantumRegister(4)
+sub_circ = QuantumCircuit(sub_q, name='IQFT')
+sub_circ.swap(sub_q[0], sub_q[3])
+for j in range(4):
+   for k in range(j):
+       sub_circ.cu1(math.pi/float(2**(j-k)), sub_q[j], sub_q[k])
+   sub_circ.h(sub_q[j])
+sub_circ=sub_circ.inverse()
+sub_inst = sub_circ.to_instruction()
+circ.append(sub_inst, [q[0],q[1],q[2],q[3]])
+#circ.draw()
+
+
+#phase inverstion of |0000>
+circ.x(q[0])
+circ.x(q[1])
+circ.x(q[2])
+circ.x(q[3])
+circ.h(q[3])
+circ.ccx(q[0], q[1], q[4])
+circ.ccx(q[2], q[4], q[3])
+circ.ccx(q[0], q[1], q[4])
+circ.h(q[3])
+circ.x(q[0])
+circ.x(q[1])
+circ.x(q[2])
+circ.x(q[3])
+
+#circ.draw()
+
+
+
+#phase inverstion of |0001>
+circ.x(q[1])
+circ.x(q[2])
+circ.x(q[3])
+circ.h(q[3])
+circ.ccx(q[0], q[1], q[4])
+circ.ccx(q[2], q[4], q[3])
+circ.ccx(q[0], q[1], q[4])
+circ.h(q[3])
+circ.x(q[1])
+circ.x(q[2])
+circ.x(q[3])
+
+#circ.draw()
+
+
+#phase inverstion of |1111>
+circ.h(q[3])
+circ.ccx(q[0], q[1], q[4])
+circ.ccx(q[2], q[4], q[3])
+circ.ccx(q[0], q[1], q[4])
+circ.h(q[3])
+
+#circ.draw()
+
+
+
+#Diffusion Operator
+circ.h(q[0])
+circ.h(q[1])
+circ.h(q[2])
+circ.h(q[3])
+circ.x(q[0])
+circ.x(q[1])
+circ.x(q[2])
+circ.x(q[3])
+circ.h(q[3])
+circ.ccx(q[0], q[1], q[4])
+circ.ccx(q[2], q[4], q[3])
+circ.ccx(q[0], q[1], q[4])
+circ.h(q[3])
+circ.x(q[0])
+circ.x(q[1])
+circ.x(q[2])
+circ.x(q[3])
+circ.h(q[0])
+circ.h(q[1])
+circ.h(q[2])
+circ.h(q[3])
+#circ.draw()
+
+
+#check the state vector at any stage run the following code:
+
+# Import Aer
+from qiskit import BasicAer
+
+# Run the quantum circuit on a statevector simulator backend
+backend = BasicAer.get_backend('statevector_simulator')
+# Create a Quantum Program for execution 
+job = execute(circ, backend)
+result = job.result()
+outputstate = result.get_statevector(circ, decimals=3)
+print(outputstate)
+print(np.absolute(outputstate))
+
+ +

Note: uncomment #circ.draw() to plot the circuit

+",7739,,9006,,1/6/2020 22:13,1/6/2020 22:13,Grover search for basis states with complex coefficents and multiple marked states,,0,13,,,,CC BY-SA 4.0 +6424,1,,,6/12/2019 9:48,,4,176,"

How does the act of erasing information increase the total entropy of the system? This goes by the name Landauer's principle. Some details are here. Can anyone shed more light on this?

+",5806,,10480,,4/5/2021 17:44,4/5/2021 17:44,What is Landauer’s principle?,,1,1,,,,CC BY-SA 4.0 +6425,2,,6418,6/12/2019 10:58,,1,,"

That is a very old paper, corresponding to version one of the software. It is now on version 4.x. It is best to see the current documentation for how to use the Bloch sphere: http://qutip.org/docs/latest/guide/guide-bloch.html

+",332,,,,,6/12/2019 10:58,,,,2,,,,CC BY-SA 4.0 +6426,2,,6417,6/12/2019 11:09,,3,,"
+

Now here is where it gets deep an 𝑛 Qubit Array can represent $2^𝑛$ possible array elements (consult anywhere online for an explanation of that or drop a comment).

+

And similarly an 𝑛 Qubit quantum operator can act on that entire $2^𝑛$ quantum space, and produce an answer that we can interpret.

+
+

It's probably not too clear here, but I think the OP meant, an $n$ qubit array can represent any state that is a linear combination of $2^n$ basis states.

+

So, a classical array of 1 bit could represent any state 0 or 1 ($2^1$ possibilities), but a single qubit could be in any state $\alpha |0\rangle + \beta |1\rangle $ where $|\alpha|^2 + |\beta|^2 = 1$, so an infinite number of possibilities made from a basis of $2^n$ states.

+",2832,,-1,,6/18/2020 8:31,6/12/2019 11:09,,,,0,,,,CC BY-SA 4.0 +6427,1,6428,,6/12/2019 11:56,,3,129,"

On contrary to amplitude amplification, can I do some reflection such that my marked states' probability will vanish (ideally become zero but if there are small residuals also acceptable)? In order to preserve the normalization condition, all the rest states will get amplified uniformly but the phases of them should remain the same (their coefficients are complex. Is this possible?

+",7739,,26,,6/12/2019 15:36,6/13/2019 7:03,Amplitude suppression,,2,0,,,,CC BY-SA 4.0 +6428,2,,6427,6/12/2019 12:04,,3,,"

Any state $|\Psi\rangle$ can be decomposed using a two-dimensional subspace comprising marked and unmarked states, +$$ +|\Psi\rangle=\alpha|\Psi_m\rangle+\beta|\Psi_u\rangle. +$$ +Part of the assumption is that you have a marking oracle that acts as +$$ +|\Psi\rangle|0\rangle\rightarrow\alpha|\Psi_m\rangle|1\rangle+\beta|\Psi_u\rangle|1\rangle. +$$ +This is exactly the same thing that you use during amplitude amplification (usually, your ancilla bit would be in the state $|-\rangle=(|0\rangle-|1\rangle)/\sqrt{2}$ in order to get the phase kick-back onto the main system).

+ +

In the typical setting, the amplitude for marked states ($\alpha$) is small. If this is the case, if you simply measure the ancilla qubit, you'll find it to be in the state $|1\rangle$ with probability $|\beta|^2$, which is close to 1. You're left with the state $|\Psi_u\rangle$. Even if it doesn't work, you just have to repeat a small number of times.

+ +

If you're in the opposite regime where $\alpha$ is large, then notice this is just your normal amplitude amplification, you've merely switched the roles of marked and unmarked states - suppressing $\alpha$ is the same as amplifying $\beta$. To make this work, all you need to do is every time you apply the marking procedure, flip the ancilla qubit as well, converting marked into unmarked and vice versa.

+ +
+

how should I use just one ancilla to record multiple marked states?

+
+ +

Hopefully this is already clearer. However, the point is there is a boolean value for ""should this state be marked?"": 0 for no, 1 for yes. Multiple states can answer 1. For example, you could define the marking function to be something like ""is the number even?"" which is simple enough to mark all the even numbers simultaneously (actually, you just take the least significant bit of the number and flip it).

+",1837,,1837,,6/13/2019 7:03,6/13/2019 7:03,,,,3,,,,CC BY-SA 4.0 +6429,2,,6424,6/12/2019 12:19,,5,,"

It means that if you lose information from your system, that information must have been transferred to the system's surroundings. This shows up as an increase in the entropy in the surroundings. This is directly related to the 2nd law of thermodynamics which says the entropy of an isolated system is always increasing. See Wikipedia: Entropy in thermodynamics and information theory for more details.

+",7701,,26,,6/12/2019 15:36,6/12/2019 15:36,,,,2,,,,CC BY-SA 4.0 +6431,1,6441,,6/12/2019 17:12,,2,331,"

I am reading a paper on Quantum Secret Sharing Quantum Secret Sharing using GHZ states

+ +

I have doubts regarding the initial phase of the paper, which are: Let me state what things I read and understood

+ +
    +
  1. Alice, Bob, Charlie share a GHZ state $|\psi\rangle=\dfrac{|000\rangle+|111\rangle}{\sqrt{2}}$ and are given one particle each from this state, well this is quite clear to me, proceeding next

  2. +
  3. They each choose at random whether to measure their +particle in the $x$ or $y$ direction They then announce +publicly in which direction they have made a measurement, but not the results of their measurements. Half +the time, Bob and Charlie, by combining the results of +their measurements, can determine what the result of Alice’s measurement was. This allows Alice to establish a +joint key with Bob and Charlie, which she can then use +to send her message.

  4. +
  5. The $x$ and $y$ eigenstates are defined as $|+x\rangle=\dfrac{|0\rangle+|1\rangle}{\sqrt{2}}, |-x\rangle=\dfrac{|0\rangle-|1\rangle}{\sqrt{2}}$ , $|+y\rangle=\dfrac{|0\rangle+i|1\rangle}{\sqrt{2}}, |-y\rangle=\dfrac{|0\rangle-i|1\rangle}{\sqrt{2}}$.
    +Now my questions start from this point.

  6. +
+ +

Q1. What does it mean to measure in $x$ and $y$ direction?

+ +

Q2. The $x$ eigenstates and $y$ eigenstates are just the two different basis of a Hilbert space of dimension $2$ which are actually the eigenvectors of the unitary matrices $\begin{bmatrix} +0 &1\\ +1&0\end{bmatrix}$ and $\begin{bmatrix} +0 &-i\\ +i&0\end{bmatrix}$ expressed in ket notation, so any Qubit can be expressed in terms of these two basis is what I understand. But what is the results when say measured in the $x$ basis, and what is the system after that measurement? +I have a few more doubts but first i want to understand this from a mathematical point of view. Can somebody help?

+ +

Edit: After @DaftWullie's answer

+ +

So let's say I want to measure what is the probability that upon measurement of the third qubit I get a $|+\rangle$. So, I calculate $$p_{+}=\left(\dfrac{\langle 000|+\langle 111|}{\sqrt{2}}\right)(I\otimes I\otimes|+x\rangle\langle +x|)\left(\dfrac{ |000\rangle+|111\rangle }{\sqrt{2}}\right).$$ +Now I express the third qubit in terms of the Pauli basis to get $|0\rangle=\dfrac{|+x\rangle + |-x\rangle}{2}$ and $|1\rangle=\dfrac{|+x\rangle - |-x\rangle}{2} $ and substitute these values in place of third qubit above to obtain +$$ p_{+}=\left(\dfrac{\langle 00|(\langle +x|+\langle -x|)+\langle 11|(\langle +x|-\langle -x|)}{\sqrt{2}\sqrt{2}}\right)(I\otimes I\otimes|+x\rangle\langle +x|)\left(\dfrac{ |00\rangle( |+x\rangle + |-x\rangle) +|11\rangle (|+x\rangle - |-x\rangle) }{\sqrt{2}\sqrt{2}}\right)$$ + The left part of my expression evaluates to $$ \dfrac{\langle 00|\left( \langle+x|+x\rangle + \langle-x|+x\rangle\right) + \langle 11|\left( \langle+x|+x\rangle - \langle-x|+x\rangle\right)}{2}$$ + $$ = \dfrac{\langle 00|(1+0) +\langle 11|(1-0)}{2}= \dfrac{\langle 00| +\langle 11|}{2}$$ +Similarly the right part evaluates to $$\dfrac{|00\rangle+|11\rangle}{2}$$ +so i get $$p_+=\left(\dfrac{\langle 00| +\langle 11|}{2}\right)\left( \dfrac{|00\rangle+|11\rangle}{2}\right)=\dfrac{1}{4}+ \dfrac{1}{4}=\dfrac{1}{2}$$

+",6070,,6070,,6/14/2019 7:53,6/14/2019 7:53,Quantum secret Sharing using GHZ state paper,,1,11,,,,CC BY-SA 4.0 +6432,1,6466,,6/12/2019 20:20,,4,131,"

I am wondering if there is a way to get advice\feedback here about the following: I am about to start a MS physics program. I am interested in quantum computing and my department has the option of pursuing a thesis as a graduation route. I am new to this topic and would like to see if I can get some suggestions - papers, books, topics, etc - to think about to be able to craft a project in quantum computing for a beginner like me that can in a two-year period scale into something with more insight in the topic.

+ +

Thank you.

+",6253,,26,,6/17/2019 12:04,6/17/2019 12:04,Quantum Computing Project Inquiry,,1,0,,6/20/2019 9:32,,CC BY-SA 4.0 +6433,1,6434,,6/12/2019 20:33,,2,98,"

I am getting confused as to how to perform gate operations using matrices and am hoping someone will help me walk through this example.

+ +

Say I want to perform a Pauli-X gate on the 3rd qubit in a 3-qubit system. That operation would be:

+ +
U = I ⊗ I ⊗ X
+
+ +

Then say I have the state $|001\rangle$ so after applying U the state would become $|000\rangle$. I am trying to use Python and NumPy to calculate this but I believe I am missing something.

+ +
i = np.array([[1, 0],
+              [0, 1]])
+
+x = np.array([[0, 1],
+              [1, 0]])
+
+state_0 = np.array([[1],
+                    [0]])
+state_1 = np.array([[0],
+                    [1]])
+
+x_3 = np.kron(np.kron(i,i),x)
+
+v = np.kron(np.kron(state_0, state_0), state_1)
+
+print(x_3.dot(v))
+
+ +

This code outputs:

+ +
[[1]
+ [0]
+ [0]
+ [0]
+ [0]
+ [0]
+ [0]
+ [0]]
+
+ +

I am unsure if this output is correct and if it is how would I see this as the state $|000\rangle$? Any clarifications would be very useful! Thank you!

+",7734,,55,,7/3/2021 13:30,7/3/2021 13:30,Perform quantum gate operations using state vectors and matrices,,1,0,,,,CC BY-SA 4.0 +6434,2,,6433,6/12/2019 21:07,,3,,"

You can use the same tools you used to get this output to check that it is correct: the state $|000\rangle$ would be represented as tensor product $|0\rangle \otimes |0\rangle \otimes |0\rangle$, which in your Python notation would be np.kron(np.kron(state_0, state_0), state_0). This should give you the same column vector you got from running your code, with the first element 1 and the rest of them 0s.

+",2879,,,,,6/12/2019 21:07,,,,1,,,,CC BY-SA 4.0 +6435,1,,,6/13/2019 0:57,,7,245,"

Let $P$ be a projector and $Q = I-P$ be its complement. How to find probability $p$ and unitaries $U_1, U_2$ such that for any $\rho$, $P\rho P + Q\rho Q = p U_1\rho U_1^\dagger + (1-p)U_2\rho U_2^\dagger$? (This is Nielsen and Chuang Exercise 11.20)

+ +

I tried to spectral decompose $P = UU^\dagger$, where $U$ has $r$ columns with $r$ being the rank of $P$. This doesn't get me anywhere since $UU^\dagger$ is not of the form of a unitary.

+",7745,,5870,,6/13/2019 4:16,6/13/2019 17:29,Quantum channel representation of projective measurement,,2,0,,,,CC BY-SA 4.0 +6436,1,6461,,6/13/2019 3:19,,9,725,"

I'm trying to program a controlled gate as the figure below in Qiskit. Should it be sufficient to separate and control individually the Hadamard gates?

+ +

+",7746,,26,,6/14/2019 4:33,6/14/2019 13:16,How to program a controlled Hadamard-Hadamard gate?,,2,0,,,,CC BY-SA 4.0 +6438,2,,6436,6/13/2019 5:09,,8,,"

Yes, that notation means the Hadamard on the second qubit depends on the first qubit and the Hadamard on the third qubit depends on the first qubit. The gates aren't connected to each other in any way.

+",2832,,,,,6/13/2019 5:09,,,,1,,,,CC BY-SA 4.0 +6439,2,,6427,6/13/2019 5:37,,0,,"

You can simply apply amplitude amplification to the unmarked states. Whereas you originally reflect around the marked states, now you simply reflect around the unmarked states.

+",282,,,,,6/13/2019 5:37,,,,3,,,,CC BY-SA 4.0 +6440,2,,6435,6/13/2019 6:25,,5,,"

If $P$ is (ortho)projector, that is $P^2=P=P^\dagger$, then we can define unitary $U = I - 2P$. You can verify +$$ +UU^\dagger = U^2 = (I-2P)(I-2P) = I-4P+4P = I +$$ +Now we can express $P=\frac{1}{2}(I-U), Q=\frac{1}{2}(I+U)$ and calculate +$$ +P\rho P + Q\rho Q = \frac{1}{4}(I-U)\rho(I-U) + \frac{1}{4}(I+U)\rho(I+U)= +$$ +$$ += \frac{1}{4}(\rho - U\rho - \rho U + U\rho U) + \frac{1}{4}(\rho + U\rho + \rho U + U\rho U)= \frac{1}{2}(\rho + U\rho U) = \frac{1}{2}(\rho + U\rho U^\dagger) +$$

+ +

Update
+In general case we can use the fact that the channel $\rho \rightarrow \sum_{k=1}^n P_k \rho P_k$ is the composition of $n$ channels $\rho \rightarrow P_k \rho P_k + P_k^\perp \rho P_k^\perp$, $k=1,..,n$.

+",5870,,5870,,6/13/2019 16:53,6/13/2019 16:53,,,,0,,,,CC BY-SA 4.0 +6441,2,,6431,6/13/2019 6:47,,4,,"

This question is actually entirely about the basics of measurement on a quantum system, and nothing to do with secret sharing.

+ +

Let's state the measurement postulate of quantum mechanics as it applies to projective measurements:

+ +
+

A measurement is described by a set of projectors $P_i$ satisfying + $\sum_iP_i=1$. If a state $|\psi\rangle$ is being measured, the + outcome $i$ is obtained with probability + $p_i=\langle\psi|P_i|\psi\rangle$, and if outcome $i$ is obtained, the + state after measurement is $P_i|\psi\rangle/\sqrt{p_i}$.

+
+ +

So, all you need to know are the projectors. Giving an operator such as Pauli $X$ is one way of specifying the measurement as an operator decomposes into projectors onto the subspaces of different eigenvalues. e.g. $X=|+x\rangle\langle+x|-|-x\rangle\langle-x|$, so it says use projectors $P_+=|+x\rangle\langle+x|$, $P_-=|-x\rangle\langle-x|$ on a single qubit. If you're measuring multiple qubits, you pad all the other qubits with identity matrices. So a measurement in the $X$ basis of qubit 2 means $1\otimes X\otimes 1$, which has projectors $1\otimes P_+\otimes 1$ and $1\otimes P_-\otimes 1$.

+",1837,,,,,6/13/2019 6:47,,,,2,,,,CC BY-SA 4.0 +6442,2,,6435,6/13/2019 15:54,,3,,"

I'll cover a slightly more general case.

+ +

Let $P_k$, $k=1,...,N$ a complete set of orthogonal projectors: $\sum_k P_k=I$ and $P_j P_k=\delta_{jk}P_j$.

+ +

Consider the map $\mathcal E(\rho)=\sum_k P_k \rho P_k$.

+ +

We want to find a set of unitaries $\mathcal U_k$ and probabilities $p_k$ such that $\mathcal E(\rho)=\sum_\ell p_\ell\mathcal U_\ell\rho\,\mathcal U_\ell$.

+ +

Define the unitaries $\mathcal U_k=\mathcal U_k^\dagger=I-2P_k$, $k=1,...,N$. We then have +\begin{align} +\sum_k\mathcal U_k\rho\,\mathcal{U}_k &=N\rho-2\sum_k\{P_k,\rho\}+4\sum_k P_k\rho P_k \\ +&=(N-4)\rho+4\sum_k P_k\rho P_k. +\end{align} +Thus, +$$\frac{1}{4}\sum_k \mathcal U_k\rho\,\mathcal U_k+\frac{4-N}{4}\rho=\sum_k P_k\rho P_k.\tag A$$ +Lets work out explicitly a few cases:

+ +
+ +

$N=2$ case

+ +

This is the problem as originally stated (with $P_1=P$ and $P_2=Q$). +We have +$$\frac{1}{4}(\mathcal U_1\rho\,\mathcal U_1+\mathcal U_2\rho\,\mathcal U_2) ++\frac{1}{2}\rho=P_1\rho P_1+P_2\rho P_2.$$

+ +

$N=3$ case

+ +

$$\frac{1}{4}(\mathcal U_1\rho\,\mathcal U_1+\mathcal U_2\rho\,\mathcal U_2+\mathcal U_3\rho\,\mathcal U_3) ++\frac{1}{4}\rho +=P_1\rho P_1+P_2\rho P_2+P_3\rho P_3.$$

+ +

$N=4$ case

+ +

$$\frac{1}{4}\sum_{k=1}^4 \mathcal U_k\rho\,\mathcal U_k=\sum_{k=1}^4 P_k\rho P_k.$$

+ +

$N>4$ case

+ +

Interestingly, this method stops working for $N>4$ (which of course does not mean that we cannot decompose these channels using unitaries, only that this particular decomposition method does not work anymore). More precisely, (A) still holds, but it's no longer a valid Kraus decomposition because $4-N<0$.

+",55,,55,,6/13/2019 17:29,6/13/2019 17:29,,,,1,,,,CC BY-SA 4.0 +6443,1,6453,,6/13/2019 16:11,,7,1967,"

I have a question while reading the quantum fidelity definition in Wikipedia Fidelity of quantum states, at the end of the Definition section of quantum fidelity formula, it says Explicit expression for qubits. If rho and sigma are both qubit states, the fidelity can be computed as: +$$ +F(\rho, \sigma)=\operatorname{tr}(\rho \sigma)+2 \sqrt{\operatorname{det}(\rho) \operatorname{det}(\sigma)} +$$ +So I'm really confused about where this formula comes from. I tested several simple examples, it seems that the formula is not suitable to calculate the fidelity between two mixed states while the dimensions of the density matrices are not $2\times2$ (e.g. for the case both of the two matrices are diag(0.5,0,0,0.5), the fidelity calculated by this formula is 0.5 not 1.

+ +

However, if one of the density matrices is in pure state, it seems the result now is always correct even though the dimensions of the density matrices are bigger than $2\times2$.

+ +

I'm wondering how to prove this formula and is it always safe to use it while one of the density matrices is in pure state...

+ +

Thanks in advance!

+",7752,,55,,4/26/2021 15:41,5/30/2021 16:12,Quantum fidelity simplified formula while both of the density matrices are single qubit states,,2,0,,,,CC BY-SA 4.0 +6446,2,,5973,6/14/2019 0:00,,4,,"

I have a theory as for where the issue comes from (huge thanks to Robin for helping me figure it out!)

+ +

Grover iteration consists of four steps:

+ +
    +
  • Apply the oracle.
  • +
  • Apply the Hadamard transform.
  • +
  • Perform a conditional phase shift.
  • +
  • Apply the Hadamard transform.
  • +
+ +

ConditionalPhaseFlip operation in the Q# code implements the third step: it gives a phase shift of -1 to the $|0\rangle$ state (if you follow Q# code closely, this routine takes a marking oracle which marks the $|0\rangle$ state and converts it to phase-flipping oracle which flips the phase of this state only).

+ +

This implementation differs from the description in Nielsen and Chuang, which says that each basis state except $|0\rangle$ gets a phase shift of -1 (the difference is global phase of -1). When you use this Grover iteration as part of Grover search algorithm, this extra global phase has no effect on measurement outcomes.

+ +

However, when you use this iteration as part of quantum counting algorithm, this global phase can actually be detected! Since phase estimation uses controlled versions of the iteration, the phase becomes relative instead of global, and starts affecting the computation.

+ +

Let's denote the Grover iteration as $G$ with eigenvalues $e^{i\theta}$ and $e^{i (2 \pi - \theta)}$ (with the correct number of solutions calculated as $M_c = N \sin^2 \frac{\theta}{2}$). The Grover iteration with an global phase of $-1$ $(-G)$ will have eigenvalues multiplied by $-1$: $-e^{i\theta}$ and $-e^{i (2 \pi - \theta)}$. Given that $e^{i\pi} = -1$, we can write them as $e^{i(\pi + \theta)}$ and $e^{i (\pi - \theta)}$. When you feed the unitary $(-G)$ into the quantum counting algorithm, you'll get $M_{-1} = N \sin^2 \frac{\theta + \pi}{2} = N \cos^2 \frac{\theta}{2}$ - which is exactly the answer you're getting!

+ +

The fix is a lot easier than figuring out what went wrong - just add a global phase of -1 to ConditionalPhaseFlip. You can use R operation for that: R(PauliI, 2.0 * PI(), register[0]);.

+",2879,,,,,6/14/2019 0:00,,,,2,,,,CC BY-SA 4.0 +6447,2,,4730,6/14/2019 0:31,,3,,"

Looking at the implementation of GroverPow only, it seems that the issue might be the same as in this question, though implemented in a slightly different way.

+ +

This section of the code

+ +
ApplyToEachCA(X, inputQubits);
+Controlled Z(Most(inputQubits), Tail(inputQubits));
+ApplyToEachCA(X, inputQubits);
+
+ +

implements conditional phase shift by flipping the phase only for the $|0...0\rangle$ state. This yields a global phase difference of -1 compared to Nielsen and Chuang presentation which flips phase of all states except for the $|0...0\rangle$ state. This is detected by phase estimation algorithm, so that quantum counting ends up reporting the number of solutions equal to $N - M$ instead of just $M$ (I did the detailed math in my answer).

+",2879,,,,,6/14/2019 0:31,,,,2,,,,CC BY-SA 4.0 +6448,1,6451,,6/14/2019 4:50,,8,178,"

This may be a fairly basic question, but in Nielsen & Chuang, the following circuit is given for simulating $\exp\left(-i\Delta t Z_1 \otimes Z_2 \otimes Z_3\right)$:

+ +

which uses an ancilla qubit initialized to $|0\rangle$. But from messing around with different gate sequences, it seems like this can be done with

+ +

\begin{align} +CNOT_{1,2}CNOT_{1,3}e^{-i\Delta t Z_3}CNOT_{1,3}CNOT_{1,2} +\end{align} +or even +\begin{align} +CNOT_{1,2}CNOT_{2,3}e^{-i\Delta t Z_3}CNOT_{2,3}CNOT_{1,2} +\end{align}

+ +

which doesn't require the ancilla and has two fewer CNOTs. Is there any advantage to using an ancilla qubit in this circuit?

+",4841,,,,,6/14/2019 7:26,Simulating a 3-local Hamiltonian Term,,1,0,,,,CC BY-SA 4.0 +6449,1,,,6/14/2019 6:14,,8,194,"

Quantum Entanglement and Geometry — Andreas Gabriel (2010) — Sec: 2.3.4 ~p. 11

+ +
+

Another basis for $d\times d$-dimensional matrices that has proven to be quite useful in quantum information theory is the Weyl operator basis, which consists of $d^2$ unitary and mutually orthogonal matrices $W_{m,n}$ defined as $$W_{m,n}=\sum_{k=0}^{d-1}e^{\frac{2\pi i}{d}kn}|k\rangle\langle k+m|$$ where $0\leq m.n \leq d-1$ and $(k+m)$ is understood to modulo $d$. Note that $$U_{00}=\Bbb 1, U_{0,1}=\sigma_1, U_{1,0}=\sigma_3, U_{1,1}=i\sigma_2.$$

+
+ +

Questions:

+ +
    +
  1. It seems Weyl matrices are generalizations to the Pauli matrices. So how and where exactly are they useful? Do they have any special properties like Pauli matrices? And what motivated the definition of Weyl matrices?

  2. +
  3. Weyl matrices are only finite-dimensional; I suppose there must be an infinite dimensional operator analogue to them such that the summation would be replaced by an integral?

  4. +
+",26,,55,,4/26/2021 15:41,5/3/2022 19:00,What is the motivation for Weyl matrices in quantum information theory?,,0,2,,,,CC BY-SA 4.0 +6451,2,,6448,6/14/2019 7:26,,6,,"

Yes, in this special case the circuit will simplify as you suggest. The advantage of the circuit that was given is that it generalises more easily, and works for any $H$ which has $\pm 1$ eigenvalues. Here's a general form of the circuit for your reference: +

+ +

This essentially comes down to an issue of how you can reversibly compute a one-bit function $f:\{0,1\}^n\mapsto\{0,1\}$ (the 0/1 answer conveys whether it's in the +1 or -1 eigenspace). You can guarantee to do this with $n+1$ bits. Sometimes you can do it with $n$ (basically if the function $f$ is balanced so that half the inputs give 0 answer and half give the 1 answer).

+",1837,,,,,6/14/2019 7:26,,,,0,,,,CC BY-SA 4.0 +6452,1,,,6/14/2019 7:48,,2,119,"

Since yesterday I'm trying to run on the new composer (quantum-computing.ibm.com) both new experiments (never run before) and older experiments (that have been successfully run and completed some ago) on ibmq_16_melbourne, but they're stuck on VALIDATING and never run.

+ +

I can successfully run experiments on other devices ibmqx4, ibmqx2 and ibmq_qasm_simulator.

+ +

Issue is only with ibmq_16_melbourne.

+ +

Does this depend on my account or on the device itself?

+ +

Thank you.

+",7758,,,,,6/19/2019 9:25,Experiments stuck on VALIDATING ibmq_16_melbourne,,1,3,,,,CC BY-SA 4.0 +6453,2,,6443,6/14/2019 7:54,,3,,"

The general expression for the fidelity is +$$ +F(\rho,\sigma)=\left(\text{Tr}\sqrt{\sqrt{\rho}\sigma\sqrt{\rho}}\right)^2=(\text{Tr}|\sqrt{\rho\sigma}|)^2. +$$ +Assume $\rho$ and $\sigma$ are $2\times 2$ matrices. Then $\sqrt{\rho\sigma}$ is also a $2\times 2$ matrix which we assume to have eigenvalues $\lambda_1$ and $\lambda_2$. Thus, +$$ +F=(|\lambda_1|+|\lambda_2|)^2=\lambda_1^2+\lambda_2^2+2|\lambda_1\lambda_2|. +$$

+ +

However, we also have that +$$ +\text{Tr}(\rho\sigma)=\lambda_1^2+\lambda_2^2 +$$ +and +$$ +\text{det}(\rho\sigma)=\lambda_1^2\lambda_2^2, +$$ +so $\sqrt{\text{det}(\rho\sigma)}=|\lambda_1\lambda_2|$. So, that proves the relation specifically for $2\times 2$ matrices. As you stated, it generally does not hold for larger matrices.

+ +

In the special case of $\rho$ being pure, it does hold, but it's far easier simply to calculate $F=\langle\psi|\sigma|\psi\rangle=\text{Tr}(\rho\sigma)$.

+",1837,,7752,,6/14/2019 11:09,6/14/2019 11:09,,,,3,,,,CC BY-SA 4.0 +6454,1,,,6/14/2019 7:59,,2,155,"

Is there a way of eliminating a term of a superposition state? +Let's say I have the state

+ +

$$\frac{1}{\sqrt 2}|00\rangle + \frac{1}{2}|01\rangle + \frac{1}{2}|10\rangle$$

+ +

What operation would I do to eliminate the state $|00\rangle$? And be left with only the terms $|01\rangle + |10\rangle$. I'm looking for a general solution, an idea, rather than one specific to this case.

+",7759,,26,,6/14/2019 13:45,6/14/2019 13:45,Eliminating a term of a superposition state,,1,2,,,,CC BY-SA 4.0 +6455,2,,6409,6/14/2019 8:17,,2,,"

The state you've given, $|\psi\rangle=a|0\rangle+b|1\rangle$ is a pure state. It has not been decohered. Decoherence is a process which turns pure states into mixed states. We usually write these in terms of density matrices. A pure state can be written in this form: +$$ +|\psi\rangle\langle\psi|=\left(\begin{array}{cc} |a|^2 & ab^\star \\ a^\star b & |b|^2 \end{array}\right). +$$ +It is very much not diagonal.

+ +

Decoherence (I'm going to use a particular form called dephasing) can alter this matrix, reducing the off-diagonal elements to +$$ +\rho=\left(\begin{array}{cc} |a|^2 & \gamma ab^\star \\ \gamma a^\star b & |b|^2 \end{array}\right) +$$ +for $0\leq \gamma\leq 1$. So, when we talk about coherence, people often mean comparing the product of the off-diagonal elements to the product of the diagonal elements (or some equivalent procedure). +$$ +\gamma^2=\frac{\langle0|\rho|1\rangle\langle1|\rho|0\rangle}{\langle0|\rho|0\rangle\langle1|\rho|1\rangle} +$$ +If the state is pure, and therefore has not been decohered, the two values are equal. The larger the difference, the more decoherence has occurred (because the coherence has been reduced).

+",1837,,,,,6/14/2019 8:17,,,,0,,,,CC BY-SA 4.0 +6456,2,,6413,6/14/2019 8:34,,5,,"
+

I know that $b$ can be decomposed mathematically as $b= c_1u_1 + +> \cdots + c_nu_n$ since these eigenvectors form an orthonormal basis. + Why only consider the effect on $|u_j \rangle$?

+
+ +

As you say, you know you can decompose $b$ in terms of the $|u_j \rangle$, so by linearity, if we know the effect on one basis state (which is pedagogically easier to describe), then we know the overall effect.

+ +
+

Is $\sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau|$, not simply + the identity matrix of dimension $T$? In which case the result after + tensoring is a block matrix with $e^{iA\tau t_{0}/T}$ on the main + diagonal, and $0_n$ elsewhere. Do I have this right?

+
+ +

This is sort of right - if the term $e^{iA\tau t_{0}/T}$ didn't contain $\tau$, you'd be fine. However, it does, so you have to include that in the sum over $\tau$, so you're not just doing $\sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau|$ in isolation. As a simple example of this, imagine you were doing +$$ +\sum_{\tau}|\tau\rangle\langle\tau|\otimes |\tau\rangle\langle\tau|, +$$ +this is certainly not the same thing as $1\otimes|\tau\rangle\langle\tau|$ (after all, what is $\tau$ at this point?). That is why the operator describes a controlled evolution. It say ""if the first register is in the state $\tau$, apply the evolution $e^{iA\tau t_{0}/T}$ on the second register"". To reiterate, the key point is that both terms in the tensor product depend on $\tau$.

+ +
+

what is contained in register $C$ ? The state $|\Psi_{\lambda_j t_o} +> \rangle $ seems to describe the superposition of registers $C,I$.

+
+ +

Indeed it does. It is crucial that the two registers are entangled, and you cannot consider just $C$ in isolation. However, this is where it continues to help by just considering $|u_j \rangle$ instead of $b$. In that case, the register $C$ is separable from register $I$. What that state is looks horribly messy and hard to decipher. When I think about this calculation, as a first step, I find it easier to think about setting $|\Psi_0\rangle$ as a uniform superposition, just like you would in a 'normal' phase estimation procedure. Then your register $C$ is in the state that is output from a normal phase estimation procedure, and it is clear that application of the (inverse) Fourier transform gives you the phase, in other words the eigenvalue of $|u_j\rangle$ with high probability.

+ +

If my alteration of $|\Psi_0\rangle$ is so obvious and simple, why don't they do that? The answer is it's an optimisation. The normal phase estimation protocol aims to maximise the probability of getting the right phase, whatever that phase may be. However, that's not the right figure of merit for the HHL algorithm (basically, because you're inverting eigenvalues, you need your small eigenvalues to be estimated more accurately than the larger ones), and the slightly different choice of $|\Psi_0\rangle$ aims to optimise the phase estimation procedure for that particular application.

+",1837,,,,,6/14/2019 8:34,,,,0,,,,CC BY-SA 4.0 +6457,2,,6413,6/14/2019 8:48,,3,,"
+

1) Are we not applying the conditional Hamiltonian evolution to $|\Psi_0 \rangle |b \rangle$?

+
+ +

The operation +$$\sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau| \otimes e^{iA\tau t_0 / T}$$ +is a controlled operation. You can read it as:

+ +
+

$\forall \tau \in [0, T-1]$, if the first register is in the state $\vert \tau \rangle$, apply $e^{iA\tau t_0 / T}$.

+
+ +

This can be verified with the following property: +$$\left( A \otimes B \right) \times \left( \vert a \rangle \otimes \vert b \rangle\right) = \left(A \times \vert a \rangle \right) \otimes \left( B \times \vert b \rangle\right)$$ +where:

+ +
    +
  • $A$ (resp. $B$) is a unitary operator on the space of $\vert a \rangle$ (resp. $\vert b \rangle$)
  • +
  • $\times$ is the matrix-vector multiplication
  • +
  • $\otimes$ is the kronecker product.
  • +
+ +

Coming back to the ""controlled Hamiltonian operation"", if you apply the operator on a state $\vert \Psi_0 \rangle \otimes \vert b \rangle$ you end up with:

+ +

$$ +\begin{split} +\left( \sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau| \otimes e^{iA\tau t_0 / T} \right) \times \left(\vert \Psi_0 \rangle \otimes \vert b \rangle\right) +&= \sum_{\tau = 0} ^{T - 1} \left(|\tau \rangle \langle \tau| \otimes e^{iA\tau t_0 / T}\right) \times \left(\vert \Psi_0 \rangle \otimes \vert b \rangle\right) \\ +&= \sum_{\tau = 0} ^{T - 1} \left(|\tau \rangle \langle \tau| \times \vert \Psi_0 \rangle \right) \otimes \left(e^{iA\tau t_0 / T} \times\vert b \rangle\right) \\ +\end{split} +$$ +The first part of the sum $\left(|\tau \rangle \langle \tau| \times \vert \Psi_0 \rangle \right)$ is $\vert \Psi_0 \rangle$ when $\vert \Psi_0 \rangle = \vert \tau \rangle$, else it simplifies to the zero vector, which ""removes"" the effect of $e^{iA\tau t_0 / T}$ on $\vert b \rangle$ when $\vert \Psi_0 \rangle \neq \vert \tau \rangle$.

+ +
+

I know that $b$ can be decomposed mathematically as $b= c_1u_1 + \cdots + c_nu_n$ since these eigenvectors form an orthonormal basis. Why only consider the effect on $|u_j \rangle$?

+
+ +

We could consider the effect on any other basis instead of the eigenbasis. But for the HHL algorithm, the controlled Hamiltonian simulation part is used in the Quantum Phase Estimation algorithm to estimate the eigenvalues of the simulated matrix ($A$ in your example). Considering another basis, even if it is possible, is not what will lead us to the solution which is the extraction of the eigenvalues of $A$ to invert them afterwards.

+ +
+

2)What is going on with the $\sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau|$ portion of the sum in the conditional Hamiltionian evolution? In this answer here , it + is described ""[...] a control part. It means that the operation will be controlled by the state of the first quantum register (the register C as the exponent tells us)"". I understand the ""gist"" of this statement but any reference to understand it more fully would be much appreciated. + Edit: Is + $\sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau|$, not simply the identity matrix of dimension $T$? In which case the result after tensoring is a block matrix with $e^{iA\tau t_{0}/T}$ on the main diagonal, and $0_n$ elsewhere. Do I have this right?

+
+ +

See above. The error you made in your reasoning here is that you studied one part of the sum independently of the other, which is not possible.

+ +

Quick note: $\sum_{\tau = 0} ^{T - 1} |\tau \rangle \langle \tau|$ alone is the identity matrix of size $T$; you are right.

+ +
+

3) After this step, a Fourier transform is applied to the register $C$, but at this point what is contained in register $C$ ? The state $|\Psi_{\lambda_j t_o} \rangle $ seems to describe the superposition of registers $C,I$.

+
+ +

The Fourier transform is part of the Quantum Phase Estimation algorithm. I personally find easier to understand first all the details of the QPE algorithm and then viewing the first part of the HHL algorithm as the QPE algorithm with a specific unitary matrix. Doing this allows you to first untangle the mathematical complexity of the QPE algorithm, and then ""forget"" about this and focus on the mathematical complexity added by the state $\vert \Psi_0\rangle$ and the application of the controlled Hamiltonian simulations.

+ +

Note: @DaftWullie explains why $\vert \Psi_0 \rangle$ has such a complicated expression both in its answer to this question and a more detailed answer.

+",1386,,1386,,6/14/2019 9:49,6/14/2019 9:49,,,,0,,,,CC BY-SA 4.0 +6458,1,6459,,6/14/2019 10:45,,13,1589,"

Is swap gate equivalent to just exchanging the wire of the two qubits?

+

if yes why not just switching the wire whenever we want to apply a swap gate?

+",7739,,-1,,6/18/2020 8:31,6/14/2019 19:39,Is swap gate equivalent to just exchanging the wire of the two qubits?,,2,0,,,,CC BY-SA 4.0 +6459,2,,6458,6/14/2019 11:08,,15,,"

Yes, it is equivalent. That's a perfectly valid way to represent it in a quantum circuit diagram.

+ +

In practice, it depends what physical implementation you're talking about. If you have 'flying' qubits, then it is possible to just reorder them, or even simply relabel them without actively doing anything. However, many physical implementations of quantum computation use static qubits. That means one particular physical qubit is in a particular place. If you want to make it interact (e.g. perform controlled-not) with another qubit, they usually have to be next to each other. That means performing swap operations along some path, exchanging the states of the qubits so that the state that was on one physical qubit is now on a different one, where you need it to be.

+",1837,,,,,6/14/2019 11:08,,,,0,,,,CC BY-SA 4.0 +6460,2,,6454,6/14/2019 11:21,,1,,"

If you've got

+ +

$$|\Psi\rangle = \frac{1}{\sqrt{2}}|00\rangle+\frac{1}{2} \Big( |01\rangle + |10\rangle \Big)$$

+ +

and you want to suppress state $|00\rangle$ using two ancillary qubits, you can

+ +
    +
  • apply a negated Toffoli gate to an ancillary qubit q[2] as target
  • +
  • apply Hadamard to a second ancillary q[3]
  • +
  • Toffoli $\mathbf{CCX}(q[2],q[3],q[0])$
  • +
  • $\mathbf{X}(q[3])$
  • +
  • $\mathbf{CCX}(q[2],q[3],q[1])$
  • +
+ +

and you'll obtain

+ +

$$|\Psi_1\rangle = \frac{1}{\sqrt{2}}\Big( |01\rangle + |10\rangle \Big)$$

+ +

Simplyfing:

+ +

+ +

In general (if the state $|\Psi\rangle$ is not a simple superposition) you can use a negated Toffoli gate (or a series of $n-1$ negated Toffoli gates for an input register of $n$ qubits) to get the state $|00\rangle$ (or the state $|0\rangle^n$ for an input register of $n$ qubits) to an ancillary qubit (or $n-1$ ancillary qubits) and then suppress it to obtain the desired result (this depends on the result you want to obtain).

+",7758,,,,,6/14/2019 11:21,,,,0,,,,CC BY-SA 4.0 +6461,2,,6436,6/14/2019 13:16,,6,,"

It seems like this gate is controlled on the top qubit (which I will call qubit 0) and performs a hadamard on both the other qubits (qubits 1 and 2) when the control is in state $|1\rangle$. In this case it is equivalent to separte two controlled-hadamards: each controlled on qubit 0, with qubit 1 as the target for one and qubit 2 as the target for the other.

+ +

The controlled-hadamard can be implemented with ch. The entire three qubit gate is then as follows.

+ +
qc = QuantumCircuit(3)
+qc.ch(0,1)
+qc.ch(0,2)
+
+",409,,,,,6/14/2019 13:16,,,,1,,,,CC BY-SA 4.0 +6462,1,6465,,6/14/2019 15:03,,5,3282,"

I'm trying to implement the three qubit bit flip code in Qiskit. +Therefore, I need to get the result of a measure of two ancilla qubits, to deduce which gate I need to use do recover my logical qubit. I know how to get the result of a measure, at the end of a circuit with :

+ +
backend_sim = Aer.get_backend('qasm_simulator')
+job_sim = execute(qc, backend_sim, shots=1000)
+result_sim = job_sim.result()
+counts = result_sim.get_counts(qc)
+plot_histogram(counts)
+
+ +

But, I don't know how to get the result of a measure into the circuit. Sorry if my question is stupid, I'm a beginner on Qiskit.

+ +

+",7762,,,,,6/15/2019 17:49,Get result measurement into a circuit with Qiskit,,1,4,,,,CC BY-SA 4.0 +6463,2,,6458,6/14/2019 19:39,,6,,"
+

why not just switching the wire whenever we want to apply a swap gate?

+
+ +

If this is the crux of the question I think the main rationale here is to treat the swap gate as an actual gate.

+ +

I only rarely see raw swap gates on their own in diagrams, typically I see them as part of a Fredkin Gate. Basically, by treating it as a gate rather than a crossing of wires, it makes it easier to understand how it can be ""controlled"" like any other gate.

+ +

But yes, an un-controlled swap gate could be implemented on classical bits in electrical wires by swapping the wires' positions.

+",5843,,,,,6/14/2019 19:39,,,,0,,,,CC BY-SA 4.0 +6464,1,,,6/14/2019 20:59,,4,610,"

I have multiple different operators in matrix form and I need to find their common eigenstates. The challenge is that the common eigenstate is in a superposition of multiple states and isn't just a single eigenvector. Can someone give me an idea of how to do this? How would I figure out what a common eigenstate in the form of a linear combination of vectors is for multiple matrices? For context, I am using Python and NumPy.

+",7734,,55,,4/23/2021 8:57,4/23/2021 8:57,How to find a common eigenstate of commuting operators?,,1,0,,,,CC BY-SA 4.0 +6465,2,,6462,6/15/2019 3:20,,4,,"

In Circuit Composer, you can use an if statement as shown below The circuit measures qubit 1 after a gate operation and, if it is 0, then applies an X gate to qubit 2:

+ +
OPENQASM 2.0;
+include ""qelib1.inc"";
+
+qreg q[3];
+creg c[3];
+
+x q[0];
+measure q[0] -> c[0];
+if(c==0) x q[1]; # here where you can set it to trigger on c == 1
+measure q[1] -> c[1];
+
+ +

+ +

This Circuit yields a 1 for q[0] and a 0 for qubit 1 , because the X gate isn't applied due to the conditional. Hope this helps!

+ +

Edit: For syntax in qiskit, please look at the code below:

+ +
qc = QuantumCircuit(q, c)
+qc.h(q)
+qc.measure(q,c)
+qc.x(q[0]).c_if(c, 0)
+qc.measure(q,c)
+qc.draw(output='mpl')
+
+ +

It appears that you should use .c_if at the end of a certain operation to use conditionals.

+",7764,,7764,,6/15/2019 17:49,6/15/2019 17:49,,,,2,,,,CC BY-SA 4.0 +6466,2,,6432,6/15/2019 3:48,,4,,"

If you are looking for a place to start, I probably start by asking you a few clarifying questions. Quantum Computation & Information is a broad field. I would say that it can primarily be viewed as a spectrum, similar to classical computing, from hardware up to algorithms. To get an idea of the hardware side, a great reference is Jerry Chow's thesis. This paper is a great overview of the hardware implementation that is popular today, superconducting qubits. There are different implementations of quantum computers today, but the superconducting qubit architecture is the most popular (for the time being). On the upper end of algorithms, there are several papers from the 1990's by Peter Shor and John Preskill that would be useful. Shor devised the quantum algorithm for prime factorization that you may have heard a lot about, and both Shor and Preskill were influential in the development of Quantum Error Correction, the idea that with enough qubits that are of good enough quality, you can implement error correcting codes and get quantum computers to perform arbitrarily well. In the middle, I would say that you have programming of today's (primarily IBM's) quantum computers for near term applications. This programming is primarily done in python using qiskit, a programming framework made by IBM. A general reference for the whole field would be Nielsen and Chuang's book on the subject as a whole. Hopefully this is good enough to get you started. Let me know if you would like more detail/references on a certain area.

+ +

Disclaimer: I have only been reading into quantum computing for about a year and half now, and certainly would not consider myself an expert.

+",7764,,,,,6/15/2019 3:48,,,,0,,,,CC BY-SA 4.0 +6467,1,,,6/15/2019 5:45,,5,267,"

The Peres-Horodecki criteria for a 2*2 state states that if the smallest eigenvalue of the partial transpose of the state is negative, it is entangled, else it is separable.

+ +

According to this paper (page 4, left side), the following is an equivalent formulation to express the above criterion.

+ +

Assume the matrix in question looks like this:

+ +

$$\begin{bmatrix} +\rho_{00,00} & \rho_{00,01} & \rho_{00,10} & \rho_{00,11} \\ +\rho_{01,00} & \rho_{01,01} & \rho_{01,10} & \rho_{01,11} \\ +\rho_{10,00} & \rho_{10,01} & \rho_{10,10} & \rho_{10,11} \\ +\rho_{11,00} & \rho_{11,01} & \rho_{11,10} & \rho_{11,11} \\ +\end{bmatrix}$$

+ +

Consider the following three determinants:

+ +

$$ W_2 = \begin{vmatrix} +\rho_{00,00} & \rho_{01,00} \\ +\rho_{00,01} & \rho_{01,01} \\ +\end{vmatrix} $$

+ +

$$W_3 = \begin{vmatrix} +\rho_{00,00} & \rho_{01,00} & \rho_{00,10} \\ +\rho_{00,01} & \rho_{01,01} & \rho_{00,11} \\ +\rho_{10,00} & \rho_{11,00} & \rho_{10,10} \\ +\end{vmatrix}$$

+ +

$$W_4 = \begin{vmatrix} +\rho_{00,00} & \rho_{01,00} & \rho_{00,10} & \rho_{01,10} \\ +\rho_{00,01} & \rho_{01,01} & \rho_{00,11} & \rho_{01,11}\\ +\rho_{10,00} & \rho_{11,00} & \rho_{10,10} & \rho_{11,10}\\ +\rho_{10,01} & \rho_{11,01} & \rho_{10,11} & \rho_{11,11}\\ +\end{vmatrix}$$

+ +

Notice that $W_4$ is the determinant of the partial transpose of the matrix and $W_3$ and $W_2$ are the first 3*3 and 2*2 elements of the partial transpose.

+ +

The condition is if $W_2 \geq 0$ and ($W_3 < 0$ or $W_4 < 0$), then the state is entangled. If not, it is separable.

+ +

How are these two equivalent?

+ +

Also, can this method be extended to ensure the smallest eigenvalue is greater than any $x$, where $x$ is not necessarily 0?

+",2832,,10480,,3/9/2021 18:48,3/9/2021 18:48,Equivalent determinant condition for Peres-Horodecki criteria,,1,3,,,,CC BY-SA 4.0 +6468,1,,,6/15/2019 7:59,,3,137,"

I'm referring to an earlier question. It involves secret sharing based on the different measurement directions 3 people i.e Alice Bob and Charlie do. Now there is a block in the referred paper which I want to understand in order to proceed further and here it goes assuming the GHZ state they share is $$ |\psi\rangle=\dfrac{|000\rangle+|111\rangle}{\sqrt{2}}$$

+ +
+

Suppose that Bob is dishonest and that he has managed to get a hold of Charlie’s + particle as well as his own. He then measures the two particles and sends one of them on to Charlie. His object + is to discover what Alice’s bit is, without any assistance + from Charlie, and to do so in a way that cannot be detected. Alice has measured her particle in either the $x$ + or $y$ direction, but Bob does not know which. He would + like to measure the quantum state of his two-particle system, but because he does not know what measurement + Alice made, he does not know whether to make his in the $\dfrac{|00\rangle ± |11\rangle}{\sqrt{2}}$ + basis or in the $\dfrac{|00\rangle ± i|11\rangle}{\sqrt{2}}$ basis. + Choosing at random he has a probability of $1/2$ of making a mistake. If he chooses correctly, he will know, for + valid combinations of measurement axes, what the result + of Charlie’s measurement is from the result of his own, + and this means he will then know what Alice’s bit is. For + example, if Alice measured in the $x$ direction and found + $| + x\rangle$, then the state Bob receives is $\dfrac{|00\rangle + |11\rangle}{\sqrt{2}}$. If + Bob now measures in the $\dfrac{|00\rangle \pm |11\rangle}{\sqrt{2}}$ basis, he knows + what the two- particle state is, and because + $$\dfrac{|00\rangle + |11\rangle}{\sqrt{2}}= \dfrac{|+x\rangle|+x\rangle + |-x\rangle|-x\rangle}{\sqrt{2}}$$ Bob knows that Charlie’s measurement will produce a + result identical to his

+
+ +

The questions I have is

+ +
    +
  1. How do they accomplish the sharing of particles of this GHZ state? What particle is Alice given of this GHZ state I know it is given that the first particle but what does ""first"" mean?

  2. +
  3. It says Bob catches hold of Charlie's particle measures it and then sends to Charlie, but isn't Charlie already holding his particle when they decided to share the GHZ state or does Charlie get his particle after Bob measures both his and Charlie's particle?

  4. +
  5. As given if Bob receives $\dfrac{|00\rangle + |11\rangle}{\sqrt{2}}$ then after measuring in the basis given he will get $p_{++}=1$ and $p_{--}=0$, where $p_{++}=\dfrac{|00\rangle + |11\rangle}{\sqrt{2}}$ and $p_{--}=\dfrac{|00\rangle - |11\rangle}{\sqrt{2}}$, what does this have to do with the text that follows this measurement outcome?

  6. +
+",6070,,26,,6/16/2019 15:28,6/16/2019 15:28,GHZ - measuring particles,,0,0,,10/13/2021 22:12,,CC BY-SA 4.0 +6469,2,,6464,6/15/2019 8:27,,4,,"

Superposition is a linear combination of vectors which is a single vector. It may not be equal to some basis vector (from computational basis, for example), but this is not a big deal in general.

+ +

As for question, I suppose operators are normal (so we can apply the spectral theorem).

+ +

In the simplest case if operator $A$ has eigenvalue $\lambda$ with multiplicity 1, then the corresponding eigenvector $v$ will also be eigenvector for any commuting operator $B$. +Since $Av=\lambda v$ and $AB=BA$ then +$$ +ABv = BAv= B\lambda v \implies A(Bv) = \lambda (Bv) \implies Bv = \mu v +$$ +Here we obtained that $Bv$ is also eigenvector of $A$ with eigenvalue $\lambda$ and since it has multiplicity 1 it must be collinear to $v$.
+So such eigenvector $v$ will automatically be common eigenvector for a set of commuting with $A$ operators.

+ +

In general case $A$ may not have eigenvalue with multiplicity 1. In this case $A$ has invariant subspaces (eigenspaces) $H_{\lambda_i}, \text{dim}H_{\lambda_i}>1$ such that $Av = \lambda_i v, \forall v \in H_{\lambda_i} $.They split space $H = H_{\lambda_1} \oplus ... \oplus H_{\lambda_k}$.
+Similarly to the simple case, we can show that if $AB=BA$ then $H_{\lambda_i}$ are also invariant for $B: B(H_{\lambda_i}) \subset H_{\lambda_i}$. Now we can consider restrictions of operator $B$ on the subspaces $H_{\lambda_i}$. Every restriction has its own eigendecomposition. But every eigenspace of every such restriction of $B$ will be common eigenspace of $A$ and $B$ since $H_{\lambda_i}$ is eigenspace of $A$.
+Actually, if we take the intersection of eigendecompositions $\{H_{\lambda_i}\}$ and $\{H_{\mu_i}\}$ correspondingly for $A$ and $B$ then we will obtain the decomposition of $H$ into common eigenspaces of $A$ and $B$.

+ +

Though it may not be that efficient to calculate intersection of all eigendecompositions for operators $A_i$.

+ +

I guess we can just pick some random numbers $r_i$ and find eigenvector of $\sum_i r_i A_i$. With high probability it will be the common eigenvector for commuting operators $A_i$.

+",5870,,5870,,6/15/2019 8:39,6/15/2019 8:39,,,,0,,,,CC BY-SA 4.0 +6470,2,,120,6/16/2019 5:43,,1,,"

The Quantum Reality group at the Centre for Quantum Technologies (National University of Singapore) https://qreality.quantumlah.org/

+",7771,,,,,6/16/2019 5:43,,,,0,,,,CC BY-SA 4.0 +6471,2,,4527,6/16/2019 6:26,,2,,"

At this early stage of quantum technology development, a useful starting point to understand the ""expectation of profitability"" is to look at the private markets (angel investing, venture capital, private equity, etc) in addition to public companies. Today there are 76 companies active in quantum computing, those were involved in 178 deals where 260 investors participated. The largest deal was for 350 Million USD, and, the median post-valuation 10 Million USD. As of June 15th, 2019, the total capital invested in quantum computing is 1.38 Billion USD, and there have been 11 exits. 2018 registered the higher deal count to date (24) and it was concentrated in venture capital allocations. In terms of industry verticals, there are around 15 active categories for the investments made in quantum computing, artificial intelligence is the second largest, followed by cybersecurity -but relatively unexploited opportunities are present in smaller niche verticals. Source: Morningstar, Inc.

+",7771,,7771,,6/17/2019 5:58,6/17/2019 5:58,,,,1,,,,CC BY-SA 4.0 +6472,1,6474,,6/16/2019 7:02,,4,752,"

Problem definition

+

I'm implementing a quantum circuit in qiskit for a Szegedy quantum walk, (reference, Fig 21.). It uses two registers of dimension $N$ ($N=3$) each one. The challenges I'm facing are:

+
    +
  1. Multiple controlled gates (2 and 3 controls and targets like $H$, $R_{y}$).
  2. +
  3. Hermitian conjugate of an operator (Dagger).
  4. +
  5. Ancilla qubits, that increase the complexity of the circuit.
  6. +
+

Here is a main part of the circuit:

+

+

For example, we have $K_{b_{2}}$ controlled by zero and one controls.

+

+

Main questions

+
    +
  • How do I implement the controlled-dagger operator $K^{\dagger}_{b_{2}}$, of operator $K_{b_2}$? Does qiskit provide dagger operators of the principal gates? I have a little insight here. Should I apply tdg to all gates in $K_{b_{2}}$?

    +
  • +
  • For multiple-controlled qubits operations, I base the construction of the multiple-controlled gates in the Nielsen&Chuang book, as Toffoli gates. So, we must use ancilla qubits. For $N$ controls we use $N-1$ ancilla qubits.

    +
  • +
  • Is the following proposal correct?

    +
  • +
+

proposition

+

So, for $K_{b_{2}}$, I control individually all the gates as follows, is this approximation correct?

+

+

How do I control the $R_{y}$ gate? I could not find a Controlled rotation around Y-axis only for Z axis (crz).

+

qiskit

+

I would define for each gate of the above figure, the "compute-copy-uncompute" method here.

+
def kb2(qw, q0, q1, anc):
+    qw.ccx(q0[0], q0[1], anc[0])
+    qw.cry(np.pi/2, anc[0], q1[0])
+    qw.ccx(q0[0], q0[1], anc[0])
+    qw.ccx(q0[0], q0[1], anc[0])
+    qw.ccx(anc[0], q1[0], anc[1])
+    qw.cry(np.pi/2, anc[1], q1[1])
+    qw.ccx(anc[0], q1[0], anc[1])
+    qw.ccx(q0[0], q0[1], anc[0])
+    qw.ccx(q0[0], q0[1], anc[0])
+    qw.ccx(anc[0], q1[0], anc[1])
+    qw.ch(anc[1], q1[1])
+    qw.ccx(anc[0], q1[0], anc[1])
+    qw.ccx(q0[0], q0[1], anc[0])
+    
+    #... and so on
+    
+    return kb2
+
+q0 = QuantumRegister(3, 'q0')
+q1 = QuantumRegister(3, 'q1')
+anc = QuantumRegister(2, 'a')
+
+qwcirc = QuantumCircuit(q0, q1, anc)
+
+qwcirc.x(q0[1]) # for 0-control
+kb2(qwcirc, q0, q1, anc)
+qwcirc.x(q0[1]) #for 0-control
+
+# Matplotlib Drawing
+qwcirc.draw(output='mpl')
+
+

I think half of the Toffoli's gates may be avoided...but I really hope to start a conversation. Thanks in advance.

+",7746,,-1,,6/18/2020 8:31,6/17/2019 7:25,Implementing a complex circuit for a Szegedy quantum walk in qiskit,,1,0,,,,CC BY-SA 4.0 +6473,1,6484,,6/16/2019 10:10,,1,246,"

Let's say we got a CX with a Hadamard gate on the control gate and any state at the target gate, will the target necessarily become a superposition of two states?

+ +

Best.

+",7405,,26,,6/16/2019 15:36,6/18/2019 18:57,CX gate with Hadamard,,2,0,,,,CC BY-SA 4.0 +6474,2,,6472,6/16/2019 13:18,,2,,"

This is an interesting question here.

+
+

How do I implement the controlled-dagger operator $K^{\dagger}_{b_{2}}$, of operator $K_{b_2}$? Does qiskit provide dagger operators of the principal gates? I have a little insight here. Should I apply tdg to all gates in $K_{b_{2}}$?

+
+

The dagger operation is quite simple to implement and can be seen as a recursive operation.

+

The only requirement is that the dagger of each gate in your gateset is also in your gateset. This means that if $U$ is a gate in your gateset (i.e. a "primitive" gate), then $U^\dagger$ should also be present in your gateset.

+

If this requirement is checked (and it is checked for IBM gateset, which is the answer to your second question), then here is a pseudo-algorithm using Python syntax implementing a generic dagger operation:

+
def dagger(quantum_gate):
+    if quantum_gate in gateset:
+        return quantum_gate.dagger() # just returning a gate from the gateset.
+    # else, quantum_gate is a sequence of other quantum gates (primitive or not)
+    daggerized_gate = []
+    for gate in reversed(quantum_gate):
+        daggerized_gate.append(dagger(quantum_gate)) # recursive call
+    return daggerized_gate
+
+

This algorithm is fully-generic: it works for every gates, even for controlled ones, provided the requirement is checked.

+
+

For multiple-controlled qubits operations, I base the construction of the multiple-controlled gates in the Nielsen&Chuang book, as Toffoli gates. So, we must use ancilla qubits. For $N$ controls we use $N-1$ ancilla qubits.

+
+

There are several algorithms that implement a generic $N$-controlled (controlled by $N$ qubits) $X$ gate. As far as I know, there are 3 distinct classes:

+
    +
  1. The algorithms requiering $N-1$ ancilla qubits as you mention. These algorithms have the best gate-count and circuit-depth complexity.
  2. +
  3. The algorithms requiering only $1$ ancilla qubit, at the expense of a bigger gate-count and circuit-depth.
  4. +
  5. Hybrid algorithms between the 2 previous classes: they need more than one ancilla qubit but less than $N-1$ and also have a gate complexity between the 2 previous classes.
  6. +
+

I don't have links right now, but will edit as soon as possible to provide you links to papers describing algorithms in the 3 previous classes.

+

Note: if someone has access to some papers, please edit my answer if possible or leave the link in comments.

+
+

Is the following proposal correct?

+

So, for $K_{b_{2}}$, I control individually all the gates as follows, is this approximation correct?

+

+

How do I control the $R_{y}$ gate? I could not find a Controlled rotation around Y-axis only for Z axis (crz).

+
+

This is not an approximation: it is 100% correct. Controlling a composed-quantum gate is equivalent to controlling all the gates composing it (may be used recursively).

+

About the implementation of the $R_y$ gate, you can implement it with the circuit given here.

+

+

For multiply-controlled $R_y$ gates, you can apply this definition recursively.

+

A quick observation: you can remove the 3rd control from the last 2 $H$ gates. If the first 2 controls are verified, the $H$ gate will be applied only once to the last qubit, independently of the value of third control-qubit.

+",1386,,-1,,6/18/2020 8:31,6/17/2019 7:25,,,,5,,,,CC BY-SA 4.0 +6475,1,6485,,6/16/2019 15:53,,6,110,"

I have seen Why can the Discrete Fourier Transform be implemented efficiently as a quantum circuit?. This is not a duplicate.

+ +

I am familiar with the decomposition of the QFT from Nielsen&Chuang and Preskill's notes, and it requires to be able to perform n-different control phase gates. +If we only allow the smallest control-phase only we can still implement all the other ones as powers but we now need to use it exponentially many times. It seems that the speedup of the quantum fourier transform is based on allowing a particularly nice (albeit reasonable) gate set.

+ +

Did I miss anything? Is there a way to decompose that circuit efficiently into a standard gate set (e.g. CNOT, H, P, and Paulis)?

+",7775,,7775,,6/23/2019 11:46,6/23/2019 11:46,Is the quantum Fourier transform efficient if only one control-phase is allowed in the gate set,,1,0,,,,CC BY-SA 4.0 +6476,1,,,6/16/2019 16:47,,2,45,"

Based on the article given by J. L. Ball, I. Fuentes-Schuller, and F. P. Schuller, Phys. Lett. A 359, 550 (2006) +had used the following expression of von-Neumann entropy

+ +

\begin{equation} +S = - \operatorname { Tr } \left( \varrho \log _ { 2 } \varrho \right) = \log _ { 2 } \left( \frac { \left| \gamma _ { B } \right| ^ { \left( 2 \left| \gamma _ { B } \right| ^ { 2 } \right) / \left( \left| \gamma _ { B } \right| ^ { 2 } - 1 \right) } } { 1 - \left| \gamma _ { B } \right| ^ { 2 } } \right) +\end{equation} +where, +\begin{equation} +| \gamma | ^ { 2 } \equiv \left| \beta _ { k } / \alpha _ { k } \right| ^ { 2 } +\end{equation} +provided with, +\begin{equation} +\varrho = | \overline { 0 } _ { - k } \overline { 0 } _ { k } \rangle \left\langle \overline { 0 } _ { k } \overline { 0 } _ { - k } |\right. +\end{equation} +\begin{equation}{\label{eq34}} +| \overline { 0 } \rangle = \sum _ { n = 0 } ^ { \infty } c _ { n } | n _ { k } n _ { - k } \rangle +\end{equation} +\begin{equation} +c _ { 0 } = \sqrt { 1 - \left| \frac { \beta _ { k } } { \alpha _ { k } } \right| ^ { 2 } } +\end{equation} +\begin{equation} +c _ { n } = \left( \frac { \beta _ { k } ^ { * } } { \alpha _ { k } ^ { * } } \right) ^ { n } c _ { 0 } +\end{equation}

+ +

I tried to substitute by these expressions but without success. I appreciate your answers.

+",5823,,10480,,3/20/2021 6:09,3/20/2021 6:09,How to prove the following bosonic entanglement expression?,,1,3,,,,CC BY-SA 4.0 +6477,1,6478,,6/16/2019 17:06,,3,607,"

I want to implement amplitude amplification using Q#. I have the operation $A$ + that prepares my initial state and I need to compute $ A^{-1} $ to implement the algorithm.

+ +

Is there an easy way to do that in Q# (a keyword or operation)?

+",7759,,26,,6/16/2019 17:11,6/16/2019 17:44,How to compute the inverse of an operation in Q#?,,2,0,,,,CC BY-SA 4.0 +6478,2,,6477,6/16/2019 17:33,,5,,"

As given in the documentation, if your operation is unitary, you can add the statement adjoint auto; within the operation after the body block. This will generate the adjoint (which is the inverse for unitary).

+ +

Then, to use the inverse call Adjoint A(parameters)

+",2832,,,,,6/16/2019 17:33,,,,1,,,,CC BY-SA 4.0 +6479,2,,6477,6/16/2019 17:44,,5,,"

In the case that your operation can be represented by a unitary operator $U$ (this is typically the case if your operation doesn't use any measurements), you can indicate that by adding is Adj to your operation's signature, letting the Q# compiler know that your operation is adjointable:

+ +
open Microsoft.Quantum.Math as Math;
+
+/// # Summary
+/// Prepares a qubit in a state representing a classical probability
+/// distribution {p, 1 - p}.
+/// # Description
+/// Given a qubit in the |0⟩, prepares √p |0⟩ + √(1 - p) |1⟩
+/// for a given probability p.
+operation PrepareDistribution(probability : Double, target : Qubit) : Unit
+is Adj {
+    let rotationAngle = 2.0 * Math.ArcCos(Math.Sqrt(1.0 - probability));
+    Ry(rotationAngle, target);
+}
+
+ +

You can then call Adjoint PrepareDistribution to ""undo"" the PrepareDistribution operation. The Adjoint keyword is an example of a Q# functor, and tells Q# that you want the inverse operation. In this case, the Q# compiler will apply Ry(-rotationAngle, target).

+ +

For more information:

+ + +",1978,,,,,6/16/2019 17:44,,,,0,,,,CC BY-SA 4.0 +6480,2,,6399,6/16/2019 18:01,,1,,"

On question 2: the Wikipedia page should have included the SWAP gates as the last step. This is corroborated by the following statement (a few lines) under your picture on the Wikipedia page:

+ +
+

With this notation, the action of the quantum Fourier transform can be expressed in a compact manner:$$QFT|x_1x_2\dots x_n⟩=\frac{1}{\sqrt{N}}(|0⟩+e^{2\pi i[0.x_n]}|1⟩)\otimes(|0⟩+e^{2\pi i[0.x_{n-1}x_n]}|1⟩)\otimes\dots\otimes(|0⟩+e^{2\pi i[0.x_1x_2\dots x_n]}|1⟩) $$

+
+",7460,,,,,6/16/2019 18:01,,,,0,,,,CC BY-SA 4.0 +6481,1,,,6/16/2019 19:13,,1,58,"

I have recently been studying quantum computing specially the cryptographic aspects of it. The books I followed is Nielsen and Chuang, and a book named Quantum Computing Explained by David McMohan. The chapter that got me really interested in quantum computing was the superdense coding one. I was just curious to know if there are some projects or problems related to these topics which one can start doing. Can somebody give useful links for these topics?

+",6070,,26,,6/17/2019 6:05,6/17/2019 6:05,Superdense coding projects,,0,0,,,,CC BY-SA 4.0 +6482,2,,6473,6/16/2019 19:57,,1,,"

If I am properly understanding what you are asking, then no. If for the control, we start with $\left|0\right>$ and apply a Hadamard to it, then we end with our control in an even mixture of $\left|0\right>$ and $\left|1\right>$ and therefore 50% of the time the CX gate will act like an X gate, and 50% of the time the CX gate will act like the Identity. The key now is looking for target states that act the same way under application of the X gate as application of the Identity. These states are the eigenstates of the X gate, so $\left|+\right>$ and $\left|-\right>$. If the target input is in either the $\left|+\right>$ or $\left|-\right>$ state, then the target after the CX gate will NOT be in a superposition of two states.

+",7764,,23,,6/18/2019 18:57,6/18/2019 18:57,,,,4,,,,CC BY-SA 4.0 +6483,1,,,6/16/2019 20:48,,2,392,"

Does anyone know where I can find working Slack invite links to any of IBM's Slack pages? The Slack links on this support page are all broken. Thank you.

+",7764,,26,,6/17/2019 5:55,6/17/2019 9:48,IBM Slack links broken,,1,0,,,,CC BY-SA 4.0 +6484,2,,6473,6/17/2019 4:23,,1,,"

Assuming your control is $|0\rangle$ to begin with. Then after application of Hadamard, the control is: +$$\frac{|0\rangle + |1\rangle}{\sqrt 2}$$.

+ +

Now using this as control and applying $X$ gate to the target, say $|0\rangle$, you get: +$$\frac{|0\rangle|0\rangle + |1\rangle |1\rangle}{\sqrt 2}$$

+ +

Now, the system is entangled and is in a superposition of the states $|00\rangle$ and $|11\rangle$. Because it is entangled, it does not make sense to separately talk about the target state and ask if it is in superposition.

+ +

If you measure out the target, you will notice it is in a classical mixture (not a quantum superposition) of states $|0\rangle$ and $|1\rangle$ represented as follows: +$$\frac{1}{2}|0\rangle\langle0| + \frac{1}{2}|1\rangle\langle1|$$

+ +

And looking at the outcome, you will see a basis state (I assume this is what you mean by simple state): $|0\rangle$ or $|1\rangle$, so yes, on measuring you will see a simple state.

+ +
+ +

A similar thing happens for $|1\rangle$. Any state that is not an eigenstate of $X$ will lead to some sort of entanglement as shown above. However, like @John Garmon said, if you use an eigenstate of $X$, say $|-\rangle$, on applying $CX$ the states becomes: +$$\frac{|0\rangle|-\rangle - |1\rangle|-\rangle}{\sqrt 2}$$ +$$= \frac{|0\rangle - |1\rangle}{\sqrt 2} |-\rangle$$

+ +

And the target state is not entangled, and is a 'simple' state with respect to the $|+\rangle, |-\rangle$ basis.

+",2832,,2832,,6/17/2019 4:30,6/17/2019 4:30,,,,0,,,,CC BY-SA 4.0 +6485,2,,6475,6/17/2019 6:47,,3,,"

Talking about efficiency here isn't exactly a fair question: as you change n, the number of qubits in the Fourier transfer, you're changing the gate that you're talking about using (because the smallest phase will be something like controlled-$Z(\pi/2^n)$). After all, if I can do controlled-$Z$ when I have two qubits, why would I suddenly lose the ability to do controlled-$Z$ (and only be able to do controlled-$\sqrt{Z}$) when I have 3 qubits?

+ +

If you use a fixed gate set rather than changing it with $n$, then whichever phase you happen to use is only a finite overhead to convert back into the standard controlled-phase, and so the whole circuit remains efficient.

+",1837,,,,,6/17/2019 6:47,,,,1,,,,CC BY-SA 4.0 +6486,2,,6467,6/17/2019 6:56,,4,,"

This is called Sylvester's Criterion. There's plenty of information available once you have the name. The linked wikipedia article contains a proof.

+ +

Strictly, Sylvester's Criterion requires that $W_2,W_3,W_4> 0$ for the state to be positive under the partial transpose. However, for a density matrix, $W_2$ is always positive semi-definite. This is because you could certainly define a density matrix of the form +$$ +\left(\begin{array}{cccc} +\rho_{00,00} & \rho_{01,00} & 0 & 0 \\ +\rho_{00,10} & \rho_{01,01} & 0 & 0 \\ +0 & 0 & 1 & 0 \\ +0 & 0 & 0 & 1 +\end{array}\right) +$$ +up to some rescaling. This has the same determinant $W_2$ but is separable, + and hence unaffected by the partial transpose. +Hence, non-positivity is determined by looking at a violation caused by $W_3$ or $W_4$.

+ +

I agree with a query in the comments that it is not immediately obvious that it is relevant for detecting negativity (I will continue to think about it...). If it is a problem, we should be able to come up with a counter-example.

+ +

The method is easily extended to any smallest eigenvalue. Simply reduce the matrix by $x$ times the appropriately sized identity matrix, shifting the min eigenvalue from $x$ to 0.

+",1837,,1837,,6/17/2019 12:00,6/17/2019 12:00,,,,1,,,,CC BY-SA 4.0 +6487,2,,6483,6/17/2019 9:48,,3,,"

There is a link on the qiskit website to the public Slack. Here you can find channels for talking the various elements of Qiskit and also the IBM Q Experience.

+",5955,,,,,6/17/2019 9:48,,,,0,,,,CC BY-SA 4.0 +6488,1,6490,,6/17/2019 9:57,,1,389,"

In Chapter 6 of ""Quantum Computation and Quantum Information"" Textbook by Nielsen and Chuang, Box 6.1 gives a circuit example of Quantum Search Algorithm done on a two-bit sized search space.

+ +

The Quantum Search Algorithm consists of an initial Hadamard Transformation on the two-bit input(2 wires), followed by iterations of the Grover Algorithm which itself contains a conditional phase-shift circuit.

+ +

The phase shift operation, lets call it $S$, when written in matrix form is given by:

+ +
+

$$S= 2|00\rangle \langle 00|-I$$ so that $S|00\rangle=|00\rangle$, and $S|x\rangle=-|x\rangle$ for $x \neq 00$

+
+ +

The sequence of gate operation on the input qubits are as such:
+(1) Apply $X$ gate on both the 1st and 2nd bit.
+(2) Apply $H$ gate on the 1st bit.
+(3) Apply C-NOT gate on the 1st bit with the 2nd bit as the control bit.
+(4) Do (2).
+(5) Do (1).

+ +

I tried to use $|00\rangle$ as the input state for the phase shift hoping to get back $|00\rangle$.
+However I got -$|00\rangle$ after the phase shift if I work out the math for such a gate sequence. These are my steps:

+ +

(1) $X_2|0\rangle_2 \otimes X_1|0\rangle_1 =|1\rangle_2|1\rangle_1$

+ +

(2) $|1\rangle_2 \otimes H_1|1\rangle_1 = |1\rangle_2 \otimes (\frac{1}{\sqrt +{2}} |0\rangle_1 - \frac{1}{\sqrt{2}}|1\rangle_1)$

+ +

(3) $|1\rangle_2 \otimes X_1(\frac{1}{\sqrt{2}} |0\rangle_1 - \frac{1}{\sqrt {2}}|1\rangle_1) =|1\rangle_2 \otimes (\frac{1}{\sqrt{2}} |1\rangle_1 - \frac{1}{\sqrt {2}}|0\rangle_1) $

+ +

(4) $|1\rangle_2 \otimes H_1(\frac{1}{\sqrt{2}} |1\rangle_1 - \frac{1}{\sqrt {2}}|0\rangle_1)$ $= |1\rangle_2 \otimes \left[\frac{1}{\sqrt{2}} (\frac{1}{\sqrt{2}} |0\rangle_1 - \frac{1}{\sqrt {2}}|1\rangle_1) - \frac{1}{\sqrt {2}}(\frac{1}{\sqrt{2}} |0\rangle_1 + \frac{1}{\sqrt {2}}|1\rangle_1)\right] = |1\rangle_2\otimes -|1\rangle_1 $

+ +

(5) $-X_2|1\rangle_2 \otimes X_1|1\rangle_1 =-|0\rangle_2|0\rangle_1$

+ +

Can someone find out whats my mistake?

+",5253,,,,,6/17/2019 12:48,Construction of Phase Shift Operation used in Quantum Search,,1,4,,,,CC BY-SA 4.0 +6489,1,6492,,6/17/2019 10:06,,5,247,"

I'm going through some slides on the PPT/NPT criteria along with Horodecki's paper, and I'm kind of stuck. Let's take this slide:

+ +

+ +

Firstly, why can we write a bipartite density matrix as $\sum_{ijkl}\rho_{kl}^{ij}|i\rangle\langle j|\otimes |k\rangle\langle l|$? What states are the index labels $i, j, k, l$ referring to?

+ +

Secondly, Horodecki says on page 21 that if a $\rho_{AB}$ is separable then the new matrix $\rho_{AB}^{T_B}$ with matrix elements can be defined in some product basis as $\langle m|\langle \mu |\rho_{AB}^{T_B}|n\rangle|\nu\rangle = \langle m|\langle \nu|\rho_{AB}|n\rangle|\mu\rangle$. I don't quite understand where they're getting this form from. What are $|m\rangle, |n\rangle, |\mu\rangle, |\nu\rangle$?

+",26,,10480,,3/9/2021 18:50,3/9/2021 18:50,Understanding the classification of quantum states based on partial transposition: representations of the bipartite density matrix,,1,2,,,,CC BY-SA 4.0 +6490,2,,6488,6/17/2019 12:43,,2,,"

You're right! Maybe this answer is still helpful / interesting for you.

+ +

There are several sources for the Grover algorithm and the phase shift. In Nielsen and Chuang, you'll find that the circuit does something different than what the authors actually say on the previous page. Nevertheless, that does not change the final result. I would like to clarify this a bit.

+ +

Before I start a big calculation, let's summarize what the Grover algorithm is all about. +In the Grover algorithm, two elements are important. This is the oracle on the one hand and the conditional phase shift on the other hand.

+ +

I try to reduce the mathematical calculations to the minimum. Suppose we are looking for an element of four elements. The searched element is $|11\rangle$.

+ +

We start with a equal superposition over all states:

+ +

$$|\psi_0\rangle=\frac{1}{2}(|00\rangle+|01\rangle+|10\rangle+|11\rangle)$$

+ +

The oracle negates the amplitude of the searched element. Important the oracle recognizes a solution for the search problem, so the oracle does the following:

+ +

$$|\psi_1\rangle=\frac{1}{2}(|00\rangle+|01\rangle+|10\rangle-|11\rangle)$$

+ +

Next, the Hadamard transform is used, as can be seen quite well on the circuit shown in Nielsen & Chuang.

+ +

$$|\psi_2\rangle=\frac{1}{2}(H|00\rangle+H|01\rangle+H|10\rangle-H|11\rangle)$$ +$$=\frac{1}{4}(|00\rangle + |01\rangle + |10\rangle +|11\rangle \\ + |00\rangle - |01\rangle+|10\rangle-|11\rangle \\ +|00\rangle+|01\rangle-|10\rangle-|11\rangle \\ -|00\rangle+|01\rangle+|10\rangle-|11\rangle)$$ +$$=\frac{1}{2}(|00\rangle+|01\rangle+|10\rangle-|11\rangle)$$

+ +

Now the conditional phase shift is applied, which means: +$|00\rangle\rightarrow|00\rangle, |x\rangle\rightarrow -|x\rangle$ therefore:

+ +

$$|\psi_3\rangle=\frac{1}{2}(|00\rangle-|01\rangle-|10\rangle+|11\rangle)$$

+ +

The Hadamard-Transformation is to apply: +$$H|\psi_3\rangle=\frac{1}{2}(H|00\rangle-H|01\rangle-H|10\rangle+H|11\rangle)$$

+ +

Now results in a calculation, which is very similar to the previous one, I abbreviate the times something and write only the result:

+ +

$$\frac{1}{4}(4|11\rangle)=|11\rangle$$

+ +

If you measure the register at this point you will see state $|11\rangle$ with 100% probability!

+ +

But lets get back to the circuit that you have analyzed. The quantum circuit does the following: $|00\rangle \rightarrow -|00\rangle, |x\rangle \rightarrow |x\rangle$ +Now I apply this rule to this: +$$|\psi_2\rangle=\frac{1}{2}(|00\rangle+|01\rangle+|10\rangle-|11\rangle)$$ +I get: +$$|\psi_3\rangle=\frac{1}{2}(-|00\rangle+|01\rangle+|10\rangle-|11\rangle)$$ +Now the Hadamard transformation has to be executed again: +$$H|\psi_3\rangle=\frac{1}{2}(-H|00\rangle+H|01\rangle+H|10\rangle-H|11\rangle)$$ +If one calculates this now, one gets the following: +$$\frac{1}{4}(-4|11\rangle)=-|11\rangle$$

+ +

In summary, this means that the difference between the regulations is really just another sign. However, this does not matter in the measurement, since only the magnitude square of the amplitude plays a role.

+ +

In fact, this is a bit strange in Nielsen and Chuang. Since the circuit shown there actually implements the last rule. You have also recognized that correctly.

+ +

So in a nutshell: Whether this $|0\rangle\rightarrow|0\rangle, |x\rangle\rightarrow-|x\rangle$ or $|0\rangle\rightarrow-|0\rangle, |x\rangle\rightarrow|x\rangle$ (at the phase shift operator) here is used is ""no matter"". The difference is only the sign. Granted, if you look at Nielsen and Chuang's first pages on the Grover algorithm, then the real implementation is a bit confusing to the reader. But you analyzed the circuit absolutely correctly.

+",4974,,4974,,6/17/2019 12:48,6/17/2019 12:48,,,,2,,,,CC BY-SA 4.0 +6491,1,6498,,6/17/2019 14:32,,8,267,"

The pure states of a qudit inhabit the $\mathbb{CP}(d-1)$ manifold.

+ +
    +
  1. Is it true that the pure states of $n$ qubits live on the $\mathbb{CP}(2^n-1)$ manifold?

  2. +
  3. If the answer to the first question is yes, then how do the sets of measurements on $n$ qubits and an $d=2^n$ qudit compare? Intuitively, I feel like the latter should be bigger due to the locality issues. However, if we stick to a particular bases, there seem to be a one-to-one correspondence.

  4. +
+",6313,,6313,,6/17/2019 14:50,6/19/2019 21:35,$n$ qubit vs. a $d=2^n$ qudit states and measurements,,1,3,,,,CC BY-SA 4.0 +6492,2,,6489,6/17/2019 15:39,,5,,"

For any orthonormal basis that you pick, call it $|e_i\rangle$, you can write a matrix in terms of that basis as +$$ +\rho=\sum_{i,j}\rho_{i,j}|e_i\rangle\langle e_j|. +$$ +When you're talking about a bipartite system, a sensible basis is one based on product states, usually the tensor product between two single-system orthonormal bases. So, you might write +$$ +|e_i\rangle=|n\rangle|\nu\rangle, +$$ +splitting the sum over $i$ into two sums, over $n$ and $\nu$. Hence, you can write +$$ +\rho=\sum_{n,\nu,m,\mu}\rho_{n,\nu,m,\mu}|n\rangle\langle m|\otimes|\nu\rangle\langle\mu|. +$$ +It just happens that they've chosen to change where the different indices are put.

+ +

As for the partial transpose, that is simply the definition of the partial transpose. It may not seem so familiar, but recall with the transpose does, +$$ +\langle e_i|\rho|e_j\rangle=\langle e_j|\rho^T|e_i\rangle. +$$ +All the partial transpose does is that it only switches the left and right indices for the second subsystem, not the first.

+ +

In fact, this definition of +$$ +\langle n,\nu|\rho|m,\mu\rangle=\langle n,\mu|\rho^{T_B}|m,\nu\rangle +$$ +is a general definition. It's not about whether $\rho$ is separable or not. The point is that if it is separable, then $\rho^{T_B}$ is still a valid quantum state. On the other hand, if $\rho$ were not separable, there is no reason why $\rho^{T_B}$ need be a valid quantum state. In particular, it could have negative eigenvalues.

+",1837,,26,,6/17/2019 17:23,6/17/2019 17:23,,,,1,,,,CC BY-SA 4.0 +6493,1,22100,,6/17/2019 18:01,,8,237,"

As discussed in this question, the expected security of 1024-bit RSA is 80-bits:

+ +
+

NIST SP 800-57 §5.6.1 p.62–64 specifies a correspondence between RSA modulus size $n$ and expected security strength $s$ in bits:

+ +
Strength  RSA modulus size
+  80        1024
+ 112        2048
+ 128        3072
+ 192        7680
+ 256       15360
+
+
+ +

According to Wikipedia, we now have a 20-qubit quantum computer:

+ +
+

IBM Q System One is a 20-qubit computer.

+
+ +

Question: If we tried to use a 20-qubit computer, e.g. IBM Q System One, to calculate the $\sim {2}^{80}$ keys in the 1024-bit RSA keyspace, how long would it take?

+",7429,,2293,,11/27/2021 8:55,11/27/2021 8:55,Calculating power of a quantum computer for RSA,,1,5,,,,CC BY-SA 4.0 +6494,1,6495,,6/18/2019 7:25,,5,249,"

In the paper ""Compiling basic linear algebra subroutines for quantum computers"" +here, they discuss (page 2 bottom right) using the HHL algorithm to multiply a vector by a matrix. However, after having read the HHL09 paper, what is being estimated is the state $|x \rangle = A^{-1} |b \rangle$, where $A |x \rangle = |b \rangle$ for some Hermitian matrix $A$ of dimension $n$, and vectors $b, x$ of size $n$, where $b$ and $A$ are known.

+ +

Is it possible to use the HHL algorithm to compute $A |b \rangle$ knowing $A$ and $b$. For instance, running the algorithm in reverse seems not possible (?), because not all steps in the algorithm are unitary.

+",7481,,55,,6/18/2019 14:33,6/20/2019 8:02,Using the HHL algorithm to compute $A |b \rangle$ instead of $A^{-1} |b \rangle$,,2,0,,,,CC BY-SA 4.0 +6495,2,,6494,6/18/2019 7:56,,4,,"

Note: the graphics have been generated with the LaTeX code available here. Credits to @Niel de Beaudrap.

+ +
+ +

Yes it is possible!

+ +

The HHL algorithm can be schematically depicted as

+ +

+ +

Let's split down the parts:

+ +
    +
  1. The first part aims at computing an approximation of the eigenvalues of $H$, $H = A$ if $A$ is hermitian, else $H = \begin{pmatrix} 0 & A \\ A^\dagger & 0 \end{pmatrix}$.
  2. +
  3. The second part invert these eigenvalues and adds a phase proportional to these eigenvalues in front of your state (see the original HHL09 paper for the exact expression).
  4. +
  5. The third part uncompute the first part, leaving you with a state like +$$ +\sum_{j=1}^{N}\beta_j \vert u_j \rangle \left( \sqrt{1 - \frac{C^2}{\lambda_j^2}} \vert 0 \rangle + \frac{C}{\lambda_j}\vert 1 \rangle \right). +$$
  6. +
  7. The measure project the resulting state. If the measure succeed (measured value is $1$), then this means that your state is now +$$ +\sum_{j=1}^{N}\beta_j \vert u_j \rangle \frac{C}{\lambda_j}\vert 1 \rangle = \left(\sum_{j=1}^{N}C\frac{\beta_j}{\lambda_j} \vert u_j \rangle \right) \vert 1 \rangle +$$ +which is the solution of the linear system considered.
  8. +
+ +

Everything apart being equal, if you do not invert the eigenvalues in step 2, you will end up with a state like +$$ +\sum_{j=1}^{N}\beta_j \vert u_j \rangle \left( \sqrt{1 - C^2\lambda_j^2} \vert 0 \rangle + C\lambda_j\vert 1 \rangle \right). +$$ +for step 3 and a result like +$$ +\left(C\sum_{j=1}^{N}\beta_j\lambda_j \vert u_j \rangle \right) \vert 1 \rangle +$$ +if your measurement succeeded.

+ +

This is the state you are looking for: the result of the operation $A\times b$, scaled by $C$ in order to be of unit-norm.

+",1386,,,,,6/18/2019 7:56,,,,9,,,,CC BY-SA 4.0 +6496,1,,,6/18/2019 9:22,,15,621,"

Is there a known formula or a scaling behaviour for how many two-qubit gates are required to construct a general N-qubit unitary?

+ +

I suppose there are several cases to consider:

+ +
    +
  • Exact representation of the gates
  • +
  • Approximate decompositions to a given accuracy
  • +
  • Any subclass of unitaries that have more efficient decompositions
  • +
  • With vs without ancillary qubits.
  • +
+ +

edit: As a starting point, I know an optimal decomposition of a general two-qubit gate (into CNOT and single-qubit) and I consider single-qubit operations as ""free"" (they can be absorbed into the two-qubit gates, and for practical implementations they have lower error rates).

+ +

edit: In Nielsen and Chuang they say that there always exists an $n\times n$ unitary that requires n-1 2-qubit gates. Are n-1 gates sufficient for a general $n\times n$ unitary?

+",6076,,55,,9/7/2019 14:30,5/27/2020 17:04,How many two-qubit gates are required to implement a general N-qubit unitary?,,2,4,,,,CC BY-SA 4.0 +6497,1,,,6/18/2019 9:28,,5,119,"

I am currently writing a script to automate the creation of parity curves for a 2 qubit bell state and then calculate fidelity and proving entanglement from that (inspired by this paper). It was going really well. I am able to run simulations perfectly for states 00 and its complement state 10 (getting fidelity values on ibmqx4 of roughly 0.7). Although, it then starts to get weird running states 11 and its complement 01. Although I haven't run state 01 on the real machine yet, the simulation of it runs perfectly. State 11 however, doesn't. As far as I understand 11 and 01 should output similar results. Here's a sample of my 01 states results.

+ +
10,471
+11,40 
+00,43
+01,440
+10,490
+11,51
+00,54
+
+ +

As you can see, a variety of states come out, allowing me to calculate parity. Running exactly the same code with state 11 instead gives

+ +
10,471
+01,498
+10,526
+01,528
+10,496
+01,514
+10,510
+
+ +

which, obviously looks a lot more like a generic bell state with no rotation. The code used to set up the circuit and rotation for simulation is shown below. The math for theta, lam and phi for states 00 and 10 are taken from the paper mentioned above (on the second column of text on page 2). Math for states 11 and 01 are not on the paper but was worked out by my supervisor.

+ +
# Set range for rotation 
+phi_range = np.linspace(0, np.pi, 128)
+
+for phi_value in phi_range:
+    # inside the loop because putting it outside breaks it and makes it run 
+    # really really slow
+    qr = QuantumRegister(2, name='qr')
+    cr = ClassicalRegister(2, name='cr')
+    bell = QuantumCircuit(qr, cr, name='bell')
+
+    # Set the details of the rotation
+    if startingState == '00' or startingState == '10':
+        theta = np.pi/2
+        lam = -phi_value - np.pi/2
+
+    elif startingState == '01' or startingState == '11':
+        theta = phi_value
+        lam = 0 - np.pi/2
+    else:
+        raise ValueError('Setting rotation problems')
+
+    phi = -lam
+
+    # initializing the starting state of the circuit (done separately to 
+    # above for clarity)
+    if startingState == '01':
+        bell.x(qr[1])
+    elif startingState == '10':
+        bell.x(qr[0])
+    elif startingState == '11':
+        bell.x(range(2))
+
+    # this is the bell state code itself
+    bell.h(qr[0])
+    bell.cx(qr[0], qr[1])
+
+    bell.barrier()
+    bell.u3(theta, lam, phi, qr)
+    bell.barrier()
+
+    bell.measure(qr[0], cr[0])
+    bell.measure(qr[1], cr[1])
+
+ +

I have checked that this creates the correct circuit several times over, and again, it works for all states except 11. Can anyone work out why?

+",7788,,55,,4/23/2021 8:57,4/23/2021 8:57,Bell State 11 not working for parity curve,,0,4,,,,CC BY-SA 4.0 +6498,2,,6491,6/18/2019 13:38,,9,,"

Without additional assumptions or context, there is no fundamental difference between an ""$2^n$-dimensional qudit"" and ""$n$ qubits"". Any ""qudit system"" over $2^n$ modes for some integer $n$ can be thought of as a system of $n$ qubits. Equivalently, an $n$-qubit system is nothing but a $2^n$-dimensional qudit system.

+ +

The difference is in the fact that if you talk of qubit systems, there is an implicit assumption that you are going to ""prefer"" operations that act on few qubits at the same time (the precise meaning of this will strongly depend on the context). +In other words, if you are studying an $n$-qubit system, you are likely to be going to use an operatorial basis for the space of operators that is built out of products of single-qubit operations.

+ +

For example, say you have a ""four-dimensional qudit system"". The ""computational basis"" for this system will usually be written as $\{\lvert 1\rangle,\lvert 2\rangle,\lvert 3\rangle,\lvert 4\rangle\}$. +Nonetheless, you can simply ""reinterpret"" these by writing them in binary notation: +$$\lvert 1\rangle\to\lvert00\rangle, +\quad\lvert 2\rangle\to\lvert01\rangle, +\quad\lvert 3\rangle\to\lvert10\rangle, +\quad\lvert 4\rangle\to\lvert11\rangle.$$ +Then, an operation that only makes first and second modes interfere corresponds to a ""local operation on the second qubit"", and similarly for the other possible operations. +In a situation in which these kinds of ""local"" operations are natural, it is then also natural to introduce the notion of entanglement, which needs a notion of ""partiteness"" to make sense.

+ +

Interestingly, note that if you think of the possible states as those of a single $n$-dimensional qudit, there is no notion of entanglement, only of correlations. +On the other hand, if you reinterpret the states as those of a number of qubits, then you can meaningfully talk of entanglement between the different modes.

+ +

Finally, it's worth nothing that for practical purposes there is a significant difference between ""$2^n$-dimensional qudit"" and ""$n$ qubits"". You could describe a system of $n$ interacting physical systems (say, interacting atoms) as possible states of a single qudit, but that would result in a very awkward formalism that would obscure the physically interesting aspects of the problem.

+ +

Addressing now more directly the raised points:

+ +
+

Is it true that the pure states of $n$ qubits live on the $\mathbb{CP}(2^n−1)$ manifold?

+
+ +

As of above, yes. At a purely abstract level there is absolutely no difference between the two things.

+ +
+

If the answer to the first question is yes, then how do the sets of measurements on $n$ qubits and an $d=2^n$ qudit compare? Intuitively, I feel like the latter should be bigger due to the locality issues. However, if we stick to a particular bases, there seem to be a one-to-one correspondence.

+
+ +

Again, what measurements you are going to use fully depends on what you are trying to model. If you think of the system as comprised of $n$ qubits, it is likely (though not necessary) that you are going to consider local measurements.

+ +

To talk of how ""big"" a set of measurements is, you should first specify what kind of measurements you are considering. If you stick to projective measurements, then the maximum number of measurement outcomes will be $2^n$ in both cases, the difference will be in how the projectors are built. For the qudit system you might consider a set of projectors of the form $\mathbb P_k\equiv\lvert k\rangle\!\langle k\rvert$, while for $n$ qubits the projectors might be written as products of two-outcome projective measurements $\mathbb P_\ell^\pm$, projecting on one of the two possible states of the $\ell$-th qubit.

+",55,,55,,6/19/2019 21:35,6/19/2019 21:35,,,,4,,,,CC BY-SA 4.0 +6499,1,12975,,6/18/2019 13:44,,5,103,"
+

Definition of k-distillability

+

For a bipartite state $\rho$, $H=H_A\otimes H_B$ and for an integer $k\geq 1$, $\rho$ is $k$-distillable if there exists a (non-normalized) state $|\psi\rangle\in H^{\otimes k}$ of Schimdt-rank at most $2$ such that,

+

$$\langle \psi|\sigma^{\otimes k}|\psi\rangle < 0, \sigma = \Bbb I\otimes T(\rho).$$

+

$\rho$ is distillable if it is $k$ for some integer $k\geq 1.$

+

Source

+
+

I get the mathematical condition but don't really understand the motivation for $k$-distillability in general, or more specifically the condition $\langle \psi|\sigma^{\otimes k}|\psi\rangle < 0$. Could someone explain where this comes from?

+",26,,55,,1/2/2021 11:56,1/3/2021 9:17,Motivation for the definition of k-distillability,,1,0,,,,CC BY-SA 4.0 +6500,1,,,6/18/2019 15:30,,3,62,"

This is a sequel to Motivation for the definition of k-distillability

+
+
+

Geometrical interpretation from the definition of 1-distillability

+
    +
  • The eigenstate $|\psi\rangle$ of the partially transposed $1$-distillable states will have Schmidt rank at most 2, i.e.,
  • +
+

$$|\psi\rangle\langle\psi|=\sum_i\lambda_i^2|ii\rangle\langle ii|, \textit{ where } \sum_i\lambda_i^2=1\tag{17}$$

+
    +
  • The constraint $\sum_i\lambda_i^2=1$ gives rise to a geometric structure in arbitrary $N$ dimensions.
  • +
+

Source

+
+

Questions:

+
    +
  1. In the definition of $k$-distillability (cf. here) we were talking about bipartite density matrices $\rho$ in $H_A\otimes H_B$. In what sense is $|\psi\rangle$ an "eigenstate" of a partially transposed $1$-distillable state? Is for $1$-distillable $\rho$'s the (non-normalized) state $|\psi\rangle \in H$, such that $\langle \psi|\sigma|\psi\rangle < 0$ necessarily an eigenstate of $\rho$? Also, can we prove that $\langle \psi|\sigma|\psi\rangle < 0$ for any eigenstate of $\rho$?

    +
  2. +
  3. I do not see how the fact that "the eigenstate $|\psi\rangle$ of the partially transposed $1$-distillable states will have a Schmidt rank at most 2" is encapsulated within the statement "$|\psi\rangle\langle\psi|=\sum_i\lambda_i^2|ii\rangle\langle ii|$ where $\sum_i\lambda_i^2=1$".

    +

    As far as I understand, the Schmidt decomposition of a pure state $|\Psi\rangle$ of a composite system AB, considering an orthonormal basis $|i_A\rangle$ for system A and $|i_B\rangle$ for system B, is $$|\Psi\rangle = \sum_i \lambda_i|i_A\rangle|i_B\rangle,$$ where $\lambda_i$ are non-negative real numbers satisfying $\sum_i\lambda_i^2=1$ known as Schmidt co-efficients. Now the number of non-zero $\lambda_i$'s in the Schmidt decomposition is called Schmidt rank or Schmidt number. So I don't quite understand the geometric constraint they're talking about; if the Schmidt rank is at most 2, then we'd be restricted to only two cases i.e. $\lambda_1^2=1$ and $\lambda_1^2+\lambda_2^2 = 1$...which aren't so interesting. Am I missing something?

    +
  4. +
+",26,,55,,4/23/2021 8:57,4/23/2021 8:57,Geometric interpretation of 1-distillability,,0,2,,,,CC BY-SA 4.0 +6501,1,6502,,6/18/2019 16:57,,8,1506,"

I'm trying to understand the three qubits bit-flip code. I use the book of Phillip Kaye An introduction to quantum computing.

+ +

In this book he introduce the three qubits bit-flip code with this circuit :

+ +

+ +

But, I saw in Quantum Error Correction for Beginners (here), that they introduce the three qubits bit-flip code with an another circuit:

+ +

+ +

Therefore, I ask myself, why do we need two more ancilla qubits in the second algorithm ? What do we earn with that ?

+",7762,,,,,4/30/2022 14:36,2 ways to do the three qubits bit-flip code,,4,0,,,,CC BY-SA 4.0 +6502,2,,6501,6/18/2019 18:52,,4,,"

Both circuits start by turning $|\psi\rangle = a |0\rangle + b|1\rangle$ into $|\psi\rangle = a |000\rangle + b|111\rangle$, copying the 0/1 information onto two additional qubits.

+ +

Note that, for any pair of qubits in this state, either both are in state $|0\rangle$, or both are in state $|1\rangle$. Any superposition must be expressed only in terms of states that satisfy this condition.

+ +

This gives us a way to check up on whether everything is okay. We make a measurement that checks whether the 0/1 states of two neighbouring qubits are the same or different. We want it to give us only this information and no more, to ensure that preserves superpositions.

+ +

Each ancilla in the second circuit is there to perform this exact measurement. The two cnots that act on the ancilla, as well as the measurement gate itself, are all part of the measurement. Th measurement outputs 0 when two qubits can be expressed as a superposition or mixture of $|00\rangle$ and $|11\rangle$. It outputs 1 if they must be expressed with $|01\rangle$ and $|10\rangle$.

+ +

Given this information, we can see if errors happened, and try to guess what they were. A corresponding correction operator can then be performed.

+ +

The first circuit seems like it could probably correct a bit flip on the first qubit. I'm not really sure what it is designed for, though.

+",409,,409,,6/19/2019 9:07,6/19/2019 9:07,,,,2,,,,CC BY-SA 4.0 +6503,1,6514,,6/18/2019 21:41,,3,83,"

I was trying to see what IBM would do under the hood with a CCNOT gate. Something appears to be erroneous with the run.

+ +

+ +

The circuit above should produce state 11100 with 100% probability, as confirmed by the visualizer (and the basic definition of the CCNOT). However both the simulator and the actual backend (ibmqx4) give all 1024 shots as 00000. Something is definitely not working right here.

+",7701,,26,,6/19/2019 6:31,6/19/2019 7:46,Bug in IBM backend?,,1,0,,,,CC BY-SA 4.0 +6505,1,6512,,6/18/2019 23:52,,2,1114,"

For a controlled Z gate $CZ_{1,2,3}$ acting on 3 qubits, which of the following is correct? If it is the first one then what is the difference between that and a CZ gate acting on qubits 1 and 3?

+ +

$$I \otimes I \otimes I − |1⟩⟨1| \otimes I \otimes (Z − I)$$

+ +

$$I \otimes I \otimes I − |1⟩⟨1| \otimes |1⟩⟨1| \otimes (Z − I)$$

+",7734,,26,,6/19/2019 6:26,6/19/2019 6:33,Controlled Z gate acting on 3 qubits in matrix form,,3,0,,,,CC BY-SA 4.0 +6506,2,,6505,6/19/2019 0:31,,1,,"

What do you mean by $CZ_{1,2,3}$? You should specify which ones are control and which ones are being acted on.

+ +

It is a (useful such as for graph states) coincidence that for $CZ_{1,2}$ you get the same result by interpreting either as the control and the other as being acted on.

+ +

$$ +\begin{pmatrix} +1&0&0&0\\ +0&1&0&0\\ +0&0&1&0\\ +0&0&0&-1\\ +\end{pmatrix} +$$

+ +

is invariant under the action of permuting the tensor factors. That is by conjugating by the following matrix:

+ +

$$ +\begin{pmatrix} +1&0&0&0\\ +0&0&1&0\\ +0&1&0&0\\ +0&0&0&1\\ +\end{pmatrix} +$$

+ +

but that is not generally true.

+ +

$CU_{1,2}$ with the $1$ qubit acting as control and $2$ being acted on by the unitary 2 by 2 matrix $U$ in that case. In total this would be the 4 by 4 unitary matrix (again in usual basis)

+ +

$$ +\begin{pmatrix} +1&0&0&0\\ +0&1&0&0\\ +0&0&u_{00}&u_{01}\\ +0&0&u_{10}&u_{11}\\ +\end{pmatrix} +$$

+ +

You can easily see that in this general case, it matters which is the control and which is acted on. It is not invariant under exchange of factors.

+ +

So the first thing you wrote is the result of interpreting the first as the control and acting on the third. The second thing you wrote means you have two controls. Both 1 and 2 are controls in that case. Again acting on the third.

+",434,,,,,6/19/2019 0:31,,,,0,,,,CC BY-SA 4.0 +6507,2,,6505,6/19/2019 0:36,,3,,"

Assuming the first qubit is the control, and then there are three target qubits, the $CZZZ$ gate would be:

+ +

$$|0\rangle\langle0| \otimes I \otimes I \otimes I + |1\rangle\langle1| \otimes Z \otimes Z \otimes Z$$

+ +

Essentially, the first term projects out the $|0\rangle$ state of the control qubit and applies the identity to the targets in that case, and the second projects out the $|1\rangle$ state and applies $Z$ to each of the targets in that case.

+ +

If you want a $CCZ$ gate (doubly-controlled $Z$), that's a little bit more complicated:

+ +

$$(I \otimes I - |1\rangle\langle1| \otimes |1\rangle\langle1|) \otimes I + |1\rangle\langle1| \otimes |1\rangle\langle1| \otimes Z$$

+ +

The second term projects out the $|1\rangle$ state of the two controls and applies the $Z$ in that state; the first term projects out the other state combinations and applies the identity in that case.

+",4265,,,,,6/19/2019 0:36,,,,0,,,,CC BY-SA 4.0 +6509,1,,,6/19/2019 3:37,,3,56,"

I am trying to write a simple circuit to understand the process of finding the set of parameters such that the cost function of that circuit in question is minimized. For that I understand one has to have a readout bit in order to calculate the cost function.

+ +

I have read on papers that through a control gate one can achieve this. My question is the following: do I have to have control gates as in between each step of the circuit (between the gates), or can I just apply the control gates at the end of circuit? Also: why is not advantageous to only use a readout bit instead of multiple readout bits?

+",6253,,26,,6/19/2019 6:27,6/19/2019 6:27,Understanding CNOT gate for indirect measurement,,0,1,,,,CC BY-SA 4.0 +6510,1,,,6/19/2019 6:05,,1,124,"

I am using state vectors and operator matrices to test out my knowledge in a Python program. How would I represent the state $|+\rangle$ in Python? I want to then perform several operations in a matrix form on it. I am pretty sure NumPy arrays don't allow for irrational numbers and $|+\rangle$ has a coefficient of $\frac{1}{\sqrt{2}}$ so I am unsure of how to represent this. Should I use fractions? I am new to QC and Python so if anyone has any good suggestions please help out! Thank you!

+",7734,,26,,6/19/2019 6:29,6/19/2019 16:47,How to represent $|+\rangle$ in Python?,,2,1,,,,CC BY-SA 4.0 +6511,1,,,6/19/2019 6:30,,3,78,"

Can you please help me to find an answer to this question: I am using qutip for the study of quantum systems. suppose I have calculated the solution of the master equation using the mcsolve function and let it be

+ +
output = mcsolve(H,psi0,tlist,c_op_list,exp_op_list,ntraj) 
+
+ +

If I want to plot the expectation value points on the Bloch sphere, I can use

+ +
b.add_points(output.expect[0], output.expect[1], output.expect[2]) 
+
+ +

But how can I add the states on the Bloch sphere? I am sorry if there is anything wrong in the way I have asked the question because I am new to the programming.

+",7502,,7502,,6/19/2019 8:59,6/19/2019 8:59,How to add states on the Bloch sphere from a master equation?,,0,0,,,,CC BY-SA 4.0 +6512,2,,6505,6/19/2019 6:33,,1,,"

The difficulty is that the wording describing what you want is unclear. What your two stated options do is:

+ +
+

$$I \otimes I \otimes I − |1⟩⟨1| \otimes I \otimes (Z − I)$$

+
+ +

This is a standard controlled-phase gate acting between qubits 1 and 3, doing nothing to qubit 2.

+ +
+

$$I \otimes I \otimes I − |1⟩⟨1| \otimes |1⟩⟨1| \otimes (Z − I)$$

+
+ +

This is a controlled-controlled-phase gate acting on all three qubits, so it applies a -1 phase if all three are in the $1\rangle$ and leaves them unchanged otherwise. The symmetry of the system is perhaps better represented by writing it as +$$I \otimes I \otimes I − 2|1⟩⟨1| \otimes |1⟩⟨1| \otimes |1⟩⟨1|.$$

+",1837,,,,,6/19/2019 6:33,,,,0,,,,CC BY-SA 4.0 +6513,1,,,6/19/2019 7:34,,4,114,"

The working of a quantum oracle is still not completely clear to me and I have a few questions: As I understand it, an oracle is a unitary quantum gate and must somehow differentiate between the eigenstates of the quantum register (the current state of which is a superposition of its eigenstates which are composites of the eigenstates of the cubits that make up the register) so that the amplitudes of some eigenstates can be increased or decreased. The differentiating criterion is given by some function $f(x)$ and $f(x)$ is mostly given to be two-valued.

+ +

My first question is: what is the domain of $x$? Is this just the set of eigenstates of the quantum register? If so, then for the quantum algorithm to work, all data must somehow be in the register state. This encoding of external data (the haystack) into the states of the quantum register would seem to be a major challenge. How can this be done?

+ +

Or is it possible that $f(x)$ somehow calls a classical function... but how, when?

+ +

It is said that in e.g. Grover's algorithm the function $f(x)$ is called just once. But what does this mean if it somehow has to filter all the $2^N$ eigenstates.

+",7626,,26,,6/20/2019 6:44,6/26/2019 9:01,Does an oracle use only the eigenstates of the quantum register?,,2,3,,,,CC BY-SA 4.0 +6514,2,,6503,6/19/2019 7:46,,2,,"

I think you forgot to measure your quantum registers. The backends and the actual simulators always return the results read from the classical registers. Even if the simulator could return the amplitudes 1, the real backends cannot as we can't read the whole statevector. I guess this behaviour has been fixed in order to have a consistency between real hardware and simulators.

+ +

Short solution: add measurement gates at the end of your circuit.

+ +
+ +

1 It depends on the simulation algorithm used.

+",1386,,,,,6/19/2019 7:46,,,,1,,,,CC BY-SA 4.0 +6515,2,,6452,6/19/2019 9:25,,1,,"

Quite simply, it was broken but now it's fixed!

+",409,,,,,6/19/2019 9:25,,,,0,,,,CC BY-SA 4.0 +6516,1,6517,,6/19/2019 11:36,,3,103,"

What are the $2$ qubits of the state +$a\lvert 00\rangle+b\lvert11\rangle$?

+ +

Are they $a'\vert0\rangle+b'\vert1\rangle$ and $c'\vert0\rangle+d'\vert1\rangle$?

+ +

How are they measured, and what would be the outcome on each qubit?

+",7405,,55,,6/20/2019 14:05,6/20/2019 14:05,What are the two qubits in the state $a\lvert 00\rangle+b\lvert11\rangle$?,,1,5,,,,CC BY-SA 4.0 +6517,2,,6516,6/19/2019 12:59,,3,,"

You can't associate some pure states $|x\rangle$ and $|y\rangle$ to the subsystems of the 2-qubit system in the entangled state ($a\vert 00\rangle+b\vert11\rangle, a\ne 0, b \ne 0$ in our case). This is the definition of entanglement. You can verify that there is no vectors $|x\rangle$, $|y\rangle$ such that $|x\rangle \otimes |y\rangle = a\vert 0\rangle \otimes |0\rangle+b\vert1\rangle \otimes |1\rangle$.

+ +

But we can associate mixed states to the subsystems of this entangled state. Mixed state is a probability distribution over pure states. Both mixed states in this case coincide and equal to $\{ |0\rangle$ with probability $|a|^2$, $|1\rangle$ with probability $|b|^2\}$.

+ +

The general method of calculating (mixed) state of a subsystem is via partial trace of density matrix.

+ +

In our case +$$\text{tr}_1((a|00\rangle + b|11\rangle)(\bar{a}\langle 00| + \bar{b}\langle11|)) = +|a^2|\cdot |0\rangle\langle0| + |b^2| \cdot |1\rangle\langle1| +$$

+ +

So the density matrix of the second qubit is $|a^2|\cdot |0\rangle\langle0| + |b^2| \cdot |1\rangle\langle1|$.
+Similarly for the 1st qubit.

+",5870,,,,,6/19/2019 12:59,,,,0,,,,CC BY-SA 4.0 +6518,2,,6510,6/19/2019 15:11,,1,,"

You could either do a numerical approximation

+ +

1/math.sqrt(2)

+ +

but that would get evaluated to a floating point approximation.

+ +

You could do a symbolic expression that is left unevaluated

+ +

1/sympy.sqrt(2)

+ +

Symbolic results like this can be symbolically simplified with usual rules of mathematics without resorting to calculations with their floating point approximations. This addresses issues of the usual funny things that happen with numerical artifacts.

+ +

For example, you could do sympy.sqrt(2)**2

+",434,,,,,6/19/2019 15:11,,,,0,,,,CC BY-SA 4.0 +6519,1,8409,,6/19/2019 16:42,,8,804,"

I understand the mathematical construction of the Choi-Jamiolkowski isomorphism aka channel-state duality. It all makes sense formally, yet I still struggle to grasp its physical (or quantum-informational) meaning. Does the isomorphism between quantum states and quantum channels in any sense establish some kind of connection relating the constitution (state) of systems to evolution (channel) of other systems?

+ +
+ +

Cross-posted on physics.SE

+",7802,,55,,4/23/2021 8:56,4/23/2021 8:56,Does the Choi-Jamiolkowski isomorphism really establish a connection between kinematics and dynamics?,,1,1,,,,CC BY-SA 4.0 +6520,2,,6510,6/19/2019 16:47,,2,,"

Just use [0.5**0.5, 0.5**0.5], or similarly np.array([np.sqrt(0.5), np.sqrt(0.5)], dtype=np.complex128).

+ +

Yes, the representation will be approximate instead of exact. Mainly that means you need to use approximate comparison methods like np.allclose instead of ==. This is significantly less of a hassle than dealing with exact analytic representations, which will take thousands or millions of times longer to compute while ultimately not being any more informative.

+",119,,,,,6/19/2019 16:47,,,,0,,,,CC BY-SA 4.0 +6521,2,,6501,6/19/2019 22:04,,3,,"

The second circuit doesn't have to perform a quantum CCNOT operation (which in practice decomposes into a dozen other operations) and doesn't have to leave the code space (allowing it to be applied iteratively).

+",119,,,,,6/19/2019 22:04,,,,0,,,,CC BY-SA 4.0 +6522,2,,6476,6/19/2019 23:16,,1,,"

We have, +\begin{equation} +\begin{aligned} +S &= - \operatorname { Tr } \left( \varrho \log _ { 2 } \varrho \right) = \log _ { 2 } \left( \frac { \left| \gamma _ { B } \right| ^ { \left( 2 \left| \gamma _ { B } \right| ^ { 2 } \right) / \left( \left| \gamma _ { B } \right| ^ { 2 } - 1 \right) } } { 1 - \left| \gamma _ { B } \right| ^ { 2 } } \right) = \log _ { 2 } \left( \frac { \gamma ^ { \gamma / \gamma -1 } } { 1 - \gamma } \right) \\&= - \left(\frac{\gamma}{1-\gamma} \log _ { 2 }\gamma + \log_{2}(1-\gamma) \right) +\end{aligned} \label{a} \tag{1} +\end{equation} +where we shortened our expressions by, $\gamma = \gamma_B^2$.

+ +

On the other hand we believe that, +\begin{equation} +\begin{aligned} +S &= - \operatorname { Tr } \left( \varrho \log _ { 2 } \varrho \right) = - \sum_{i=0}^{\infty} c_n^2 \log(c_n^2) = \sum_{i=0}^{\infty} \gamma^n(1-\gamma) \log_2\left(\gamma^n(1-\gamma)\right) \\&= \sum_{i=0}^{\infty} \gamma^n(1-\gamma) \left( +\log_2\ (\gamma^n)+\log_2(1-\gamma )\right) \\&= (1-\gamma ) \sum_{i=0}^{\infty} \gamma^n \log_2\ (\gamma^n)+ (1-\gamma ) \log_2 (1-\gamma ) \sum_{i=0}^{\infty} \gamma^n +\end{aligned} \label{b} \tag{2} +\end{equation} +Now, those sequences have the following closed form providing that, $|\gamma|<1$, +\begin{equation} +\begin{aligned} +\sum_{n=0}^\infty \gamma^n = \frac1{1-\gamma} \\ +\text{and},\\ +\sum_{n=0}^\infty \gamma^n\log \gamma^n &= \sum_{n=0}^\infty \gamma^n n \log \gamma=\sum_{n=0}^\infty \gamma \gamma^{n-1} n \log \gamma =\log \gamma\left(\gamma\sum_{n=0}^\infty \left(\gamma^n\right)'\right) \\&= \log \gamma\cdot \frac \gamma{(1-\gamma)^2}=\log \gamma^{\gamma/(1-\gamma)^2} +\end{aligned} +\end{equation} +It follows that we can subsitute these results in eq.(\ref{b}) to obtain eq.(\ref{a})

+ +

For reference.

+",5823,,,,,6/19/2019 23:16,,,,0,,,,CC BY-SA 4.0 +6523,1,6528,,6/19/2019 23:17,,5,102,"

In the paper ""Compiling basic linear algebra subroutines for quantum computers"" here, the introduction seems to imply that the subroutines covered will touch on matrix addition and multiplication, but the subroutines in question concern the product of matrix exponentials, and the sum of exponentials (i.e for A, B Hermitian, $e^{i(A+B)t}$).

+ +

Can it be inferred that after these results are achieved that there is some way to get $(A+B)$ from $e^{i(A+B)t}$ ?

+",7481,,,,,10/11/2019 5:06,"The possibility of recovering the matrix $A+B$ from $e^{i(A+B)t}$ for Hermitian $A,B$",,1,0,,,,CC BY-SA 4.0 +6524,1,,,6/20/2019 0:49,,3,47,"

The full user guide here states ""If you find any bugs, please report them with our bug tracker, accessible via the little bug icon in the lower right-hand corner of each page.""

+ +

+ +

However, I was unable to find this bug icon. The arrow seen in the screenshot only returns you to the top of the page.

+ +

Then I found a link under ""Documentation and Support"" for bug reports. However, the link brought me to a page that told me ""This invite link is no longer active.""

+ +

+ +

+ +

To conclude, I am trying to report a typo on the 'Introduction to Quantum Circuits'.

+ +

+ +

See Example 1

+ +

Inner Product Error - This is the same as a dot product right?

+",7806,,,,,6/20/2019 0:49,Bug report bug report?,,0,1,,6/20/2019 9:48,,CC BY-SA 4.0 +6525,1,6553,,6/20/2019 3:02,,4,397,"

I'm reading Linear Optics Quantum Computation: an Overview.

+ +

On page 16 we're given a matrix

+ +

$$U = \begin{pmatrix}1-\sqrt{2}&\frac{1}{\sqrt{\sqrt{2}}}&\sqrt{\frac{3}{\sqrt 2}-2}\\\frac{1}{\sqrt{\sqrt 2}}&\frac{1}{2}&\frac{1}{2}-\frac{1}{\sqrt 2}\\\sqrt{\frac{3}{\sqrt{2}}-2}&\frac{1}{2}-\frac{1}{\sqrt 2}&\sqrt 2 - \frac{1}{2}\end{pmatrix}$$

+ +

and this exercise:

+ +
+

What transformation does this implement on the input state $(\alpha|0\rangle+\beta|1\rangle+\gamma|2\rangle)|10\rangle$? What is the transformation if we measure $|10\rangle$ in modes $2$ and $3$? This will be important later!

+
+ +

I know that I should write states using the creation operator and $|00\rangle$, and then let $U$ act on creation operators. Yet this approach does not seem to get me anywhere.

+",7805,,26,,6/20/2019 6:41,6/22/2019 0:48,Non-linear sign shift gate,,1,1,,,,CC BY-SA 4.0 +6526,1,,,6/20/2019 4:41,,1,122,"

I started this book on quantum computing (Nielsen and Chuang). I have gone through the first chapter but I need to really understand the concepts; what should I do? Should I cover some background topics or move to some other book. By the way, I have done Bachelors in Computer Science; I never studied quantum before but I started this book so I can start research on quantum algorithms.

+",,user2479,26,,6/20/2019 5:59,6/20/2019 6:18,Getting started with quantum computing from a computer science perspective,,1,1,,6/20/2019 8:06,,CC BY-SA 4.0 +6527,1,6536,,6/20/2019 5:33,,2,246,"

It may look a silly question but anybody of you knows what's:

+ +

$$(|0\rangle+|1\rangle)\otimes(|0\rangle+|1\rangle)$$ (x: Kronecker operator)

+ +

$$(|0\rangle+|1\rangle)*(|0\rangle+|1\rangle)$$ (*: vector multiplication operator)

+ +

yielding?

+",7405,,5870,,6/20/2019 10:10,6/22/2019 13:27,Kronecker product and multiplication operation on qubit states,,1,0,,,,CC BY-SA 4.0 +6528,2,,6523,6/20/2019 6:08,,4,,"

Yes, see for instance this stack exchange question: Using the HHL algorithm to compute $A|b\rangle$ instead of $A^{−1}|b\rangle$ +. +It is discussed that if you have access to an exponential $e^{iX \otimes H\tau}$, then you can implement $H$. +To see this, note that +$$ +e^{iX\otimes H \tau} |0\rangle |\psi\rangle += (\mathbb{I} + i\tau X \otimes H + O(\tau^2)) |0\rangle |\psi\rangle += |0\rangle |\psi\rangle + i\tau |1\rangle H|\psi\rangle + O(\tau^2). +$$ +Now measure the first register. If the outcome is 1, then we get the state $|1\rangle H|\psi\rangle + O(\tau)$. For $\tau$ sufficiently small this approximates $H|\psi\rangle$.

+ +

So in your case, rather than summing $A$ and $B$, you could sum $X \otimes A$ and $X\otimes B$ with $X$ the Pauli X gate. Then you can use the exponential $e^{iX \otimes (A+B)t}$ to implement $A+B$ using the above approach.

+",282,,26,,10/11/2019 5:06,10/11/2019 5:06,,,,8,,,,CC BY-SA 4.0 +6529,1,6582,,6/20/2019 6:13,,2,405,"

Does anybody know how to explain briefly how to realize qubits (initialization, states transition, measurements,..) with superconducting Josephson junctions, say DC-SQUIDS?

+",7405,,26,,6/23/2019 14:42,7/1/2019 1:17,Physical realization of qubits with superconducting Josephson junctions,,1,2,,,,CC BY-SA 4.0 +6530,2,,6526,6/20/2019 6:18,,1,,"

Apart from the resources mentioned in the Linked threads, I recently came across a textbook that's very much like an "undergraduate version" of Nielsen and Chuang, and should be helpful for you to get started.

+

Elements of Quantum Computation and Quantum Communication - Anirban Pathak

+
+

Preface:

+

This introductory textbook is written primarily for undergraduate students of physics, mathematics, computer science and other related disciplines. It is also expected to be valuable to teachers as well as to researchers working in other domains, who are interested in obtaining an understanding of quantum computation and quantum communication. I used to offer a course on quantum information theory from 2002-2006. Later I offered a few short courses in different summer schools and workshops. This book is prepared mainly from those lectures. There are many excellent textbooks +on quantum information theory. However, most of those books are either +too technical for beginners or they are not complete. This was one of my +reasons for writing this book. But more importantly, every teacher has +his/her own way to present the subject and teachers are usually biased on +that. I belong to that class of biased teachers and this book is an initiative to present the subject in my way. Another fact that played a very important role in the present initiative is that there are engineering students who hardly know anything about quantum mechanics and there are physics students who do not know what a Turing machine is. But students from both groups are equally interested in quantum computing and often they join +the same course. Keeping both kinds of students in mind, this book aims +to give a brief idea of quantum computation and quantum communication +in a self-contained manner. It does not demand any prior knowledge of +quantum mechanics or computer science.(...)

+
+",26,,-1,,6/18/2020 8:31,6/20/2019 6:18,,,,0,,,,CC BY-SA 4.0 +6531,2,,6494,6/20/2019 6:53,,3,,"

Let's assume that you have a Hermitian matrix +$$ +H=\left(\begin{array}{cc} 0 & A^\dagger \\ A & 0 \end{array}\right). +$$ +Let $|b\rangle$ be the state that we want to apply $A$ to, extended to work on the space that $H$ acts on. So, our aim is to implement $H|b\rangle$.

+ +

Let $X$ be the standard Pauli $X$ matrix. If we implement a unitary evolution +$$ +U=e^{-i X\otimes H\delta t}, +$$ +then the action of this on an input state $|0\rangle|b\rangle$ can be expressed through a Taylor expansion, assuming $\delta t\|H\|\ll 1$: +$$ +U|0\rangle|b\rangle=|0\rangle|b\rangle-i\delta t |1\rangle(H|b\rangle)-\frac{\delta t^2}{2}|0\rangle(H^2|b\rangle)+\ldots. +$$ +So, if we measure the ancilla qubit in the standard basis, then with probability $\delta t^2\|H|b\rangle\|^2$, we find the ancilla to be in state $|1\rangle$, and the other register is in the desired state $H|b\rangle$, up to an accuracy $O(\delta t^2)$ (coming from the $O(\delta t^4)$ term in the Taylor expansion). If you don't get the $|1\rangle$ answer to your measurement, then to accuracy $O(\delta t^2)$, you've stil got the original state $|0\rangle|b\rangle$, so you can just repeat until success.

+ +

By that simple method, the overall error is very bad - you have to repeat $O(1/\delta t^2)$ times so that the overall error becomes $O(1)$. I'm sure this could be improved by replacing the $X$ with a cycle operation on a larger dimensional Hilbert space. However, note that this method is very similar to part of the HHL algorithm (where they do the controlled-rotation from the phase estimation register onto an ancilla) and, at least there, it is claimed that it can be improved using amplitude amplification. So I assume (without having looked at the details) that something similar is possible here.

+",1837,,1837,,6/20/2019 8:02,6/20/2019 8:02,,,,1,,,,CC BY-SA 4.0 +6533,2,,6513,6/20/2019 7:26,,4,,"

The domain of $x$ is all bitstrings of certain length, which corresponds to eigenstates of the register. The exact meaning of $x$ might vary - it could be a set of boolean values, like in SAT problem, or a set of colors assigned to vertices, like in graph coloring problem, or integers.

+ +

The oracle has to encode the condition you're searching for as a quantum circuit - and yes, this is a challenge indeed. It is worth checking out other questions on Grover on this site, since a lot of them will consider oracle implementations (here are two that look the closest to your question at a glance: 1, 2).

+ +

Speaking of a SAT problem specifically, since it was mentioned in the comments, the oracle has to encode the logical constraints on the boolean values that the variables can take based on the specific formula you're given. Each AND clause is expressed as a controlled X gate; each OR clause is expressed as a 0-controlled X gate, followed by an X gate on the target (De Morgan's laws), and so on. You can find an example of implementing an oracle for an instance of SAT problem in my tutorial.

+",2879,,,,,6/20/2019 7:26,,,,0,,,,CC BY-SA 4.0 +6534,1,6535,,6/20/2019 8:19,,2,257,"

I understand that, projecting $\lvert 00\rangle$ on the Bell states would produce $\lvert\Phi^+\rangle$. Because,

+ +

$$ +CNOT(H\lvert0\rangle \otimes \lvert0\rangle) = \frac{1}{\sqrt{2}}(\lvert00\rangle + \lvert11)\rangle +$$

+ +

We can get other Bell states from $\lvert 01\rangle, \lvert10\rangle, \lvert 11\rangle$. However, I am having trouble understanding what would happen if I do the same for $\lvert ++\rangle$. Like:

+ +

$$ +CNOT(H\lvert+\rangle \otimes \lvert+\rangle) = ? +$$

+",2403,,,,,6/21/2019 6:42,Projecting $\lvert ++ \rangle$ on Bell Basis,,2,2,,,,CC BY-SA 4.0 +6535,2,,6534,6/20/2019 8:32,,5,,"

The Hadamard gate is: +$$\frac{1}{\sqrt 2} \left(|0\rangle \langle 0 | + |0\rangle\langle 1| + |1\rangle \langle 0| - |1\rangle \langle 1|\right)$$

+ +

And since $|+\rangle$ is $\frac{1}{\sqrt 2}\left(|0\rangle + |1\rangle \right)$,

+ +

you can work out that $H(|+\rangle) = |0\rangle$

+ +

So, +$$CNOT(H|+\rangle \otimes |+\rangle)$$ +$$= CNOT(|0\rangle \otimes |+\rangle)$$ +$$= |0\rangle \otimes |+\rangle$$

+ +

You can also check that $H^2 = I$ or that the Hadamard gate is both Unitary and Hermitian. +$$H = H^\dagger$$ +$$H^\dagger = H^{-1}$$ +So, $H = H^{-1}$, the Hadamard gate is its own inverse.

+ +
+ +

What you have done is not projection of $|00\rangle$ to get the state $|\phi^+\rangle$, but you just applied the unitary that takes the computational basis to the Bell basis.

+ +

As you said in the comments, true, if you measure a state in a basis, you will get one of the basis vectors as outcomes with different probabilities. To see that, express the state in hand in the measurement basis.

+ +

For ex:

+ +

$$|00\rangle = \frac{1}{\sqrt 2} (|\phi^+\rangle + |\phi^-\rangle)$$ so you will get $|\phi^+\rangle$ with 50% probability and $|\phi^-\rangle$ with 50% probability.

+ +

Similarly, on expressing $|++\rangle$ in the Bell basis as: +$$\frac{1}{\sqrt 2}(|\phi^+\rangle + |\psi^+\rangle)$$ you get each of those states with 50% probability on measuring.

+",2832,,2832,,6/20/2019 15:20,6/20/2019 15:20,,,,1,,,,CC BY-SA 4.0 +6536,2,,6527,6/20/2019 8:39,,3,,"

The Kronecker product of the vectors will lead to

+ +
    +
  • $|0\rangle=\begin{pmatrix}1\\0\end{pmatrix}$ and $|1\rangle=\begin{pmatrix}0\\1\end{pmatrix}$

  • +
  • $(|0\rangle+|1\rangle)\otimes(|0\rangle+|1\rangle)=|00\rangle+|01\rangle+|10\rangle+|11\rangle=\begin{pmatrix}1\\0\end{pmatrix}\otimes\begin{pmatrix}1\\0\end{pmatrix}+\begin{pmatrix}1\\0\end{pmatrix}\otimes\begin{pmatrix}0\\1\end{pmatrix}+\begin{pmatrix}0\\1\end{pmatrix}\otimes\begin{pmatrix}1\\0\end{pmatrix}+\begin{pmatrix}0\\1\end{pmatrix}\otimes\begin{pmatrix}0\\1\end{pmatrix}=\begin{pmatrix}1\\0\\0\\0\end{pmatrix}+\begin{pmatrix}0\\1\\0\\0\end{pmatrix}+\begin{pmatrix}0\\0\\1\\0\end{pmatrix}+\begin{pmatrix}0\\0\\0\\1\end{pmatrix}=\begin{pmatrix}1\\1\\1\\1\end{pmatrix}$

  • +
+ +

While the vector multiplication (which I assume that is the Vector inner product) is

+ +
    +
  • $(|0\rangle+|1\rangle)*(|0\rangle+|1\rangle)=(|0\rangle+|1\rangle)^\dagger(|0\rangle+|1\rangle)=\langle0|0\rangle+\langle0|1\rangle+\langle1|0\rangle+\langle1|1\rangle=1+0+0+1=2.$
  • +
+",2371,,2371,,6/22/2019 13:27,6/22/2019 13:27,,,,8,,,,CC BY-SA 4.0 +6538,1,6545,,6/20/2019 18:04,,5,490,"

I'm aware that this is basically a duplicate question, but I don't have any rep in this community so I can't comment on it, and I don't think I should ""answer"" that question with my own question:

+ +

No-cloning theorem and distinguishing between two non-orthogonal quantum states

+ +
+

Exercise 1.2: Explain how a device which, upon input of one of two non-orthogonal quantum states $|ψ⟩$ or $|ϕ⟩$ correctly identified the state, could be used to build a device which cloned the states $|ψ⟩$ and $|ϕ⟩$, in violation of the no-cloning theorem. Conversely, explain how a device for cloning could be used to distinguish non-orthogonal quantum states.

+
+ +

The first part isn't quite trivial to me. Since the device can distinguish both $|\psi\rangle$ and $|\phi\rangle$ with certainty, they are effectively orthogonal states, and thus can be cloned when the device measures in the ""basis"" $\{|\psi\rangle,|\phi\rangle\}$. Is this correct?

+",7816,,23,,6/21/2019 6:53,6/21/2019 6:56,Cloning quantum states with a device that distinguishes between two non-orthogonal quantum states,,2,1,,,,CC BY-SA 4.0 +6539,2,,6538,6/20/2019 19:48,,2,,"

No, $|\psi\rangle$ and $|\phi\rangle$ are non-orthogonal by assumption, they can't be effectively (whatever this means) orthogonal. The device just gives us the answer $\phi$ or $\psi$ (you can think it returns label and destroys the input state), so we can prepare $|\psi\rangle$ or $|\phi\rangle$ separately (or many copies of it). It is that trivial.

+",5870,,,,,6/20/2019 19:48,,,,1,,,,CC BY-SA 4.0 +6540,1,,,6/20/2019 19:53,,4,1172,"

Could and how quantum computing improve chess engines? Will it be able to think much faster and better than a classical chess computer?
+Will a quantum computing chess engine be drastically better than current chess engines?
+
+I believe my question is different than Will quantum computers be able to solve the game of chess?
+From what I managed to understand, that question is talking about if a quantum computer will be able to tell who has 100% to win a game from a given position, and what are the moves to do that(?).
+
+I might be wrong, but I think that quantum computer can search much faster than classical computer, $O(\sqrt{n})$, and quantum copmuter has advatanges against classical computer. +
+Also, from the little I know, some chess engines have kind of tree of many games and a big database they use while playing against other chess engines. When some chess engines use kind of networking which has many computers running games and ""learning"" to make their Elo better to play against other chess engines. +
+
+I'm more interested about if it could be possible to use a quantum computer's speed and its advantages against classical computer, to make a stronger chess engine with higher Elo than current chess engines. Could a quantum computer think better than a classical computer to win it in chess?
+I am not interested about the question with a given chess position, who can force a checkmate.
+
+I tried to make as clarified as I could, since I don't have knowledge with quantum computing and how to apply it in different ways.

+",7818,,26,,10/11/2019 5:09,9/5/2020 9:23,Could quantum computing improve chess engines?,,0,4,,,,CC BY-SA 4.0 +6542,1,,,6/21/2019 2:28,,1,227,"

I have started using IBM's Q Experience and I am trying to obtain an access token in order to communicate with the REST API. I understand that I can use my API token to obtain authorization by sending an html post request to the API but I keep getting an error. Attached is the code I am using as well as the output. I apologize if this is a simple syntax related issue by I can't seem to get around it. Thank you for your help.

+ +

Code:

+ +
import requests
+import pprint
+
+api_token = 'api token goes here'
+
+r = requests.post(url = 'https://quantumexperience.ng.bluemix.net/api/users/loginWithToken'
+                  params = {'apiToken': '{}'.format(api_token)})
+
+r.json()
+
+ +

Output:

+ +
{'error': {'status': 400, 'message': 'Generic error', 'code': 'GENERIC_ERROR'}}
+
+",7820,,26,,6/21/2019 8:08,6/21/2019 8:08,Having trouble communicating with the IBM Q Experience REST API,,0,4,,,,CC BY-SA 4.0 +6544,2,,6534,6/21/2019 6:42,,3,,"

The four Bell states are +$$ +|\Phi_{\pm}\rangle=(|00\rangle\pm|11\rangle)/\sqrt{2}\qquad |\Psi_{\pm}\rangle=(|01\rangle\pm|10\rangle)/\sqrt{2}. +$$ +So, let's consider what happens then we try and measure in the Bell basis, i.e. project onto one of these four states. If we started with the state $|00\rangle$, then we can write it as +$$ +|00\rangle=\frac{1}{\sqrt{2}}(|\Phi_+\rangle+|\Phi_-\rangle). +$$ +Hence, we would get the answers $|\Phi_{\pm}\rangle$ each with probability $\frac12$.

+ +

Imagine, instead, that your initial state is $|++\rangle$. You can write this as +$$ +|++\rangle=\frac{1}{\sqrt{2}}(|\Phi_+\rangle+|\Psi_+\rangle), +$$ +so when you measure it in the Bell basis, you get the answers $|\Phi_+\rangle$ or $|\Psi_+\rangle$ with 50:50 probability.

+",1837,,,,,6/21/2019 6:42,,,,0,,,,CC BY-SA 4.0 +6545,2,,6538,6/21/2019 6:56,,2,,"

Forget that you know that non-orthogonal states cannot be distinguished, as this is what you're trying to prove. It's like a proof by contradiction.

+ +

The question is talking about a hypothetical device that could, if it existed, distinguish between $|\psi\rangle$ and $|\phi\rangle$. Assume it exists, and prove that it gives you cloning (I know which state I had because I could distinguish them, so I can make arbitrarily many copies). But that's in contradiction with no-cloning, so the hypothetical device must be impossible.

+",1837,,,,,6/21/2019 6:56,,,,0,,,,CC BY-SA 4.0 +6546,1,6547,,6/21/2019 10:50,,4,893,"

I have been reading a paper about perfect error correction codes, and when the circuit is described, the author uses some negative controlled gates, that is:

+ +

The gate is applied if the control is $|0\rangle$ and trivial operation is applied when the control is $|1\rangle$.

+ +

Consequently, it is the reverse operation that a regular controlled gate. The author represents such gates with an empty circle instead of the filled dot used for regular controlled gates.

+ +

I am wondering how could one implement one of such negative controlled gates by using a standard controlled gate, that is, add some other gates to the controlled unitary so that its operation is reversed.

+",2371,,491,,7/17/2020 23:23,7/17/2020 23:23,How do you implement a negative controlled gate using the regular controlled gate?,,2,0,,,,CC BY-SA 4.0 +6547,2,,6546,6/21/2019 11:39,,6,,"
+

I am wondering how could one implement one of such negative controlled gates by using a standard controlled gate, that is, add some other gates to the controlled unitary so that its operation is reversed.

+
+ +

This is addressed in Nielsen and Chuang's section 4.3 (~ p. 184, 10th edition).

+ +

Basically,$$c_{|0\rangle}U_{AB} \equiv (X_A\otimes I_B)c_{|1\rangle}U_{AB}(X_A\otimes I_B),$$

+ +

i.e. the $X$ gate does a basis transformation $|0\rangle_A\to|1\rangle_A$ for you such that you can apply the required unitary and then transform back to the original basis using another $X$.

+ +

+ +
+

In the controlled gates we have been considering, conditional dynamics on the target + qubit occurs if the control bits are set to one. Of course, there is nothing special about one, and it is often useful to consider dynamics which occur conditional on the control bit being set to zero. For instance, suppose we wish to implement a two qubit gate in which the second (‘target’) qubit is flipped, conditional on the first (‘control’) qubit being set to zero. In Figure 4.11 we introduce a circuit notation for this gate, together with an equivalent circuit in terms of the gates we have already introduced. Generically we shall use the open circle notation to indicate conditioning on the qubit being set to zero, while a closed circle indicates conditioning on the qubit being set to one.

+
+",26,,26,,6/21/2019 11:50,6/21/2019 11:50,,,,0,,,,CC BY-SA 4.0 +6548,1,,,6/21/2019 12:04,,1,74,"

A pure quantum state is a state which can be described by a single ket vector. A mixed quantum state is a statistical ensemble of pure states. When carriers transport from source to drain in a Field Effect Transistor, which state could describe it? +A pure state or a mixed state?

+",7825,,7825,,6/21/2019 13:07,6/21/2019 13:07,Which state describes carrier transport through channel? A mixed state or a pure state?,,0,3,,,,CC BY-SA 4.0 +6549,1,,,6/21/2019 13:29,,-4,230,"

Suppose you have a large collection of N numbered copper coins. However, one of them is nickel but looks exactly the same as the rest. How do you find out which number the nickel coin has?

+ +

Classical computer: Try each of them in turn to see if it is magnetic, this takes on average N/2 tries.

+ +

Quantum computer: Put them all in a bag together with a magnet on a string, shake a bit and pull out the magnet plus the nickel coin. If it doesn't work the first time try again. This takes only one or a few tries. The magnet interacts with all the coins at once.

+",7626,,26,,6/21/2019 13:31,10/11/2019 5:12,What about this metaphor for quantum computing?,,1,6,,6/25/2019 22:27,,CC BY-SA 4.0 +6550,2,,6208,6/21/2019 14:13,,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{2\pi i k}{2^n} \left ( i_{0} - 2^n \theta \right )} |x\rangle,$$

+ +

where $i_{0}$ is the integer closest to $2^{n}\omega$ such that $i_{0} < 2^{n}\omega$ ($2^{n}\omega = i_{0}-2^{n}\delta$). When measurement occurs, the axioms of quantum mechanics give you that the probability of measuring $i_{0}$ is +$$\mathrm{prob}(i_{0})=\frac{1}{2^{2n}} \left | \sum_{k=0}^{2^n-1} e^{2 \pi i \delta k} \right |^2.$$

+ +

Notice that at the point you are asked to evaluate a finite geometrical series. We have the formula: +$$\sum_{k=0}^{n-1} ar^k= a \left(\frac{1-r^{n}}{1-r}\right), (1)$$

+ +

valid only for $r\neq 1$ . This is a key point in the whole discussion as for $\delta = 0$ we simply end up adding $\frac{1}{2^{n}}$ $2^{n}$ times and so we get $\frac{(2^{n})^{2}}{2^{2n}}=1$ (we do not use the formula). So in the case of $2^{n}\omega$ being an integer, we have concluded that the probability of getting the exact value of the phase is 100%. If $\delta\neq 0$ we use the formula (1) and get +$$\mathrm{prob}(i_{0})=\frac{1}{2^{2n}} \left | \frac{1- {e^{2 \pi i 2^n \delta}}}{1-{e^{2 \pi i \delta}}} \right |^2.(2)$$

+ +

Now notice that +$$4\left | \sin(x)) \right |^{2}=4\left | \frac{e^{-ix}-e^{ix}}{2i}\right |^{2}=\left | e^{-ix}-e^{ix} \right |^{2}=\left | 1-e^{2ix} \right |^{2}.(3)$$

+ +

Using identity (3) we may rewrite (2) as +$$\mathrm{prob}(i_{0})=\frac{1}{2^{2n}} \frac{\sin^{2}(\pi \delta 2^{n})}{\sin^{2}(\pi \delta)},$$

+ +

using the definition of $\delta$ we get (for $\delta \neq 0$) +$$\mathrm{prob}(i_{0})=\frac{1}{2^{2n}} \frac{\sin^{2}(\pi (2^{n}\omega -i_{0}))}{\sin^{2}(\pi(\omega -\frac{i_{0}}{2^{n}}))},$$

+ +

which is exactly the result you were looking for. With a bit more effort it is possible to show that in the case where $\delta \neq 0$ the following holds +$$\mathrm{prob}(i_{0})\geqslant \frac{4}{\pi ^{2}}.$$

+ +

So we may conclude with stating that for some special phases (such that $2^{n}\omega$ is an integer) we can extract the exact value of the phase. However, in the general case where $2^{n}\omega$ is not an integer, we get an approximation of the phase with a probability of at least $\frac{4}{\pi ^{2}}$.

+",7826,,7826,,11/28/2019 19:25,11/28/2019 19:25,,,,2,,,,CC BY-SA 4.0 +6552,1,,,6/22/2019 0:14,,4,31,"

I am wondering if anyone in here has heard/read is involved in quantum codes applied to simulate plasmas?

+ +

I have read that PPNL is working on that but have not actually seen/found any of their papers on the subject.

+ +

Thank you!

+",6253,,434,,6/24/2019 17:29,6/24/2019 17:29,Quantum Codes and Plasma Codes for Simulation Applications,,0,2,,,,CC BY-SA 4.0 +6553,2,,6525,6/22/2019 0:48,,2,,"
+

I know that I should write states using the creation operator and $|00⟩$, and then let $U$ act on creation operators.

+
+ +

This is exactly right.

+ +

Writing the state in terms of creation operators gives $$(\alpha|0\rangle+\beta|1\rangle+\gamma|2\rangle)|10\rangle = \left(\alpha + \beta a_1^\dagger + \gamma a_1^\dagger a_1^\dagger\right)a_2^\dagger\left|000\right>.$$

+ +

We know from page 10 that the unitary transformation matrix acts on the creation operators as

+ +
+

$$a_l^\dagger\left|0\right>\rightarrow\sum_mU_{ml}a_m^\dagger\left|0\right>$$

+
+ +

That is, overall it gives $$\left(\alpha + \beta \sum_mU_{m1}a_m^\dagger + \gamma \sum_{m, l}U_{m1}U_{l1}a_m^\dagger a_l^\dagger\right)\sum_jU_{j2}a_j^\dagger\left|000\right>.$$ The reason that this looks like a mess is simply because it is (at this point anyway) - 3 photons in 3 modes is considerably more complicated than 3 photons in 1 mode or 1 photon in 3 modes, so naively, the only option is to persevere and see what comes out the other end. Making use of the Reck decomposition (equation 15, which looks like $U = D^\dagger T^\dagger_{2, 1} T^\dagger_{3, 1} T^\dagger_{3, 2}$ for 3 modes, as on page 15) can sometimes be used to make things easier to handle, but in this case, it doesn't particularly look like it would help. What might make it easier is splitting it into chunks, then taking the sum: So, taking the $\alpha$ component, then the $\beta$ component, then the $\gamma$ component and summing them together. The occasional term simplifies down a bit but overall, this (part) seems to be one of those questions where the purpose is to give the reader practise in doing these sorts of calculations, so actually writing it down here in this answer won't help that.

+ +

However, for the latter part of the question, there is a bit of simplification that can be done. This lies in realising that the $U$ is symmetric: $U^\dagger = U$ and so, going 'backwards' is the same evolution as going 'forwards'. The above considers writing the output in terms of the input $\left(a_l^\dagger\left|0\right>\rightarrow\sum_mU_{ml}a_m^\dagger\left|0\right>\right)$. However, the input can also be written in terms of the output and we know both the input and two modes of the output, so we're only looking at outputs of the form $$(\alpha'|0\rangle+\beta'|1\rangle+\gamma'|2\rangle)|10\rangle = \left(\alpha' + \beta' a_1^\dagger + \gamma' a_1^\dagger a_1^\dagger\right)a_2^\dagger\left|000\right>.$$

+ +

Indeed, taking the $\alpha'$ component gives that, the only single photon term that survives is $\frac{1}{2}\alpha\left|010\right>$ as the only possible way to go from an input of $a_2^\dagger$ to $a_2^\dagger$ is by the operation $U_{22}$. Similarly, the $\beta$ term gives the only two photon term that survives as $$\left(U_{11}U_{22} + U_{12}U_{21}\right)\beta\left|110\right> = \left(\frac{1}{2}\left(1-\sqrt{2}\right) + \frac{1}{\sqrt{2}}\right)\beta\left|110\right> = \frac{1}{2}\beta\left|110\right>,$$ corresponding to the possible transformations of $a_1^\dagger a_2^\dagger \rightarrow a_1^\dagger a_2^\dagger$. The $\gamma'$ term then gives $$\left(\left(1-\sqrt{2}\right)^2\frac{1}{2} + 2\left(1-\sqrt{2}\right)\frac{1}{\sqrt{2}}\right)\gamma\left|210\right> = -\frac{1}{2}\gamma\left|210\right>,$$ giving the overall output if we measure $\left|10\right>$ in modes 2 and 3 as $$(\alpha|0\rangle+\beta|1\rangle-\gamma|2\rangle)|10\rangle,$$ where the factor of 1/2 shows that the probability of obtaining this state is 1/4 and is then factored out for normalisation.

+ +

If the former part of the question is fully calculated, then doing the latter part is a relatively simple matter of looking for the terms of the correct form, however, the above shows an easier way of performing this latter part without having to do the former and transforms a brute force 'calculate all the terms and look for the ones you want' into a much smaller combinatorics-type problem of 'what are the ways that this input can be transformed into this output?' and multiplying and summing the relevant matrix elements.

+ +

This method is essentially an adaption of that used in e.g. Ralph's Linear Optical CNOT Gate in the Coincidence Basis, which will hopefully offer more insight into what's happening.

+",23,,,,,6/22/2019 0:48,,,,1,,,,CC BY-SA 4.0 +6554,1,6563,,6/22/2019 1:38,,5,647,"

I am looking for guidance in more generally how to developed n-bit gates in Cirq.

+ +

I am working on a QNN paper and I need to develop a n-controlled gate to be able to measure the cost function of the circuit.

+",6253,,,,,12/5/2021 6:32,N-Toffoli on Cirq,,2,0,,,,CC BY-SA 4.0 +6555,1,,,6/22/2019 2:12,,1,538,"

The current processors are limited by the speed of the electrons but quantum processors take advantage of the properties of subatomic particles. But the question is how to compare the processing power of these two processors.

+ +

How to compare the processing power of CPU and QPU to solve and calculate mathematical and cryptographical equations?

+ +

Like an ""Intel Core i9 CPU"" vs ""IBM Q 5 Tenerife QPU""?

+",7429,,26,,6/23/2019 7:02,6/23/2019 7:02,Comparing CPU to QPU In terms of processing power,,0,2,0,,,CC BY-SA 4.0 +6556,1,,,6/22/2019 2:45,,3,88,"

Does anybody of you know what are the two states $|0\rangle$ and $|1\rangle$ of a qubit in a DC-SQUID (2 Josephson junctions in a loop)?

+",7405,,26,,6/23/2019 7:01,6/23/2019 7:01,States of a qubit in a DC-SQUID,,0,0,,,,CC BY-SA 4.0 +6558,1,,,6/22/2019 5:55,,3,173,"

I implemented the following circuit:

+ +

I am interested in measuring the expected energy of the circuit. I am using Cirq. I am wondering what are the next steps. Sorry if the question seems very basic, but I am not sure how to interpret the measurement gate to extract this energy.

+ +

+ +

Thank you.

+",6253,,6253,,6/22/2019 6:57,6/22/2019 6:57,Measuring the expected energy of a quantum circuit,,0,7,,,,CC BY-SA 4.0 +6560,1,,,6/22/2019 8:54,,2,88,"

I am an Electrical and Computer Engineering student from Egypt and was considering venturing into the realm of Quantum Computing. I really want to take part in the next info revolution and I have taken some online courses towards that end, but that is not enough, I believe.

+ +

I was thinking of having that education in Germany, because it is affordable, very excellent and close to home, or French Canada or The USA. However when I search for Masters or PhDs in the field I only get sham sites and I get that many universities have Quantum Computing interest and research groups but I can't find degrees or subspecialization or even individual courses that can aid in bridging the gap of knowledge.

+ +

So does anybody know any universities that offer such degrees or courses?

+",7834,,2879,,6/22/2019 15:31,6/22/2019 15:31,"Are there any Quantum Computing degrees in Germany, Quebec, or The USA?",,0,10,,6/25/2019 22:27,,CC BY-SA 4.0 +6561,1,,,6/22/2019 12:49,,4,447,"

What is the goal of Hamiltonian simulation?

+ +

Is it going to simulate a quantum system on a classical computer or quantum computer or none of them?

+ +

What is the relationship between a quantum algorithm and the Hamiltonian simulation?

+",7835,,,,,9/12/2019 14:25,Hamiltonian simulation in quantum computation,,2,1,,,,CC BY-SA 4.0 +6562,1,6578,,6/23/2019 2:24,,4,327,"

First of all: thanks for reading again. I appreciate the feedback I have gotten from this community the past weeks as I started to feel ready to ask questions about quantum computing topics.

+ +

I am trying implement the following paper: https://arxiv.org/abs/1509.04279.

+ +

I have used the ansatz represented the quantum circuit shown in Cirq's tutorial. I even tried to apply Farhi and Neven's method of gradient descent to see whether that could help find the minimal expected energy of the system. (It did not).

+ +

But I have gone back to the original paper by McClean et al. and they discuss about NM Algorithm to find the minimal energy of the system.

+ +

Here it is my question: how can it be possible to apply NM when you cannot have a given order a-priori.

+ +

Here it is what I think I understand:

+ +
    +
  1. The objective function is the energy measurement operation from +Cirq's tutorial.
  2. +
  3. $x_1,...., x_n$ are the gate parameters in each of the quantum gates for the circuit representing the ansatz.
  4. +
+ +

So one of my questions would be how to frame the algorithm using Cirq's circuit to properly implement it to reproduce the results of the paper. I am unsure right now of how to use the measured energy as a way to calculate the adjustments necessary to the gate parameters to minimize the measured energy.

+ +

And also, how should I think about the objective function? Is it comparable to a cost function, or loss function, of the circuit in question?

+",6253,,55,,4/23/2021 8:56,4/23/2021 8:56,How to implement NM Algorithm for Variational Quantum Eigensolver?,,1,0,,,,CC BY-SA 4.0 +6563,2,,6554,6/23/2019 4:33,,7,,"

This is actually very easy in Cirq. The controlled_by method can be used to automatically make any given gate controlled by an arbitrary number of control qubits. Here is a simple example for creating an X gate with 5 controls:

+ + + +
import cirq
+
+qb = [cirq.LineQubit(i) for i in range(6)]
+
+cnX = cirq.X.controlled_by(qb[0], qb[1], qb[2], qb[3], qb[4])
+
+circuit = cirq.Circuit()
+circuit.append(cnX(qb[5]))
+
+",7680,,121,,10/26/2019 2:29,10/26/2019 2:29,,,,3,,,,CC BY-SA 4.0 +6564,1,,,6/23/2019 7:16,,3,41,"

In the link provided researches utilize strong two-plasmon absorption in graphene nanoribbons to create a “square-root-of-swap”, could such a device be utilized to perform other quantum logic gates?

+ +

Link: Quantum computing with graphene plasmons (Calafell et al., 2019)

+",7842,,26,,6/23/2019 7:29,6/23/2019 7:29,How to perform quantum logic gates on plasmons?,,0,0,0,,,CC BY-SA 4.0 +6565,1,,,6/23/2019 20:24,,2,47,"

(I am importing this question that I asked in Physics stack exchange)

+ +

Let the system formed by particle(microscopic or macroscopic)- environment coupling be described by $|ϕ\rangle\langleϕ|$ .

+ +

In decoherence approach, to retrieve the classical properties, one focuses on +$Tr_a(|ϕ\rangle\langleϕ|)$. Where the subscript 'a' denotes a particular basis spanning the Hilbert space of the environment. The amplitudes associated with the states in this reduced density matrix are then interpreted as classical probabilities. I have a single questions with this approach in relation to the idea of retrieving classical dynamics.

+ +

As for the particle is concerned, this consideration is with reference to only one of the observable associated with said particle. i.e. In the state $|Φ\rangle$, the entanglement involves the eigenstates of an observable of the environment on the one hand and the eigenstates of an observable of the particle on the other hand, and when one says that the particle's quantum coherence is approximately lost, it is only with reference to the eigenstates of the latter observable characterizing the particle. But for the claim 'classical physics has been retrieved' to be validated, one would expect a similar loss of coherence for all the physical quantities associated with the said particle. Which means, not just it's position(say) must be shown to apparently become classical, but also it's momentum, internal energy and other classical physical quantities that are associated with that particle. Is such a calculation possible within the decoherence approach? If so, how does one proceed? And does it work in the broadest generality possible(That is for all environment-system interaction and for all initial states)?

+",7845,,23,,6/23/2019 20:54,6/23/2019 20:54,Can decoherence account for suppression of interference in all basis?,,0,2,,,,CC BY-SA 4.0 +6566,1,6577,,6/24/2019 5:51,,3,718,"

It's perhaps a very silly question, but in what ways is it advantageous to use GridQubit vs LineQubits to develop quantum circuits? Specially to develop ansatz ? Are GridQubits Cirq's way of representing lattices or possibly surface codes?

+ +

Thank you

+",6253,,,,,4/1/2020 13:42,GridQubit in Cirq vs LineQubit,,2,0,,,,CC BY-SA 4.0 +6567,2,,6561,6/24/2019 6:59,,3,,"

Hamiltonian simulation is usually talking about simulating a quantum system on another quantum system.

+ +

In particular, a digital simulation would involve implementing the simulation on a quantum computer using, e.g. the gate model. In this setting, there are several different strategies, i.e. algorithms, which one can use to perform the simulation. These have different performance characteristics, such as the level of accuracy.

+ +

This simulation is BQP-complete. That means it's the hardest sort of problem that a quantum computer can perform. This is because you can perform simulation on a quantum computer, and you can embed any arbitrary quantum computation in a Hamiltonian evolution.

+",1837,,,,,6/24/2019 6:59,,,,0,,,,CC BY-SA 4.0 +6568,2,,6566,6/24/2019 8:10,,1,,"

Cirq defines qubits to be LineQubits or GridQubits, since these are common constructions in NISQ computers. +Qubits are commonly defined in lists (or generally iterables) for easy indexing in algorithms. +In simulation using either has no impact on your algorithm.

+ +

From Cirq's documentation

+ +
+

GridQubit is a qubit on a 2d square lattice.

+
+",5791,,5791,,4/1/2020 13:42,4/1/2020 13:42,,,,0,,,,CC BY-SA 4.0 +6569,2,,6546,6/24/2019 9:36,,2,,"

Let me work out here the more general case, in which you have a controlled operation but in which the "turned-off" and "turned-on" states are not necessarily $\newcommand{\ket}[1]{\lvert #1\rangle}\newcommand{\ketbra}[2]{\lvert #1\rangle\!\langle #2\rvert}\ket0$ and $\ket1$.

+

Consider a generic controlled operation +$$ +\mathcal U=\ketbra{\phi_1}{\phi_1}\otimes U_1+\ketbra{\phi_2}{\phi_2}\otimes U_2 +\equiv \mathbb P_{\phi_1}\otimes U_1+\mathbb P_{\phi_2}\otimes U_2,$$ with $\ket{\phi_1},\ket{\phi_2}$ arbitrary orthogonal states and $\mathbb P_{\psi}$ denotes the projector onto the state $\ket\psi$: $\mathbb P_{\psi}\equiv\ketbra\psi\psi$.

+

Define now the "inverse-controlled" operation $\tilde{\mathcal U}$ defined as +$$\tilde{\mathcal U}\equiv +\mathbb P_{\phi_2}\otimes U_1+\mathbb P_{\phi_1}\otimes U_2.$$ +The question is whether you can implement $\tilde{\mathcal U}$ by using only $\mathcal U$ and local operations.

+

More specifically, it is easy to see that we can do this by only using local operations on the controlling qubit. To see this, let $V$ be a single-qubit unitary, and consider the composition of $\mathcal U$ with two $V$ on the first qubit:

+

$$(V\otimes I)\mathcal U(V^\dagger\otimes I)= +(V\mathbb P_{\phi_1} V^\dagger)\otimes U_1+ +(V\mathbb P_{\phi_2} V^\dagger)\otimes U_2.$$ +We thus simply need a $V$ such that $V\mathbb P_{\phi_i}V^\dagger=\mathbb P_{\phi_{3-i}}$. +This is equivalent to asking for a $V$ such that +\begin{align} + V\ket{\phi_1} &=\ket{\phi_2} \\ + V\ket{\phi_2} &=\ket{\phi_1}. +\end{align} +In the case $\ket{\phi_1}=\ket0, \ket{\phi_2}=\ket1$ you recover $V=X$, while more in general you want an operation $V$ whose SVD reads +$$V=\ketbra{\phi_1}{\phi_2}+\ketbra{\phi_2}{\phi_1}.$$

+",55,,55,,7/14/2020 17:01,7/14/2020 17:01,,,,0,,,,CC BY-SA 4.0 +6570,2,,6549,6/24/2019 9:37,,2,,"

Why not uncover the quantum computer—open the box—to reveal the mechanism? Well, we can’t. If we “watch” the computation happen, we expose the quantum computer to an environment and this will break the computation. The kind of things a quantum computer needs to do requires complete isolation from the environment. Just like a magician’s trick, if we reveal the mechanism, the magic doesn’t happen.

+ +

Don’t place your analogy at the level of explanation — place it at the level of the phenomenon. Let your analogy do the work of explanation for you.

+ +

+ +

If you really want to explain quantum computing and its workings you will have to explain a little math, which hopefully isn’t too much for your audience.

+ +

Just keep in mind that the math won't fully help you understand how the mechanism works, it is simply just a better way of putting the concept of quantum computing and for a better understanding of the concept behind it. A good metaphor can be found in this answer.

+",7842,,26,,10/11/2019 5:12,10/11/2019 5:12,,,,0,,,,CC BY-SA 4.0 +6571,1,,,6/24/2019 14:53,,-2,500,"

I have been using Qiskit over the last few weeks to run different programs. But right now, whenever I try to run any code, it gives me a 403 error stating that I am out of credits. I am creating a random walk simulation.

+",7856,,409,,6/26/2019 8:59,6/26/2019 8:59,What does it mean to get 403 error when running a code on Qiskit?,,1,2,,7/12/2019 12:32,,CC BY-SA 4.0 +6572,1,,,6/24/2019 15:03,,3,107,"

At first when I heard about entanglement, I thought ""Neat, so we can make a manipulation on our quantum computer here in such a way that can be interpreted as a binary output somewhere else, and have secure, instant communication of information across vast distance.""

+ +

Then I read an article about the effect of quantum mechanics / computing on security and it was explained that we cannot manipulate the communicated information, we can just get the same random numbers from each end securely, which is still useful. So then my thinking was ""Ok, so no messages, but very secure crypto key exchanges, that's still cool..""

+ +

And now I watch this video which at the time stamp linked suggested that we can manipulate one end and have that manipulation communicated at the other end.

+ +

So will I one day be able to send ""Hello world"" through a near zero latency, perfectly secure entangled particle pair, or will I not?

+",7857,,10480,,3/20/2021 6:09,3/20/2021 6:37,Does entanglement allow communication of user specified information or not?,,3,2,,,,CC BY-SA 4.0 +6575,1,6576,,6/24/2019 18:14,,3,97,"

If our input $x \in \{0, 1\}^{n}$ is given as a black box, we usually query an oracle as follows.

+ +

$$O_{x}|i, b \rangle = (-1)^{b x_{i}} |i, b \rangle$$

+ +

$i = \{1, 2, \cdots, n \}$ is the index of the input we are querying. $x_{i}$ is the value at that index. $b = \{0, 1\}$ is an arbitrary Boolean value.

+ +

Why do we need the $|b \rangle$ register? Why can't we have a query of the form

+ +

$$O_{x}|i \rangle = (-1)^{x_{i}} |i \rangle$$

+ +

This transformation is certainly unitary. Andrew Childs notes in his lecture that we can't distinguish between $x$ and $\bar{x}$ (bitwise complement of $x$) if we exclude the $|b \rangle$ register. I don't see why this should be the case.

+",1351,,119,,6/26/2019 17:17,6/26/2019 17:17,Why is the second register needed to define bit flip quantum oracles in a way that distinguishes between complementary oracles?,,1,0,,,,CC BY-SA 4.0 +6576,2,,6575,6/24/2019 18:43,,4,,"

Consider the last part of your question:

+ +
+

Why can't we have a query of the form + $$O_{x}|i \rangle = (-1)^{x_{i}} |i \rangle$$ + This transformation is certainly unitary. Andrew Childs notes [...] that we can't distinguish between $x$ and $\bar{x}$ (bitwise complement of $x$) if we exclude the $|b \rangle$ register. I don't see why this should be the case.

+
+ +

Let $\lvert \psi \rangle = \sum_k u_k \lvert k \rangle$. Then: +$$\begin{align*} O_x \lvert \psi \rangle & = \sum_k (-1)^{x_k} u_k \lvert k \rangle \\[2ex] +O_{\bar x} \lvert \psi \rangle & = \sum_k (-1)^{\bar x_k} u_k \lvert k \rangle \\ + & = \sum_k (-1)^{1 + x_k} u_k \lvert k \rangle \\ +& = \sum_k - (-1)^{x_k} u_k \lvert k \rangle \\ +&= - O_x \lvert \psi \rangle. +\end{align*} $$ +Because global phases (such as the factor difference between $O_{\bar x} \lvert \psi \rangle$ and $- O_x \lvert \psi \rangle$) aren't detectable, it is impossible to distinguish between these two states. In fact, more properly speaking, they are the same state — and these two different vectors are just equivalent ways of representing it, as the differences they have do not correspond to any physical properties.

+",124,,124,,6/24/2019 20:29,6/24/2019 20:29,,,,0,,,,CC BY-SA 4.0 +6577,2,,6566,6/24/2019 23:13,,6,,"

When using a simulator, it doesn't really matter what kind of qubit you refer to. You can even mix-and-match the types. The type of qubit only becomes relevant when you intend to run on a device, because devices have qubits at specific locations.

+ +

For example, if you wanted to run on Bristlecone, you would limit yourself to GridQubit instances that actually appeared on the chip:

+ +
>>> import cirq
+>>> print(cirq.google.Bristlecone)
+                                             (0, 5)────(0, 6)
+                                             │         │
+                                             │         │
+                                    (1, 4)───(1, 5)────(1, 6)────(1, 7)
+                                    │        │         │         │
+                                    │        │         │         │
+                           (2, 3)───(2, 4)───(2, 5)────(2, 6)────(2, 7)───(2, 8)
+                           │        │        │         │         │        │
+                           │        │        │         │         │        │
+                  (3, 2)───(3, 3)───(3, 4)───(3, 5)────(3, 6)────(3, 7)───(3, 8)───(3, 9)
+                  │        │        │        │         │         │        │        │
+                  │        │        │        │         │         │        │        │
+         (4, 1)───(4, 2)───(4, 3)───(4, 4)───(4, 5)────(4, 6)────(4, 7)───(4, 8)───(4, 9)───(4, 10)
+         │        │        │        │        │         │         │        │        │        │
+         │        │        │        │        │         │         │        │        │        │
+(5, 0)───(5, 1)───(5, 2)───(5, 3)───(5, 4)───(5, 5)────(5, 6)────(5, 7)───(5, 8)───(5, 9)───(5, 10)───(5, 11)
+         │        │        │        │        │         │         │        │        │        │
+         │        │        │        │        │         │         │        │        │        │
+         (6, 1)───(6, 2)───(6, 3)───(6, 4)───(6, 5)────(6, 6)────(6, 7)───(6, 8)───(6, 9)───(6, 10)
+                  │        │        │        │         │         │        │        │
+                  │        │        │        │         │         │        │        │
+                  (7, 2)───(7, 3)───(7, 4)───(7, 5)────(7, 6)────(7, 7)───(7, 8)───(7, 9)
+                           │        │        │         │         │        │
+                           │        │        │         │         │        │
+                           (8, 3)───(8, 4)───(8, 5)────(8, 6)────(8, 7)───(8, 8)
+                                    │        │         │         │
+                                    │        │         │         │
+                                    (9, 4)───(9, 5)────(9, 6)────(9, 7)
+                                             │         │
+                                             │         │
+                                             (10, 5)───(10, 6)
+
+ +

Whereas if you were intending to run on an ion trap which arranged qubits into a line, you would be more likely to work in terms of LineQubits.

+ +

Another situation where you would use a LineQubit is if you had an algorithm that only required linear nearest-neighbor connectivity, such as a chemistry algorithm based on an fswap network. You would define the circuit in terms of LineQubits and then use a placement pass to map the line onto the actual device, replacing LineQubits with GridQubits perhaps returned by cirq.google.line_on_device.

+ +
>>> cirq.google.line_on_device(cirq.google.Bristlecone, 10)
+(cirq.GridQubit(0, 5),
+ cirq.GridQubit(0, 6),
+ cirq.GridQubit(1, 6),
+ cirq.GridQubit(1, 7),
+ cirq.GridQubit(2, 7),
+ cirq.GridQubit(2, 8),
+ cirq.GridQubit(3, 8),
+ cirq.GridQubit(3, 9),
+ cirq.GridQubit(4, 9),
+ cirq.GridQubit(4, 10))
+
+",119,,,,,6/24/2019 23:13,,,,0,,,,CC BY-SA 4.0 +6578,2,,6562,6/24/2019 23:37,,3,,"

If you are looking for a more complete implementation of a quantum variational algorithm in the context of Cirq, I would recommend looking at the second example in the OpenFermion-Cirq notebook found here. It uses a custom ansatz for hydrogen in a minimal basis, but makes a bit more explicit all the required pieces. Another good example, perhaps without the chemistry overhead, is the QAOA notebook written more generally for Cirq, and has some of the experimental considerations (such as finite sampling) included. I realize these examples are not completely telling for all of your questions, but following each of the subroutines down their respective rabbit holes should allow you to see all of the pieces.

+ +

I want to offer a word of caution however that the first example (and many others you will find) explores variational algorithms in a context that can be useful, but is not completely true to how one would experience it in an experiment and hence there are big caveats for evaluation of classical optimizers (like NM) in this setting. In particular, it queries the objective function (which is the same as the energy or a cost / loss function in this case) essentially perfectly (close to achievable precision on the classical device) for negligible cost. This lets one explore the parameter space and cost function surface, but is not informative as to the best optimizer to use in an experiment.

+ +

The reason is that classical computers do arithmetic 1 digit at a time for floating point numbers (sometimes phrased as costing $\log(1/\epsilon)$ for precision $\epsilon$) while readout from quantum computers costs you something more like $1/\epsilon^\alpha$ in number of circuit repetitions, where usually for a near-term device $\alpha=2$, analogous to Monte Carlo scaling. This means you can choose to pay more for additional precision in the readout, but the cost is steep.

+ +

As a result, practical optimizers for these problems need to tolerate heavy noise to be effective, often lumped into their own subcategories of optimizers for stochastic functions. The original work used Nelder-Mead as a hack to avoid focusing on the classical part of the problem (the quantum experiment was the focus), however this was perhaps a mistake in hindsight. I would never recommend using it (or other optimizers which are for deterministic problems by design) for these problems in practice, especially in gearing up for a challenging experiment.

+ +

Considering the case where one is gearing up for experiment, with real readout considerations, it's absolutely crucial to judge success based on expected experimental time, and not something intangible or missing information like ""number of iterations"". My practical recommendation at the moment would be to pair a reasonable, unbiased estimator of the gradient(such as that in the work by Farhi and Neven, the recent work by Napp and Harrow, or something like simultaneous perturbation by stochastic approximation) with a decaying step size (sometimes called learning rate) that is adjusted for problem instances. Tuning this decay and other method hyperparameters in a good way is crucial for success.

+ +

If one merely wants to toy with the ansatz and problem without worrying about performance in experiment (where one assumes extremely accurate evaluations are possible in negligible time), the considerations are different and simple implementations that are already available are probably preferred. For example, BFGS for local optimization and basin hopping using BFGS as the local optimizer if global search is of interest are probably good default choices.

+ +

As an additional note, it's important to remember that most quantum variational algorithms today will generally be non-convex optimizations. As a result, having a good initial guess for the parameters is extremely important. Also, random initialization (as one often does in machine learning) is fraught with difficulties that we explored in some depth.

+",7863,,,,,6/24/2019 23:37,,,,0,,,,CC BY-SA 4.0 +6579,1,,,6/25/2019 3:29,,3,111,"

I have been experimenting with slowing down the decay of qubits, and as a control, I implemented a circuit with just identity gates for comparison. However, when I implement such circuits in Qiskit, no matter how many identity gates I put, I get about the same fidelity each time. For example, I implemented the following two circuits with 10 identity gates and 20 identity gates in Qiskit and ran it using ibmqx4:

+ +

+ +

+ +

And I get the the respective histograms of their fidelity:

+ +

+ +

+ +

Which is obviously very weird. However, when I run the same thing in the composer on the IBM Quantum experience, I get the following histograms instead:

+ +

+ +

+ +

As you can see, the results from the composer is more correct. Am I doing anything wrong, or is there a bug with the implementation of identity gates in Qiskit?

+",7866,,,,,6/25/2019 3:29,There seems to be a problem with the implementation of identity gates on Qiskit as compared to the circuit composer,,0,0,,,,CC BY-SA 4.0 +6580,1,6583,,6/25/2019 4:27,,1,255,"

According to this answer by rrtucci, +I still cannot catch the spirit of QFT algorithm.

+ +

So I would like to ask why are we using the Hadamard gate when computing the Fourier Transform?

+ +

Moreover, what is the main idea behind Hadamard Gate?

+",5152,,10480,,4/5/2021 17:40,4/5/2021 17:40,What is the intuition of using Hadamard gate in quantum fourier transform?,,1,0,,,,CC BY-SA 4.0 +6581,2,,6572,6/25/2019 6:53,,4,,"

An entangled quantum state, where one subsystem is held by each party, and there is no other communication, cannot be used to achieve communication.

+ +

The two classes of operation that one party could perform on their quantum system are unitaries and measurements.

+ +
    +
  • A unitary performed on one quantum subsystem (Alice) does not change the other one (Bob), so that cannot give you communication

  • +
  • A measurement performed on Alice's subsystem gives a random outcome. While that outcome is effectively communicated to Bob's subsystem, since Alice could not choose the outcome, she cannot choose what is communicated. Moreover, Bob needs to know what basis Alice used if he is to access that result, so she cannot use that choice to communicate anything.

  • +
+ +

However, to be clear, there are other settings in which entanglement can be used to communicate information, such as superdense coding. This is where Alice manipulates her quantum system, and then physically sends her part of the quantum state to Bob (in the previous scenario, she kept hold of it the whole time). This gives you double the communication rate of a classical channel. Theoretically, the data can be transmitted at the speed of light (as can classical), giving you trivial latency.

+ +

This method can be perfectly secure (although it is not usually talked about in this context) in the sense that an eavesdropper cannot access the information that Alice encoded (because that can only be done if you can access both halves, but Bob never lets his half out of his possession). However, Eve would be able to scramble the message by manipulating Alice's qubit during transmission. Build in some authentication and it would probably be OK.

+",1837,,1837,,6/25/2019 7:01,6/25/2019 7:01,,,,0,,,,CC BY-SA 4.0 +6582,2,,6529,6/25/2019 7:38,,2,,"

I think the subject matter of supercondcuting qubits is rather broad and diverse, making it challenging to accurately capture it in a 'brief explanation'.

+ +

With that said, this recent review (Krantz et al., Applied Physics Reviews 6, 021318 (2019)) - ""A Quantum Engineer's Guide to Superconducting Qubits"" (arXiv:1904.06560) from the MIT group may be a good place to start.

+ +

Section II in the article is perhaps the most relevant to this question, as it describes several implementations of superconducting qubits, from the transmon and tunable transmon to flux qubits and fluxonium. The article further discusses, in sections IV and V, the state of the art in terms of control and readout.

+ +

The article does not discuss charge- and phase-qubits, which were abandoned (for the most part) because of their higher sensitivity to noise and material losses.

+",127,,127,,7/1/2019 1:17,7/1/2019 1:17,,,,1,,,,CC BY-SA 4.0 +6583,2,,6580,6/25/2019 9:00,,6,,"

The intuition, roughly speaking, is that the only way that you're going to get some difference between classical and quantum computing is if you are able to prepare qubits in a superposition. If you remain in a basis state the whole time, you just have a classical computation. So, you need superposition. Hadamard is the gate that prepares superpositions at the start of an algorithm, and it's the gate that, either by itself, or with the help of some phase gates in the Fourier transform, converts a superposition back into a basis state so that we can read it out at the end.

+",1837,,,,,6/25/2019 9:00,,,,0,,,,CC BY-SA 4.0 +6584,1,6614,,6/25/2019 9:26,,4,205,"

For my summer research internship I'm looking to randomized benchmark (RB) non-Clifford gates for a single qubit. Since I found out that Qiskit ignis allows for the RB of Clifford gates, naturally I thought I'd start there. However, the Ignis RB module doesn't seem to allow the RB of non-Clifford gates, or at least it doesn't seem like there's a straightforward way to modify it for non-Clifford gates simulation. I wondering if anyone has any idea as to what modifications I could be making, or if there's any modules out there that could help me with what I want?

+",7869,,23,,6/25/2019 10:59,6/26/2019 22:40,How to do randomised benchmarking for non-Clifford gates on Qiskit?,,1,0,,,,CC BY-SA 4.0 +6585,1,,,6/25/2019 10:45,,3,53,"

I was reading a paper on Quantum Neural Networks where the authors discussed a new back propagation algorithm. They shared a schematic of the circuit. However, I am unable to understand how the proposed circuit can be derived from the equations derived. Can anybody shed some light?

+ +

The paper can be found here: https://arxiv.org/pdf/1905.10912.pdf

+ +

The following equations:

+ +

$$ +\vert\psi(x)\rangle = \prod_{j=1}^{2^N} x_j \vert j\rangle +$$

+ +

The above is the encoding.

+ +

$$ +\begin{split} + \hat{\mathcal{N}} \vert \psi\rangle = \, &e^{-i\hat{H}\delta t}\vert \psi \rangle \\ + = &e^{-i\hat{\sum\limits_{j=1}^{2^N} w_j \Xi_j}\delta t}\vert\psi\rangle\\ + =\, &\prod_{j=1}^{2^N} e^{ - iw_j \Xi_j \delta t} \vert \psi\rangle\\ + =\, &e^{ - iw_1 \Xi_1 \delta t} * e^{ - iw_2 \Xi_2 \delta t} \dots e^{ - iw_k \Xi_k \delta t} \dots e^{ - iw_{2^N} \Xi_{2^N} \delta t}\vert \psi\rangle. \\ +\end{split} +$$

+ +

The above is the architecture where $w_{j}$ represents the $i\,th$ weight and the funny horizontal symbol is actually one of $\{I, \sigma_{x}, \sigma_{y}, \sigma_{z}\}$, the set of Identity and Pauli matrices, $\delta t$ is a small time interval under which the system is evolved, and $\hat{H}$ is the Hamiltonian of the system.

+ +

The authors go on to state each product term can be written as (example if the horizontal symbol was actually $\sigma_{x}$):

+ +

$$ +\begin{split} + e^{ - i w \sigma_x \delta t} &= cos(w \delta t)I - i sin(w \delta t) \sigma_x \\ + &= \left[\begin{smallmatrix} cos(w \delta t) &0 \\ 0 & cos(w \delta t) \end{smallmatrix}\right] + \left[\begin{smallmatrix} 0 &-i sin(w \delta t) \\ -i sin(w \delta t) & 0 \end{smallmatrix}\right] \\ + &= \left[\begin{smallmatrix} cos(w \delta t) &-i sin(w \delta t) \\ -i sin(w \delta t) & cos(w \delta t) \end{smallmatrix}\right] +\end{split} +$$

+ +

They defined the loss function as below:

+ +

$$ +\begin{split} + \mathcal{L} &= (\langle\psi\vert \hat{\mathcal{N}}^{\star} - \langle y\vert)*(\hat{\mathcal{N}}\vert\psi\rangle-\vert y\rangle)\\ + &=\langle\psi\vert \hat{\mathcal{N}}^{\star} \hat{\mathcal{N}}\vert \psi\rangle - \langle y\vert\hat{\mathcal{N}}\vert\psi\rangle - \langle\psi\vert\hat{\mathcal{N}}^*\vert y\rangle+\langle y | y \rangle\\ + &= 2 -\langle y\vert\hat{\mathcal{N}}\vert\psi\rangle - \langle\psi\vert\hat{\mathcal{N}}^*\vert y\rangle +\end{split} +$$

+ +

And the training involves the following equations:

+ +

$$ +\begin{split} + \frac{\partial \mathcal{L}}{\partial w_k} &= -\langle y\vert\frac{\partial \hat{\mathcal{N}}}{\partial w_k}\vert\psi\rangle - \langle\psi\vert\frac{\partial \hat{\mathcal{N}}^*}{\partial w_k}\vert y\rangle; \\ + \frac{\partial \hat{\mathcal{N}}}{\partial w_k} &= e^{ - i\alpha_1 \Xi_1 \delta t} * e^{ - i\alpha_2 \Xi_2 \delta t} \dots (-i \Xi_k \delta t) \,e^{ - i\alpha_k \Xi_k \delta t} \dots e^{ - i\alpha_n \Xi_n \delta t};\\ + \frac{\partial \hat{\mathcal{N}}^*}{\partial w_k} &= e^{ i\alpha_1 \Xi_1 \delta t} * e^{ i\alpha_2 \Xi_2 \delta t} \dots (i \Xi_k \delta t) \,e^{ i\alpha_k \Xi_k \delta t} \dots e^{ i\alpha_n \Xi_n \delta t}. +\end{split} +$$

+ +

Finally, they came up with this schematic:

+ +

+ +

Can anybody please explain how the circuit is derived from the equations?

+",6207,,1386,,6/25/2019 11:12,6/25/2019 11:12,How to derive a circuit from given equations?,,0,1,,,,CC BY-SA 4.0 +6586,1,6587,,6/25/2019 11:36,,5,928,"

I am trying to implement Simon's algorithm which calls for a 2-to-1 mapping function that satisfies $f(x) = f(x⊕s)$.

+ +

I am looking for a simple way to code the oracle (using $H$, $Cx$, and $R$ gates), ideally with an easy way to redefine $s$.

+",7864,,55,,6/26/2019 15:36,6/26/2019 15:36,Coding an oracle for Simon's algorithm,,1,0,,,,CC BY-SA 4.0 +6587,2,,6586,6/25/2019 11:50,,4,,"

You could do something like:

+ +
    +
  • assume the most significant bit of $s$ is 1.

  • +
  • write a function that says ""if the most significant bit of $x$ is 0, return $x$. if the most significant bit of $x$ is 1, return $x\oplus s$.

  • +
+ +

This is easily implemented because you start by doing a transversal set of cNOT gates to copy $x$ from the input register to the output register. Then, you simply do a bunch of controlled-not gates controlled off the most significant bit of the first register, targeting each of the qubits in the output register for which the corresponding bit of $s$ is 1.

+",1837,,,,,6/25/2019 11:50,,,,2,,,,CC BY-SA 4.0 +6588,1,6856,,6/25/2019 14:54,,4,420,"

I read the article of IBM on Quantum Volume, but I don't understand how to calculate the effective error rate, and therefore the Quantum Volume.

+ +

Can someone give an example of the calculation?

+",7762,,55,,6/26/2019 15:39,7/23/2019 22:59,How to calculate the quantum Volume?,,1,0,,,,CC BY-SA 4.0 +6589,2,,6572,6/25/2019 15:31,,3,,"

You cannot directly send information using only entanglement like DaftWullie excellently explained.

+ +

But here's what you can do

+ +
    +
  1. Superdense coding: a) pre-share 2 entangled qubits between you and a friend b) then by sending a single qubit you can send 2 classical bits
  2. +
  3. Teleportation: a) pre-share 2 entangled qubits between you and a friend b) when you want to send an arbitrary qubit you process it together with your entangled qubit then measure it and get two classical bits. c) send those classical bits to your friend and he will be able to recreate the arbitrary qubit you wanted to send. (You have to destroy the information in order ho send it that's why it's called teleportation)
  4. +
  5. Use quantum cryptographic protocols like Quantum key distribution to encode/decode messages sent over a classical channel.
  6. +
+",7759,,,,,6/25/2019 15:31,,,,0,,,,CC BY-SA 4.0 +6590,2,,6571,6/25/2019 16:27,,2,,"

The 403 error is a http error - Forbidden. It's comming from the server that is giving you access to the quantum computer, not from the quantum computer its self.

+ +

If you are using IBM Q Experience you shuld check out the FAQ page. Regarding to credits it states:

+ +
+

A User has a maximum of 15 credits, and these credits are replenished upon the greater of 24 hours or when your execution has run off the queue.

+
+ +

So you have probably consumed your allocated credits and the http server is rejecting your requests.

+",7759,,7759,,6/26/2019 7:29,6/26/2019 7:29,,,,1,,,,CC BY-SA 4.0 +6591,1,6623,,6/25/2019 22:10,,1,158,"

I am attempting to implement a minimum spanning tree problem on the D wave quantum computing architecture. I have seen many graph problems implemented, such as a graph coloring example. There are also a variety of Traveling Salesman Tutorials available. What would be the best approach for making a functioning application of the MST on a D Wave system? Are there any related tutorials or examples to this problem other than the ones mentioned?

+",7674,,2927,,6/25/2019 23:02,6/27/2019 16:54,Minimum Spanning Tree on D Wave Processor,,1,0,,,,CC BY-SA 4.0 +6593,2,,6513,6/26/2019 9:01,,1,,"

Assuming you have n qubits then the domain of $x$ is all bit-strings $n$. ($2^n$ values)

+ +

To encode the data, in many cases, we start with the maximum superposition state. Which means each qubit is in an equal superposition of |0> and |1> so the entire system of $n$ qubits is in a massive superposition of all possible states (the entire domain of $x$).

+ +

Then in the case of Grover's algorithm in each iteration we call the oracle $f(x)$ and for the sub-states in which $f(x) = 1$ the amplitudes are enhanced. The amplitudes are diminished for the states where $f(x) = 0$. By doing this over a number of iterations we are left a superposition that contains mostly states that satisfy $f(x) =1$

+ +

The oracle does not call a classical function. It has to do computation in the quantum space.

+",7759,,,,,6/26/2019 9:01,,,,0,,,,CC BY-SA 4.0 +6594,1,6596,,6/26/2019 9:34,,1,347,"

at 1, the following code example is available:

+ +
>>> from dwave.system.samplers import DWaveSampler
+>>> from dwave.system.composites import EmbeddingComposite
+>>> sampler = DWaveSampler(endpoint='https://URL_to_my_D-Wave_system/', token='ABC-123456789012345678901234567890', solver='My_D-Wave_Solver')
+>>> sampler_embedded = EmbeddingComposite(sampler)
+>>> Q = {('x1', 'x2'): 1, ('x1', 'z'): -2, ('x2', 'z'): -2, ('z', 'z'): 3}
+>>> response = sampler_embedded.sample_qubo(Q, num_reads=5000)
+
+ +

When looking at the results, they are grouped by sample solution, with a mention of the number of occurrences:

+ +
    >>> for datum in response.data(['sample', 'energy', 'num_occurrences']):   
+...    print(datum.sample, ""Energy: "", datum.energy, ""Occurrences: "", datum.num_occurrences)
+...
+{'x1': 1, 'x2': 0, 'z': 0} Energy:  0.0 Occurrences:  1009
+{'x1': 1, 'x2': 1, 'z': 1} Energy:  0.0 Occurrences:  1452
+{'x1': 0, 'x2': 0, 'z': 0} Energy:  0.0 Occurrences:  1292
+{'x1': 0, 'x2': 1, 'z': 0} Energy:  0.0 Occurrences:  1246
+{'x1': 0, 'x2': 1, 'z': 0} Energy:  0.0 Occurrences:  1
+
+ +

After looking at the available samplers at 2, I changed the code to simulate the process with D-Wave's Dimod, and repeated this D-Wave's neal:

+ +
from dwave.system.samplers import DWaveSampler
+from dwave.system.composites import EmbeddingComposite
+import dimod
+import neal
+#sampler = DWaveSampler(endpoint='https://URL_to_my_D-Wave_system/',  token='ABC-123456789012345678901234567890', solver='My_D-Wave_Solver')
+sampler = dimod.SimulatedAnnealingSampler()
+# Note: also tried with neal: 
+# sampler = neal.SimulatedAnnealingSampler()
+#sampler_embedded = EmbeddingComposite(sampler)
+Q = {('x1', 'x2'): 1, ('x1', 'z'): -2, ('x2', 'z'): -2, ('z', 'z'): 3}
+#response = sampler_embedded.sample_qubo(Q, num_reads=5000)
+response = sampler.sample_qubo(Q, num_reads=500)
+
+ +

However, my results are not binned:

+ +
for datum in response.data(['sample', 'energy', 'num_occurrences']):   
+    print(datum.sample, ""Energy: "", datum.energy, ""Occurrences: "", datum.num_occurrences)    
+({'x2': 0, 'x1': 0, 'z': 0}, 'Energy: ', 0.0, 'Occurrences: ', 1)
+({'x2': 1, 'x1': 1, 'z': 1}, 'Energy: ', 0.0, 'Occurrences: ', 1)
+({'x2': 1, 'x1': 1, 'z': 1}, 'Energy: ', 0.0, 'Occurrences: ', 1)
+[497 similar lines removed]
+
+ +

My question: how can I make sure my results are correctly binned*?
+OR: how should I properly port the given code to be able to simulate it without access to the actual D-Wave hardware?

+ +

*: I am not asking for a generic algorithm to create bins/histograms, I have those already. I am looking for a function of set of parameters from the D-Wave libraries, as I'm surprised by the different outcomes

+",2794,,2794,,6/26/2019 10:57,6/26/2019 16:45,"How to get samples in ""bins"" from D-Wave's dimod?",,2,0,,,,CC BY-SA 4.0 +6596,2,,6594,6/26/2019 10:55,,1,,"

Old answer : +Maybe the answer mode differs using a different sampler. I have not tried but I know there is an option ""answer_mode"" in the sample_qubo method. If answer_mode='raw', you will have all responses not binned. If answer_mode='histogram', you should get them as bins.

+ +

New answer : +Dimod does not use the answer_mode argument. To work it in your way, +you have to aggregate response:

+ +
Q = {('x1', 'x2'): 1, ('x1', 'z'): -2, ('x2', 'z'): -2, ('z', 'z'): 3}
+
+response = sampler.sample_qubo(Q, num_reads=500)
+response = response.aggregate()
+
+ +

Then you will have bins :

+ +
for datum in response.data(['sample', 'energy', 'num_occurrences']):   
+    print(datum.sample, ""Energy: "", datum.energy, ""Occurrences: "", datum.num_occurrences)
+
+ +

This yields for me :

+ +

{'x1': 0, 'x2': 1, 'z': 0} Energy: 0.0 Occurrences: 134

+ +

{'x1': 1, 'x2': 1, 'z': 1} Energy: 0.0 Occurrences: 123

+ +

{'x1': 0, 'x2': 0, 'z': 0} Energy: 0.0 Occurrences: 115 +...

+",4127,,4127,,6/26/2019 14:34,6/26/2019 14:34,,,,6,,,,CC BY-SA 4.0 +6598,1,6656,,6/26/2019 12:46,,5,142,"

Suppose we are given a (univariate) polynomial $P$ of degree $d$, and we wish to determine if $P$ is identically $0$. A standard way to do this is to use a classical PRG to randomly sample $n$ bits, drawing a number $r$ uniformly from $[0,S]$; we can plug $r$ into $P$ to see if $P(r)=0$. If we only perform the above test one time, we would be ""fooled"" into thinking the polynomial is $0$ when it's not only $d/S$ times. However, we can rinse and repeat $k$ times to amplify our success probability, and our probability of being ""fooled"" is at most $(d/S)^k$.

+ +

As an alternative to drawing uniformly from $[0,S]$, we could also perform random circuit sampling on an $n$-qubit random quantum circuit $U$. That is, we measure $U\vert 00\cdots0\rangle$ for some fixed random quantum circuit $U$.

+ +

For each sample, the output of $U$ will most definitely not be uniformly distributed; it's more likely that most states are never sampled, a good number of states having a reasonable probability of being sampled, and a small number of states having a large probability of being sampled. This is according to the Porter-Thomas distribution as I understand it.

+ +
+

If we were to sample $n$ qubits $k$ times from a random quantum circuit $U$, and use these $r_1,r_2,\cdots, r_k$ as a test that a polynomial is $0$, what is our soundness probability?

+
+ +

Could it be more efficient to repeatedly sample $n$ qubits from the same random quantum quantum circuit to determine guesses $r_1,r_2,\cdots,r_k$ drawn from the Porter-Thomas distribution determined by $U|00\cdots 0\rangle$ than to repeatedly sample $n$ bits at random to determine guesses $r_1,r_2,\cdots,r_k$ drawn from the uniform distribution?

+",2927,,2927,,7/1/2019 17:55,7/1/2019 21:49,Can we amplify BPP algorithms with a random quantum circuit?,,1,0,,,,CC BY-SA 4.0 +6601,1,6602,,6/26/2019 13:31,,1,405,"

Suppose that there is an ensemble with 60% of the states prepared in

+ +

$$|a\rangle=\sqrt{\frac{2}{5}}|+\rangle-\sqrt{\frac{3}{5}}|-\rangle$$ +and 40% in:

+ +

$$|b\rangle=\sqrt{\frac{5}{8}}|+\rangle+\sqrt{\frac{3}{8}}|-\rangle$$

+ +

I've considered two ways to calculate this. For the first, one could replace the $|+\rangle$ and $|-\rangle$ and calculate the density matrix as usual in $0,1$ base. Another possibility would be to calculate the density matrix in $\{|+\rangle,|-\rangle\}$ basis and then to convert it into a corresponding $|0\rangle$ $|1\rangle$ density matrix. My question, how would you proceed here?

+ +

But I'm not sure if both ways come to the same result?

+ +

The density matrix in $\{|+\rangle,|-\rangle\}$ Base is: +$$\rho_a=\frac{2}{3}|+\rangle\langle+|-\frac{\sqrt{6}}{5}|+\rangle\langle-|-\frac{\sqrt{6}}{5}|-\rangle\langle+|+\frac{3}{5}|-\rangle\langle-|$$ +$$\rho_b=\frac{5}{8}|+\rangle\langle+|+\frac{\sqrt{15}}{8}|+\rangle\langle-|+\frac{\sqrt{15}}{8}|-\rangle\langle+|+\frac{3}{8}|-\rangle\langle-|$$ +$$\rho=\frac{2}{5}p_b+\frac{3}{5}p_a=\begin{pmatrix}\frac{49}{100}&\frac{5\sqrt{15}-12\sqrt{6}}{100}\\\frac{5\sqrt{15}-12\sqrt{6}}{100}&\frac{41}{100}\end{pmatrix}$$

+ +

Now the question is, can one translate this density matrix $p$ from $\{|+\rangle,|-\rangle\}$ into the $\{|0\rangle, |1\rangle\}$ basis?

+ +

or should one have started like this:

+ +

$$|a\rangle=\sqrt{\frac{2}{5}}|+\rangle-\sqrt{\frac{3}{5}}|-\rangle=\sqrt{\frac{2}{5}}\left(\frac{|0\rangle+|1\rangle}{\sqrt{2}}\right)-\sqrt{\frac{3}{5}}\left(\frac{|0\rangle-|1\rangle}{\sqrt{2}}\right)$$

+ +

Then calculate the same for $|b\rangle$ and then the density matrix

+ +
+ +

Then I would be interested, for this question, I did not want to open a new topic. Suppose we have the following density matrix:

+ +

$$\rho=\begin{pmatrix}\frac{2}{5}&\frac{-i}{8}\\\frac{i}{8}&\frac{3}{5}\end{pmatrix}$$

+ +

What is the probability that the system is in state 0? I would say 2/5 so 40%, but according to the solution that is not true. So my question is why is not that true?

+ +

I have found these tasks out of interest and try to work on them. But I wanted to get some advice from those present ...

+",4974,,4974,,6/26/2019 14:36,6/26/2019 14:36,What is the probability that measurement finds it in the $|0\rangle$ state?,,1,2,,,,CC BY-SA 4.0 +6602,2,,6601,6/26/2019 13:47,,2,,"

Let's call the two states $|a_1\rangle$ and $|a_2\rangle$ to distinguish them. What you're saying is that the state has been prepared (to the best of our knowledge) as +$$ +\rho=\frac{3}{5}|a_1\rangle\langle a_1|+\frac{2}{5}|a_2\rangle\langle a_2|. +$$ +The probability that you expect it to give you an answer $|0\rangle$ if you project in the standard basis is $\langle 0|\rho|0\rangle$. You can perform that calculation in whatever basis you want to!

+ +

I would probably start by calculating +$$ +\langle 0|a_1\rangle=\frac{1}{\sqrt{2}}\sqrt{\frac{2}{5}}-\frac{1}{\sqrt{2}}\sqrt{\frac{3}{5}}=\frac{\sqrt{2}-\sqrt{3}}{\sqrt{10}} +$$ +and +$$ +\langle 0|a_2\rangle=\frac{1}{\sqrt{2}}\sqrt{\frac{5}{8}}-\frac{1}{\sqrt{2}}\sqrt{\frac{3}{8}}=\frac{\sqrt{5}-\sqrt{3}}{\sqrt{16}} +$$ +Hence, the overall calculation is +$$ +\frac{3}{5}\left(\frac{\sqrt{2}-\sqrt{3}}{\sqrt{10}}\right)^2+\frac{2}{5}\left(\frac{\sqrt{5}-\sqrt{3}}{\sqrt{16}}\right)^2 +$$ +If my hastily done maths is correct, this is the same as +$$ +\frac{1}{2}-\frac{12\sqrt{6}+5\sqrt{15}}{100}. +$$

+ +
+ +

Second question (really ought to be separate):

+ +

Assuming the matrix $p$ that you give (might be better to use the standard notation, $\rho$, for a density matrix) is written in the standard basis, then the probability of finding it in the 0 state when measured in the standard basis is indeed $\frac{2}{5}$. But that is not quite what your wording says (I don't know where the imprecision comes in). What you ask what is the probability that the system is in the state $|0\rangle$. This is different because measuring changes the state of the system. You measure it, and you find it to be $|0\rangle$ with a certain probability. That's not the same as it being that state with a certain probability prior to the measurement. However the literal question probably isn't really answerable.

+",1837,,,,,6/26/2019 13:47,,,,5,,,,CC BY-SA 4.0 +6603,2,,6594,6/26/2019 14:27,,0,,"

As cnada pointed out, the correct parameter for this is ""answer_mode"". This parameter is not available for the simulated_annealing sampler.

+ +

As per 1, samplers.DWaveSampler.sample_qubo() can take the set of parameters mentioned in 2, including ""answer mode"". As seen in 3, samplers.simulated_annealing.sample_qubo() can only take beta_range’, num_reads’, ‘num_sweeps’ 4. This does not include ""answer_mode"".

+",2794,,2794,,6/26/2019 16:45,6/26/2019 16:45,,,,0,,,,CC BY-SA 4.0 +6604,1,,,6/26/2019 15:06,,2,627,"

I am trying to use Qiskit to write a code that uses QFT to add 2 numbers. I am referring to this paper: +https://iopscience.iop.org/article/10.1088/1742-6596/735/1/012083

+ +

I have a few questions: +1) Is the $R$ rotation gate in this paper equivalent to the Controlled-U1 gate in Qiskit?

+ +

2) Why does the value of $k$ change?

+ +

3) The program is supposed to add $1$ and $2$. Number $1$ is encoded as $01$, represented by the zero vector $(1,0)$ and the 1 vector $(0,1)$. When does number $2$ come into play? It seems that they keep performing operations on number $1$ until the end.

+ +

4) Number $1$ is represented by $0$ on $a_1$ and $1$ on $a_2$. And number $2$ consists of $1$ on $b_1$ and $0$ on $b_2$, is that right?

+",7856,,2927,,6/30/2019 16:57,7/30/2019 18:03,Using Quantum Fourier Transform in adding two 2-bit numbers,,1,1,,,,CC BY-SA 4.0 +6605,1,,,6/26/2019 15:16,,1,192,"

How can I build a controlled version of the below matrix in qiskit?$$ +\begin{pmatrix} +e^{i\theta} & 0\\ +0 & e^{i\theta} +\end{pmatrix} = e^{i\theta}I +$$

+",7732,,23,,6/26/2019 21:03,6/26/2019 21:03,How can I build a controlled gate for this matrix in qiskit?,,1,0,,,,CC BY-SA 4.0 +6606,2,,6605,6/26/2019 15:22,,2,,"

Simply implement the gate +$$ +\left(\begin{array}{cc} 1 & 0 \\ 0 & e^{i\theta} \end{array}\right) +$$ +on the control qubit.

+",1837,,,,,6/26/2019 15:22,,,,0,,,,CC BY-SA 4.0 +6607,1,6612,,6/26/2019 16:18,,4,261,"

Suppose I have a quantum gate $U$ and it's a controlled gate. In particular, I have a $2\times 2$ matrix formulation of the gate's action on 2 adjacent qubits.

+ +

How can I make this work on an $n$-bit system?

+ +

To explain precisely what I mean, if I wanted to implement a controlled $U$ gate on a 3 qubit system where the first 2 bits have the $U$ acting on them and the third qubit is kept the same, I would get the corresponding matrix by working out $U\otimes I$. However, I could not do any similar product to get the gate on 3 qubits in which the first bit is ""controlled"", the second bit is kept the same and the third bit has $U$ acting on it.

+ +

So how do I make the matrix which allows me to ""control"" the $m$th bit and use $U$ conditionally on the $n$th bit out of a bunch of $k$ qubits?

+",7881,,,,,6/26/2019 21:14,How to create an $n$-qubit normally controlled gate?,,1,4,,,,CC BY-SA 4.0 +6608,1,6610,,6/26/2019 18:21,,4,838,"

IBM-Q states that the real devices available for public use have a set of ""basis"" gates consisting of u1,u2,u3 and CNOT. However in Qiskit the circuit can be built with many gates which are not directly one of these. For example the controlled u1 gate is an ""elementary operation"" in QISKit, but it is not a basis gate in for the device.

+ +

In order to have such a circuit be executed on a real device these gates must be decomposed into the device's basis gates. I assume this is handled by the compile function.

+ +

Is there an easy way in QISKit to see the quantum circuit after this step has taken place?

+",7609,,7609,,6/26/2019 18:47,6/26/2019 19:14,What does a quantum circuit look like after qiskit.compile() has been applied?,,1,0,,,,CC BY-SA 4.0 +6610,2,,6608,6/26/2019 19:14,,7,,"

The function that handles this is transpile(), which could be found in qiskit.compiler. When you call transpile(circuit, backend) it goes through the compilation process for the input circuit based on the backend you provide. It returns a new circuit that will be valid to run on the provided backend.

+ +

You can then view this new circuit just like you would with any circuit, either print(circuit) or circuit.draw().

+",6180,,,,,6/26/2019 19:14,,,,0,,,,CC BY-SA 4.0 +6611,1,6673,,6/26/2019 21:11,,1,882,"

I am wanting to find the two qubit reduced density matrix on a 5 qubit system. I have the 5 qubit state in the form of a tensor product and I want to find the reduced density matrix of qubits 1 and 3. I have the following formula for the reduced density matrix for qubit 3:

+ +

\begin{align} + \mathrm{Tr}_1\left|h\right>_{13}\left<h\right| = \sum_{i=0}^{1}\left<i|h\right>_{13}\left<h|i\right> +\end{align}

+ +

I am unsure of how to extract $\left|h\right>_{13}$ from the 5 qubit state. Please help!

+",7734,,26,,10/10/2019 9:13,5/20/2022 20:23,Taking the two qubit reduced density matrix on a 5 qubit system,,1,2,,,,CC BY-SA 4.0 +6612,2,,6607,6/26/2019 21:14,,2,,"

$U$ actually means the 4 by 4 matrix acting on both the control and the affected qubits. You are mixing up this $U$ with the 2 by 2 block inside it. To avoid that from now on, just take $U$ to be the 4 by 4 one.

+ +

Now that that is clarified. Rearrange things with a swap.

+ +

So if the first is control and third is acted on you should do:

+ +

$$ +(I_2 \otimes S) (U \otimes I_2) (I_2 \otimes S) +$$

+ +

where $S$ is a 4 by 4 unitary matrix that swaps two qubits. By it's positioning in $I_2 \otimes S$ it is acting on qubits 2 and 3 in this case.

+ +

$$ +\begin{pmatrix} +1&0&0&0\\ +0&0&1&0\\ +0&1&0&0\\ +0&0&0&1\\ +\end{pmatrix} +$$

+ +

$(U \otimes I_2)$ had the first as control and the second affected. By conjugating by this swap we changed the roles of second and third qubit. So the combined result has the first as control and the third affected.

+",434,,,,,6/26/2019 21:14,,,,0,,,,CC BY-SA 4.0 +6614,2,,6584,6/26/2019 22:40,,1,,"

Quite simply: it's on the to-do list.

+ +

Here is a sneak peak of how it will be done.

+",409,,,,,6/26/2019 22:40,,,,1,,,,CC BY-SA 4.0 +6615,1,6619,,6/26/2019 22:54,,5,381,"

I am trying to understand an argument that Matrix Inversion is BQP-complete for certain conditions on the matrix. This is explained here on page 39 (this paper is a primer to the HHL algorithm and gives some more detailed calculations, more detail about assumptions for people new to the subject).

+ +

Definition:

+ +

An algorithm solves matrix inversion if it has:

+ +

Input: An $O(1)$-sparse matrix hermitian $A$ of dimension $N$ specified using an oracle or via a $\mathrm{poly}(\log N)$-time algorithm that returns the non-zero elements of a row. The singular values of $A$ lie between $\frac{1} {\kappa} $ and 1, where $\kappa$ is the ration between the largest eigenvalue and the smallest eigenvalue of $A$.

+ +

Output:

+ +

A bit that equals one with probability $\langle x | M |x \rangle \pm \epsilon $ where $M = |0 \rangle \langle 0 | \otimes I^{N/2}$ corresponds to measuring the first qubit and $|x \rangle$ is a normalised state proportional to $A^{-1} |b \rangle$ for $|b \rangle = |0 \rangle$.

+ +

Let $C$ be a quantum circuit acting on $n = logN$ qubits which applies $T$ two-qubit gates $U_1, \cdots U_T$. The initial state is given by $|0 \rangle^{\otimes n}$, and the answer will be determined by measuring the first qubit of the final state. Adjoin an ancilla register of dimension $3T$ and define a unitary operation: +$$U = \sum_{t-1}^{T}|t+1 \rangle \langle t| \otimes U_t + |t+T+1 \rangle \langle t+T| \otimes I $$$$ + |t+2T+1 \bmod 3T \rangle\langle t+2T| \otimes U^{\dagger}_{3T+1-t}.$$

+ +

The author then writes: ""This operator has been chosen such that for $T+1 \leq t \leq 2T$, applying $U^t$ to the state $|1 \rangle |\psi \rangle$ yields the output state $|t+1 \rangle \otimes U_t \cdots U_1 |\psi \rangle$. We can see this as the first $T+1$ applications of $U$ return $|T+2 \rangle \otimes U_T \cdots U_1 |\psi \rangle$ . We see from the second term of the definition for $U$ that for the next $t'<T-1$ applications, the action on the $|\psi \rangle$ register remains unchanged, while the ancillary variable is merely being incremented.""

+ +

This last statement is quite a mouthful as the expression is very complicated. I am having difficulty seeing why this is true and any insights would be much appreciated.

+",7481,,26,,10/10/2019 9:11,10/10/2019 9:11,Showing that Matrix Inversion is BQP-complete - HHL Algorithm,,1,0,,,,CC BY-SA 4.0 +6616,1,6617,,6/26/2019 23:47,,4,297,"

The standard method of implementing the one-bit Deutsch Oracle algorithm is to use two qbits, one as input & one as output (which allows you to write the non-reversible constant functions in a reversible way). However, I've heard there is a different way of implementing the one-bit Deutsch Oracle algorithm involving phases which only requires a single qbit; how is this done?

+",4153,,26,,10/10/2019 9:08,10/10/2019 9:08,Implementing the one-bit Deutsch Oracle algorithm using phase,,1,0,,,,CC BY-SA 4.0 +6617,2,,6616,6/27/2019 0:17,,5,,"

Overview

+ +

To recap the one-bit Deutsch Oracle problem, there are four possible oracle functions: constant-0, constant-1, identity, and negation. The task is to determine whether the oracle function is constant (constant-0 & constant-1) or variable/balanced (identity & negation). You can do this using phases as follows:

+ +
    +
  1. Rewrite the oracle function as $U_f|x\rangle=(-1)^{f(x)}|x\rangle$
  2. +
  3. Calculate $U_f|+\rangle$
  4. +
  5. Measure in the $\{|+\rangle, |-\rangle \}$ basis; the oracle function is constant if the result is $|+\rangle$ and variable/balanced if the result is $|-\rangle$
  6. +
+ +

Rewriting the oracle functions

+ +

Constant-0

+ +

We have:

+ +

$f(0) = 0, f(1) = 0$

+ +

So:

+ +

$U_f|0\rangle = (-1)^{f(0)}|0\rangle = (-1)^0|0\rangle = 1|0\rangle = |0\rangle$

+ +

$U_f|1\rangle = (-1)^{f(1)}|1\rangle = (-1)^0|1\rangle = 1|1\rangle = |1\rangle$

+ +

In this case $U_f = I$, the identity operator.

+ +

Constant-1

+ +

We have:

+ +

$f(0) = 1, f(1) = 1$

+ +

So:

+ +

$U_f|0\rangle = (-1)^{f(0)}|0\rangle = (-1)^1|0\rangle = -1|0\rangle = -|0\rangle$

+ +

$U_f|1\rangle = (-1)^{f(1)}|1\rangle = (-1)^1|1\rangle = -1|1\rangle = -|1\rangle$

+ +

We always multiply the phase by -1. For this we can use a rotation gate $U_f = R_y(2\pi)$.

+ +

Identity

+ +

We have:

+ +

$f(0) = 0, f(1) = 1$

+ +

So:

+ +

$U_f|0\rangle = (-1)^{f(0)}|0\rangle = (-1)^0|0\rangle = 1|0\rangle = |0\rangle$

+ +

$U_f|1\rangle = (-1)^{f(1)}|1\rangle = (-1)^1|1\rangle = -1|1\rangle = -|1\rangle$

+ +

So if the input is $|0\rangle$ then we leave it alone, but if it's $|1\rangle$ then we flip the phase. Sound familiar? Recall the phase-flip, or Z-gate:

+ +

$Z = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}$

+ +

So $U_f = Z$ for Identity.

+ +

Negation

+ +

We have:

+ +

$f(0) = 1, f(1) = 0$

+ +

So:

+ +

$U_f|0\rangle = (-1)^{f(0)}|0\rangle = (-1)^1|0\rangle = -1|0\rangle = -|0\rangle$

+ +

$U_f|1\rangle = (-1)^{f(1)}|1\rangle = (-1)^0|1\rangle = 1|1\rangle = |1\rangle$

+ +

In this case $U_f = XZX$.

+ +

Calculating $U_f|+\rangle$

+ +

Constant-0

+ +

$I|+\rangle = |+\rangle$

+ +

Constant-1

+ +

$R_y(2\pi)|+\rangle = -|+\rangle$

+ +

Identity

+ +

$Z|+\rangle = |-\rangle$

+ +

Negation

+ +

$XZX|+\rangle = XZ|+\rangle = X|-\rangle = -|-\rangle$

+ +

Measurement

+ +

It's pretty clear that if we measure in the $\{|+\rangle, |-\rangle \}$ basis, we'll get $|+\rangle$ when the oracle function is constant and $|-\rangle$ when the oracle function is variable. Done.

+ +

Discussion

+ +

While this approach does have the benefit (for learners) of not requiring multiple qbits or a CNOT gate, the rewriting step seems more like ""cheating"" given the problem statement.

+",4153,,4153,,6/28/2019 21:03,6/28/2019 21:03,,,,1,,,,CC BY-SA 4.0 +6618,1,,,6/27/2019 4:43,,3,165,"

I have been reading Farhi and Neven's paper on quantum neural networks on quantum circuits. I also found an example - albeit not ideal as pointed out by a couple of users - thank you - in here.

+ +

From these sources I used Cirq to build the following circuit: +

+ +

From this circuit, and from reading Farhi et al., I added the following:

+ +

+The modifications:

+ +
    +
  1. A 5th qubit to be a readout bit (ancilla) to measure the predicted label of the readout bit.

  2. +
  3. A Pauli-X gate to ensure the readout bit would be |1> following Farhi's paper prior to start measuring the predicted label.

  4. +
  5. N-bit toffoli gate to indirectly measure the ansatz to measure the effects of the $(\beta, \gamma)$ in the circuit as these are changed.

  6. +
  7. Hadamard layer before entering the operations shown in the picture above. I did this to be able to apply the optimization algorithm successfully; otherwise, without this first Hadamard layer, it will never converge.

  8. +
+ +

Having a readout bit that can measure the ansatz, and following the QNN paper, one defines:

+ +

loss$(\theta,z) = 1 - l( 𝑧 )𝑃(\phi)$,

+ +

where $P(\phi)$ is the result of measuring the output of the readout bit as you change $\beta, \gamma$, and $l(z)$ is the label of quantum bit. It turns out that for the purposes of implementation this relation can be stated as:

+ +

loss$(\theta,z) \approx 1 - [𝑃(\phi)]^2$,

+ +

I have applied this technique to this circuit, and while for some cases the technique performs well, I see some instances this output:

+ +

+ +

Plot on the left shows the loss function as parameters in circuit are variated; Plot on the right shows the state of readout bit under optimization process. Presumably, since the readout bit after X-gate is converted to |1>, the minimization of the loss measured in this system will return the readout bit to this state. That said, if you find this assumption also questionable, please let me know.

+ +

And it can get much worse:

+ +

+ +

So, here are my questions:

+ +
    +
  1. Clearly the loss function shows something is not right with this setup. Granted, the circuit itself can be flawed, I for one I am not sure if acting Pauli-X on the readout bit and then n-toffoli gate was the right thing to do. That said, I am not sure about that after this results. How do you ""debug"" a circuit with this in mind?

  2. +
  3. As a general question, given that from this toy-model it is clear that one cannot willy-nilly apply QNN to any random circuit, what is the criteria, if any, Hamiltonian / random quantum circuit, must have to be worth applying this technique.

  4. +
  5. Are there any better ways to extract information of the circuit for an optimization method than the n-toffoli approached I took? For example, I know it is a silly question, but can you illustrate how useful it can be to apply measurement gates to all the qubits?

  6. +
  7. Suppose you are shown this picture of the circuit, how can one take the circuit layout and go back to the Hamiltonian for the circuit? I ask because I am both fascinated and a bit confused about how can the Ising, Hubbard-fermi, among many others, are represented by a hamiltonian that can also be expressed as a quantum circuit through an ansatz.

  8. +
+ +

Just for reference, optimization algorithm I implemented is the one discussed on Farhi et al but with the modification of Adam to SGD. On a paper out of Google X last two weeks ago they shown it could successfully be applied for machine learning applications on both quantum circuits but also Tensor Networks.

+ +

Sorry for the long post. Thank you for reading, and thanks in advance for your feedback.

+",6253,,6253,,6/29/2019 1:15,6/29/2019 1:15,Quantum Optimization via Quantum Label Classification in Quantum Circuits,,0,2,,,,CC BY-SA 4.0 +6619,2,,6615,6/27/2019 7:02,,4,,"

Define the states +$$ +|\psi_t\rangle=\left\{\begin{array}{cc} +|t\rangle\otimes(U_{t-1}U_{t-2}\ldots U_1|\psi\rangle) & t=1,2,\ldots T \\ +|t\rangle\otimes(U_{T}U_{T-1}\ldots U_1|\psi\rangle) & t=T+1,T+2,\ldots 2T \\ +|t\rangle\otimes(U_{3T+1-t}U_{3T-t}\ldots U_1|\psi\rangle) & t=2T+1,2T+2,\ldots 3T +\end{array}\right. +$$ +Now let +$$ +U=\frac{2}{T}\sum_{t=1}^{T}|t+1\rangle\langle t|\otimes U_t+|t+T+1\rangle\langle t+T|\otimes I+|t+2T+1\text{ mod }3T\rangle\langle t + 2T|\otimes U^\dagger_{3T+1-t}. +$$ +You can verify that +$$ +U|\psi_t\rangle=|\psi_{t+1}\rangle +$$ +for $t=1,2,\ldots 3T-1$ and +$$ +U|\psi_{3T}\rangle=|\psi_1\rangle. +$$ +So, basically, $U$ acts as a cyclic permutation through the states $\{|\psi_t\rangle\}$. Act $U$ $k$ times, (i.e. apply $U^k$) and you go from any $|\psi_t\rangle$ to $|\psi_{t+k}\rangle$.

+ +

Now, if you start in $|\psi_1\rangle$ and enact any $U^k$ for $k=T,T+1,\ldots 2T-1$, you get an outcome for which the second register is the same, +$$ +U_{T}U_{T-1}\ldots U_1|\psi\rangle. +$$ +This idea is hence that the $U_1$, $U_2$ etc can be thought of as the individual unitaries of an arbitrary quantum computation of $T$ steps, and that this state is the overall output of the computation.

+ +

The paper then goes on to talk about implementing +$$ +A=I-Ue^{-1/T}, +$$ +and it's $A^{-1}$ you're trying to calculate. Using a Taylor expansion, this would be +$$ +A^{-1}=\sum_tU^te^{-t/T} +$$ +So, this includes $t=T$ to $2T-1$ with high (enough) probability, meaning that the act of the inversion effectively gives us the outcome of a quantum computation. If it can calculate the act of any quantum computer, the computation is at least as hard as the hardest thing a quantum computer can calculate, so the computation is BQP-hard. Since it can be completed on a quantum computer, the calculation is in BQP, and hence the overall classification is BQP-complete.

+",1837,,,,,6/27/2019 7:02,,,,2,,,,CC BY-SA 4.0 +6620,1,6621,,6/27/2019 12:43,,1,124,"

Note: This question is a follow up of Approximating unitary matrices.

+ +
+ +

The decompositions provided in Approximating unitary matrices are correct and worked for me without problem.

+ +

But I am now facing an issue: I want to try to optimise my circuit, and the method I want to use restricts the gate-set I can afford to use. The solution given in the previous post is no longer usable for me, because the gate-set I can use does not contain all the gates used in the solution.

+ +

My problem is the following: I need to approximate the following quantum gate +$$W = +\begin{pmatrix} +1&0&0&0\\ +0&\frac{1}{\sqrt{2}}&\frac{1}{\sqrt{2}}&0\\ +0&\frac{1}{\sqrt{2}}&\frac{-1}{\sqrt{2}}&0\\ +0&0&0&1 \\ +\end{pmatrix}$$ +with the gate-set +$$ +\left\{ H, X, R_\phi, \text{C}R_\phi, R_z, \text{C}R_z, \text{C}X, \text{CC}X \right\} +$$ +with $R_\phi$ defined as in Wikipedia, $R_z$ the rotation around the $Z$-axis and $\text{C}$ being a control (i.e. $\text{CC}X$ is the Toffoli gate, or double-controlled $X$ gate).

+ +

As shown by @Craig Gidney in his answer, this boils down to implement a controlled-$H$ gate with my gate-set, or equivalently a $R_y\left( \frac{\pi}{4} \right)$ gate.

+ +

I would love to have an exact decomposition, that is why I already tested:

+ +
    +
  • Using the following formula +$$U = e^{i\alpha} R_z(\beta) R_y(\gamma) R_z(\lambda).$$ +As I only need to implement $R_y\left( \frac{\pi}{4}\right)$ I replaced $\gamma$ by $\frac{\pi}{4}$ and searched for values of $\beta$ and $\lambda$ that would result in a gate $U$ that I can implement easily with my gate-set. I did not succeed, but finding a solution to this alternative problem would solve my original problem as the equation above is equivalent to: +$$R_y(\gamma) = e^{-i\alpha} R_z(-\beta) U R_z(-\lambda)$$ +and $R_z$ is in my gate-set.

  • +
  • Trying to find a decomposition by playing with matrices, this approach did not work either, mostly because it was more random tries.

  • +
+ +

I no exact decomposition exist, I will end up using an algorithm like Solovay-Kitaev or Group Leader Optimisation, but introducing errors in this gate is a real issue as it is used extensively in all the quantum circuit.

+",1386,,,,,6/27/2019 12:55,Approximating unitary matrices -- restricted gateset,,1,0,,,,CC BY-SA 4.0 +6621,2,,6620,6/27/2019 12:55,,3,,"

You would be better off trying to write +$$ +R_y(\pi/4)=e^{i\alpha}R_z(\beta)R_x(\gamma)R_z(\delta)=e^{i\alpha}R_z(\beta)HR_z(\gamma)HR_z(\delta) +$$ +and solving for the parameters in there.

+ +

By the way, what you're essentially interested in is $\sqrt{Z}R_x(\pi/4)\sqrt{Z}^\dagger$, up to some possible phases. Hopefully that indicates what angles of rotation you're going to be wanting.

+",1837,,,,,6/27/2019 12:55,,,,0,,,,CC BY-SA 4.0 +6622,1,,,6/27/2019 14:50,,4,484,"

So I'm currently working on a little program to measure how long the coherence time of a qubit is. Basically the idea is to initialise a qubit with a X or H gate then stick in a varying amount of identity gates (as I haven't been able to find any sort of delay gate/function) and just see how many identity gates it takes before the state decoheres to something unrecognisable (adding another H gate on the end for T2 measurement). So 2 questions off that:

+ +
    +
  1. Is there some sort of wait function or gate so I don't need to use Identity gates, as I know they will add more noise?

  2. +
  3. Is there a way to measure the time taken to run on the circuit. Either the time per shot or a time taken running all the shots?

  4. +
+ +

I know that result().get_data() has a time to run but that is the total time, including set up and all the other stuff, not the time just spent on processing the circuit itself.

+ +

And yes I do also know that the last calibration values for T1 and T2 are easily available, this is just for my own interest in doing it.

+",7788,,55,,4/23/2021 8:56,4/23/2021 8:56,Measuring Coherence Length for T1 and T2 values with IBMQ Experience,,0,1,,,,CC BY-SA 4.0 +6623,2,,6591,6/27/2019 16:54,,2,,"

Well first you will have to specify the MST in a QUBO/Ising formulation. In this article showing formulations for different types of problems, section 8.1 is about the MST with a maximal degree constraint. This paper contains results of Spanning Tree calculations.

+ +

When you have the formulation, you map it on the Chimera Graph if the hardware size is not limiting. Otherwise, one would try a divide and conquer approach to solve the optimization problem.

+",4127,,,,,6/27/2019 16:54,,,,0,,,,CC BY-SA 4.0 +6624,1,,,6/27/2019 17:22,,3,175,"

I am trying to find a nice way to represent the square root of an arbitrary single qubit unitary to implement Lemma 6.1 from this paper

+ +

Given the Euler angles: $R_z(a)R_y(b)R_z(c) = \left(R_z\left(a'\right)R_y\left(b'\right)R_z\left(c'\right)\right)^2$

+ +

Is there a closed form expression that relates the angles $a',\, b',\, c'$ to the angles $a,b,c$?

+ +

I have tried some simultaneous equations after I do the Euler angle exchange to have:

+ +

$R_z(a)R_y(b)R_z(c) = R_z(a') [R_z(A)R_y(B)R_z(C)] R_z(c')$, where $A,B,C$ can be related to $a,b,c$ via some nasty expressions found eg. on p4 of this paper.

+ +

But from there I cannot find a closed form expression for all of $a',b',c'$.

+ +

This seems like the sort of problem that must have been solved before - or at least it must be known whether a nice relation exists - but I cannot find work on it. Is it possible to go via quaternions or something?

+",7883,,23,,6/28/2019 8:33,6/28/2019 9:16,Calculate the square root of Euler angles,,2,1,,,,CC BY-SA 4.0 +6625,2,,6624,6/28/2019 6:24,,1,,"

If it were me, I'd go via the fact that you can describe any $U$ in the form +$$ +U=e^{i\alpha}e^{\theta\underline{n}\cdot\underline{\sigma}}. +$$ +There are already questions on Stack Exchange about how to set up the relation between the Euler angles and this Bloch vector representation (this one gets you most of the way there). The point is that the square root is easy to take in this representation: +$$ +\sqrt{U}=e^{i\alpha/2}e^{\frac{\theta}{2}\underline{n}\cdot\underline{\sigma}} +$$ +from which you can calculate the Euler angles. I doubt the relation is going to be particularly nice (as you can perhaps tell, because I'm not giving you the answer directly), except in exceptional circumstances such as when the rotation is about an axis of the form $(n_x,n_y,0)$ (in which case you'll have $c=-a=c'=-a$ and $b'=b/2$)

+",1837,,,,,6/28/2019 6:24,,,,0,,,,CC BY-SA 4.0 +6627,2,,6624,6/28/2019 9:16,,1,,"

DaftWullie's answer certainly does the job but there are also other methods:

+ +

For a $2\times 2$ unitary $U$, you can perform an eigendecomposition: for $$\Lambda = \begin{pmatrix}\lambda_+&0\\0&\lambda_-\end{pmatrix} = \begin{pmatrix}e^{i\phi_+}&0\\0&e^{i\phi_-}\end{pmatrix}$$ and $$V = \begin{pmatrix}v_+&v_+\end{pmatrix},$$ where $\lambda_\pm$ are the eigenvalues and $v_\pm$ the corresponding eigenvectors, $U$ can be written as $U = V\Lambda V^\dagger$ and the square root of $U$ can be written as $U = V\sqrt{\Lambda}V^\dagger$ as $V$ is also unitary and $$\sqrt{\Lambda} = \begin{pmatrix}\sqrt{\lambda_+}&0\\0&\sqrt{\lambda_-}\end{pmatrix} = \begin{pmatrix}e^{\frac{1}{2}i\phi_+}&0\\0&e^{\frac{1}{2}i\phi_-}\end{pmatrix}.$$

+ +

Another method, adapted from this Wiki page is that, denoting $$U = \begin{pmatrix}\alpha&\beta\\-e^{i\varphi}\beta^*&e^{i\varphi}\alpha^*\end{pmatrix}$$ for an arbitrary unitary (special unitary when $\varphi = 0, 2\pi$) transformation, which has determinant $e^{i\varphi}$ and trace $\alpha+e^{i\varphi}\alpha^*$, a square root of $U$ can be written as (when $\alpha+e^{i\varphi}\alpha^*+2e^{\frac{i}{2}\varphi}\neq0$) $$\frac{1}{\sqrt{\alpha+e^{i\varphi}\alpha^*+2e^{\frac{i}{2}\varphi}}}\left(U+e^{\frac{i}{2}\varphi}I_2\right) = \frac{1}{\sqrt{\alpha+e^{i\varphi}\alpha^*+2e^{\frac{i}{2}\varphi}}}\begin{pmatrix}\alpha+e^{\frac{i}{2}\varphi}&\beta\\-e^{i\varphi}\beta^*&e^{i\varphi}\alpha^*+e^{\frac{i}{2}\varphi}\end{pmatrix}.$$

+ +

In my (relatively limited) experience this is the simplest form I've seen and so, is the one I use most often.

+",23,,,,,6/28/2019 9:16,,,,0,,,,CC BY-SA 4.0 +6628,1,6743,,6/28/2019 11:44,,3,180,"

Chapter 6.3 of ""Quantum Computation and Quantum Information 10th Anniversary Edition"" textbook by Nielsen and Chuang talks about using the Quantum Counting Algorithm to find the number of solutions to the Quantum Search Algorithm before actually implementing it.

+ +

For a search space of size $2N$ with $M$ number of solutions, the number of Grover iterations $R$ required to obtain the state of solutions is upper bounded by (Eqn 6.17):

+ +
+

$$R \leq \lceil\frac{\pi}{4}\sqrt{2N/M}\space\rceil $$

+
+ +

At the last paragraph of this chapter, they stated that the angular error after the $R$ number of Grover iterations is at most $\pi/4(1+|\Delta\theta|/\theta)$. I think that this means:

+ +
+

$$|\Delta\theta| R \leq |\Delta\theta|\lceil\frac{\pi}{4}\sqrt{2N/M}\space\rceil = \pi/4(1+|\Delta\theta|/\theta) $$

+
+ +

We know that $\sin^2(\theta/2)=\frac{M}{2N}$, so I tried to use substitution in the attempt to get the stated angular error. This is what I got:

+ +
+

$$|\Delta\theta| R \leq |\Delta\theta| \space \lceil \frac{\pi}{4}\frac{1}{\sin(\theta/2)} \rceil $$

+
+ +

Can someone explain to me how to get the stated angular error?

+",5253,,26,,10/14/2019 16:14,7/4/2022 20:45,Angular Error associated with Quantum Search Algorithm,,2,2,,,,CC BY-SA 4.0 +6629,1,6630,,6/29/2019 7:24,,3,968,"

I realize that fundamentally speaking quantum and classical computers might as well be apples and oranges, and that for very specific problems such as integer factorization with Shor's algorithm quantum computers blow conventional computers out of the water, but could a quantum computer run classical algorithms?

+ +

If so, using a comparable classical computer, how would the calculation speed of a quantum computer running a classical algorithm compare to the calculation speed of the classical computer?

+",7892,,,,,6/29/2019 9:42,Can a quantum computer run classical algorithms?,,1,2,,,,CC BY-SA 4.0 +6630,2,,6629,6/29/2019 9:42,,6,,"

Quantum computers can run classical computations using exactly the same algorithms, and hence have the same running time in terms of scaling. For example, if you look at shor’s algorithm, a major component of that is modular exponentiation, but nobody ever draws the circuit because they just say “use the classical algorithm”.

+ +

In terms of absolute running time, that is heavily hardware dependant so you can’t make comparisons so easily.

+ +

Quantum computers offer the possibility of other algorithms in addition to the classical ones that could be faster, but there’s no standard method for generating an improvement.

+",1837,,,,,6/29/2019 9:42,,,,2,,,,CC BY-SA 4.0 +6631,1,,,6/29/2019 14:13,,11,265,"

Suppose I want to obtain a gate sequence representing a particular 1 qubit unitary matrix. +The gate set is represented by a discrete universal set, e.g. Clifford+T gates or $\{T,H\}$ gates. +A well known approach to solve the problem is to use Solovay-Kitaev (SK) algorithm. +I tried this implementation for SK algorithm. The resulting circuits are incredibly long ($l\sim 100-1000$ gates for the Fowler distance $\epsilon \sim 0.01$, tolerance error for the basic approximation $\epsilon\sim 0.03$). Moreover the basic approximation (building a KD-tree) can take quite long time (although this might be due to somewhat slow Python code).

+ +

On the other hand I wrote a very simple script that generates random sequences of gates and selects the best performing circuits. It works very fast and results in much shorter circuits with Fowler distances $\epsilon< 10^{-4}-10^{-5}$. This should be more than sufficient for any realistic applications.

+ +

So, at this point I don't quite understand, what is practical significance of Solovay-Kitaev algorithm in this case (for 1 qubit operations)?

+ +

Of course, the theoretical scaling of SK algorithm looks pretty good. The number of gates generated by SK algorithm to approximate any 1 qubit unitary grows as $l\sim\log^c(1/\delta)$, where $\delta$ is L2 approximation error. For random sampling there are no such guarantees. However on practice I'm not convinced that SK is very useful for 1 qubit case. +No doubts that in the case of large number of qubits random sampling will fail because of the curse of dimensionality. But it seems that SK algorithm also quickly becomes computationally unfeasible ($\#$ of qubits $\geq 4$?).

+",7896,,55,,7/3/2019 8:40,2/11/2021 13:42,Sampling random circuits vs Solovay-Kitaev compiler,,1,0,,,,CC BY-SA 4.0 +6632,1,,,6/29/2019 18:35,,3,122,"

The no-cloning theorem can be sharpened to give quantitative bounds on the fidelity with which an arbitrary quantum state can be copied. Is there a similar picture available for classical copying? This breaks down into two

+ +

Questions:

+ +
    +
  1. In classical physics, do there exist limitations on copying? For instance, I might speculate that it's possible to make copies of a classical state down to any desired resolution, but guess that some minimum amount of energy $E(n)$ is required to copy $n$ bits of information, and that $E(n)$ diverges as $n \to \infty$ (probably $E(n)$ is also dependent on other parameters such as temperature). Such a limit would presumably be closely related to Landauer's Principle.

  2. +
  3. An actual classical system is just an approximation of a quantum system. So it seems natural to speculate that there's some way to quantify ""how far a system is from being classical"", and bound the fidelity with which the system can copy information based on this measure. What is the key parameter here? Does it have to do with how big the Hilbert space for the ""environment"" is? Or with measures of decoherence?

  4. +
+ +

A guess:

+ +

Part of the problem is that I don't actually know how to formalize the notion of ""classical information"" in a quantum system. But here's a shot at something like (2). Define a classical copier to be an operator $H$ on a Hilbert space $V \otimes V$ such that $H(e_i \otimes v) = e_i \otimes e_i$ for some specified basis $e_i$ and $v$ in $V$. One operates $H$ by preparing the system so that the input is known to be collapsed to some $e_i \otimes v$ before applying $H$ (by measuring some $H'$). Then it seems like one would quantify the limits of $H$ as a copier in terms of how precisely the eigenbasis of $H$ actually lines up with the eigenbasis of $H'$ (since in practice it's impossible to make them match up perfectly) and then applying the usual quantitative version of the no-cloning theorem.

+",7716,,7716,,6/30/2019 16:42,7/2/2019 6:15,Classical and quantum limits to classical copying?,,1,0,0,,,CC BY-SA 4.0 +6633,1,,,6/29/2019 19:33,,3,27,"

Synchronous Interactions Between Quantum and Macroscopic Systems +Lester Ingber

+ +

This project calculates synchronous quantum systems and macroscopic systems with well-defined interactions. I would like information about any other similar projects that might guide this one.

+ +

This project was mapped out in several publications, recently in +L. Ingber, ``Quantum calcium-ion interactions with EEG,'' Sci 1 (7), 1-21 (2018). [ URL https://www.ingber.com/smni18_quantumCaEEG.pdf and https://doi.org/10.3390/sci1010020 ] +which was performed with the help of XSEDE.org supercomputer resources from Feb 2013 through Dec 2018. The Abstract is given below, and that Conclusion is the starting point of this project.

+ +

This project would use quantum computing in one or both contexts: +(a) to perform the optimization of the cost/objective function over the space of parameters defined by the SMNI model with EEG data as input. +(b) to propagate the Ca2+ wave function between EEG epochs in lock-step with the changing magnetic vector potential defined by highly synchronous neuronal firings.

+ +

Background: +Previous papers have developed a statistical mechanics of neocortical interactions (SMNI) fit to short-term memory and EEG data. Adaptive Simulated Annealing (ASA) has been developed to perform fits to such nonlinear stochastic systems. An N-dimensional path-integral algorithm for quantum systems, qPATHINT, has been developed from classical PATHINT. Both fold short-time propagators (distributions or wave functions) over long times. Previous papers applied qPATHINT to two systems, in neocortical interactions and financial options.

+ +

Objective: +In this paper the quantum path-integral for Calcium ions is used to derive a closed-form analytic solution at arbitrary time that is used to calculate interactions with classical-physics SMNI interactions among scales. Using fits of this SMNI model to EEG data, including these effects, will help determine if this is a reasonable approach.

+ +

Method: +Methods of mathematical-physics for optimization and for path integrals in classical and quantum spaces are used for this project. Studies using supercomputer resources tested various dimensions for their scaling limits. In this paper the quantum path-integral is used to derive a closed-form analytic solution at arbitrary time that is used to calculate interactions with classical-physics SMNI interactions among scales.

+ +

Results: +The mathematical-physics and computer parts of the study are successful, in that there is modest improvement of cost/objective functions used to fit EEG data using these models.

+ +

Conclusion: +This project points to directions for more detailed calculations using more EEG data and qPATHINT at each time slice to propagate quantum calcium waves, synchronized with PATHINT propagation of classical SMNI.

+ +

Thanks. +Lester Ingber +ingber@alumni.caltech.edu

+",4350,,,,,6/29/2019 19:33,Synchronous Interactions Between Quantum and Macroscopic Systems,,0,0,,,,CC BY-SA 4.0 +6634,1,6647,,6/30/2019 5:30,,4,641,"

I know this question has been answered here, but the answers leave some things confusing to me. When broken down (and used to calculate), the idea that the states are entangled doesn't seem to be right. I'm sure there is a mistake in my reasoning, but I'm not sure where. Here goes:

+ +

Say we take qubits in states $a|0\rangle + b|1\rangle$ and send them through a CNOT gate, which looks like this, the gate on the bottom being an XOR (that outputs 1 if the inputs are not the same binary value).

+ +

+ +

First, we use a fanout, which, according to other answers, leaves us with two qubits in state $a|00\rangle + b|11\rangle$. The set of three qubits, before two are passed through the XOR gate, can be expressed as $a|00\rangle\otimes|0\rangle + b|11\rangle\otimes|0\rangle$.

+ +

When we put this through the XOR gate, there is probability $a^2$ that the qubit will be $0$ which would result in an output of $0$. This means that exiting the gate, the probability amplitude of $|0\rangle$ is $a$. There is probability $b^2$ that the qubit will be $1$ so the probability amplitude of getting $|1\rangle$ as the second ouput is $b$. So our qubit is in state $a|0\rangle + b|1\rangle$, a clone of the original state. We now have two qubits in this state, as the first one comes out of the first output unchanged. As far as I can tell, they are not entangled.

+ +

Obviously, there is something wrong in this logic, I just don't know where. Could someone help me out?

+",7902,,7902,,6/30/2019 17:51,7/1/2019 6:41,Why can't a fanout be made with a CNOT gate?,,2,6,,,,CC BY-SA 4.0 +6635,1,6637,,6/30/2019 7:45,,3,220,"

It appears to me that a ccH, ccX and ccH sequence is exactly equivalent to a cH, ccX and cH gate sequence. Is there any quick way to see/verify this?

+",26,,,,,6/30/2019 11:47,"Is a ccH, ccX and ccH equivalent to a cH, ccX and cH sequence?",,2,0,,,,CC BY-SA 4.0 +6636,2,,6635,6/30/2019 11:31,,2,,"

There is a way to simplify it down slightly - for some controlled unitary $C\left(U\right)=I\oplus U$ and some arbitrary unitary $V$ (of the same dimension as $U$), $$\left(I\otimes V\right).C\left(U\right).\left(I\otimes V^\dagger\right) = \begin{pmatrix}V&0\\0&V\end{pmatrix}\begin{pmatrix}I&0\\0&U\end{pmatrix}\begin{pmatrix}V^\dagger&0\\0&V^\dagger\end{pmatrix} = C\left(VUV^\dagger\right),$$ so it's now clear that $\left[I\otimes C\left(H\right)\right].C\left(C\left(X\right)\right).\left[I\otimes C\left(H\right)\right] = C\left(C\left(H\right).C\left(X\right).C\left(H\right)\right)$.

+ +

Funnily enough, if instead of using $I\otimes V$ in the above and instead used $C\left(V\right)$, we'd find that $$C\left(V\right).C\left(U\right).C\left(V^\dagger\right) = \begin{pmatrix}I&0\\0&V\end{pmatrix}\begin{pmatrix}I&0\\0&U\end{pmatrix}\begin{pmatrix}I&0\\0&V^\dagger\end{pmatrix} = C\left(VUV^\dagger\right)$$ and so it's not just clear that \begin{align*}C\left(C\left(H\right)\right).C\left(C\left(X\right)\right).C\left(C\left(H\right)\right) &= C\left(C\left(H\right).C\left(X\right).C\left(H\right)\right) \\ &=\left[I\otimes C\left(H\right)\right].C\left(C\left(X\right)\right).\left[I\otimes C\left(H\right)\right]\end{align*} but the more general version $$\left(I\otimes V\right).C\left(U\right).\left(I\otimes V^\dagger\right) = C\left(V\right).C\left(U\right).C\left(V^\dagger\right)$$ is also true, for any unitaries $U$ and $V$

+ +
+ +

My use of brackets in the control operation is maybe slightly more unusual, but hopefully it makes it more obvious what the operation is

+",23,,,,,6/30/2019 11:31,,,,0,,,,CC BY-SA 4.0 +6637,2,,6635,6/30/2019 11:42,,4,,"

Start

+ +

+ +

No control equals each control $\forall U : U = C(U) \cdot \bar{C}(U)$

+ +

+ +

Opposite controls commute $\forall U, V : [C(U), \bar{C}(V)] = 0$

+ +

+ +

No control equals each control $\forall U : U = C(U) \cdot \bar{C}(U)$

+ +

+ +

Self-inverse operations self-cancel

+ +

+ +

Done

+ +

More generally, for any ""V conjugated by U"" operation of the form $U_a \cdot C_b(V_a) \cdot U_a^{-1}$, the $U$ operation can gain or lose any controls that $V$ has without changing the circuit's effect.

+",119,,119,,6/30/2019 11:47,6/30/2019 11:47,,,,0,,,,CC BY-SA 4.0 +6638,2,,6634,6/30/2019 13:10,,2,,"

I'm a little confused about which gates operate on which qubits and how, but following the linked question, I think I understand that you are wondering why, given a single qubit in the state in $a|0\rangle+b|1\rangle$ and preparing two qubits in a state $a|00\rangle+b|11\rangle$ does not qualify as cloning the first bit, especially because the probabilities of measuring $0$ and $1$ on the second bit is exactly the same as that of the first bit.

+ +

The important answer which must be stressed is that the second qubit is not so much a copy of the first qubit, as it is entangled with the first qubit - they are married together (in a non-classical way.)

+ +

It might be an oversimplification, but cloning is classical, entangling is quantum.

+ +

The best example of the difference between cloning and entangling that I can think of would be that Eve the eavesdropper can follow your scheme to entangle qubits sent in a BB84 channel between Alice and Bob, but she would not be able to deduce the secret key based on such entanglement, without getting noticed by Alice/Bob.

+",2927,,,,,6/30/2019 13:10,,,,0,,,,CC BY-SA 4.0 +6639,1,,,6/30/2019 15:11,,18,10543,"

I am a first-year undergraduate electrical engineering student. I want to study quantum computing and quantum AI in the future and also possibly work on building quantum computers.

+ +

I have finished Strang's Introduction to Linear Algebra twice and Axler's Linear Algebra Done Right. I have finished MIT OCW 6.041 Probability Course. I know Calculus 1, 2, and 3 and Differential Equations.

+ +

I have 2 questions:

+ +
    +
  1. Is my background sufficient for studying quantum computing?
  2. +
  3. Where should I start/which materials do you suggest?
  4. +
+",7904,,26,,10/14/2019 16:02,7/13/2022 22:23,Is my background sufficient to start quantum computing?,,11,9,,,,CC BY-SA 4.0 +6640,2,,6604,6/30/2019 15:34,,1,,"

It appears that you are asking for details about the following circuit from the paper of Cherkas and Chivilikhin, that they describe as implementing the addition of two $2$-bit numbers. Although they don't say it, I believe this is (mod 4).

+ +

+ +

The first application of $R_1$ is controlled on the basis of $a_1$, the second $R_2$ is controlled on the basis of $a_1$, and the third is controlled on $a_2$. When we say we apply $R_k$, we are applying either $R_1$ or $R_2$. Thus the angle of rotation is dependent on $k$.

+ +

It appears that the first number is $a=(a_1,a_2)$ having the most significant bit be $a_1$ and the least significant bit $a_2$, while the second number is similarly $b=(b_1,b_2)$. That is, I think you fourth question is correct, but I'm not sure if your third question is the right understanding.

+",2927,,,,,6/30/2019 15:34,,,,0,,,,CC BY-SA 4.0 +6641,1,,,6/30/2019 15:50,,2,98,"

This question requires the knowledge of GRAPE. More info can be found here and in this short presentation.

+ +

I have tried to modify the grape_unitary() function in grape.py also to accommodate open quantum systems. One can use it to generate time varying fields for synthesising unitaries for them. +I have tried to run it for the same system as in this jupyter notebook.

+ +
+

I have run into a problem as to some sets of collapse operators give spurious overlap values.

+
+ +

The code seems to work well for the closed system, though it is slower than the original jupyter notebook. +Here is the +code

+ +

fsa.py is the file analogous to grape.py. +tca.py is the example file (almost entirely based on this notebook ) where I run it for a closed quantum system (as in the aforementioned notebook). +otca.py, otca1.py and other otca*.py are files where I run them for various collapse operators. +tej_plotter.py is just a small python script file to save graphical representation of the final unitaries.

+ +
+

The explanation of the main idea is here. An updated version will be found here

+
+ +

\begin{array} {|r|r|}\hline file & output & collapse\ operator \\ \hline tca.py & copA0 & none \\ \hline otca.py & ocopA0 & x \otimes y \\ \hline otca1.py & o1copA0 & x \otimes y , y \otimes z \\ \hline otca2.py & o2copA0 & y \otimes z \\ \hline otca3.py & o3copA0 & z \otimes x \\ \hline otca4.py & o4copA0 & x \otimes y, z \otimes x \\ \hline otca5.py & o5copA0 & y \otimes z, z \otimes x \\ \hline otca6.py & o6copA0 & x \otimes y , y \otimes z, z \otimes x \\ \hline \end{array} +I have also raised this as an issue on the QuTiP page.

+ +

Could this be fixed by redefining (generalising) _overlap(A, B) function in grape.py ?

+",462,,26,,10/14/2019 16:08,10/14/2019 16:08,Modifying GRAPE for open quantum systems,,0,0,,,,CC BY-SA 4.0 +6642,2,,6639,6/30/2019 16:26,,1,,"

The more you know about math, programming, quantum physics, etc. the better, but this field is new for everyone involved. We are all constantly learning so I guess you should do OK. Having said that, I would recommend you to develop your programming skills (Python is widely used in this realm) and start reading the stuff provided online by companies that are developing quantum computers such as IBM, Rigetti and D-Wave. That will get you started. Good luck.

+",7804,,91,,6/30/2019 16:56,6/30/2019 16:56,,,,0,,,,CC BY-SA 4.0 +6643,1,,,6/30/2019 17:35,,1,127,"

This is related to this but a little different, so bear with me.

+ +

When is a fanout not violating the no-cloning theorem? It seems accepted that a fanout (or at least what seems to be one in my novice understanding of computing) can be used in certain instances despite this seemingly cloning the state, which I know is impossible. For example, in a CNOT gate, to use the XOR gate, which takes two inputs and outputs one, the top qubit must be duplicated. How is this possible?

+",7902,,7902,,6/30/2019 21:52,6/30/2019 21:52,When can a fanout be used without violating the no-cloning theorem?,,0,4,,,,CC BY-SA 4.0 +6644,2,,6639,6/30/2019 22:00,,3,,"

I would definitely say go for it. I have a lot less experience and math knowledge than you do, but I have been able to learn the basics. There is certainly some stuff that goes over my head, but I think you would be well prepared. The one area where you may need more study is logic and classical computer science. Having knowledge, even somewhat basic knowledge, here definitely helps. I started out with Chris Bernhardt's Quantum Computing for Everyone. This may be too simple for you, but it gave me a good entry point.

+ +

In the end, I think it's your interest and enthusiasm that matters most, so, if you're fascinated by the subject, pursue it!

+",7902,,,,,6/30/2019 22:00,,,,0,,,,CC BY-SA 4.0 +6645,2,,6639,6/30/2019 22:15,,16,,"

I am working on a textbook that is currently in Early Access called Learn Quantum Computing with Python and Q#. It is intended for folks who want to learn how to program for a quantum computer, and learn the basics of how a quantum computer works along the way. Only knowledge prerequisites are programming in some language (Python helps but not really required) and the basics of Linear Algebra (multiple matrices and vectors sort of stuff). My co-author @chris-granade and I would love feedback on what is currently out on the forums associated with the book, and there are discount codes floating around for conferences and podcasts and such, hmu on dm and I can find one for ya!

+",4211,,,,,6/30/2019 22:15,,,,3,,,,CC BY-SA 4.0 +6646,2,,6255,6/30/2019 23:35,,19,,"

Definitions

+ +

Denoting the Haar measure of some function $f\left(x\right)$ over $d$-dimensional unitaries as $\int_{\mathrm U\left(d\right)}f\left(x\right)d\mu\left(x\right)$, twirling some arbitrary channel $\varepsilon$ can be defined as the operation $\varepsilon \mapsto\int_{\mathrm U\left(d\right)}U^\dagger\varepsilon U dU$, which, when $\varepsilon$ is acting on some density matrix $\rho$ gives $$\rho\mapsto\int_{\mathrm{U}(d)} U^{\dagger} \varepsilon\left(U \rho U^{\dagger}\right) U d U.$$

+ +

While the above applies to intergrating over the $d$-dimensional unitary group, the same idea can be applied to (weighted) gatesets $\mathrm D_w$, consisting of elements of unitaries $U_i$ along with associated probabilities $p_i$ such that the weighted gate-set channel is $\mathcal U_{\mathrm D_w}:\rho\mapsto\sum_{U_i\in\mathrm D}p_iU_i\rho U_i^\dagger$. A special case of this are the unweighted gatesets $\mathrm D$ where $p_i = \frac{1}{\left|\mathrm D\right|}\,\forall\, i$. This allows us to define the Twirling operation over a gateset as the operation $\varepsilon\mapsto\sum_{U_i\in\mathrm D}p_iU^\dagger_i\varepsilon U_i$.

+ +

The Pauli twirling operation is then defined as $\varepsilon\mapsto\sum_{P_i\in\mathrm P_n}p_iP_i\varepsilon P_i$ where $\mathrm P_n$ is the Pauli group over $n$ qubits, while the Clifford twirl can either be defined as $\varepsilon\mapsto\sum_{U_i\in\mathrm C_n}p_iU^\dagger_i\varepsilon U_i$ or $\varepsilon\mapsto\sum_{U_i\in\mathrm C_1^{\otimes n}}p_iU^\dagger_i\varepsilon U_i$.1

+ +

Unitary Designs

+ +

There is a difference between what these two twirls do and it lies in the theory of unitary t-designs2: a set $\mathrm D_w$ is a $t$-design if and only if $$\sum_{U\in \mathrm D}\left(U^\dagger\right)^{\otimes t}\otimes \left(U^T\right)^{\otimes t} = \int_{\mathrm U\left(d\right)}\left(V^\dagger\right)^{\otimes t}\otimes \left(V^T\right)^{\otimes t}\,dV$$ and if $\mathrm D_w$ is a $t$-design, it's also a $\left(t-1\right)$-design for any positive integer $t$. This is equivalent to the statement that $$\sum_{U \in D}(U)^{\otimes t} \rho\left(U^{\dagger}\right)^{\otimes t}=\int_{U(d)}(V)^{\otimes t} \rho\left(V^{\dagger}\right)^{\otimes t} d V,$$ which gives the $t^{th}$ statistical moment of $\rho$.

+ +

Using Schur's Lemma

+ +

For a pure state (density matrix) in 2 dimensions $\rho$, $\int_{\mathrm U\left(d\right)} V\rho V^\dagger\,dV = \frac{1}{2}I$ and so, this fully depolarises (i.e. maximally mixes) the state and as the single qubit Pauli twirl is also the depolarisation channel, the Pauli group is a $1$-design. However, by Schur's lemma, it's not a $2$-design. In other words, as explained in section IIA of Gross, Audenaert and Eisert, twirling essentially writes the state in terms of a sum of irreducible subspaces, which, for a 2D 2-design, are the symmetric $\frac{1}{2}\left(I+SWAP\right)$ and antisymmetric $\frac{1}{2}\left(I-SWAP\right)$ subspaces and this is not what the Pauli twirl does. However, it is what the Clifford twirl does. Furthermore, as shown both here and here, the Clifford group forms a 3-design.

+ +

Randomised Benchmarking

+ +

This is useful and even relatively important from a quantum computing perspective when it comes to benchmarking - it turns out that local random circuits are approximate designs and can be created in polynomial time

+ +

Vectorisation

+ +

This all relates to the papers linked in the question by the process of vectorisation and the property that $|A B C\rangle \rangle=A \otimes C^T|B\rangle \rangle$, which when $\varepsilon$ is written as a sum of Krauss operators gives $$\int_{\mathrm{U}(d)} U^{\dagger} \varepsilon\left(U \rho U^{\dagger}\right) U d U \mapsto\sum_{K} \int_{U(d)}\left(U^{\dagger} \otimes U^T\right) \cdot\left(K \otimes K^{*}\right) \cdot\left(U \otimes U^{*}\right)|\rho\rangle \rangle d U.$$

+ +

If we then go a step further and start with a random state, we can effectively integrate over $\rho$ and repeat the vectorisation process to give $$\int_{\mathrm{U}(d)} U^{\dagger} \varepsilon\left(U \rho U^{\dagger}\right) U d U \mapsto\int_{U(d)} U^{\dagger} \otimes U^T \otimes U^T \otimes U^{\dagger} d U \sum_{K}\left|K \otimes K^* \right\rangle \rangle$$ and we now have something that looks more like a 2-design.

+ +

Overall, we've gone from twirling over some channel to an operation that looks something similar to 2-design acting on the vectorisation of the Krauss operator form of that channel and finally...

+ +

The difference between Pauli and Clifford Twirls

+ +

Rewriting $K = \sum_j|u_j^{\left(K\right)}\rangle\langle v_j^{\left(K\right)}|$ gives $K\otimes K^* = \sum_{j, l}|u_j^{\left(K\right)}\rangle|u_l^{*\left(K\right)}\rangle\langle v_j^{\left(K\right)}|\langle v_l^{*\left(K\right)}|$ and so $|K\otimes K^*\rangle\rangle = \sum_{j, l}| v_j^{\left(K\right)}\rangle| v_l^{*\left(K\right)}\rangle|u_j^{\left(K\right)}\rangle|u_l^{*\left(K\right)}\rangle$

+ +

From what's above, the Clifford twirl then permutes this to get $\sum_{j, l}|u_l^{*\left(K\right)}\rangle| v_j^{\left(K\right)}\rangle| v_l^{*\left(K\right)}\rangle|u_j^{\left(K\right)}\rangle$, sums the projections onto the symmetric and anti-symmetric subspaces and unpermutes again. Overall, information about the second statistical moment of the noise channel can be learned from repeated measurements.

+ +

By comparison, the Pauli twirl generally doesn't do this. It does, in the case of a single qubit, at least give the diagonal elements of the Process matrix, as per the paper they refer to, which happens to be the parameters they're looking for.

+ +
+ +

1 I'm not sure off the top of my head if there's a diffrerence between $\mathrm C_n$ and $\mathrm C_1^{\otimes n}$, although it seems clear that $\mathrm C_1^{\otimes n}\subset\mathrm C_n$

+ +

2 Also known as unitary k-designs

+",23,,23,,7/1/2019 7:20,7/1/2019 7:20,,,,1,,,,CC BY-SA 4.0 +6647,2,,6634,7/1/2019 6:41,,2,,"

I think you agree that if you start with the state $(a|0\rangle+b|1\rangle)|0\rangle$, the cnot produces $a|00\rangle+b|11\rangle$. The issue is why is the state of the first qubit not the same as $a|0\rangle+b|1\rangle$.

+ +

The answer is if you only look at that one qubit and you only look in the standard, $Z$ basis, then they do look the same. But those are two very restrictive assumptions.

+ +

For example, if I look at the qubit in the $|\pm\rangle=(|0\rangle\pm|1\rangle)/\sqrt{2}$ basis, then the original state is +$$ +\frac{a+b}{\sqrt{2}}|+\rangle+\frac{a-b}{\sqrt{2}}|-\rangle, +$$ +so we get the answer $|+\rangle$ with probability $\frac12|a+b|^2$. Meanwhile, our entangled state can be written as +$$ +\frac{1}{\sqrt{2}}|+\rangle(a|0\rangle+b|1\rangle)+\frac{1}{\sqrt{2}}|-\rangle(a|0\rangle-b|1\rangle), +$$ +so we get the answer $|+\rangle$ on the first qubit with probability 1/2. They are different.

+ +

Similarly, if you look at two qubits, let's return to the standard, $Z$ basis. For two copies of the original state, the probability of finding them both in $|0\rangle$ should be $|a|^4$, while for the entangled state it's just $|a|^2$. Again, they're different.

+",1837,,,,,7/1/2019 6:41,,,,0,,,,CC BY-SA 4.0 +6648,2,,6632,7/1/2019 6:53,,2,,"

You seem to be mixing two very different concepts here. Quantum cloning is talking about the absolute limits of what is theoretically possible in a perfect world. In this absolute theoretical limit, yes we can derive how well quantum cloning can work, and we also know that classical cloning is nominally perfect.

+ +

There is then a separate question of how well you can clone once you add in realistic sources of imperfection. Things like imperfect alignment of bases, decoherence .... These are certainly things you could incorporate into a quantum description, although I'm not aware of whether anyone ever has. And you could take it further and look at the classical limit of that. However, once you hit the actual classical limit, remember that there essentially is a ""preferred"" basis. You don't run into issues of misalignment because there only is one basis. And because you've implicitly got cloning built in, you've got many, many copies of data, rendering error correction incredibly effective, so decoherence is almost a non-issue as well. After all, if you copy a file one your computer, you get an exact copy, don't you?

+ +

Yes, there are limits. The higher density try and store and manipulate data, the closer to single information carrying entities you get (e.g. small number of photons in a fibre optic cable), and you're closer to using quantum things. But that's just because we're greedy. You don't have to approach those limits, and we can choose to do things supremely robustly.

+ +

I would also say that Landauer's principle is a bit misleading. It says that if you're performing an irreversible operation, and if you do it at a particular temperature, that has certain implications. However, computations don't need to be done irreversibly. They can be done reversibly, and then you're operating outside the regime that Landauer's principle can talk about.

+",1837,,1837,,7/2/2019 6:15,7/2/2019 6:15,,,,2,,,,CC BY-SA 4.0 +6649,1,,,7/1/2019 8:00,,3,162,"

What is the difference between entangled states and separable states or electron spin-singlets?

+",7361,,55,,7/3/2019 8:41,7/3/2019 8:41,What is the difference between entangled and separable states or electron spin-singlets?,,1,2,,,,CC BY-SA 4.0 +6650,2,,6639,7/1/2019 8:10,,-1,,"

Yes. We need to have an aptitude for the subject to learn. Seems, you have a keen desire to learn quantum physics based computing.

+ +

The future of the computing technology is quantum, the digital computing will be a past and will be known as dumb technology of 0's and 1's very soon.

+ +

Your interest for quantum computing is more than enough to go deep into the subject.

+ +

Go through the latest journals and research work on quantum computings. Nonetheless, the Springer publication books are also good for a self study. We could get a lot of other references too in these books.

+ +

Free previews of the few books are available online:

+ + +",7913,,26,,10/14/2019 16:05,10/14/2019 16:05,,,,4,,,,CC BY-SA 4.0 +6651,2,,6649,7/1/2019 8:30,,2,,"

There could be a few things going on here. However, I think the fundamental issue is the tensor product that you write in the second expression. It implies an issue of identification. Your second expression is effectively saying:

+ +
    +
  • there are two different positions at which I can create a fermion. Call them P1 and P2.

  • +
  • create a spin-up at P1 and a spin down at P2.

  • +
+ +

This is quite a different thing from ""there are two spins, one up and one down, but I cannot distinguish which is which"", corresponding to your first expression.

+ +

This may need some further elaboration, but I don't want to overcomplicate it at this point, and I'll be guided by comments.

+ +
+ +

If you want to write B using A's description, you need to have terms that look like both $a^\dagger_{\uparrow}a^\dagger_{\downarrow}$ and $a^\dagger_{\downarrow}a^\dagger_{\uparrow}$ because you don't know which is which (that's a very vague hand-wavy description). Now, since electrons are fermions, they are antisymmetric. That shows how we have to combine those two terms: +$$ +(a^\dagger_{\uparrow}a^\dagger_{\downarrow}-a^\dagger_{\downarrow}a^\dagger_{\uparrow})|0\rangle\otimes|0\rangle. +$$ +Hopefully you can now see how that matches with the B description.

+",1837,,1837,,7/1/2019 14:26,7/1/2019 14:26,,,,1,,,,CC BY-SA 4.0 +6653,2,,6639,7/1/2019 17:44,,1,,"

I think it would be best if you start reading Mike and Ike. Buy the hard copy. Go through the exercises. This would be sufficient to read the papers. The further reading section would provide starting points from where it would be suitable to enter the literature.

+ +

For the programming aspects best place to start is Qutip

+",462,,,,,7/1/2019 17:44,,,,0,,,,CC BY-SA 4.0 +6654,2,,6639,7/1/2019 19:19,,0,,"

I would also recommend looking up Jack Hidary's new book ""Quantum Computing: An Applied Approach"" which provides a very hands-on approach for learning the basics (and more).

+",7864,,,,,7/1/2019 19:19,,,,0,,,,CC BY-SA 4.0 +6655,1,,,7/1/2019 19:48,,5,1392,"

It is very confusing how the CNOT gate can change the properties of the controlled qubit (possibly because I am still stuck in the classical programming mindset): +

+ +

Many books have explained the phenomenon using a $4\times 4$ matrix multiplication and tensor products to show how this happens. However, the math doesn't seem to agree because if I don't do the tensor product of the two qubits and instead just do the math separately by applying $2\times 2$ matrices to the top and bottom qubit based on what is happening and then tensor the two together in the end, the two methods don't agree.

+ +

Here is (what is in my mind) a simple example to show the mathematical error:

+ +

As we can see from the bottom qubit. The $X$ in the very beginning obviously transforms the $|0\rangle$ to a $|1\rangle$. The controlled dot doesn't do anything: it merely observes the bottom qubit in order to decide whether to apply the $X$ gate onto the top qubit. Thus, it does nothing to the bottom qubit. As everyone knows, all functions of quantum computing are inverses of each other. Hence, the 2 H gates cancel out. It thus makes no sense to me how the bottom qubit can be 100% off all the time when it should logically be ""On"" (and if we do out the matrices it will work out as such).

+ +

Thank you so much for your help and I apologize if this question is basic.

+",7903,,2927,,7/1/2019 20:57,7/2/2019 8:23,How can a CNOT gate change the control qbit (e.g. in the Deutsch Oracle problem)?,,3,1,,,,CC BY-SA 4.0 +6656,2,,6598,7/1/2019 21:36,,1,,"

In essence you are asking could it be more efficient to use non-uniform distribution (instead of uniform) to pick numbers $r_i$ from $[0,S]$ for testing. Quantum circuit here just encodes the distribution, essentially it has no other use.

+ +

Well, it depends on how we model our probability space for all polynomials. In some models it could be better to pick numbers closer to 0, in some others it's better to pick uniformly and in some models it's better to use some specific distribution.

+ +

And this is really hard task to correctly define probability space for all polynomials (that will be ""uniform"" in some sense). Note that it's even impossible to define uniform distribution over real line compatible with standard Kolmogorov axioms of probability.

+",5870,,5870,,7/1/2019 21:49,7/1/2019 21:49,,,,1,,,,CC BY-SA 4.0 +6657,1,,,7/1/2019 21:49,,2,57,"

As outlined in Quantum Computing Progress and Prospects published this year, on page 169-171 there is the diagram showing that we are at the 10's of qubits mark. Looking into the diagram further there is the statement prior that states ,

+ +
+

The first benchmark machine is the class of digital (gate-based) + quantum computers containing around $2^{4}$ qubits with average gate + error rate better than 5 percent, which first became available in + 2017.

+
+ +

However, when I look at Quantum Computing Report I find that there are a couple of companies past the 50+ qubit count to get to the next point. Is the report already outdated, or am I missing something?

+",7867,,,,,7/1/2019 21:49,I thought we had already passed this error and qubit threshold?,,0,0,,,,CC BY-SA 4.0 +6658,2,,6639,7/2/2019 0:27,,2,,"

Understanding the basic theory of quantum computing should be within reach. If you understand linear algebra, then math will not be your stumbling block. Quantum mechanics shouldn't be either — while you do need to exploit some of its machinery, you do not need a deep understanding to get started. Most introductory QC resources will build up the essential ideas of superposition, measurement, unitary operators, and the concept of entanglement.

+ +

Engineering quantum computers is another story. If you want to do that then you will need to know much more about quantum mechanics proper. But the basic theory of quantum computing should still come first.

+ +

If you're getting started, you should check out the on brilliant.org (brilliant.org/courses/quantum-computing, the first chapter is free). Full disclosure, I co-wrote this course out of frustration with the state of available QC learning options. It takes you from learning what a qubit is up to present-day realizations of quantum computing (hybrid classical/quantum approaches like VQE).

+ +

Along the way, you investigate quantum gates, build basic quantum information processing circuits (e.g. teleportation and superdense coding), see clear examples of quantum speedups, and understand the major classes of quantum algorithms. You learn the math, but it also has simulated quantum computer embedded in the course, so you can internalize what's going on. You'll also learn how to program quantum algorithms in Microsoft's Q# language and use it to build out a basic application in quantum chemistry.

+",7923,,,,,7/2/2019 0:27,,,,0,,,,CC BY-SA 4.0 +6659,2,,6655,7/2/2019 2:44,,3,,"
+

As everyone knows, all functions of quantum computing are inverses of + each other. Hence, the 2 H gates cancel out.

+
+ +

Quantum gates all have inverses, but the inverse of a gate is not necessarily the same gate, though Hadamard gates, which are the ones being most considered here, are their own inverse. I'm not sure if by ""2 H gates"" you mean the two gates before the CNOT in the smaller diagram, which are on different qubits, or the two $H^{\otimes 2}$ gates flanking the CNOT in the larger diagram. In the former case, there's no cancellation since they are on different qubits. In the other case, they don't cancel because there is the CNOT between them and matrix multiplication is non-commutative: since $AB \neq BA$ is possible, you can't conclude $A^{-1}BA = A^{-1}AB = B$, and thus the two sets of Hadamards don't cancel out.

+ +

Now that we know that they don't just cancel out, you can derive that a CNOT with $H^{\otimes 2}$ flankings actually together make another CNOT with swapped control and target qubits. First, here is the conceptually simple but really tedious matrix multiplication of that:

+ +

$$\frac{1}{4}\begin{bmatrix}1 & 1 & 1 & 1 \\ 1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & -1 & -1 & 1 \end{bmatrix} \begin{bmatrix}1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0\end{bmatrix} \begin{bmatrix}1 & 1 & 1 & 1 \\ 1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & -1 & -1 & 1 \end{bmatrix} = \frac{1}{4}\begin{bmatrix}1 & 1 & 1 & 1 \\ 1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & -1 & -1 & 1 \end{bmatrix} \begin{bmatrix}1 & 1 & 1 & 1 \\ 1 & -1 & 1 & -1 \\ 1 & -1 & -1 & 1 \\ 1 & 1 & -1 & -1\end{bmatrix} = \begin{bmatrix}1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0\end{bmatrix}$$.

+ +

With $a\left|00\right> + b\left|01\right> + c\left|10\right> + d\left|11\right> = \begin{bmatrix} a \\ b \\ c \\ d \end{bmatrix}$, we see the original in the flank swaps the probability amplitudes of $\left|10\right>$ and $\left|11\right>$ (left qubit is control), while the new one swaps the amplitudes of $\left|01\right>$ and $\left|11\right>$ (right qubit is control).

+ +

A harder but interesting and less tedious way to recognize this is through the symmetry of the controlled-$Z$ gate, as described in page 5 of https://arxiv.org/pdf/1110.2998.pdf. A controlled-$Z$ gate's control and target qubits are indistinguishable since the only probability amplitude in computational basis that changes is the sign flip of the probability amplitude of $\left|11\right>$. However, if one of the qubits in the controlled-$Z$ has Hadamards flanking it, they together are a CNOT with the Hadamard-flanked qubit being the target. Add the $H^{\otimes 2}$ on both sides to this CNOT and you have the ""control"" qubit of the controlled-$Z$ gate with a Hadamard behind and in front of it, and the ""target"" qubit with two on each side. The two Hadamards on each side for that qubit cancel out since there is nothing between them, so it ends up with a controlled-$Z$ with Hadamards behind and in front of what we previously noted as the control, but, since a controlled-$Z$ doesn't distinguish control and target, that is instead the target of a CNOT due to the Hadamards, and we have the switch.

+",7680,,,,,7/2/2019 2:44,,,,0,,,,CC BY-SA 4.0 +6660,2,,6655,7/2/2019 4:23,,6,,"
+

The controlled dot doesn't do anything: it merely observes the bottom qubit in order to decide whether to apply the 𝑋 gate onto the top qubit.

+
+ +

In the answer below, the qubit that appears first is the control qubit, it maps to the bottom qubit in your diagram, and the second one is the target qubit.

+ +
    +
  • The CNOT gate works on two qubits at once. You can't think of it's operation separately on the first and second qubit, and you can't do the math using two separate $2*2$ matrices.
  • +
  • The definition of what CNOT does to a basis is this: +$$CNOT(|00\rangle) = |00\rangle$$ +$$CNOT(|01\rangle) = |01\rangle$$ +$$CNOT(|10\rangle) = |11\rangle$$ +$$CNOT(|11\rangle) = |10\rangle$$
  • +
+ +

Sure, when you look at the definition of the basis, it seems like CNOT doesn't do anything to the first qubit, and only observes the first and flips the second if necessary. But consider applying CNOT on a non-basis state:

+ +

$$CNOT(|+\rangle |0\rangle)$$ +$$=CNOT \left(\frac{|0\rangle + |1\rangle}{\sqrt 2}|0\rangle \right)$$ +$$=CNOT \left(\frac{|00\rangle}{\sqrt 2} + \frac{|10\rangle}{\sqrt 2}\right)$$ +Now, exploiting the linear property of quantum gates, we have +$$= \frac{|00\rangle + |11\rangle}{\sqrt 2}$$

+ +

Notice that the first qubit is not in the $|+\rangle$ state anymore, even though it was the qubit just being observed. It in fact does not have any pure representation. It has gotten entangled with the second qubit.

+ +

So CNOT does infact effect the control qubit in the sense that it ties it up with outcomes of the target qubit.

+ +
    +
  • Now, in your first example
  • +
+ +

After applying $X$ on both qubits, you have $|11\rangle$.

+ +

After applying $H$ on both qubits you have $|--\rangle$, or $\frac{|00\rangle - |01\rangle - |10\rangle + |11\rangle}{\sqrt 2}$.

+ +

After applying the CNOT on this qubit set, you have + $\frac{|00\rangle - |01\rangle - |11\rangle + |10\rangle}{\sqrt 2}$ which you can factorise as $|+-\rangle$

+ +

And now applying the two $H$'s, you have $|01\rangle$. +Hence the bottom qubit is 'off' and the top qubit is 'on'.

+",2832,,,,,7/2/2019 4:23,,,,0,,,,CC BY-SA 4.0 +6661,2,,6655,7/2/2019 8:23,,2,,"

I am not sure what the second question is about, but in the first one you are probably inquiring about the concept of ""phase kickback"":

+ +

Why does the "Phase Kickback" mechanism work in the Quantum phase estimation algorithm?

+",332,,,,,7/2/2019 8:23,,,,0,,,,CC BY-SA 4.0 +6662,1,,,7/2/2019 9:32,,1,2616,"

I have an error when I use Quantum SVM kernel algorithm from Qiskit aqua.

+ +

This is my code section with imports:

+ +
from datasets import *
+import numpy as np
+from qiskit_aqua.utils import split_dataset_to_data_and_labels
+from qiskit_aqua.input import svminput
+from qiskit_aqua import run_algorithm
+from qiskit_aqua.utils import split_dataset_to_data_and_labels
+
+ +

And here is the error I obtain:

+ +
ModuleNotFoundError: No module named 'qiskit_aqua'
+
+",7877,,55,,4/9/2021 9:00,2/11/2022 9:35,import error :No module named 'qiskit_aqua',,2,2,,,,CC BY-SA 4.0 +6663,2,,6662,7/2/2019 9:39,,3,,"

If your using the latest qiskit version then it is qiskit.aqua

+",332,,,,,7/2/2019 9:39,,,,1,,,,CC BY-SA 4.0 +6664,1,,,7/2/2019 10:39,,1,166,"

I have an error when I use Quantum SVM kernel algorithm from Qiskit aqua.

+ +

This is my code section with imports:

+ +
from qiskit.qobj import (QasmQobj, QobjExperimentHeader,
+                         QasmQobjInstruction, QasmQobjExperimentConfig, QasmQobjExperiment,
+                         QasmQobjConfig)
+
+ +

And here is the error I obtain:

+ +
ImportError: cannot import name 'QasmQobj' from 'qiskit.qobj' 
+
+",7877,,23,,7/2/2019 13:24,11/29/2019 14:02,Qiskit Aqua cannot import 'QasmQobj',,1,4,0,,,CC BY-SA 4.0 +6667,2,,6664,7/2/2019 12:36,,1,,"

With the information you provided in your question, I recommand you to try to reinstall qiskit from scratch.

+ +

To do so, just execute

+ +
python -m pip install -U qiskit
+
+ +

I tried to execute your import statements after running this line, and it worked.

+ +

If you do not use the default python, replace python with the python executable you are using (e.g. python3). If you are on linux, which python will show you the executable hidden behind the python command.

+ +

If your problem is still here, please provide the output of the following commands (should always be provided in questions related to issues with python libraries):

+ +
python -V
+python -m pip list
+
+",1386,,,,,7/2/2019 12:36,,,,11,,,,CC BY-SA 4.0 +6668,1,,,7/2/2019 15:11,,1,154,"

I was fiddling with the quantum circuit used for Deutsch's algorithm and I was led to a zero state as a result which is bizarre. I don't know how to explain this result.

+ +

***I'm using Nielsen and Chuang to study QC

+",7943,,2879,,7/2/2019 21:36,7/2/2019 21:36,What does a zero state combined state vector for 2 qubits mean?,,1,1,,,,CC BY-SA 4.0 +6669,1,,,7/2/2019 15:22,,1,81,"

Can the marked qubit be associated only with half of the register? I mean if I can ask the oracle if the $2$ low qubits from a $4$ qubit register have a certain value.

+ +

I ask this to know if I can bit-append for example names and telephones into one register, so I can entangle the marked qubit with CNOT gates only with one half of register qubits which are the telephones, so when I seek a telephone the oracle amplifies the state associated with the qubit marked.

+ +

There will be $N\times N$ states in the register initialized all to $0$ except the $N$ that are name-telephone equally with HADAMARD to get $1$ on the states' sumatory module.

+",7933,,2879,,7/2/2019 17:50,7/2/2019 18:49,Entangling marked qubit with part of the register in Grover's search,,1,2,,,,CC BY-SA 4.0 +6670,2,,6668,7/2/2019 17:42,,1,,"

The terms of expression do not cancel out in the balanced function case.

+ +

We start with

+ +

$$\frac{1}{2} (|0\rangle|0 \oplus f(0)\rangle - |0\rangle|1 \oplus f(0)\rangle + |1\rangle|0 \oplus f(1)\rangle - |1\rangle|1 \oplus f(1)\rangle)$$

+ +

If $f(0) \neq f(1)$, consider the first two terms (the only ones which can cancel with each other, since the state of the first qubit is $|0\rangle$): the state of the second qubit in them is $|0 \oplus f(0)\rangle$ and $|1 \oplus f(0)\rangle$, which are different states no matter what the value of $f(0)$ is.

+ +

It will be helpful for you to consider the cases for $f(x) = x$ and $f(x) = 1-x$ separately to convince yourself that the cancellation doesn't happen.

+",2879,,,,,7/2/2019 17:42,,,,0,,,,CC BY-SA 4.0 +6671,2,,6669,7/2/2019 18:49,,1,,"

On one hand, the oracle can use an arbitrary subset of the register qubits to decide whether it marks the state as the solution to the encoded problem. For example, if you're looking for any 4-qubit state with the first 2 qubits in state $|11\rangle$, you can do a CCNOT with those qubits as controls and the marked qubit as target to implement this condition - you're not required to use the last 2 qubits.

+ +

However, if you do nothing else in the oracle, you'll get an arbitrary answer that will fit the criteria; following the example from the previous paragraph, you'll get a random state of the form $|11??\rangle$. You probably want instead to have a mapping of the first pair of qubits to the second one, so that you'd get not only the key $|11\rangle$, but also the specific value that corresponds to it. In this case you'll need to encode it somehow, which will be reflected in the oracle and will ultimately entangle all register qubits with the marked qubit. Any qubits that are not entangled with the marked qubit have a chance to end up in a random state.

+",2879,,,,,7/2/2019 18:49,,,,2,,,,CC BY-SA 4.0 +6672,1,,,7/2/2019 21:02,,4,239,"

I'm trying to run a program in the Qiskit Notebook on the IBMQ Experience. I need to import some .py files that I've done in order to run my main program but the notebook won't accept .py files. I've tried uploading them (doesn't work, it loads forever) and also tried to write a .ipynb file and then change the name to .py but then the file disappeared.

+",7945,,,,,7/3/2019 17:24,How to upload .py file to new online Qiskit Notebook,,1,0,,,,CC BY-SA 4.0 +6673,2,,6611,7/3/2019 3:01,,3,,"

Doing a 5 to 2-qubit reduction is a little tedious, but we can illustrate how it works with a simpler example.

+

Let's take a 3-qubit state $\lvert\psi_{ABC}\rangle$ and boil it down to $\lvert\psi_{BC}\rangle$, say

+

$$\lvert\psi_{ABC}\rangle = \alpha\lvert 001\rangle + \beta\lvert 101\rangle + \gamma\lvert 011\rangle.$$

+

First of all, the density operator for the state $\lvert\psi_{ABC}\rangle$ is given by

+

$$\begin{align} +\rho_{ABC} &= \lvert\psi_{ABC}\rangle\langle\psi_{ABC}\rvert \\ +&= \left(\alpha\lvert 001\rangle + \beta\lvert 101\rangle + \gamma\lvert 011\rangle\right)\otimes\left(\alpha^*\langle 001\rvert + \beta^*\langle 101\rvert + \gamma^*\langle 011\rvert\right) +\end{align}$$

+

Expanding this out, we get +$$ +\begin{align} +\rho_{ABC} &= \alpha^*\alpha \lvert 001\rangle\langle 001\rvert + \beta^*\alpha \lvert 001\rangle\langle 101\rvert + \gamma^*\alpha \lvert 001\rangle\langle 011\rvert \\ +&+\alpha^*\beta \lvert 101\rangle\langle 001\rvert + \beta^*\beta \lvert 101\rangle\langle 101\rvert + \gamma^*\beta \lvert 101\rangle\langle 011\rvert \\ +&+\alpha^*\gamma \lvert 011\rangle\langle 001\rvert + \beta^*\gamma \lvert 011\rangle\langle 101\rvert + \gamma^*\gamma \lvert 011\rangle\langle 011\rvert +\end{align} +$$

+

The idea of the reduced density operator is to trace over the particles that you don't care about. For example, to find $\rho_{BC}$, we would trace over particle A:

+

$$\rho_{BC} = \text{Tr}_{A}\left(\rho_{ABC}\right)$$

+

Before we write out the whole thing, in symbols the trace over $A$ is:

+

$$\text{Tr}_{A}\left(\rho_{ABC}\right) = \langle 0_A\rvert\rho_{ABC}\lvert 0_A\rangle + \langle 1_A\rvert\rho_{ABC}\lvert 1_A\rangle.$$

+

Taking the trace will eliminate all terms where particle $A$ is not in the same state in the bra and ket. For example, the term $\beta\alpha^*\lvert101\rangle\langle001\rvert$ will disappear.

+

Carrying out the process, the terms that survive in the reduced density operator are

+

$$\begin{align} +\rho_{BC} &= \alpha^*\alpha \lvert 01\rangle\langle 01\rvert + +\gamma^*\alpha \lvert 01\rangle\langle 11\rvert \\ +&+ +\beta^*\beta \lvert 01\rangle\langle 01\rvert + +\alpha^*\gamma \lvert 11\rangle\langle 01\rvert \\ +&+ +\gamma^*\gamma \lvert 11\rangle\langle 11\rvert +\end{align}$$

+

If you want to further reduce to the $\rho_B$ density operator, then just trace over $C$, i.e.

+

$$\begin{align} +\rho_B &= \text{Tr}_C \left(\rho_{BC}\right) \\ +&= \langle 0_C\lvert\rho_{BC}\rvert 0_C\rangle + \langle 1_C\lvert\rho_{BC}\rvert 1_C\rangle +\end{align}$$

+

In this case, all of the terms survive and the resulting density operator is

+

$$ +\begin{align} +\rho_B &= \left(\alpha^*\alpha + \beta^*\beta\right)\lvert0\rangle\langle0\rvert + \gamma^*\gamma\lvert 1\rangle\langle 1\rvert \\ +& \gamma^*\alpha\lvert 0\rangle\langle 1\rvert+ \alpha^*\gamma\lvert 1\rangle\langle 0\rvert +\end{align} +$$

+
+

(If we were being strict with notation, then we should really write $\lvert 1_A\rangle$ as $\lvert 1\rangle\otimes I^{\otimes 2}$ where $I^{\otimes 2}$ is the identity operator on the $BC$ subspace. But we'll understand that when we write something like $\langle 1_A\rvert001\rangle$ it really means $\left(\langle 1_A\rvert 0_A\rangle\right)\otimes\lvert 01\rangle = \lvert 01\rangle$. Similarly, $\langle 001\rvert 1_A\rangle = \left(\langle 0_A\rvert 1_A\rangle\right)\langle01\rvert = 0$.)

+",7923,,14239,,5/20/2022 20:23,5/20/2022 20:23,,,,0,,,,CC BY-SA 4.0 +6674,2,,6631,7/3/2019 11:29,,8,,"

The Solovay-Kitaev algorithm is not practical. It is very useful theoretically because it proves that once you have a ""dense"" set of quantum gates (i.e. a set with which you can approximate any other quantum gate) you can approximate up to an arbitrary precision and quickly any quantum gate.

+ +

In practice, the Solovay-Kitaev works as follow:

+ +
    +
  1. Fill the space of implementable quantum gates as much as possible. This is performed by creating quantum circuits with the gate-set considered and storing them in memory alongside the unitary evolution they implement. The goal of this step is to fill the space of implementable quantum gates such as, for any unitary matrix, there is a entry in the set at distance at most $\epsilon_0$.
  2. +
  3. Recurse as explained in this article and when reaching the end of the recursion, find a circuit (pre-computed in step 1) that approximates sufficiently well the current unitary.
  4. +
+ +

Some obervations:

+ +
    +
  • Point 1 only need to be done once for each circuit arity. Once you finished point 1 for $k$-qubit gates, you can just save the result on a hard-drive and reload it for the next approximation.
  • +
  • Point 1 is VERY GREEDY in computational resources. A quantum gate on $n$ qubits can be represented as a matrix in $SU(2^n)$, which is a space of dimension $2^{2n} - 1$. Filling uniformly a space with such a dimension requires a HUGE number of points (i.e. a huge number of quantum circuits).
  • +
  • In order to perform point 2, one of the most efficient method (asymptotically-speaking) is to use nearest-neighbour algorithms. There exist a lot of algorithms (the most used being probably the KD-tree approach), and some of them are designed for high-dimensional data (see this answer or this one).

    + +

    But still, your search space (the circuits generated in point 1) ""suffer from the curse of dimensionality"" in the sense that its size grows really fast when the dimension increase. Even if you can search for a nearest-neighbour in $O(n\ln(n))$, the $n$ is incredibly large here.

  • +
  • During the recursion, a matrix decomposition needs to be performed. An efficient algorithm for the decomposition has been devised in this article for $1$-qubit gates (i.e. $SU(2)$ matrices), but no efficient implementation exist for gates on $2$ or more qubits: you end up diagonalising the unitary matrix you want to implement, which become quite costly when the unitary matrix becomes large.

  • +
+ +

To sum up:

+ +
    +
  1. The Solovay-Kitaev algorithm has only a very little practical application for $1$-qubit gates, nearly no practical application for $2$-qubit gates and clearly no practical application for $3$-qubit gates and above.
  2. +
  3. Randomised approach can work way better and have a better scaling with respect to the number of qubits. You can also have a look at the Group Leader Optimisation Algorithm -- GLOA if you want to dig in this direction.
  4. +
  5. The theoretical scaling of SK is very good with respect to precision, but exponential with respect to the size of the gate.
  6. +
  7. In the case of large number of qubit, SK will fail or take days whereas the randomised approach might give you a decomposition with a low precision in seconds or minutes. As a side note, the randomised approach is trivial to parallelise, SK is not so easy (nearest-neighbour algorithms are hard to parallelise efficiently).
  8. +
+",1386,,,,,7/3/2019 11:29,,,,3,,,,CC BY-SA 4.0 +6675,2,,6672,7/3/2019 17:24,,1,,"

The file editor only uploads, downloads and displays .ipynb files. However, you can create additional files using notebooks. To see that they are there, you can use the sys package.

+ +

You won't be able to import from local .py files, but you can open them as a text file and do something like eval their contents as a workaround.

+",409,,,,,7/3/2019 17:24,,,,0,,,,CC BY-SA 4.0 +6676,1,6678,,7/3/2019 18:30,,2,422,"

Equation 7.71 of Nielsen and Chuang's Quantum Computation and Quantum Information gives the Hamiltonian for a two level atom and single mode photons in a cavity as:

+ +

$H = \hbarωN + δZ + g(a^†σ_− + aσ_+)$

+ +

where $ω$ is the photon frequency, $δ = (ω_0 - ω)/2$ with $ω_0$ the atomic transition frequency. $Z$ is the Pauli Z matrix; g is a coupling constant; $a^†$ and $a$ are creation and annihilation operators for photons, and $σ_−$ and $σ_+$ are lowering and raising operators for the atomic energy levels.

+ +

Neglecting the $N$ term (since it only contributes a fixed phase) and considering a single excitation in the (photon) field mode, this Hamiltonian is re-written as

+ +

$$H = -\begin{bmatrix}\delta&0&0\\0&\delta&g\\0&g&-\delta\end{bmatrix}$$

+ +

I've tried but been unable to derive this Hamiltonian from equation 7.71 above. $H$ in 7.71 should be a 2 x 2 matrix as Pauli matrices are 2 x 2. But here it is written as a 3 x 3 matrix. Can you please explain how this can be obtained? Thanks.

+",7805,,23,,7/3/2019 19:46,7/3/2019 19:54,"Hamiltonian for Single-photon, Single-atom QED Cavity",,1,0,,,,CC BY-SA 4.0 +6678,2,,6676,7/3/2019 19:54,,2,,"

While the Pauli-$Z$ matrix is a 2 x 2 matrix, there are more basis states that need to be considered, namely the vacuum. The atomic basis states are $\left|0\right>$ and $\left|1\right>$, representing the number of excitations in the atom (as it's only a two-level atom, there can't be more than 1 excitation) and this is what $Z$ acts on. Similarly, the number of excitations (i.e. photons) in the field forms another basis, denoted by $\left|N\right>$.

+ +

However, we're only considering a cavity with a total of number of photons $\leq 1$, so the possible bases are, ordering the Hilbert space by $\mathcal H_{\text{photons}}\otimes\mathcal H_{\text{atom}}$, $\left|00\right>, \,\left|10\right>$ and $\left|01\right>$, as all the other possible states have $> 1$ photon.

+ +

The easiest way to go about figuring out what the Hamiltonian on this system looks like is to look at what each operator does to each state, where $N=aa^\dagger$ is ignored.

+ +

That is, $Z$ acts on the 'atomic' Hilbert space as $\delta Z\left|0\right> = \delta\left|0\right>$ and $\delta Z\left|1\right> = -\delta\left|1\right>$, $\sigma_+$ acts on the same space as $\sigma_+\left|0\right> = \left|1\right>$ and $\sigma_+\left|1\right> = 0$ and $\sigma_-$ acts as $\sigma_-\left|1\right> = \left|0\right>$ and $\sigma_-\left|0\right> = 0$. Similarly, on the photonic Hilbert space, $a\left|0\right> = 0$, $a\left|1\right> = \left|0\right>$, $a^\dagger\left|0\right> = \left|1\right>$ and $a^\dagger\left|1\right> = \sqrt{2}\left|2\right>$.

+ +

As a result, the term involving $g$ acts on the combined system as: +$$\begin{align*}g\left(a^\dagger\sigma_- + a\sigma_+\right)\left|00\right> &= 0\\ +g\left(a^\dagger\sigma_- + a\sigma_+\right)\left|10\right> &= g\left|01\right>\\ +g\left(a^\dagger\sigma_- + a\sigma_+\right)\left|01\right> &= g\left|10\right>\end{align*}$$ and the $\delta Z$ term similarly gives $$\begin{align*}\delta Z\left|00\right>&=\delta\left|00\right>\\\delta Z\left|10\right>&=\delta\left|10\right>\\\delta Z\left|01\right>&=-\delta\left|01\right>\end{align*}.$$

+ +

Writing this in matrix form with the basis $\left|00\right>, \,\left|10\right>$ and $\left|01\right>$ as above gives equation 7.76 as expected: $$H = \begin{bmatrix}\delta&0&0\\0&\delta&g\\0&g&-\delta\end{bmatrix}.$$

+ +
+ +

It does appear that I'm out in what I get for $H$ by a minus sign, but looking at equation 7.77, which has $U=e^{-iHt} = e^{-i\delta t}\left|00\rangle\langle00\right|+...$ suggests that this is presumably a typo (in my version, anyway), unless there's something I'm missing.

+",23,,,,,7/3/2019 19:54,,,,1,,,,CC BY-SA 4.0 +6679,1,,,7/3/2019 20:38,,4,129,"

In the paper, ""Quantum algorithm implementations for beginners"" in the section XVII. QUANTUM SIMULATION OF THE TRANSVERSE ISING MODEL (page 54-58), the authors have plotted energy $E$ vs magnetic field strength $h$ using two circuits, one without entanglement and one with entanglement.

+ +

My question is two-fold:

+ +
    +
  1. Why have only these circuits only been used?
  2. +
  3. What implementation changes can I make in the maxcut code using VQE to obtain the above graph? I am trying to change the RY package which is used in the code to change the circuit. In the paper fig 51.(c), the depth of the circuit is 1. Does that mean to increase the depth, I have to replicate the circuit in fig 51.(c) up to depth times? Can someone provide the code changes?
  4. +
+",7949,,45,,7/3/2019 20:43,7/3/2019 20:43,What implementation changes should be done in maxcut code using VQE?,,0,0,,,,CC BY-SA 4.0 +6680,1,,,7/4/2019 3:22,,2,147,"

I have been running some simple ""Hello Quantum World"" code and every time I try to run it on 4096 shots or 8192 shots, the results always show as if I ran the code on 1024 shots (or in the most recent case, nothing at all). Is this a bug?

+ +

I have only been using the interface (as you can see). In this case, I ran a hadamard gate and then an x gate on 4096 shots. Notice how the shots are not written at all. +Also, I have run other code with just the hadamard gate and then a target gate on 4096 and 8192 shots, but the interface says I ran it on 1024.

+ +

+",7953,,7953,,7/4/2019 23:30,7/4/2019 23:30,Number of Shots always 1024/or nothing (IBM q experience),,0,0,,,,CC BY-SA 4.0 +6681,1,7065,,7/4/2019 5:34,,12,405,"

I was looking at this lecture note where the author gives an oracle separation between $\mathsf{BQP}$ and $\mathsf{NP}$. He hints at how ""standard diagonalisation techniques can be used to make this rigorous"".

+ +

Can someone detail a diagonalisation technique that ought to be used? There should intuitively be important differences between the ones used to put something outside classical complexity classes and the ones used to put something outside $\mathsf{BQP}$. Specifically, given that Grover's algorithm is optimal, I am looking for a diagonalisation technique such that we can construct an oracle $A$ for which $\mathsf{NP}^{A} \not\subseteq \mathsf{BQP}^{A}$.

+",1351,,124,,8/21/2019 11:49,11/1/2019 4:49,Separating NP from BQP relative to an oracle,,1,0,,,,CC BY-SA 4.0 +6684,1,6685,,7/4/2019 9:14,,4,246,"

I was reading these lecture notes from Prof. Aaronson about Watrous's MA protocol for the group non-membership problem. At the end of the description, there's an approach to distinguish if Merlin cheated or not, to confirm that Marline sent a superposition $|H\rangle$ over the subgroup $H$. So Arthur takes whatever Merlin sends $|H'\rangle$, randomly selects $y\in H$, and computes the superposition $\sum_{h'\in H'}|h'y\rangle$ over the set $H'y$.

+

But the way group multiplication done is by an oracle promising that its inputs are some superpositions over group elements. What if Merlin cheated by sending a superposition of garbage encodings? In this case, we must try to get rid of the components falling into garbage encoding.

+

Then I realized it is not just that; if we ever want to compute a superposition over some artificial objects, it is almost inevitable to get your superposition with some components being non-sense encoding. There must (or better be) some way to sanitize the input, right?

+

In classical computing we usually can easily solve this. In quantum computing, it seems to be not a "big-deal" as well, but I just can't figure this out.

+
+

To make it more specific, I might define some subset $E\subseteq \{0,1\}^n$ to be the set of encodings that make sense, and $X:=\{0,1\}^n-E$ to be the set of garbage encodings. Now given a n-qubit input quantum-mechanically $|\psi\rangle\in\mathbb{C}^{\{0,1\}^n}$, $|\psi\rangle$ can always be represented as $|\psi\rangle=|e\rangle+|x\rangle$ where $|e\rangle\in\mathbb{C}^E, |x\rangle\in\mathbb{C}^X$. Is it even possible to extract $|e\rangle$ out of $|\psi\rangle$?

+
+

I tried to deterministically do the check (in each branch separately), but then we will get something like,

+

$$ +\sum_{e\in E}c_e|e\rangle|garbage\rangle. +$$

+

This is still not the same as

+

$$ +|e\rangle=\sum_{e\in E}c_e|e\rangle. +$$

+",4855,,2927,,1/2/2021 21:16,1/2/2021 21:16,Quantum State Sanitizing,,1,3,,,,CC BY-SA 4.0 +6685,2,,6684,7/4/2019 18:17,,2,,"
+

Then I realized it is not just that; if we ever want to compute a superposition over some artificial objects, it is almost inevitable to get your superposition with some components being non-sense encoding. There must (or better be) some way to sanitize the input, right?

+
+ +

But this is the point! We asume Merlin is powerful enough to prepare a uniform superposition of $|H\rangle$ without having non-sense encodings. If Arthur himself could do it easily, then Group Non-Membership would be in $\mathrm{BQP}$ and not in $\mathrm{QMA}$.

+ +
+

To make it more specific, I might define some subset $E\subseteq \{0,1\}^n$ to be the set of encodings that make sense, and $X:=\{0,1\}^n-E$ to be the set of garbage encodings. Now given a n-qubit input quantum-mechanically $|\psi\rangle\in\mathbb{C}^{\{0,1\}^n}$, $|\psi\rangle$ can always be represented as $|\psi\rangle=|e\rangle+|x\rangle$ where $|e\rangle\in\mathbb{C}^E, |x\rangle\in\mathbb{C}^X$. Is it even possible to extract $|e\rangle$ out of $|\psi\rangle$?

+
+ +

It's certainly not likely to be easily or efficiently done, unless $\mathrm{NP}\subseteq\mathrm{BQP}$. For example, $E$ could be the solutions to some $n$-bit $\mathsf{3SAT}$ instance while $X$ could be those that don't satisfy the $n$-bit $\mathsf{3SAT}$. $|\psi\rangle=|e\rangle+|x\rangle$ could be the uniform superposition over all $n$-bit strings. If Arthur had an easy way to ""sanitize"" and extract $|e\rangle$ from $|\psi\rangle$ then Arthur could solve $\mathsf{3SAT}$.

+ +
+

I tried to deterministically do the check (in each branch separately)

+
+ +

The protocol assumes that Merlin gives Arthur a uniform superposition of $|H\rangle$. Arthur can perform either the first test to determine if $y\in H'$, or the second test to determine if $H=H'$.

+ +
+ +

EDIT

+ +

Further to the comments, let's look at 4 different tests/situations.

+ +

(a0) Merlin sends $|H'\rangle$ with $H'=H$ and Arthur tests whether $x\not\in H'$

+ +

(a1) Merlin sends $|H'\rangle$ with $H'$ being a non-sense encoding, and Arthur tests whether $x\not\in H'$

+ +

(b0) Merlin sends $|H'\rangle$ with $H'=H$ and Arthur tests whether $H'=H$

+ +

(b1) Merlin sends $|H'\rangle$ with $H'$ being a non-sense encoding, and Arthur tests whether $H'=H$

+ +

It seems like you are worried about the (a1) case - indeed, Arthur might be fooled into thinking that $x\not\in H$ only because Merlin maliciously sent a non-sense encoding.

+ +

However as long as Arthur can do the (b) tests sometimes, he has a chance of catching Merlin in a cheat. The (b) tests rely on the group-theoretic fact that Arthur, as weak as he is, can still create and Hadamard $|0\rangle|H'\rangle+|1\rangle |H'y\rangle$, for a $y\in H$ of Arthur's choice.

+ +

These (b) tests suffice to make sure that Merlin did not send a non-sense encoding, because if Merlin sent a non-sense encoding, then $\langle H'|H\rangle\le \epsilon$, and Arthur will measure $|1\rangle$ sometimes after Hadamarding $|0\rangle|H'\rangle+|1\rangle |H'y\rangle$.

+ +

When a system is in the state $\frac{1}{\sqrt{2}}(|0\rangle|H'\rangle+|1\rangle|H'y\rangle)$ and $|H'\rangle=|H'y\rangle$, then Hadamarding and measuring the left qubit will always return $0$, because the right qubits representing $H'$ and $H'y$ ""destructively interfere.""

+ +

But there's the group-theoretic fact that if $y\not\in H'$, then $|H'\rangle\ne|H'y\rangle$. Then Hadamarding $\frac{1}{\sqrt{2}}(|0\rangle|H'\rangle+|1\rangle|H'y\rangle)$ will sometimes return $1$ in the left qubit, because the right qubits representing $H'$ and $H'y$ do not interfere.

+",2927,,2927,,7/7/2019 13:24,7/7/2019 13:24,,,,9,,,,CC BY-SA 4.0 +6686,1,6691,,7/5/2019 2:47,,2,1119,"

I am trying to understand the function of the $CR_z$ and $CR_y$ gates.

+

Why are these gates used in practice? What advantage is gained by rotating a qubit around the $y$- or $z$-axis?

+

For example, this code from the Qiskit tutorial's Tic-Tac-Toe game (original source) which defines the cnx gate:

+
def cnx(qc, *qubits):
+  if len(qubits) >= 3:
+    last = qubits[-1]
+    #What is the goal of the next two lines?
+    qc.crz(np.pi/2, qubits[-2], qubits[-1])
+    qc.cry(np.pi/2, 0, 0, qubits[-2],qubits[-1])
+    
+    #Is this a recursive call to cnx ?
+    cnx(qc,*qubits[:-2],qubits[-1])
+    
+    #why is there another flip?
+    qc.cry(-np.pi/2, 0, 0, qubits[-2], qubits[-1])
+    
+    #what about this line ?
+    cnx(qc,*qubits[:-2],qubits[-1])
+    
+    #what about this line too?
+    qc.crz(-np.pi/2,qubits[-2],qubits[-1])
+
+

Please explain the inline questions in the context of the initial question.

+

Thanks!

+",7405,,17931,,5/20/2022 18:07,5/20/2022 23:05,CRZ and CRY Gates,,1,4,,,,CC BY-SA 4.0 +6688,1,,,7/5/2019 12:17,,2,355,"

I have an example with 6 qubits for names and 6 for telephones. I encoded their relation like this:

+ +
(ControlledOnInt(1, SetRegisterToInt(6, _)))(rnames, rtels);
+(ControlledOnInt(3, SetRegisterToInt(2, _)))(rnames, rtels);
+
+ +

So there are only 2 registers states(tel->name) in a BD with 64 possible states.

+ +

When I ask the BD for a name from a telephone it works ok, 6 => 2 and 2 => 3 because only in these 2 values (6 and 2) the marked qbit entangled with telephones is One.

+ +

So the important part is the oracle made with ControlledOnInt, and I need to know how does it, because I have my own Grovers in c++ and I want to know the details to make it, and also to learn what gates it uses and how it multiply the matrices.

+ +

Thanks

+",7933,,2879,,10/22/2019 5:12,10/22/2019 5:12,How does ControlledOnInt in Q# make it Grovers Oracle?,,1,2,,,,CC BY-SA 4.0 +6689,1,6690,,7/5/2019 13:24,,1,209,"

If I have an $n$ qubit system and a projector $P$ such as $P_0 = \left|0\right>^{\otimes n}\left<0\right|^{\otimes n}$ (as an example) on those qubits, is there an efficient way to implement the unitary $e^{-i\theta P}$?

+ +

In the specific example given, there is a simple but inefficient implementation in terms of exponentials of Paulis: $$P_0 = \sum_{j\in\left\lbrace0, 1\right\rbrace^n}\bigotimes_{k=1}^nZ_k^{j_k},$$ where $Z^1_k$ is the Pauli-$Z$ operator on qubit $k$ and $Z^0_k$ is the identity on qubit $k$. That is, the given projector is the sum over all possible permutations of identity and $Z$. As $Z$ and identities all commute, this can then be written as $$U_{P_0} = \prod_{j\in\left\lbrace0, 1\right\rbrace^n}e^{-i\theta\bigotimes_{k=1}^nZ_k^{j_k}}.$$ However, for $n$ qubits, this requires an exponential number of gates. Is there any way to improve upon this?

+ +

Funnily enough, using e.g. the Reck or Clements scheme (in photonics), this appears to be trivial, as it's simply a phase on a single mode. However, to my knowledge, this doesn't count as it requires an expontial number of resources to recreate the evolution given by a unitary acting on $n$ qubits.

+",23,,,,,6/16/2020 13:27,Efficient implementation of exponential of projector,,1,0,,,,CC BY-SA 4.0 +6690,2,,6689,7/5/2019 15:21,,3,,"

With auxiliary qubits, you could construct a gate that is controlled on the $n$ qubits being $0$ to apply $X$ to the auxiliary. This can be done with polynomially many gates and auxiliaries.

+ +

Once you have that, you can apply contolled $e^{-i \theta}$ on any of the original $n$.

+ +

Then do all the uncomputation.

+",434,,434,,6/16/2020 13:27,6/16/2020 13:27,,,,0,,,,CC BY-SA 4.0 +6691,2,,6686,7/5/2019 15:40,,3,,"

Quantum algorithms provide a computational speedup by orchestrating constructive and destructive interference of the amplitudes. It is as if there must be a 8minus sign* somewhere in the matrices - otherwise we merely work in the classical world, and would not see a computational speedup.

+

Let's consider the following gates as controlled Pauli matrices: +\begin{align} + CR_x&= + \begin{pmatrix} + 1&0&0&0\\ + 0&1&0&0\\ + 0&0&0&1\\ + 0&0&1&0 + \end{pmatrix} \\ +\\ + CR_y&= + \begin{pmatrix} + 1&0&0&0\\ + 0&1&0&0\\ + 0&0&0&-i\\ + 0&0&i&0 + \end{pmatrix} \\\ +\\ + CR_z&= + \begin{pmatrix} + 1&0&0&0\\ + 0&1&0&0\\ + 0&0&1&0\\ + 0&0&0&-1 + \end{pmatrix} \,. +\end{align}

+

As can be seen, $CR_x$ does not have a minus sign - nothing gets inverted. $CR_x$ corresponds to the $\mathsf{CNOT}$ gate; operating only with $\mathsf{CNOT}$ gates does not provide any quantum speedup - $\mathsf{CNOT}$ gates can be implemented classically.

+

Not so, however, with $CR_y$ and $CR_z$. For example, $CR_z$ can be used to invert the probability amplitude of the marked states in Grover's algorithm. The marked states, being inverted, will destructively interfere with the unmarked states during the diffusion operation.

+
+

As an example, consider qubits $|\psi\rangle=\frac{1}{\sqrt{2}}|(|00\rangle+|11\rangle)$. The target qubit is $1$ only when the control qubit is $1$.

+

We have:

+

$$CR_x|\psi\rangle=\frac{1}{\sqrt{2}}(|00\rangle+|10\rangle)$$ +$$CR_y|\psi\rangle=\frac{1}{\sqrt{2}}(|00\rangle-i|10\rangle)$$ +$$CR_z|\psi\rangle=\frac{1}{\sqrt{2}}|(|00\rangle-|11\rangle)$$

+

When the control qubit is $1$, the target qubit may have a phase of $-1$ or $-i$.

+",2927,,2927,,5/20/2022 23:05,5/20/2022 23:05,,,,6,,,,CC BY-SA 4.0 +6692,1,6698,,7/5/2019 16:39,,5,635,"

Here's my circuit, trying to checkout the effect of measurement on the IBM Q circuit. Here you can see I do 2 different measurement at different time, and I hope to be able to see both results. However, I do not know how to do so. +

+ +
q = QuantumRegister(2)
+c = ClassicalRegister(2)
+qc = QuantumCircuit(q, c)
+qc.h(q[0])
+qc.cx(q[0], q[1])
+qc.measure(q,c)
+job_sim = execute(qc, backend=simulator, shots=1024)
+counts_sim = job_sim.result().get_counts(qc)
+qc.cx(q[0], q[1])
+qc.measure(q,c)
+job_sim2 = execute(qc, backend=simulator, shots=1024)
+counts_sim2 = job_sim2.result().get_counts(qc)
+
+ +

Can anyone tell me how do I extract all measurement results at different time from the same classical bits in one execution? Thank you!

+",7598,,,,,6/13/2021 17:24,How do I get out 2 measurements from the same execution on Qiskit?,,3,0,,,,CC BY-SA 4.0 +6693,2,,6688,7/5/2019 16:45,,3,,"

ControlledOnInt is a library function which applies a specified operation (in this case SetRegisterToInt) to the target register only if the control register is in a state that encodes the given integer. Internally it does the following:

+ +
    +
  • convert the given integer to an array of bits (in little-endian format I think);
  • +
  • applies X gate to each qubit that corresponds to a 0 bit in the notation of the integer;
  • +
  • applies normally controlled version of the operation (apply operation if all control qubits are in $|1\rangle$ state) to the control and target registers;
  • +
  • and applies X gate to each qubit that that corresponds to a 0 bit in the notation of the integer again to return control register to its starting state.
  • +
+",2879,,,,,7/5/2019 16:45,,,,3,,,,CC BY-SA 4.0 +6694,1,,,7/5/2019 19:41,,1,62,"

I want to understand this Qiskit function (a function for creating the gate CNX with Python): more specifically i don't understand what's the rotations (Y and Z) over the qubits for ? +I added inline questions in the code below :

+ +
def cnx(qc, *qubits):
+ if len(qubits) >= 3:
+  last = qubits[-1]
+  #What's the goal of the next two lines ?
+  qc.crz(np.pi/2, qubits[-2], qubits[-1])
+  qc.cry(np.pi/2, 0, 0, qubits[-2],qubits[-1])
+
+  #Is this a recursive call to cnx ?
+  cnx(qc,*qubits[:-2],qubits[-1])
+
+  #what's this flip yielding ?
+  qc.cry(-np.pi/2, 0, 0, qubits[-2], qubits[-1])
+
+  #what about this line ?
+  cnx(qc,*qubits[:-2],qubits[-1])
+
+  #what about this line too?
+  qc.crz(-np.pi/2,qubits[-2],qubits[-1])
+
+ +

Thanks !

+",7405,,7405,,7/5/2019 20:42,7/5/2019 20:42,About a Qiskit Function,,0,3,,,,CC BY-SA 4.0 +6695,1,6711,,7/5/2019 21:41,,2,721,"

I've already tried the approach in this answer, but I'm getting this error:

+ +
IBMQuantumExperience.IBMQuantumExperience.CredentialsError: error during login: License required. You need to accept the License from Web Platform. https://quantumexperience.ng.bluemix.net
+
+ +

However, I've already accepted the terms, and have already successfully run two experiments using the Qiskit SDK, like the ones in the docs.

+ +

I'm suspecting IBMQuantumExperience, and by extension qiskit-api-py might be out of date, superceded by qiskit. My question is then this: is it possible to check my remaining credits using the new library, and if so, how? If not, how else can I check my credits?

+",5290,,,,,7/8/2019 14:10,How do I check my remaining IBM Q credits?,,1,0,,,,CC BY-SA 4.0 +6697,1,6714,,7/6/2019 5:27,,0,1149,"

I'm trying to create and run parallel execution using the instruction here. However, when I implement it, it tells me that I shouldn't be using compile anymore since

+ +
+

DeprecationWarning: qiskit.compile() is deprecated and will be removed in Qiskit Terra 0.9. Please use qiskit.compiler.transpile() to transform circuits and qiskit.compiler.assemble() to produce a runnable qobj. + DeprecationWarning)

+
+ +

So how do I go about doing this using the new modules? Thank you!

+ +

Here's the code in the link for creating parallel executions:

+ +
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
+from qiskit import Aer, compile
+from qiskit.backends.jobstatus import JOB_FINAL_STATES
+
+n_qubits = 5
+qc_list = []
+for i in range(n_qubits):
+    qr = QuantumRegister(n_qubits)
+    cr = ClassicalRegister(n_qubits)
+    qc = QuantumCircuit(qr, cr)
+    qc.x(qr[i])
+    qc.measure(qr, cr)
+    qc_list.append(qc)
+
+backend = Aer.get_backend('qasm_simulator')
+qobj_list = [compile(qc, backend) for qc in qc_list]
+job_list = [backend.run(qobj) for qobj in qobj_list]
+
+while job_list:
+    for job in job_list:
+        if job.status() in JOB_FINAL_STATES:
+            job_list.remove(job)
+            print(job.result().get_counts())
+
+",7598,,,,,7/8/2019 17:28,Creating and running parallel circuits in Qiskit,,1,0,,,,CC BY-SA 4.0 +6698,2,,6692,7/6/2019 14:30,,2,,"

Unfortunately this is not currently possible on the IBM devices.

+ +

What you should really do is only have four classical channels and send your first two measurements to the first two classical channels, and the second two measurements to the second two classical channels. You then only execute the circuit once. However, you can try this and it still won't work because this can't yet be done on the IBM machines.

+ +

edit: a slightly more constructive answer is that you can achieve what you want using two extra qubits. The idea is to replace the first two measurements with CNOTs with the controls on your qubits and the target on the extra qubits. You can then measure all four qubits. The measurement of the extra qubits corresponds to your first set of measurements and the measurements of your original qubits corresponds to the second set of measurments.

+",6076,,6076,,7/6/2019 20:48,7/6/2019 20:48,,,,0,,,,CC BY-SA 4.0 +6699,2,,6692,7/6/2019 20:51,,1,,"

When you measure, you choose a bit where the result should go. If you measure to the same bit multiple times, then the results of all but the last will not be recorded.

+ +

To get the results you want, you'll need to declare more bits. For example, you could use a couple of two-bit classical registers: one for the first pair of bits, and the other for the second.

+ +
q = QuantumRegister(2)
+c1 = ClassicalRegister(2)
+c2 = ClassicalRegister(2)
+qc = QuantumCircuit(q, c)
+qc.h(q[0])
+qc.cx(q[0], q[1])
+qc.measure(q,c1)
+job_sim = execute(qc, backend=simulator, shots=1024)
+counts_sim = job_sim.result().get_counts(qc)
+qc.cx(q[0], q[1])
+qc.measure(q,c2)
+job_sim2 = execute(qc, backend=simulator, shots=1024)
+counts_sim2 = job_sim2.result().get_counts(qc)
+
+ +

As the other answer notes, this will not currently run on real hardware. Only on simulators.

+",409,,,,,7/6/2019 20:51,,,,0,,,,CC BY-SA 4.0 +6700,1,6712,,7/7/2019 1:48,,0,401,"

I am trying to run an execution on IBMQx2 where I can specify the physical qubits to which I apply gates. The execution without the initial_layout runs fine, but the one with it keeps giving me either ""statusCode"":400,""name"":""Q_OBJECT_NOT_VALID"" or 'Not enough qubits in CouplingGraph'. Here's the circuit that I use:

+ +
qr = QuantumRegister(5, 'q')
+cr = ClassicalRegister(5)
+qc = QuantumCircuit(qr, cr)
+qc.h(qr[0])
+qc.h(qr[1])
+qc.h(qr[2])
+qc.h(qr[3])
+qc.h(qr[4])
+qc.measure(qr, cr)
+
+coupling_map = [[0, 1], [0, 2], [1, 2], [3, 2], [3, 4], [4, 2]]
+layout = {0: qr[0], 1: qr[1], 2: qr[2], 3: qr[3], 4: qr[4]}
+#layout = {('qr', 0): ('q', 0), ('qr', 1): ('q', 1), ('qr', 2): ('q', 2), ('qr', 3): ('q', 3), ('qr', 4): ('q', 4)}
+
+job_exp = execute(qc, backend=backend, coupling_map=coupling_map, initial_layout=layout, shots=16384)
+
+ +

If I use the first layout, it gives me,

+ +
+

JobError: ""{'statusCode': 400, 'name': 'Q_OBJECT_NOT_VALID', 'message': 'Q-Object not valid.', 'code': 'Q_OBJECT_NOT_VALID'}""

+
+ +

which I think may be caused by deprecated syntax or something, so I went on here to find what I hope is a more updated version of initial_layout. It got worse: this seems to be even older, and with it another error,

+ +
+

TranspilerError: 'Not enough qubits in CouplingGraph'`

+
+ +

The problem persists whether I add coupling_map in or not. Can anyone tell me how to fix this? Thank you!

+",7598,,7598,,7/7/2019 1:55,7/8/2019 15:20,Problem with initial_layout on Qiskit/IBMQ: 'Not enough qubits in CouplingGraph',,1,1,,,,CC BY-SA 4.0 +6701,1,,,7/7/2019 4:42,,1,19,"

I have been reading this paper: https://arxiv.org/abs/1906.01563v1.

+ +

I am wondering: is it possible to use the idea behind quantum circuits to build classical Hamiltonians represented in the same way?

+",6253,,,,,7/7/2019 4:42,Ansatz Techniques to Multi-Body Physics Problems,,0,0,,,,CC BY-SA 4.0 +6702,1,,,7/7/2019 20:40,,3,314,"

My question is about if there is any way to represent a circuit that take 3 inputs and applies a rotation gate on the third qubit if the first two qubits is similar (has the same state)?

+",6098,,2927,,7/7/2019 20:42,7/7/2019 21:02,"control gate with 3 inputs, two control and rotation gate",,1,1,,,,CC BY-SA 4.0 +6703,2,,6702,7/7/2019 20:56,,1,,"
 #This line creates the circuit instance
+ circuit = cirq.Circuit() 
+
+ #These lines creates the cubits you want to use from a given length
+ length = 3
+ qubits = [cirq.LineQubit(i) for i in range(length)]
+
+ #Here you assign the control qubits (the first two) and then the target qubit
+ controlled_rotation_on_Z = cirq.Z.controlled_by(*qubits[:-1])
+ circuit.append(controlled_rotation_on_Z(qubits[-1]))
+
+Yielding the following circuit:
+
+0: ───@───
+      │
+1: ───@───
+      │
+2: ───Z───
+
+ +

It is worth noting that it can be more than just 3 qubits. You can have N available qubits and you can develop a control gate, i.e. a Toffoli gate, that controls N-1 qubits and the very last qubit is the target qubit. So, it doesn't have to just rotation gates. Something to keep in mind.

+ +

Take a look at this question: How to create an $n$-qubit normally controlled gate?

+ +

And there are more of these questions in the exchange. I personally asked a couple of weeks ago about an N-Toffoli gate and was helped out greatly by that answer!

+ +

Hope it helps!

+",6253,,6253,,7/7/2019 21:02,7/7/2019 21:02,,,,3,,,,CC BY-SA 4.0 +6704,1,,,7/7/2019 21:08,,1,73,"

I am working on implementing a paper on QNNs. I have successfully been able to resize a MNIST digit to be able to meet the size of quantum circuit. But I am not clear of how to convert the resized image into a format that will allow me to use it to apply to this circuit to see how label classification works in this quantum circuit.

+ +

Any suggestions would be mostly appreciated.

+",6253,,,,,7/7/2019 21:08,Encoding Binary Data into Quantum Basis,,0,0,,,,CC BY-SA 4.0 +6705,2,,6628,7/8/2019 2:50,,1,,"

In the last equation in the question above the left hand, and right hand - the $\Delta \theta$ terms cancel, and the denominator $\sin^{2}(\theta)$ term whose root is as you mentioned inverted (as it's in the denominator) to give the bound as the first equation in the question. See related question for the floor operation,

+",429,,26,,10/14/2019 16:14,10/14/2019 16:14,,,,2,,,,CC BY-SA 4.0 +6706,1,,,7/8/2019 9:16,,2,47,"

This jupyter notebook implements GRAPE +for the synthesisizing a CNOT gate. + More info can be found here and in this short presentation. +In the following jupyter notebook at In[8] 1 +the starting guess for the control field is prepared as follows

+ +
    +
  • generate a vector of random numbers for each control field
  • +
  • convolve it with another vector of length 10 (consisting of '1').
  • +
+ +

Why is there a need to convolve the field? GRAPE does not say anything about how one must generate the initial guess. +Also as side questions

+ +
    +
  • why do it with a vector of ones?
  • +
  • what is the reason behind choosing the value 2*np.pi*0.01 in the initial random generation step
  • +
+",462,,462,,7/13/2019 4:52,7/13/2019 4:52,What is the need of convolution here?,,0,0,,,,CC BY-SA 4.0 +6707,1,,,7/8/2019 10:43,,1,55,"

This question requires the knowledge of GRAPE. More info can be found here and in this short presentation. +In the following jupyter notebook the result of this line

+ +
+

_overlap(result.U_f, U_f_numerical).real, abs(_overlap(result.U_f, U_f_numerical))**2

+
+ +

(which is in the ""Test numerical integration of GRAPE pulse"") the result obtained seems very low. +Why would the unitary obtained by the propagator function ""U_f_numerical"" be so different from that derived from the cy_grape_unitary function ""result.U_f""?
+They are both derived from ""result.H_t"". I am saying that they seem to be different based on the low value ""0.11355125771393167"" of the _overlap function. I may be totally wrong about this. +I have raised this as an issue

+",462,,462,,7/13/2019 4:47,7/13/2019 4:47,Different values of similar functions,,0,2,,,,CC BY-SA 4.0 +6708,1,6717,,7/8/2019 10:51,,5,765,"

When interpreted geometrically, the second phase of the Grover's algorithm which corresponds to inversion about the mean is interpreted as reflection over the original state.

+ +

Can you explain intuitively the relationship between those two?

+",7986,,,,,7/10/2019 21:49,Second reflection in the Grover's algorithm,,1,0,,,,CC BY-SA 4.0 +6709,1,,,7/8/2019 11:47,,2,44,"

This question requires the knowledge of GRAPE. More info can be found here and in this short presentation. +In the following jupyter notebook is the analytical solution as in this image right? + +Because on trying (g = pi/ 4* T = 1/8) as in this figure + +I am unable to get the U = cnot() (the target unitary) + +I may have commited a mistake somewhere in the calculations. If so, I would be very much obliged if you would point it out to me.

+ +

I have raised an issue

+",462,,462,,7/13/2019 4:51,7/13/2019 4:51,Is the analytical solution right?,,0,0,,,,CC BY-SA 4.0 +6710,2,,5007,7/8/2019 12:48,,4,,"

Posting an answer because I realised what my issue was:

+ +

What I didn't realise then: When a density matrix is written in any basis, the diagonal elements correspond to the probabilities of the density matrix landing on the basis states of that basis.

+ +

So, if in some basis formed by vectors $|x_1\rangle, |x_2\rangle, |x_3\rangle, |x_4 +\rangle$, my density matrix is:

+ +

$$\begin{bmatrix} +a_{11} & a_{12} & a_{13} & a_{14} \\ +a_{21} & a_{22} & a_{23} & a_{24} \\ +a_{31} & a_{32} & a_{33} & a_{34} \\ +a_{41} & a_{42} & a_{43} & a_{44} \\ +\end{bmatrix}$$

+ +

Then, the probability of this state showing up as $|x_1\rangle \langle x_1|$ when measured is $a_{11}$, as seen by the trace rule:

+ +

Probability that $\rho$ gives $|x_1\rangle \langle x_1|$ = $Tr(|x_1\rangle \langle x_1| \rho)$ which is $a_{11}$.

+ +

Therefore, in the above question, since the matrix is written in the $\{\sigma_i\}$ basis, $p_i'$ is the probability of $\rho$ landing on $|\sigma_i\rangle$, and when multiplied and trace is taken, it results in the corresponding expression. Therefore, the intuition holds.

+ +

Note that the '$\sigma$ basis' is one in which the log matrix is diagonal.

+",2832,,,,,7/8/2019 12:48,,,,0,,,,CC BY-SA 4.0 +6711,2,,6695,7/8/2019 14:10,,1,,"

You are correct that IBMQuantumExperience is a deprecated library. Anything you wanted to use IBMQuantumExperience to do you can now do through qiskit-ibmq-provider.

+ +

To answer your main question, the credit system is being removed in the future, so there is currently no way to check your remaining credits. The feature used to be in the old IBM Q Experience page, but since the new, beta version has been launched it no longer has that capability.

+",6180,,,,,7/8/2019 14:10,,,,5,,,,CC BY-SA 4.0 +6712,2,,6700,7/8/2019 15:20,,3,,"

The Q-Object not valid error you received is caused by the amount of shots you set. The max shots allowed is 8192. Since the amount of shots you set (16384) is greater than the max amount of shots allowed, you get that error.

+ +

The TranspilerError is caused by the second format for layout. When I tested your code with the second layout, I received this error and a warning stating that the format being used for initial_layout was being deprecated. So I would stick to the first format for layout.

+ +

If you change the amount of shots to be <=8192 and use the first format for layout, then I believe the code should run.

+",6180,,,,,7/8/2019 15:20,,,,0,,,,CC BY-SA 4.0 +6713,2,,6639,7/8/2019 16:35,,3,,"

I am also an undergraduate hoping to start a career in quantum computing someday. I'm a physics student who became interested in the subject about a year ago, and these are some things that helped me build a foundation.

+ +

In terms of background, linear algebra is the only course that is essential for understanding the basics of the subject. The reason is that computation can be simplified as a series of matrices (called gates) acting on a particular vector (called the state). A course in quantum mechanics will be necessary for more advanced studies and many applications of quantum computing, but you are perfectly qualified to start learning the basics without such a course.

+ +

In terms of resources, my advice is to start with something lighter than a textbook for your first introduction. I highly recommend the Microsoft Q# Support Docs, especially the ""Quantum Computing Concepts"" articles found here. If you're looking to start programming, Q# will be very difficult to learn without background in C# and a functional programming language, so it may not be the right language to start out on. It's nothing against the language, but it was hard for me since I had never used C# and had trouble reading the language-specific docs before my functional programming course. I personally have a lot of training in Python, so languages like Google's Cirq or IBM's Qiskit were more natural choices for me.

+ +

Once you've gone through a few of those articles on the basics, that's when I would pick up a textbook. Someone has already mentioned ""Mike and Ike"" (Quantum Computation and Quantum Information by Michael Nielsen and Isaac Chuang) which is one of the most highly regarded books on the subject. Another I'd like to mention is Quantum Computer Science: An Introduction by N. David Mermin, which is pretty accessible for someone without a background in quantum mechanics, at least for a few chapters. No book is going to be right for everyone, so just try a few and see what makes sense for you.

+ +

My last piece of advice is to find a friend to work through material with or a professor to help walk you through particularly difficult topics. Something to remember throughout your academic career is that math, and related fields, is better with a guide.

+ +

Good luck!

+",4616,,,,,7/8/2019 16:35,,,,0,,,,CC BY-SA 4.0 +6714,2,,6697,7/8/2019 17:28,,4,,"

Yes, compile is deprecated in favor of transpile and assemble. For your code, using these two new functions would look something like this:

+ +
# Add to your import statements
+from qiskit.compiler import transpile, assemble
+
+# After creating qc_list
+backend = Aer.get_backend('qasm_simulator')
+transpiled_circs = transpile(qc_list, backend=backend)
+qobjs = assemble(transpiled_circs, backend=backend)
+job_info = backend.run(qobjs)
+
+# To get the results
+for circ_index in range(len(transpiled_circs)):
+    print(job_info.result().get_counts(transpiled_circs[circ_index]))
+
+ +

About the code

+ +

qc_list is still a list of circuits. transpiled_circs is a list of transpiled circuits from qc_list. qobjs is a single qobj with information for each circuit in transpiled_circs. job_info is job that is returned from backend.run(qobjs) it is a single job object.

+ +

Since job_info is a single job, the results for each circuit are located job_info.result().get_counts(). You just need to provide get_counts with a circuit to return the specific results for that circuit. That is what the for loop provides.

+ +

About transpile and assemble

+ +

transpile takes in a QuantumCircuit or list of QuantumCircuits and runs through certain PassManagers which optimize the circuit for the specific backend given. This can include rearranging gates, compressing sets of gates, deleting unnecessary gates, rearranging CX connections, etc. It returns a new circuit, or list of circuits

+ +

assemble takes in a QuantumCircuit of a list of QuantumCircuits and compresses them into a qobj

+ +

The source code for both functions can be found here: transpile, assemble

+",6180,,,,,7/8/2019 17:28,,,,0,,,,CC BY-SA 4.0 +6715,1,,,7/8/2019 17:31,,1,104,"

I want to know the big difference, in terms of fabrication (circuit) between a charge Qubit and a Transmon, how is a Transmon less affected by noise ?

+ +

Many thanks

+",7405,,,,,7/8/2019 17:31,Charge Qubit vs Transmon,,0,1,,,,CC BY-SA 4.0 +6716,1,,,7/8/2019 17:36,,4,315,"

Where I can read about protein folding on quantum computer (Qiskit will be ideal variant) with simple examples? Thanks

+",6025,,55,,4/12/2021 15:24,7/5/2022 11:51,Where I can read about protein folding on quantum computers with simple examples?,,3,2,,,,CC BY-SA 4.0 +6717,2,,6708,7/9/2019 3:45,,5,,"

The Grover diffusion operator, the second phase of the algorithm, is given by:

+ +

$$D = 2\left|s\right>\left<s\right| - I$$

+ +

where $\left|s\right> = \frac{1}{\sqrt{N}}\sum_{x=0}^{N-1}\left|x\right>$, which is also known as the uniform superposition, or, in the case of the question, the ""original state"". To see why this inverts over the mean, first notice that, for a given state $\left|\psi\right> = \sum_{x=0}^{N-1}a_x \left|x\right>$:

+ +

$$\left|s\right>\langle s|\psi\rangle = (\frac{1}{N}\sum_{x=0}^{N-1}a_x)\sum_{x=0}^{N-1}\left|x\right>$$

+ +

Thus, $(2\left|s\right>\left<s\right| - I)\left|\psi\right> = 2\left|s\right>\langle s|\psi\rangle - \left|\psi\right>$, for the probability amplitude for each $\left|x\right>$, gives double the mean value of all the probability amplitudes minus the original amplitude: inversion over the mean.

+ +

$D$'s basic 2 projection minus identity structure is what makes it interpretable as a reflection over $\left|s\right>$: to see this intuitively, notice that if $\left|\psi\right> = a_s \left|s\right> + a_r \left|r\right>$ where $\langle s|r\rangle = 0$ ($s$ and $r$ are orthogonal), then $D\left|\psi\right> = 2a_s \left|s\right> - a_s\left|s\right> - a_r \left|r\right> = a_s \left|s\right> - a_r \left|r\right>$.

+ +

The first phase is also a reflection too in a slightly different manner. To negate only the target vector $\left|\omega\right>$, the operator is of the form $I - 2\left|\omega\right>\left<\omega\right|$: the probability amplitude of states orthogonal to $\left|\omega\right>$ is left alone while the probability amplitude of $\left|\omega\right>$ is negated. This reversal means that, instead of being a reflection over $\left|\omega\right>$, it is a reflection over the hyperplane orthogonal to $\left|\omega\right>$.

+ +

You can interpret both reflections together by creating a plane out of the orthogonal $\left|\omega\right>$ and $\left|s'\right> = \frac{1}{\sqrt{N - 1}} \sum_{x\neq\omega}\left|x\right>$ (Wikipedia's diagram of this is excellent). Then the first phase is a reflection over $\left|s'\right>$ and the second phase is a reflection over $\left|s\right>$. Since $\left|s\right>$ is at an angle away from $\left|s'\right>$ towards $\left|\omega\right>$, then successive applications of the first and second phase will steer the state towards $\left|\omega\right>$. Using this reflection paradigm, you can with some effort derive the approximately $\frac{\pi}{4} \sqrt{N}$ stopping point before the reflecting goes too far.

+",7680,,7680,,7/10/2019 21:49,7/10/2019 21:49,,,,0,,,,CC BY-SA 4.0 +6719,1,,,7/9/2019 15:20,,1,135,"

If I want to to search 2 values with Grover's algorithm, it outputs the same probability for both that is bigger that the no searched states that have the same lower percent.

+ +

If I use an oracle matrix with all 1's in the diagonals except on the searched states that are -1.

+ +

But suppose you are going to find the drink that you want. For example, I like coke 57% , and pepsi 10%, the rest are 1%.

+ +

If I change the -1 in those two values in the oracle matrix for example to near 1.5 for coke and 0.5 for pepsi, it will output more probability from bigger to lower: coke module 0.57, pepsi module 0.39 and the others randomly to 0.13.

+ +

So is it possible in real life to do this? I ask because I don't know how I can change it in Q# reflection.

+ +
/// Reflection `RM` about the marked state.
+operation ReflectMarked (markedQubit : Qubit) : Unit {
+    R1(PI(), markedQubit);
+}
+
+/// Reflection about the |00…0〉 state.
+/// A register of n qubits initially in the |00…0〉 state.
+operation ReflectZero (databaseRegister : Qubit[]) : Unit {
+
+    let nQubits = Length(databaseRegister);
+
+    for (idxQubit in 0 .. nQubits - 1) {
+        X(databaseRegister[idxQubit]);
+    }
+
+    Controlled Z(databaseRegister[1 .. nQubits - 1], databaseRegister[0]);
+
+    for (idxQubit in 0 .. nQubits - 1) {
+        X(databaseRegister[idxQubit]);
+    }
+} 
+
+",7933,,2879,,8/2/2019 18:32,8/3/2019 9:57,Is it possible to change the oracle in Grover's search to ponderate probabilities in multiple values search?,,2,0,,,,CC BY-SA 4.0 +6720,2,,4268,7/9/2019 16:49,,3,,"

Here is another way to flip the phase of only |0...0⟩:

+ +
using (ancilla = Qubit()){
+    (ControlledOnInt(0, X))(register, ancilla); // Bit flips the ancilla to |1⟩ if register is |0...0⟩   
+    Z(ancilla);                                 // Ancilla phase (and therefore whole register phase) becomes -1 if above condition is satisfied
+    (ControlledOnInt(0, X))(register, ancilla); // Puts ancilla back in |0⟩  
+} 
+
+",5926,,2879,,7/9/2019 17:54,7/9/2019 17:54,,,,0,,,,CC BY-SA 4.0 +6721,1,,,7/10/2019 8:07,,10,133,"

Assume, I'm using a system of qubits to simulate a fermionic system.

+ +

If I'm using the second-quantized formalism (e.g. orbitals in quantum chemistry), the anti-symmetric nature of the fermionic wave functions can be taken into account by means of the Jordan-Wigner or Brayi-Kitaev transformation. Roughly speaking, this gives a 1-to-1 correspondence between the physical (fermionic) and logical (bosonic) DOFs, with operators of certain locality. So, in terms of qubits resources, this is as efficient as can be.

+ +

Now, could anyone please elaborate how the issue of the wave function anti-symmetry is typically resolved within the first-quantized approach? (In other words, when doing lattice simulations.)

+",6313,,,,,7/10/2019 8:07,Anti-symmetrization on the lattice,,0,5,,,,CC BY-SA 4.0 +6722,1,,,7/10/2019 16:11,,1,896,"

What is this dedicated use of IBMQ_16_melbourne? I am trying to run a simulation but it is not running. Is there any way to run the simulations? When is the backend coming online again for normal users?

+",8010,,26,,12/15/2019 3:04,12/15/2019 3:04,IBM Quantum Experience: simulation not running on IBMQ_16_melbourne,,2,2,,,,CC BY-SA 4.0 +6723,1,6725,,7/10/2019 17:20,,3,393,"

I have just tried to apply initialize function to a simple circuit. There is any way to display how is done internally the initialization circuit instead of a single block with label ""initialize""?

+ +

Here is the output of the minimal working example you can find below:

+ +
            ┌──────────────────────────────────┐
+q2476_0: |0>┤0                                 ├
+            │  initialize(0.70711,0,0,0.70711) │
+q2476_1: |0>┤1                                 ├
+            └──────────────────────────────────┘
+
+ +

Minimal working example:

+ +
import numpy as np
+import math
+from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
+
+desired_vector = [
+   1 / math.sqrt(2) * complex(1, 0),
+   0,
+   0,
+   1 / math.sqrt(2) * complex(1,0 )]
+
+q = QuantumRegister(2)
+qc = QuantumCircuit(q)
+qc.initialize(desired_vector, [q[0],q[1]])
+
+qc.draw(output='mpl')
+print(qc)
+
+",8011,,,,,7/10/2019 19:04,"Draw ""Initialize"" circuit as sequence of single gates",,1,0,,,,CC BY-SA 4.0 +6725,2,,6723,7/10/2019 19:04,,3,,"

There is a way, though it is pretty hacky. Going off of the code you provided:

+ +
qc.initialize(desired_vector, [q[0],q[1]]).gates_to_uncompute().draw()
+qc.decompose().decompose().decompose().decompose().draw()
+
+ +

The first line will provide gates that uncompute intialize. However it will only show up as Multiplex gates.

+ +

The second line is what decomposes the Multiplex gates into familiar gates. You need one decompose() call for each Multiplex gate. In this scenario, you will see 4 Multiplex gates, so you need 4 decompose() calls.

+ +

Note: initialize assumes the state is currently in the ground state. Because of this, the new circuit that is made will include a reset on each qubit at the beginning of the circuit.

+",6180,,,,,7/10/2019 19:04,,,,0,,,,CC BY-SA 4.0 +6726,1,6727,,7/10/2019 19:05,,2,41,"

I saw on the site Brilliant.org a question witch is:

+ +

""Let's say I'm given a quantum wire, I measure it and find it charged ""on"". If I come back some time later, what state should I measure?""

+ +

And the answer was: Charged ""on"".

+ +

And they explain: ""If a quantum wire is measured to be ""charged"", then for any following measurements of the same isolated quantum wire, we would expect to measure the same charge and observe the same state.""

+ +
    +
  • My question is: doesn't the system evolves between the measurement at t=0 and t>0, then the system would return in a combination states, so we don't expect the same state?? +(we can do the same experiment with a qubit)
  • +
+",8009,,,,,7/10/2019 19:49,Measuring a quantum wire at t > 0,,1,0,,,,CC BY-SA 4.0 +6727,2,,6726,7/10/2019 19:49,,4,,"

I think this question makes two assumptions:

+ +
    +
  1. the system does not evolve intentionally (i.e., no gates or measurements are performed on it), and

  2. +
  3. there is no noise that would cause the system to evolve in an unintended way.

  4. +
+ +

Of course, if you change the state of the system by applying some gates, or if the system is noisy, this will not be the case.

+",2879,,,,,7/10/2019 19:49,,,,2,,,,CC BY-SA 4.0 +6728,1,,,7/10/2019 21:16,,2,754,"

I have a tensor product of a 5 qubit state $|h\rangle$. From this I want to calculate the probability of the 2nd qubit being in state $|1\rangle$. Can someone show me how I can do this? I know I can use the Born rule but I am not sure how. For context I am using Python and NumPy.

+",7734,,10480,,4/5/2021 17:39,4/5/2021 17:39,Find probability of a single qubit's measurement results from a 5 qubit state,,3,2,,,,CC BY-SA 4.0 +6729,1,,,7/11/2019 3:11,,8,1737,"

Given two mixed states $\rho$ and $\sigma$, the trace distance between the states is defined by $\sum_{i=1}^n |\lambda_i|$, where $\lambda_i$'s are eigenvalues of $\rho - \sigma$.

+ +

I know the definition of eigenvalues, but I don't have intuition on what the sum of eigenvalues represent, and why that signifies as a distance metric. What does distance between two states even mean? Where is trace distance used?

+",8014,,55,,5/13/2020 23:37,5/13/2020 23:37,What is intuition for the trace distance between quantum states?,,2,0,,,,CC BY-SA 4.0 +6731,1,6735,,7/11/2019 9:28,,3,696,"

I read the documentation of qiskit and I can't understand the meaning of the city plot, like this: +

+ +

Why do we need a 3D plot? Why can't we just use a 2D plot, where $ | 00\rangle$, $ | 01 \rangle$, $ |10 \rangle$, $ |11 \rangle$ would lie on X-axis, and their amplitudes (or magnitudes) would lie along Y-axis?

+ +

What does the intersection of $ | 00 \rangle$ and $ | 11 \rangle$ show on such city plot?

+",6134,,6134,,7/11/2019 14:47,7/11/2019 14:49,The meaning of the city plot in Qiskit,,1,0,,,,CC BY-SA 4.0 +6732,2,,6729,7/11/2019 9:28,,2,,"

One way to understand the trace distance is to notice that it equals the (classical) trace distance (also referred to as Kolmogorov distance, see this post for some information about it) maximised over all possible POVMs on the states.

+ +

To see this, start from the following expression for the trace distance: +$$D(\rho,\sigma)\equiv\frac{1}{2}\mathrm{Tr}|\rho-\sigma|=\frac{1}{2}\max_U\mathrm{Tr}[ U(\rho-\sigma)],$$ +where the maximum is taken over all unitaries $U$.

+ +

Being $\rho-\sigma$ Hermitian, the maximum is achieved choosing the unitary +$$U=\sum_{k:\lambda_k\ge0}\mathbb P(\lambda_k)-\sum_{k:\lambda_k<0}\mathbb P(\lambda_k) +=2\sum_{k:\lambda_k\ge0}\mathbb P(\lambda_k)-I,$$ +where $\mathbb P(\lambda_k)\equiv|\lambda_k\rangle\!\langle\lambda_k|$, $\lambda_k$ are the eigenvalues of $\rho-\sigma$, and we exploited the fact that the eigenstates of an Hermitian operator form an orthonormal basis for the space. Defining the positive operator $P$ as +$$P\equiv \sum_{k:\lambda_k\ge0}\mathbb P(\lambda_k),$$ +we thus see that $D(\rho,\sigma)=\mathrm{Tr}[P(\rho-\sigma)]$ (and one can also show that such $P$ is the positive operator that maximises this quantity while satisfying $P<I$), that is, the trace distance equals the sum of the positive eigenvalues of $\rho-\sigma$.

+ +

This expression is nice because, being $P$ a positive operator, it can be interpreted as a measurement. It encodes one possible answer to some question that can be asked to the states (read, an element of a POVM), and $\mathrm{Tr}(P\rho)$ is the probability of getting this answer if the state is $\rho$. +We, therefore, conclude that $D(\rho,\sigma)$ is the maximum difference between the probabilities of getting a given answer when asking a given question to both states. In other words, this tells us how distinguishable the states are: it's the answer to the question among all possible measurements that can be performed on the states, what is the one such that $\rho$ and $\sigma$ give maximally different answers?

+ +

Maximisation over Hermitians

+ +

To see how the maximisation over Hermitian/positive operators is performed, consider an arbitrary Hermitian operator $Q$. Then, $Q=\sum_k q_k\mathbb P(q_k)$ with $q_k\in\mathbb R$, and +$$\operatorname{Tr}[Q(\rho-\sigma)]=\sum_{j,k} \lambda_j q_k |\langle \lambda_j|q_k\rangle|^2.$$ +For a fixed set of eigenvalues $q_k$, it's clear that choosing $|q_k\rangle=|\lambda_k\rangle$ gives the maximum value of the trace: $\sum_j \lambda_j q_j\equiv\langle \boldsymbol\lambda,\boldsymbol q\rangle$. +Without putting further restrictions on the Hermitian $Q$, we can get arbitrarily large values of this quantity. One way to work around this is to restrict to the Hermitians $Q$ such that $\|Q\|_2^2\equiv\operatorname{Tr}(Q^2)\le\|\rho-\sigma\|_2^2$. We can then get a maximum write +$$\max_{\text{Hermitians } Q:\|Q\|_2\le\|\rho-\sigma\|_2}\operatorname{Tr}[Q(\rho-\sigma)]=\sum_k\lambda_k^2=\|\rho-\sigma\|_2^2.$$ +This way of restricting $Q$, however, does not give us an expression similar to the original trace distance. A better way is therefore here to simply impose $-1\le Q\le1$, that is, to impose the eigenvalues of $Q$ to satisfy $-1\le q_k\le1$. +With this restriction, $\sum_k\lambda_k q_k$ is maximised with the choice $q_k=\operatorname{sign}(\lambda_k)\equiv\lambda_k/|\lambda_k|$, and we conclude that +$$\max_{-1\le Q\le1}\operatorname{Tr}[Q(\rho-\sigma)]=\sum_k|\lambda_k|=2D(\rho,\sigma).$$

+ +

This is telling us that the optimal measurement to distinguish the two states is one that collapses the states in the eigenbasis of $\rho-\sigma$, and assigns value $+1$ to the outcomes corresponding to $\lambda_k>0$ and value $-1$ to the outcomes corresponding to $\lambda_k<0$.

+ +

Maximisation over positive operators

+ +

If we instead impose the restriction $0\le Q\le 1$, the expression $\sum_k\lambda_k q_k$ is maximised by the choice $q_k=(\lambda_k+|\lambda_k|)/2$ ($q_k=\lambda_k$ when $\lambda_k\ge0$, and $q_k=0$ otherwise). +This gives +$$\max_{0\le Q\le1}\operatorname{Tr}[Q(\rho-\sigma)]=\sum_{k: \lambda_k\ge0}\lambda_k=\frac{1}{2}\sum_k|\lambda_k|=D(\rho,\sigma).$$

+",55,,55,,7/11/2019 17:00,7/11/2019 17:00,,,,6,,,,CC BY-SA 4.0 +6733,1,6815,,7/11/2019 12:29,,8,7047,"

I am learning qiskit software and this term keeps popping up and I am unable to get a grasp on the technical definition given by wikipedia. For example, the functions state fidelity and process fidelity.

+",7943,,19895,,5/19/2022 8:02,9/3/2022 18:10,What does fidelity mean?,,4,1,,,,CC BY-SA 4.0 +6735,2,,6731,7/11/2019 14:49,,4,,"

A density matrix $\rho$ on two qubits has 16 complex amplitudes (although not all are free variables due to constraints from normalization and Hermeticity), so the City plot is showing those amplitudes as well. The $|00\rangle\langle 11|$ and $|11\rangle\langle 00|$ amplitudes shown are not going to directly impact your measurement if you were to measure in the Z basis, but would come into effect due to basis transformations.

+ +

As a simple example of these off diagonal elements, Think about a single qubit density matrix representing a $|+\rangle$ state:

+ +

$$\rho = |+\rangle\langle +| = \frac{1}{2}(|0\rangle + |1\rangle )(\langle 0| + \langle 1|) = \frac{1}{2}(|0\rangle\langle 0| + |1\rangle\langle 0| + |0\rangle\langle 1| + |1\rangle\langle 1|)$$

+ +

When measured in the Z basis this state gives a 50% chance of 0 and a 50% chance of 1, which is identical to the mixed state:

+ +

$$\rho ' = \frac{1}{2}(|0\rangle\langle 0| + |1\rangle\langle 1|)$$

+ +

However in the X basis our $|+\rangle$ state will always give an eigenvalue of 1, while the mixed state will give other results.

+ +

As an aside, these off diagonal elements are important when checking the purity of a quantum state:

+ +

$$\rho^2 = \rho$$

+ +

If this equation is satisfied then your state is pure, which is only possible due to the off diagonal elements in the density matrix.

+",3056,,,,,7/11/2019 14:49,,,,0,,,,CC BY-SA 4.0 +6736,2,,6729,7/11/2019 15:10,,8,,"

Short answer. The trace distance between two states more or less determines how distinguishable they are by any operational means. A trace distance of 0 means that they are indistinguishable (because they're equal); a trace distance of 2 indicates that they can be perfectly distinguished in principle.

+ +

Long answer. We will show how, from the objective of distinguishing states, we single out the trace distance as a quantity of interest.$\def\Tr{\mathrm{Tr}}$

+ +

Suppose that you have a (possibly mixed) quantum state $\rho$. You know that it was prepared in one of two different ways: one of which yields the state $\rho_1$, and one of which yields the state $\rho_2$. So, you either have $\rho = \rho_1$ or $\rho = \rho_2$. You'd like to determine which is the case (and you don't mind destroying $\rho$ to do it). What can you do?

+ +

Anything you do will amount to performing some transformation $U$, and then performing some measurement. In fact, if you only care about guessing between two outcomes (and you don't mind the fact that you might accidentally guess the wrong outcome), you can reduce your distinguishing procedure to a standard basis measurement, if you use a sophisticated enough unitary. We can suppose that we guess $\rho_1$ for the outcome $|1\rangle$, and $\rho_2$ for the outcome $|0\rangle$. We can then ask what the probability of success is for the best possible procedure.

+ +

If we don't care about the exact circuit to perform this procedure, and only what the probability of success is, we can think of the unitary $U$ as just part of a sophisticated measurement procedure, and consider the two-valued projective measurement $\{ \Pi_1, \Pi_2 \}$ given by +$$ \Pi_1 += +U \,\lvert 1 \rangle \! \langle 1 \rvert_a \,U^\dagger += +\tfrac{1}{2}U \bigl(\mathbf 1 - Z_a\bigr) U^\dagger, +\qquad +\Pi_2 += +U\, \lvert 0 \rangle \! \langle 0 \rvert_a \,U^\dagger += +\tfrac{1}{2}U \bigl(\mathbf 1 + Z_a\bigr) U^\dagger, +$$ +and describe the distinguishing procedure as a $\{ \Pi_1, \Pi_2 \}$ measurement. +Supposing that you were given $\rho_1$ or $\rho_2$ uniformly at random, what you want to maximise is then +$$\begin{aligned} +P +&= +\mathrm{Pr}\bigl[\rho_1\bigr]\,\mathrm{Pr}\bigl[\text{guess 1} \big| \rho_1 \bigr] ++ +\mathrm{Pr}\bigl[\rho_2\bigr]\,\mathrm{Pr}\bigl[\text{guess 2} \big| \rho_2 \bigr] +\\[1ex]&= +\tfrac{1}{2}\Tr\bigl( \rho_1 \Pi_1 \bigr) + \tfrac{1}{2}\Tr\bigl( \rho_2 \Pi_2 \bigr) +\\[1ex]&= +\tfrac{1}{2}\Tr\bigl( \rho_1 \bigl[\tfrac{1}{2}U \bigl(\mathbf 1 - Z_a\bigr) U^\dagger\bigr]\bigr) + \tfrac{1}{2}\Tr\bigl( \rho_2 \bigl[\tfrac{1}{2}U \bigl(\mathbf 1 + Z_a\bigr) U^\dagger\bigr] \bigr) +\\[1ex]&= +\tfrac{1}{4}\Bigl[\Tr\bigl( \rho_1 \bigr) - \Tr\bigl( \rho_1 \bigl[U Z_a U^\dagger\bigr]\bigr) + \Tr\bigl( \rho_2 \bigr) + \Tr\bigl( \rho_2 \bigl[U Z_a U^\dagger\bigr]\bigr)\Bigr]. +\end{aligned}$$ +Let $E_U = U Z_a U^\dagger$: then using the fact that $\rho_1$ and $\rho_2$ are both density operators, we have +$$\begin{aligned} +P +&= +\tfrac{1}{4}\Bigl[2 - \Tr\bigl( \rho_1 E_U \bigr) + \Tr\bigl( \rho_2 E_U \bigr)\Bigr] +\\[1ex]&= +\tfrac{1}{2} + \tfrac{1}{4} \Tr\bigl( \bigl[\rho_2 - \rho_1\bigr] E_U \bigr). +\end{aligned}$$ +We can think of $E_U$ as an abstract observable which we measure on either $\rho_1$ or $\rho_2$: it has eigenvalues $\pm 1$ because it is related to $Z_a$ by a unitary transformation, and we associate the outcome $-1$ with a guess of ""1"" and the outcome $+1$ with a guess of ""2"". Subject to this restriction, we want to consider the observable $E_U$ which maximises the value of $\Tr( [\rho_2 - \rho_1] E_U )$; and by convexity, without loss of generality we can consider all operators $E_U$ which have eigenvalues bounded within $[-1,+1]$ and not just precisely $\pm 1$. However, this essentially characterises the trace norm, as +$$ \max_{\lVert E \rVert \leqslant 1} \Tr\bigl( \bigl[\rho_2 - \rho_1\bigr] E \bigr) = \lVert \rho_2 - \rho_1 \rVert_1 $$ +where $\lVert M \rVert_1$ is the trace norm (see e.g. Theory of Quantum Information, Eqn. (1.173)). You can grasp this on an intuitive level as follows:

+ +
    +
  • The maximisation problem on the left-hand side is essentially evaluating a large number of inner products of the eigenvectors of $[\rho_2 - \rho_1]$ with the eigenvectors of $E$.
  • +
  • In fact, if we consider the trace in the eigenbasis $|\eta_1\rangle, + |\eta_2\rangle, \ldots$ of $E$, we're just considering a sum of inner +products $\pm \langle \eta_k | (\rho_2 - \rho_1) | \eta_k \rangle$, +with a sign determined by the eigenvalue of $\eta_k\rangle$.
  • +
  • The operator $(\rho_2 - \rho_1)$ has both positive and negative eigenvalues (assuming that it isn't the zero operator). The way in which we can attempt to maximise the value of the sum above is to choose $E$ so that the positive eigenstates $|\eta_k\rangle$ of $E$ are also positive eigenstates of $(rho_2 - \rho_1)$, and the negative eigenstates of $E$ to the negative eigenstates of $(\rho_2 - \rho_1)$. The effect of this is that $(\rho_2 - \rho_1) E = \lvert \rho_2 - \rho_1 \rvert$, where the latter operator is what we get from exchanging the eigenvalues of $(\rho_2 - \rho_1)$ with their absolute values.
  • +
  • The trace of $\lvert \rho_2 - \rho_1 \rvert$ then gives us the trace norm, $\lVert \rho_2 - \rho_1 \rVert_1$, as you describe it.
  • +
+ +

Thus we have +$$\begin{aligned} +P +&= +\tfrac{1}{2} + \tfrac{1}{4} \lVert \rho_2 - \rho_1 \rVert_1, +\end{aligned}$$ +so that the trace norm characterises how distinguishable $\rho_1$ is from $\rho_2$ by any operational procedure.

+",124,,124,,7/11/2019 17:14,7/11/2019 17:14,,,,0,,,,CC BY-SA 4.0 +6737,2,,6722,7/11/2019 16:10,,1,,"

First you will need a IBM Q experience account if you do not have one. Using the token listed under your profile you will import the IBMQ package, save your account, and execute the program on an available backend.

+ +
from qiskit import IBMQ
+IBMQ.save_account('MY_TOKEN', 'URL')
+IBMQ.load_accounts(hub=None) #Run everytime to load your account info saved locally
+IBMQ.backends() #Prints available backends
+# Or select from least busy backend
+from qiskit.providers.ibmq import least_busy
+large_enough_devices = IBMQ.backends(filters=lambda x: x.configuration().n_qubits < 10 and
+                                                   not x.configuration().simulator)
+backend = least_busy(large_enough_devices)
+print(""The best backend is "" + backend.name())
+
+ +

Now execute

+ +
from qiskit.tools.monitor import job_monitor
+shots = 1024        
+max_credits = 3   
+job_exp = execute(qc, backend=backend, shots=shots, max_credits=max_credits)
+job_monitor(job_exp)
+
+ +

(Where qc is a parameter accepting the quantum circuit to be executed) +Be sure to check the qiskit tutorials for and IBM Q experience to learn more. These backend servers are pretty much always available and you can check the status of them on the IBM Q experience with your account.

+",7806,,7806,,7/11/2019 17:15,7/11/2019 17:15,,,,0,,,,CC BY-SA 4.0 +6738,1,,,7/11/2019 16:26,,2,2315," + +
from qiskit import *
+
+qr   = QuantumRegister(3)
+cr   = ClassicalRegister(3)
+circ = QuantumCircuit(qr,cr)
+
+circ.h(qr[0])
+circ.h(qr[1])
+circ.h(qr[2])
+
+circ.measure(qr,cr)
+
+
+ +

now cr[0] maybe 0 or 1

+ +

I want to know or copy its value to another normal variable to use it in my calculation, something like +if(cr[0]==0) cr_val=0 else cr_val=1

+",8018,remon78eg,162,,7/11/2019 17:42,7/14/2019 8:41,Quantum Computing Qiskit - How to read data from classical registers,,3,3,,,,CC BY-SA 4.0 +6739,1,6741,,7/11/2019 18:39,,4,29,"

What is the purpose of these quantum gates?

+ +

They're appended to the circuit after the value has been computed.

+ +

+",8019,,,,,7/11/2019 19:50,What is the purpose of the last bits in the 2-qubit-operation Toffoli implementation?,,1,0,,,,CC BY-SA 4.0 +6741,2,,6739,7/11/2019 19:50,,4,,"
In[13]:= H = 1/Sqrt[2]*{{1, 1}, {1, -1}};
+T = {{1, 0}, {0, Exp[I*Pi/4]}};
+CNOT = {{1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}};
+KroneckerProduct[IdentityMatrix[2], T].CNOT.
+    KroneckerProduct[T,ConjugateTranspose[T]].CNOT // MatrixForm
+
+
+{""1"", ""0"", ""0"", ""0""},
+{""0"", ""1"", ""0"", ""0""},
+{""0"", ""0"", ""1"", ""0""},
+{""0"", ""0"", ""0"", ""I""}
+
+ +

So that red boxed region just serves to act as multiplication by $i$ when the first two qubits are $1$.

+ +

So what remains must be acting by $-i X$ on the third qubit when both the first two are $1$.

+ +

In fact so it is, by assuming the first two qubits are $1$ and computing the resulting $2$ by $2$ operator on the third qubit. That is the $U$ for the summand $P_1 \otimes P_1 \otimes U$ when writing the full operator as $P_0 \otimes P_0 \otimes U_{00} + P_0 \otimes P_1 \otimes U_{01} \cdots$.

+ +

Plug into Mathematica again:

+ +
H.PauliMatrix[1].ConjugateTranspose[T].
+PauliMatrix[1].T.PauliMatrix[1].
+ConjugateTranspose[T].PauliMatrix[1].T.H // MatrixForm
+
+ +

And it checks out.

+ +

If you didn't have the boxed part it would be $-iX$ controlled on the first two, instead of $X$ controlled on the first two.

+",434,,,,,7/11/2019 19:50,,,,2,,,,CC BY-SA 4.0 +6742,1,,,7/11/2019 22:53,,4,83,"

Calling cirq.Simulator().run(..) on your circuit to get an idea of how it'd behave if you were to run on Google's (apparently) forthcoming real hardware is fine and dandy. Is there a way to estimate how long it would take?

+ +

Apologies if this is not a suitable question for QC.SE or I've missed something obvious!

+",8004,,,,,7/6/2022 22:26,Estimate run time of Cirq circuit on forthcoming Google quantum computer,,1,0,,,,CC BY-SA 4.0 +6743,2,,6628,7/12/2019 5:45,,4,,"

The angle of each rotation $\theta$ obeys $0\leq \theta \leq \frac{\pi}{2}$ so that $0\leq \frac{\theta}{2} \leq \frac{\pi}{4}$. The Grover Iterations as we know, rotates our initial state vector $|\psi\big>=\cos(\theta/2) |\alpha\big> + \sin(\theta/2)|\beta\big>$ by the angle $\theta$ a few times, such that eventually $|\psi \big>$ will be rotated to within an angle $\frac{\theta}{2}\leq \frac{\pi}{4}$ of $|\beta\big>$ which is our desired state.

+

By using the Quantum Counting Algorithm to get an estimate of $\theta\approx\theta+\Delta\theta$ and thus $M\approx M+\Delta M$ which is the number of solutions, we introduced the error of $\Delta\theta/2$ to our initial state $|\psi \big>$. Since we know $\frac{\theta}{2}\leq \frac{\pi}{4}$, the maximum error tied to our initial state $|\psi\big>$ will be given as:

+
+

$$\text{Maximum Initial Error} = \frac{\pi}{4} \times \frac{|\Delta\theta/2|}{\theta/2} = \frac{\pi}{4} \frac{|\Delta\theta|}{\theta}$$

+
+

Grover Iterations will then rotate $|\psi\big>$ close to $|\beta\big>$, with the maximum angular separation being $\frac{\pi}{4}$ no matter what is the value of the initial angle of $\frac{\theta+\Delta\theta}{2}$. So the total angular deviation (accounting for the offset of $\Delta\theta/2$ in the initial state $|\psi\big>$) from $|\beta\big>$ in this case is:

+
+

$$\text{Total Angular Deviation} =\frac{\pi}{4}+\text{Maximum Initial Error}$$

+
+

This is why we'll get $\frac{\pi}{4}\big(1+\frac{|\Delta\theta|}{\theta}\big)$ as compared to just $\frac{\pi}{4}$. Please do input additional comments if any.

+",5253,,18369,,7/4/2022 20:45,7/4/2022 20:45,,,,0,,,,CC BY-SA 4.0 +6744,2,,6728,7/12/2019 5:46,,2,,"

So probability of the second qubit being in state $|1\rangle$ is the probability of the 5 qubit system being in a state that has $|1\rangle$ as the second qubit.

+ +

So among all the 32 states, find the ones that have $|1\rangle$ in the second qubit, which will be half of them, for example $|01100\rangle$ and $|11111\rangle$. Add up the corresponding probabilities, which is the absolute square of the amplitudes presented to you in vector form.

+ +

Here's an example for a 3 qubit state:

+ +

$$\begin{matrix} +000 \\ 001 \\ 010 \\ 011 \\100 \\ 101 \\ 110 \\ 111 \\ +\end{matrix} +\begin{bmatrix} +0 \\0.577 \\ 0 \\ 0.577\\ 0\\ 0\\ 0\\ 0.577\\ +\end{bmatrix}$$

+ +

In the above case, the probability that the second qubit is $|1\rangle$ is probability that it will be in $|010\rangle, |011\rangle, |110\rangle$ or $|111\rangle$, which is $|0.577|^2 + |0.577|^2$ which is 0.666.

+",2832,,,,,7/12/2019 5:46,,,,0,,,,CC BY-SA 4.0 +6745,2,,6738,7/12/2019 14:05,,0,,"

if you want to excute the whole quantum algorithm again and again bases on the previous result then use while loop.

+",4206,,4206,,7/12/2019 20:37,7/12/2019 20:37,,,,0,,,,CC BY-SA 4.0 +6746,2,,6733,7/12/2019 14:15,,5,,"

Simply it is the distance (similarity measure) between two quantum states, for example the fidelity between $|0\rangle$ and $|1\rangle$ is less than the fidelity between $|0\rangle$ and $\frac{1}{\sqrt{2}}\big(|0\rangle + |1\rangle\big)$. or you can say it is the cosine of the smallest angle between two states, also called the cosine similarity

+",4206,,,,,7/12/2019 14:15,,,,2,,,,CC BY-SA 4.0 +6747,1,6753,,7/12/2019 14:56,,2,314,"

Strolling around I came across Craig Gidney's Blog and his awesome tool Quirk. I proceeded to read this interesting post of his where he alludes to the difference between actually measuring qubits in circuits and simply conditioning some part of the circuit to state of qubits. Long story short, he provides this Quirk circuit to experiment with. There he has a gate that is called ""x499"" and my question is:

+ +

How do I make this gate or any other of the input gates? (Those that feature an ""A"" or ""B"") I have spent a good amount of time dragging and dropping and clicking around but I seem unable to figure this functionality out. (* ashamed *) If I drag it into my circuit, it will turn yellow and show something like ""input A needed"".

+",5322,,,,,7/12/2019 19:09,How to use the input gates in Quirk,,1,0,,,,CC BY-SA 4.0 +6748,2,,6738,7/12/2019 15:04,,3,,"

Answering based off of the extra clarity from your comments:

+ +

Wanting to calculate the decimal value of all cr as opposed to the binary

+ +

This can be done by using the Python built in function int(). This function will return the integer value of the input in base 10 (decimal). So you can retrieve the counts from the job by calling job.result().get_counts(<circuit_name>). This will return a dictionary with the keys being the output from the ClassicalRegisters and the values being the number of times that output was measured. If you take the keys from counts and input them into int() then it will return each output as a decimal value.

+ +

Wanting to store values from cr before the execute command

+ +

To my knowledge, there is no way to read the values from cr before executing the circuit. The values are only populated into the ClassicalRegisters after measuring the circuit, which can only be done during the execution of the circuit.

+ +

You say you want to store the values from cr and reset the circuit and calculate again. This is possible, as you can just read the outputs you get from counts, then do something to the circuit based on those results, and then run the circuit again.

+",6180,,,,,7/12/2019 15:04,,,,0,,,,CC BY-SA 4.0 +6751,1,,,7/12/2019 18:12,,1,280,"

given A and B share EPR pairs $ (|00⟩+|11⟩)/√2$

+ +

both are free to measure their own qubit with the following measurement settings

+ +

A measures with $[ |0⟩, |1⟩ ]$

+ +

B measures with $[ sin(3π/8)|0⟩ + cos(3π/8)|1⟩, -sin(π/8)|0⟩ + cos(π/8)|1⟩]$

+",8028,,8028,,7/15/2019 11:45,7/15/2019 11:45,"given an EPR pair, how do I calculate expectation value?",,1,3,,,,CC BY-SA 4.0 +6752,1,,,7/12/2019 18:55,,2,390,"

I am not sure how to find the following matrix (the inverse of Quantum Fourier Transform) in terms of elementary quantum gates? I am using Qiskit to implement it.

+ +

+",7856,,,,,7/12/2019 21:11,How to decompose the Quantum Fourier Inverse matrix into elementary quantum gates?,,1,0,,,,CC BY-SA 4.0 +6753,2,,6747,7/12/2019 19:09,,3,,"

The input gates are in the bottom toolbox, near the center:

+ +

+ +

If you place an input gate in the same column as an arithmetic gate requiring that input, they will link together into a combined operation:

+ +

+ +

You can also precede the input-requiring gate with a classical setting of the value:

+ +

+ +

Separating the input and the target into separate boxes makes using arithmetic much more flexible than it otherwise would be. In an older version they were combined into a single gate, and it was just generally a giant hassle to get anything lined up.

+ +

The ""x499"" gate in the circuit you linked is a custom gate:

+ +

+ +

Specifically, it is a ""Circuit Gate"" which was made by clicking the ""Make Gate"" button and then entering a range of the (at creation time of the gate) current circuit to include in the gate.

+ +

+ +

Notice that there is in fact a series of custom gates in the before-last screenshot. Each is including a handful of copies of the previous one, in order to build up to many many applications of the ""apply Hadamard and controlled increment"" operation. This is a workaround for the fact that Quirk has no concept of a loop.

+ +

Be aware that custom gates are by far the weakest part of Quirk's user experience. They're clunky to make, impossible to delete without editing the URL, don't have large enough thumbnails... it's just something that I'd have to put 100 hours into to make it good and I haven't had the motivation.

+",119,,,,,7/12/2019 19:09,,,,1,,,,CC BY-SA 4.0 +6754,2,,6752,7/12/2019 19:52,,2,,"

Read the circuit for the QFT on 2 qubits and reverse and dagger everything

+ +

$$ +(1 \otimes H)(Controlled(2,S_1^\dagger))(H \otimes 1) +$$

+ +

Edit:

+ +

For how: Implementation of inverse QFT?

+ +

This decomposition is $m=2$ on https://en.wikipedia.org/wiki/Quantum_Fourier_transform Note that $R_2 = S$

+ +

$1 \otimes H$ to denote Hadamard on the second qubit. $H \otimes 1$ for Hadamard on the first. $Controlled(2,S_1^\dagger)$ for use qubit 2 as the control and assuming that apply $S^\dagger$ on the first qubit.

+",434,,434,,7/12/2019 21:11,7/12/2019 21:11,,,,4,,,,CC BY-SA 4.0 +6755,1,6794,,7/12/2019 21:52,,2,900,"

I'm trying to build a new instruction for my circuit. This instruction needs both a controller qubit qctl and an arbitrary register qreg. When qctl is set then the Qiskit's initialize function is applied to qreg.

+ +

The original Initialize gate (version 10.5) can be found in the official documentation or locally at path: /anaconda3/envs/<environment name>/lib/python3.7/site-packages/qiskit/extensions/initializer.py. It follows a particular procedure which consists of applying a sequence of RY and RZ gates in order to match the desired state.

+ +

The idea is:

+ +
    +
  • copy the Initialize instruction, naming it ControlledInitialize;
  • +
  • pass an additional single qubit register qctl to ControlledInitialize;
  • +
  • change all RZ, RY gates with CRZ, CRY gates (the first one is already available, the second one have to be made from scratch).
  • +
+ +

The problem

+ +

It seems that I have passed qctl register in the wrong way, in fact the below minimum example throws the error:

+ +
DAGCircuitError: '(qu)bit qctl[0] not found'
+
+ +

Minimum example

+ +
import numpy as np
+from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
+from qiskit import BasicAer, execute
+
+# copy here CRY and ControlledInitialize implementation
+
+desired_vector = [ 1 / math.sqrt(2), 0, 0, 1 / math.sqrt(2) ]
+qctl = QuantumRegister(1, ""qctl"")
+qreg = QuantumRegister(2, ""qreg"")
+creg = ClassicalRegister(2, ""creg"")
+circuit = QuantumCircuit(qctl, qreg, creg)
+
+circuit.x(qctl)
+circuit.controlled_initialize(qctl, desired_vector, qreg)
+circuit.measure(qreg, creg)
+
+job = execute(circuit, BasicAer.get_backend('qasm_simulator'), shots=10000)
+print('Counts: ', job.result().get_counts(circuit))
+
+ +

The implementation

+ +

The whole code can be seen here as .py and here as Jupyter notebook.

+ +

CRZ, CRY gates

+ +

CRZ is a standard gate, you can use it with

+ +
from qiskit.extensions.standard.crz import CrzGate
+
+ +

CRY is present in Aqua module as a function but not as a subclass of Gate class. You can easily derive the gate implementation:

+ +
from qiskit.circuit import CompositeGate
+from qiskit.circuit import Gate
+from qiskit.circuit import QuantumCircuit
+from qiskit.circuit import QuantumRegister
+from qiskit.circuit.decorators import _op_expand, _to_bits
+from qiskit.extensions.standard.u3 import U3Gate
+from qiskit.extensions.standard.cx import CnotGate
+
+class CryGate(Gate):
+    """"""controlled-rz gate.""""""
+
+    def __init__(self, theta):
+        """"""Create new cry gate.""""""
+        super().__init__(""cry"", 2, [theta]) # 2 = number of qubits
+
+    def _define(self):
+        """"""
+        self.u3(theta / 2, 0, 0, q_target)
+        self.cx(q_control, q_target)
+        self.u3(-theta / 2, 0, 0, q_target)
+        self.cx(q_control, q_target)
+        """"""
+        definition = []
+        q = QuantumRegister(2, ""q"")
+        rule = [
+            (U3Gate(self.params[0] / 2, 0, 0), [q[1]], []),
+            (CnotGate(), [q[0], q[1]], []),
+            (U3Gate(-self.params[0] / 2, 0, 0), [q[1]], []),
+            (CnotGate(), [q[0], q[1]], [])
+        ]
+        for inst in rule:
+            definition.append(inst)
+        self.definition = definition
+
+    def inverse(self):
+        """"""Invert this gate.""""""
+        return CrzGate(-self.params[0])
+
+
+@_to_bits(2)
+@_op_expand(2)
+def cry(self, theta, ctl, tgt):
+    """"""Apply crz from ctl to tgt with angle theta.""""""
+    return self.append(CryGate(theta), [ctl, tgt], [])
+
+
+QuantumCircuit.cry = cry
+CompositeGate.cry = cry
+
+ +

ControlledInitialize instruction

+ +

Any modification of original Initialize instruction is denoted with WATCH ME comment. Here an overview:

+ +
    +
  • in __init__ I just save the single qubit control register;
  • +
  • in _define, gates_to_uncompute, multiplexer the temporary circuit built will have also qctl register;
  • +
  • in _define, gates_to_uncompute, multiplexer any append function call is enriched with qctl register in the list of qubits taken as second parameter;
  • +
  • in gates_to_uncompute just substitute RYGate/RZGate with CryGate/CrzGate.

    + +
    class ControlledInitialize(Instruction):
    +
    +""""""Complex amplitude initialization.
    +
    +Class that implements the (complex amplitude) initialization of some
    +flexible collection of qubit registers (assuming the qubits are in the
    +zero state).
    +""""""
    +
    +def __init__(self, controlled_qubit, params):
    +    """"""Create new initialize composite.
    +
    +    params (list): vector of complex amplitudes to initialize to
    +    """"""
    +
    +    # WATCH ME: save controlled qubit register
    +    self.controlled_qubit = controlled_qubit
    +
    +    num_qubits = math.log2(len(params))
    +
    +    # Check if param is a power of 2
    +    if num_qubits == 0 or not num_qubits.is_integer():
    +        raise QiskitError(""Desired statevector length not a positive power of 2."")
    +
    +    # Check if probabilities (amplitudes squared) sum to 1
    +    if not math.isclose(sum(np.absolute(params) ** 2), 1.0,
    +                        abs_tol=_EPS):
    +        raise QiskitError(""Sum of amplitudes-squared does not equal one."")
    +
    +    num_qubits = int(num_qubits)
    +
    +    super().__init__(""controlledinitialize"", num_qubits, 0, params) # +1 per il controllo
    +
    +def _define(self):
    +    """"""Calculate a subcircuit that implements this initialization
    +
    +    Implements a recursive initialization algorithm, including optimizations,
    +    from ""Synthesis of Quantum Logic Circuits"" Shende, Bullock, Markov
    +    https://arxiv.org/abs/quant-ph/0406176v5
    +
    +    Additionally implements some extra optimizations: remove zero rotations and
    +    double cnots.
    +    """"""
    +    # call to generate the circuit that takes the desired vector to zero
    +    disentangling_circuit = self.gates_to_uncompute()
    +
    +    # invert the circuit to create the desired vector from zero (assuming
    +    # the qubits are in the zero state)
    +    initialize_instr = disentangling_circuit.to_instruction().inverse()
    +
    +    q = QuantumRegister(self.num_qubits, 'q')
    +    initialize_circuit = QuantumCircuit(self.controlled_qubit, q, name='init_def')
    +    for qubit in q:
    +        initialize_circuit.append(Reset(), [qubit])
    +
    +    # WATCH ME: cambiati registri
    +    temp_qubitsreg = [ self.controlled_qubit[0] ] + q[:]
    +    # initialize_circuit.append(initialize_instr, q[:])
    +    initialize_circuit.append(initialize_instr, temp_qubitsreg)
    +
    +    self.definition = initialize_circuit.data
    +
    +def gates_to_uncompute(self):
    +    """"""
    +    Call to create a circuit with gates that take the
    +    desired vector to zero.
    +
    +    Returns:
    +        QuantumCircuit: circuit to take self.params vector to |00..0>
    +    """"""
    +    q = QuantumRegister(self.num_qubits)
    +    # WATCH ME: aggiunto registro controlled_qubit
    +    circuit = QuantumCircuit(self.controlled_qubit, q, name='disentangler')
    +
    +    # kick start the peeling loop, and disentangle one-by-one from LSB to MSB
    +    remaining_param = self.params
    +
    +    for i in range(self.num_qubits):
    +        # work out which rotations must be done to disentangle the LSB
    +        # qubit (we peel away one qubit at a time)
    +        (remaining_param,
    +         thetas,
    +         phis) = ControlledInitialize._rotations_to_disentangle(remaining_param)
    +        # WATCH ME: Initialize._rotations_to_disentangle diventa ControlledInitialize._rotations_to_disentangle
    +
    +        # perform the required rotations to decouple the LSB qubit (so that
    +        # it can be ""factored"" out, leaving a shorter amplitude vector to peel away)
    +
    +        # WATCH ME: substitute RZ with CRZ
    +        # rz_mult = self._multiplex(RZGate, phis)
    +        rz_mult = self._multiplex(CrzGate, phis)
    +
    +        # WATCH ME: substitute RY with CRY
    +        # ry_mult = self._multiplex(RYGate, thetas)
    +        ry_mult = self._multiplex(CryGate, thetas)
    +
    +        # WATCH ME: cambiati registri
    +        temp_qubitsreg = [ self.controlled_qubit[0] ] + q[i:self.num_qubits]
    +        # circuit.append(rz_mult.to_instruction(), q[i:self.num_qubits])
    +        # circuit.append(ry_mult.to_instruction(), q[i:self.num_qubits])
    +        circuit.append(rz_mult.to_instruction(), temp_qubitsreg)
    +        circuit.append(ry_mult.to_instruction(), temp_qubitsreg)
    +
    +        print(""Z: "", phis, "" | Y: "", thetas)
    +
    +    return circuit
    +
    +@staticmethod
    +def _rotations_to_disentangle(local_param):
    +    """"""
    +    Static internal method to work out Ry and Rz rotation angles used
    +    to disentangle the LSB qubit.
    +    These rotations make up the block diagonal matrix U (i.e. multiplexor)
    +    that disentangles the LSB.
    +
    +    [[Ry(theta_1).Rz(phi_1)  0   .   .   0],
    +     [0         Ry(theta_2).Rz(phi_2) .  0],
    +                                .
    +                                    .
    +      0         0           Ry(theta_2^n).Rz(phi_2^n)]]
    +    """"""
    +    remaining_vector = []
    +    thetas = []
    +    phis = []
    +
    +    param_len = len(local_param)
    +
    +    for i in range(param_len // 2):
    +        # Ry and Rz rotations to move bloch vector from 0 to ""imaginary""
    +        # qubit
    +        # (imagine a qubit state signified by the amplitudes at index 2*i
    +        # and 2*(i+1), corresponding to the select qubits of the
    +        # multiplexor being in state |i>)
    +        (remains,
    +         add_theta,
    +         add_phi) = ControlledInitialize._bloch_angles(local_param[2 * i: 2 * (i + 1)])
    +        # WATCH ME: Initialize._bloch_angles diventa ControlledInitialize._bloch_angles
    +
    +        remaining_vector.append(remains)
    +
    +        # rotations for all imaginary qubits of the full vector
    +        # to move from where it is to zero, hence the negative sign
    +        thetas.append(-add_theta)
    +        phis.append(-add_phi)
    +
    +    return remaining_vector, thetas, phis
    +
    +@staticmethod
    +def _bloch_angles(pair_of_complex):
    +    """"""
    +    Static internal method to work out rotation to create the passed in
    +    qubit from the zero vector.
    +    """"""
    +    [a_complex, b_complex] = pair_of_complex
    +    # Force a and b to be complex, as otherwise numpy.angle might fail.
    +    a_complex = complex(a_complex)
    +    b_complex = complex(b_complex)
    +    mag_a = np.absolute(a_complex)
    +    final_r = float(np.sqrt(mag_a ** 2 + np.absolute(b_complex) ** 2))
    +    if final_r < _EPS:
    +        theta = 0
    +        phi = 0
    +        final_r = 0
    +        final_t = 0
    +    else:
    +        theta = float(2 * np.arccos(mag_a / final_r))
    +        a_arg = np.angle(a_complex)
    +        b_arg = np.angle(b_complex)
    +        final_t = a_arg + b_arg
    +        phi = b_arg - a_arg
    +
    +    return final_r * np.exp(1.J * final_t / 2), theta, phi
    +
    +def _multiplex(self, target_gate, list_of_angles):
    +    """"""
    +    Return a recursive implementation of a multiplexor circuit,
    +    where each instruction itself has a decomposition based on
    +    smaller multiplexors.
    +
    +    The LSB is the multiplexor ""data"" and the other bits are multiplexor ""select"".
    +
    +    Args:
    +        target_gate (Gate): Ry or Rz gate to apply to target qubit, multiplexed
    +            over all other ""select"" qubits
    +        list_of_angles (list[float]): list of rotation angles to apply Ry and Rz
    +
    +    Returns:
    +        DAGCircuit: the circuit implementing the multiplexor's action
    +    """"""
    +    list_len = len(list_of_angles)
    +    local_num_qubits = int(math.log2(list_len)) + 1
    +
    +    q = QuantumRegister(local_num_qubits)
    +    # WATCH ME: aggiunto registro controlled_qubit
    +    circuit = QuantumCircuit(self.controlled_qubit, q, name=""multiplex"" + local_num_qubits.__str__())
    +
    +    lsb = q[0]
    +    msb = q[local_num_qubits - 1]
    +
    +    # case of no multiplexing: base case for recursion
    +    if local_num_qubits == 1:
    +        temp_qubitsreg = [ self.controlled_qubit[0], q[0] ]
    +        circuit.append(target_gate(list_of_angles[0]), temp_qubitsreg)
    +        return circuit
    +
    +
    +    # calc angle weights, assuming recursion (that is the lower-level
    +    # requested angles have been correctly implemented by recursion
    +    angle_weight = scipy.kron([[0.5, 0.5], [0.5, -0.5]],
    +                              np.identity(2 ** (local_num_qubits - 2)))
    +
    +    # calc the combo angles
    +    list_of_angles = angle_weight.dot(np.array(list_of_angles)).tolist()
    +
    +    # recursive step on half the angles fulfilling the above assumption
    +    multiplex_1 = self._multiplex(target_gate, list_of_angles[0:(list_len // 2)])
    +    temp_qubitsreg =  [ self.controlled_qubit[0] ] + q[0:-1]
    +    circuit.append(multiplex_1.to_instruction(), temp_qubitsreg)
    +
    +    # attach CNOT as follows, thereby flipping the LSB qubit
    +    circuit.append(CnotGate(), [msb, lsb])
    +
    +    # implement extra efficiency from the paper of cancelling adjacent
    +    # CNOTs (by leaving out last CNOT and reversing (NOT inverting) the
    +    # second lower-level multiplex)
    +    multiplex_2 = self._multiplex(target_gate, list_of_angles[(list_len // 2):])
    +    temp_qubitsreg = [ self.controlled_qubit[0] ] + q[0:-1]
    +    if list_len > 1:
    +        circuit.append(multiplex_2.to_instruction().mirror(), temp_qubitsreg)
    +    else:
    +        circuit.append(multiplex_2.to_instruction(), temp_qubitsreg)
    +
    +    # attach a final CNOT
    +    circuit.append(CnotGate(), [msb, lsb])
    +
    +    return circuit
    +
  • +
+ +

Qiskit version

+ +

Latest version is used:

+ +
import qiskit
+qiskit.__qiskit_version__
+
+{'qiskit': '0.10.5',
+ 'qiskit-terra': '0.8.2',
+ 'qiskit-ignis': '0.1.1',
+ 'qiskit-aer': '0.2.1',
+ 'qiskit-ibmq-provider': '0.2.2',
+ 'qiskit-aqua': '0.5.2'}
+
+",1874,,,,,7/16/2019 10:05,Controlled-Initialize instruction,,1,2,,,,CC BY-SA 4.0 +6756,1,6762,,7/13/2019 4:12,,0,55,"

The Swap test proof on page 8 of https://sites.cs.ucsb.edu/~vandam/teaching/S05_CS290/week9.pdf ends with this derivation:

+ +

How you add those inner products to get from $\frac{1}{4}(2 + \langle \Psi, \varphi|\Psi, \varphi\rangle + \langle\varphi, \Psi|\Psi,\varphi\rangle)$

+ +

to +$\frac{1}{2} + \frac{1}{2} (|\Psi|\varphi\rangle|)^2 $?

+",362,,,,,7/13/2019 17:22,How is inner product addition performed?,,1,0,,,,CC BY-SA 4.0 +6759,1,,,7/13/2019 5:21,,-1,74,"

Can I edit a program with python numpy and scipy and of course qiskit in the IBM Q experience, using code? (I am not interested in drugging gates) and I can't find the way to edit my own program

+",8031,,,,,7/16/2019 9:23,edit a program on IBM Q experience,,1,0,,,,CC BY-SA 4.0 +6760,1,6767,,7/13/2019 12:03,,2,97,"

I'm doing the Q# quantum katas and I'm stuck on an oracle in the Deutsch-Jozsa algorithm katas.

+

Let $|x\rangle=|x_0x_1\dots x_{n-1}\rangle$ be a qubit array and $r$ be bit string of $k\leq n$. The $k$-prefix of a bit string $x$, $P_k(x)$, is the string obtained by cutting off everything except the first $k$ bits. An oracle for a function $f$ is a unitary operator that performs the following transformation

+

$$O_f|x\rangle|y\rangle=|x\rangle|y\oplus f(x)\rangle $$ +where $\oplus$ represents sum modulo $2$ and $|y\rangle$ in this case is a single qubit.

+

The task is to write an oracle for the following function

+

$$f(x)=\left( \bigoplus_{i=0}^{n-1}x_i \right) \oplus g(x,r)$$

+

where $$ g(x,r)=\begin{cases} +1\quad \textrm{ if } P_k(x)=r\\ +0\quad \textrm{ otherwise } +\end{cases}$$

+

The first term is easy to implement: just apply CNOT on $y$ with |$x_k\rangle$ as a control qubit for each $k$, this way $y$ is flipped as many times as there are $1$s in the string $x$, which is equivalent to flipping if the sum modulo $2$ is $1$.

+

The second term is giving me more trouble. I defined the qubit array $|r\rangle$ that contains the state equal to the bit string $r$ and another qubit array of the same length, $|z\rangle$ initially set to $|00\dots 0\rangle$ and I perform the following operation for every $j=0,\dots k-1$

+

$$\mathrm{CCNOT}|r_j\rangle|x_j\rangle|z_j\rangle $$ +$$X\otimes X |r_j\rangle|x_j\rangle $$ +$$\mathrm{CCNOT}|r_j\rangle|x_j\rangle|z_j\rangle $$ +$$X\otimes X |r_j\rangle|x_j\rangle $$

+

this way the bit $|z_j\rangle$ is flipped if and only if the state of $|r_j\rangle|x_j\rangle $ is $|0\rangle|0\rangle$ or $|1\rangle|1\rangle$. After this I apply a multi controlled $X$ gate with control $|z\rangle$ and target $|y\rangle$, the idea being that if $|z\rangle$ contains only $1$ then $P_k(x)$ and $r$ are equal. The test fails, and I can't understand why. Could anybody help?

+

Here is my code:

+
        for(k in 0..Length(x)-1) //first term
+        {
+            CNOT(x[k],y);
+        }
+
+        using(register = Qubit[Length(prefix)])
+        {
+            for(k in 0..Length(prefix)-1)           //copy the bit string prefix in a qubit array
+            {                                       //01001... -> |01001..⟩
+                if(prefix[k]==1)
+                {
+                    X(register[k]);
+                }
+            }
+            using(z = Qubit[Length(prefix)])
+            {
+                for(k in 0..Length(prefix)-1)
+                {
+                    CCNOT(register[k],x[k],z[k]);  //flips the state of the qubit z[k] if register[k] and x[k] are equal
+                    X(register[k]);                 //000 -> 000 -> 110 -> 111 -> 001
+                    X(x[k]);                        //010 -> 010 -> 100 -> 100 -> 010
+                    CCNOT(register[k],x[k],z[k]);  //100 -> 100 -> 010 -> 010 -> 100
+                    X(x[k]);                        //110 -> 111 -> 001 -> 001 -> 111
+                    X(register[k]);
+                }
+                Controlled X(z,y);
+                for(k in 0..Length(prefix)-1)  //resets z
+                {
+                    if(M(z[k])==One)
+                    {
+                        X(z[k]);
+                    }
+                }
+            }
+            for(k in 0..Length(prefix)-1) //resets register
+            {
+                if(M(register[k])==One)
+                {
+                    X(register[k]);
+                }
+            }
+        }
+
+",5125,,2927,,9/8/2021 23:34,9/8/2021 23:34,Hamming with prefix oracle,,1,0,,,,CC BY-SA 4.0 +6761,1,6763,,7/13/2019 12:28,,1,83,"

I encountered the notion of $\mathbb{Z}_2$ symmetry in an article. Can someone give a definition?

+",4127,,10480,,4/5/2021 17:38,4/5/2021 17:38,What is $\mathbb{Z}_2$ symmetry?,,1,2,,,,CC BY-SA 4.0 +6762,2,,6756,7/13/2019 13:19,,1,,"

$$ +\begin{align} + \Pr(\text{“0""}) & = + \frac{1}{4} ( 2 + \left\langle \psi , \phi \mid \phi, \psi \right\rangle + \left\langle \phi , \psi \mid \psi , \phi \right\rangle ) \\ + & = \frac{1}{4} ( 2 + \left\langle \psi \mid \phi \right\rangle \left\langle\phi \mid \psi\right\rangle + \left\langle \phi \mid \psi \right\rangle \left\langle\psi \mid \phi\right\rangle )\\ + & = \frac{1}{4} ( 2 + | \left\langle \psi \mid \phi \right\rangle |^2 + | \left\langle \phi \mid \psi \right\rangle|^2)\\ + & = \frac{1}{4} ( 2 + 2 | \left\langle \psi \mid \phi \right\rangle |^2 )\\ + & = \frac{1}{2} ( 1 + 1 | \left\langle \psi \mid \phi \right\rangle |^2 )\\ +\end{align} +$$

+ +

Edit:

+ +

$$ +| \left\langle \psi \mid \phi \right\rangle |^2 = | \left\langle \phi \mid \psi \right\rangle|^2 +$$ +Inside the norm squared, the 2 quantities inside are complex conjugates of each other. So they have the same norm squared.

+",434,,1978,,7/13/2019 17:22,7/13/2019 17:22,,,,2,,,,CC BY-SA 4.0 +6763,2,,6761,7/13/2019 14:17,,3,,"

There is an operator $P$ such that $P^2$ is the identity and commutes with the Hamiltonians.

+ +

In this case $P=\prod \sigma_x$.

+ +

This is a $\mathbb{Z}_2$ because $P$ and the identity form a group isomorphic to the integers modulo 2 (odds and evens)

+ +

Identity corresponds to evens, $P$ to odds. $P^2=1$ corresponds to odd plus odd equals even.

+ +

If there were some other operators commuting with the Hamiltonians, then would be some other kind of symmetry, not $\mathbb{Z}_2$. But in this case, it is not that complicated.

+",434,,434,,7/14/2019 14:16,7/14/2019 14:16,,,,2,,,,CC BY-SA 4.0 +6764,1,,,7/13/2019 15:03,,0,694,"

I want to do a feedforward on a quantum circuit using the simulator of Qiskit.

+ +

For example, measure qubit_1 to bit 1 and do some operator on qubit_2 if the result of measuring qubit_1 is 0 and if the result is 0, then another operator. Then measure qubit 3 and do some operator on qubit_4 if the result of measuring qubit_3 is 1.

+ +

so far I know that I could use

+ +
QuantumCurcuit.operator(Quantumregister[index]).c_if(classicalRegister, value)
+
+ +

But the condition of c_if is depended on all value of all bit of classical register. I want to do feedforward depend on an individual bit just 0 or 1.

+ +

I think it is not the right way to solve the issue by adding another addition qubit to be $|0\rangle$ and project it on the classical bit. Just to reset that bit to 0 again this way.

+ +

So is there any way to reset the classical register?

+",4729,,,,,8/14/2019 7:02,How to reset classical register on QISKit,,2,0,,,,CC BY-SA 4.0 +6765,1,6772,,7/13/2019 15:54,,1,96,"

Consider any data structure based on the binary search trees, e.g. set. Classical computers can make queries (insert, remove, test if element present), into this structure in $O(\log n)$ time, where $n$ is the number of elements.

+ +

Using the quantum circuit representation, set data structure requires $n$ wires to be implementable. The unitary matrices that represent queries on $n$ wires will have size $2^n \times 2^n$. The boundary on the length of the gate sequence is $O(2^n)$ (see Number of gates required to approximate arbitrary unitaries). Therefore, generally we won't be able to achieve classical $O(\log n)$ query complexity, we will have even worse $O(2^n)$!

+ +

I understand that $O(2^n)$ is given for arbitrary matrix. The question is: is it possible to implement the unitary matrices that represent set queries on $n$ qubits with a gate sequence of $O(\log n)$ length?

+",,user7988,,user7988,7/13/2019 16:03,7/14/2019 6:25,Is it possible to simulate any classical algorithm with the same efficiency on quantum computer?,,1,2,,,,CC BY-SA 4.0 +6766,2,,6751,7/13/2019 16:54,,1,,"

The key to figuring out the probability of any measurement result is Born's rule, which says that if you have a state $\left|\psi\right\rangle$ the probability of observing measurement outcome $\left|\phi\right\rangle$ is given by +$$ +\begin{align} + \Pr(\phi | \psi) = \left|\left\langle \phi | \psi \right\rangle \right|^2. +\end{align} +$$ +In the example you described, let's consider the probability with which Alice observes $\left|0\right\rangle$ and Bob observes $\sin(3\pi / 8) \left| 0\right\rangle + \cos(3\pi / 8) \left| 1\right\rangle$. This outcome occurs with probability +$$ +\begin{align} + & \Pr(A=0,B=0|\text{EPR}) \\ + & \quad = \frac12\left| + \sin(3\pi / 8) \left\langle 00 | 00 \right\rangle + + \cos(3\pi / 8) \left\langle 01 | 00 \right\rangle + + \sin(3\pi / 8) \left\langle 00 | 11 \right\rangle + + \cos(3\pi / 8) \left\langle 01 | 11 \right\rangle + \right|^2 \\ + & \quad = \frac12\left| + \sin(3\pi / 8) + \right|^2 \approx 0.85. +\end{align} +$$ +Here, we used that the four computational basis states $\left\{\left|00\right\rangle, \left|01\right\rangle, \left|10\right\rangle, \left|11\right\rangle \right\}$ are all orthogonal to each other, so that the $\left\langle 00 | 00\right\rangle$ is the only one that survives.

+ +

The probability for each of the other three outcomes can be worked out in a similar fashion using Born's rule.

+",1978,,,,,7/13/2019 16:54,,,,1,,,,CC BY-SA 4.0 +6767,2,,6760,7/13/2019 17:13,,3,,"

One problem is that you are resetting the $\left|z\right\rangle$ register after applying the Controlled X(z, y) operation. Right before you reset, your $\left|z\right\rangle$ register is entangled with the other two registers, such that resetting in that way collapses any superposition on the $\left|x\right\rangle \left|y\right\rangle$ registers. While that's not a problem if you only ever provide as input qubits in a computational basis state, the Deutsch–Jozsa algorithm uses inputs in states such as $\left|++\cdots+\right\rangle\left|-\right\rangle$.

+ +

If you want to use this approach, you'll need to first uncompute the information stored in $\left|z\right\rangle$. +Here, that means running the following loop over again after applying Controlled X(z, y):

+ +
for(k in 0..Length(prefix)-1)
+{
+    CCNOT(register[k],x[k],z[k]);  //flips the state of the qubit z[k] if register[k] and x[k] are equal
+    X(register[k]);                 //000 -> 000 -> 110 -> 111 -> 001
+    X(x[k]);                        //010 -> 010 -> 100 -> 100 -> 010
+    CCNOT(register[k],x[k],z[k]);  //100 -> 100 -> 010 -> 010 -> 100
+    X(x[k]);                        //110 -> 111 -> 001 -> 001 -> 111
+    X(register[k]);
+}
+
+ +

Doing so will deterministically return $\left|z\right\rangle$ to the all-zeros state, without using measurement. +This is very common in quantum programming, and is why the Q# standard libraries include operations like ApplyWithCA.

+",1978,,2879,,7/13/2019 18:25,7/13/2019 18:25,,,,0,,,,CC BY-SA 4.0 +6768,1,6782,,7/13/2019 22:19,,5,356,"

I'm trying to (understand and) solve this problem from Nielsen and Chuang's Quantum Computation and Quantum Information.

+ +

+ +

I know the definition of Operation Elements: $\sum_{k} E_k \rho E_k^†$ with $E_k = \langle e_k|U|e_0 \rangle$ where $e_k$ form the basis for the environment. But I'm not quite sure how this definition may be used to solve the problem above.

+",7805,,55,,2/19/2021 18:32,2/19/2021 18:32,Find the quantum operation corresponding to a given unitary evolution and projective measurement,,2,0,,,,CC BY-SA 4.0 +6769,1,6770,,7/14/2019 1:48,,0,64,"

In the 10th Anniversary Edition of Nielsen and Chuang Quantum Computation and Quantum Information textbook, Chapter 6.7 talks about Black Box algorithm limits.

+ +

It is given:

+ +

$f:\{0,1\}^n \rightarrow \{0,1\}$

+ +

$F:\{X_0,X_1,X_2,....,X_{N-1} \}\rightarrow \{0,1\}$ +$\text{such that} \space F \space \text{is a boolean function,} \space X_k=f(k) \space and \space N=2^n-1$

+ +

It is then mentioned that:

+ +
+

We say that a polynomial $p: R^N\rightarrow R$ represents $F$ if $p(X)=F(X)$ for all $X \in \{0,1\}^N$ (where $R$ denotes the real numbers). Such a polynomial $p$ always exists, since we can explicitly construct a suitable candidate:
+ $$p(X)=\sum_{Y\in \{0,1\}^N} F(Y)\prod_{k=0}^{N-1}[1-(Y_k-X_k)^2]$$

+
+ +

Can someone explain this formula to me and whether the construction is a result of rigorous steps or by intuition? Will also be good if there are useful materials related to this for me to read.

+",5253,,,,,7/14/2019 3:39,Minimum Multi-Degree Polynomials representing Boolean Functions,,1,0,,,,CC BY-SA 4.0 +6770,2,,6769,7/14/2019 3:39,,1,,"

Plug in an arbitrary $X$ into the formula.

+ +

Look at each summand for each particular $Y \in \{0,1\}^N$

+ +

If $Y \neq X$, then there must be at least one index $i$ such that $X_k \neq Y_k$. But both $Y_k$ and $X_k$ are only either $0$ or $1$. So if they are not equal, then the difference must be either $+1$ or $-1$. Square that and you get $1$ if they are different. Then one of the terms in the product will be $1-1=0$.

+ +

So if $Y \neq X$, that particular summand is $0$.

+ +

The only summand that remains is when $Y=X$. In that case each of the $1-(Y_k-X_k)^2$ are equal to $1$. So the product of all of those still gives $1$ and the result for that summand is $F(Y)=F(X)$.

+ +

Add together the summands for all the $Y$, and you get the only nonzero term, $F(X)$. So $p(X)=F(X)$ for all $X \in \{0,1\}^N$.

+ +

As desired, $p$ represents $F$. However, there may be simpler $p$ that still do the same. This is just one of them. The one of smallest degree gives the notion of degree of a boolean function which is related to sensitivity and block sensitivity.

+",434,,,,,7/14/2019 3:39,,,,1,,,,CC BY-SA 4.0 +6771,2,,6764,7/14/2019 5:26,,1,,"

The c_if in Qiskit only operates on a full classical register, following the OpenQASM spec. If you would like to condition on individual bits, you have to create a new ClassicalRegister for each bit. Then you can condition on each bit separately.

+",2503,,,,,7/14/2019 5:26,,,,1,,,,CC BY-SA 4.0 +6772,2,,6765,7/14/2019 6:25,,2,,"

Yes, any classical algorithm can be implemented as a quantum circuit with almost same efficiency.

+ +

At first, we make our algorithm reversible (just include input as part of the output). Then represent it as a classical logic circuit and then modify this circuit such that it will contain only reversible classical logical gates https://en.wikipedia.org/wiki/Reversible_computing#Logical_reversibility. Actually we can use only classical Toffoli gate since it's universal for classical reversible circuits. Finally reversible classical gates are simply translated to corresponding quantum gates.

+",5870,,,,,7/14/2019 6:25,,,,0,,,,CC BY-SA 4.0 +6773,2,,6738,7/14/2019 8:41,,0,,"

I find two answers: (code tested and working)

+ +
    +
  • Answer (1) (read the register value before the execute command)
  • +
+ +
from qiskit import *
+qiskit.IBMQ.disable_accounts()
+IBMQ.enable_account('change to your api','change to your url')
+#backend = qiskit.IBMQ.get_backend('ibmq_16_melbourne')
+backend = qiskit.IBMQ.get_backend('ibmq_qasm_simulator')
+
+qr  = QuantumRegister  (4)# 1110
+qq  = QuantumRegister  (4)# will set to 1110 dependin on cr read
+cr  = ClassicalRegister(4)
+cc  = QuantumCircuit(qr,qq,cr)
+
+cc.x(qr[1]);cc.x(qr[2]);cc.x(qr[3])# 1110
+
+#---the important code start:----------------------------------------
+for i in range(4):
+    cc.measure(qr[i],cr[0])#read qr to set qq depending on the read of the classical register value using (if) condition
+    cc.reset(qq[i]) # qq[i] = 0
+    cc.x(qq[i]).c_if(cr,1) # if(cr == 1): qq[i] = 1 , test the whole cr decimal value, it can hold {0 to (2^n)-1}
+#---the important code end--------------------------------------------
+
+for i in range(4): cc.measure(qq[i],cr[i])#read qq
+
+job=qiskit.execute(cc,backend,shots=1024)
+result=job.result()
+counts=result.get_counts(cc)
+print(counts) # {'1110': 1024}
+
+ +

--- execute result ---

+ +
{'1110': 1024}
+
+ +

.

+ +

.

+ +
    +
  • Answer (2) (read the register value after the execute command)
  • +
+ +
from qiskit import *
+qiskit.IBMQ.disable_accounts()
+IBMQ.enable_account('change to your api','change to your url')
+#backend = qiskit.IBMQ.get_backend('ibmq_16_melbourne')
+backend = qiskit.IBMQ.get_backend('ibmq_qasm_simulator')
+
+qr  = QuantumRegister  (4)# 1110
+cr  = ClassicalRegister(4)
+cc  = QuantumCircuit(qr,cr)
+
+cc.x(qr[1]);cc.x(qr[2]);cc.x(qr[3])# 1110
+
+for i in range(4): cc.measure(qr[i],cr[i])#read
+
+job=qiskit.execute(cc,backend,shots=1024)
+result=job.result()
+counts=result.get_counts(cc)
+print(counts) # {'1110': 1024}
+
+#---the important code start:----------------------------------------
+lAnswer = [(k[::-1],v) for k,v in counts.items()]
+lAnswer.sort(key = lambda x: x[1], reverse=True)
+Y = []
+for k, v in lAnswer: Y.append( [ int(c) for c in k ] )
+#---the important code end--------------------------------------------
+
+print(Y) # [[0, 1, 1, 1]]
+
+print(Y[0][0]) # 0
+print(Y[0][1]) # 1
+print(Y[0][2]) # 1
+print(Y[0][3]) # 1
+
+ +

--- execute result ---

+ +
{'1110': 1024}
+[[0, 1, 1, 1]]
+0
+1
+1
+1
+
+",8018,,,,,7/14/2019 8:41,,,,0,,,,CC BY-SA 4.0 +6774,1,,,7/14/2019 10:01,,-2,421,"

Note: forcing a superposition qubit to collapses to 1, means cancel the other value 0 to get 1 appear

+ +

Question details step by step:

+ +
#If i have two qubits
+Qr = QuantumRegister(1)
+qr = QuantumRegister(1)
+
+#and two classical registers
+Cr = ClassicalRegister(1)
+cr = ClassicalRegister(1)
+
+#and one quantum circuit
+cc = QuantumCircuit(Qr,qr,Cr,cr)
+
+#And put Qr in superposition state
+cc.h(Qr[0])
+
+#And copy Qr to qr
+cc.cx(Qr[0],qr[0])
+
+# How to force qr[0] to collapses to a certain needed value (say 1) ,
+# and after measuring Qr[0] it gives the same qr[0] value (gives 1 too)
+
+#########################################################################
+# need to do some tricks to force qr[0] to be 1
+# (force it to be 1 by changing the probability of being 1 to high,
+# not by changing the value of it to 1)
+# and Qr[0] measuring also gives 1 (without doing any operations to it)
+# all operations will done to qr[0] only
+# we can add/use any new registers
+#########################################################################
+
+# and after measuring , we have to found that Cr[0] == cr[0] == 1
+cc.measure(Qr[0],Cr[0]) # Cr==1
+cc.measure(qr[0],cr[0]) # cr==1
+
+
+# who can do it? and how?
+# or even increasing the probability of getting 1 like 90%:10% instead of 50%:50%
+
+
+ +

Idea (1): when we do h(Qr), it will be in superposition state, it means it can be 0 and changed to 1 at any moment, i need some method to measure the probability of being 1 at this moment, if it is high then i do normal measure to catch it, if it is low, then i loop doing another things and test the probability again until it is changed to high, then we can do normal measure to catch and make it real, we will do this to all qubits one by one till get all our outputs match the known outputs, then our inputs will be the secret inputs that we want to know.

+ +

.

+ +

in another words: we want Qr still in superposition but after excute it 1000 shots and measure it,we get 990 times 1 and 10 times 0 or {'0': 10, '1': 990}

+",8018,,55,,4/9/2021 9:00,4/9/2021 9:00,"The most important quantum question , how to force a superposition qubit to collapses to an exact value?",,2,3,,8/1/2019 17:03,,CC BY-SA 4.0 +6775,1,6791,,7/14/2019 11:25,,7,1591,"

I'm trying to apply a time evolution algorithm for a physical system I'm trying to simulate on QISkit, however, in order to do that, I need to use the so-called Ising coupling gate:

+ +

$I=\begin{pmatrix} +e^{ia} & 0 & 0 &0 \\ +0 & e^{-ia} & 0 & 0 \\ +0 & 0 & e^{-ia} & 0 \\ +0 & 0 & 0 & e^{ia} +\end{pmatrix}$

+ +

I've tried performing rotations in the z-axis in both quits with the rz gate, also I've tried combining crz gates, as well as rzz and cu1 gates, but nothing seems to work.

+ +

The closest I could get was by implementing a zzz gate followed by a cu1 gate with oposite angle, however $[I]_{1,1}$ still remains at 1, no phase detected by the Aer unitary simulator.

+ +

How can I implement this gate?

+ +

Thank you very much in advance.

+",8040,,26,,10/27/2019 9:33,2/9/2022 20:56,How to create an Ising coupling gate with Qiskit?,,4,0,,,,CC BY-SA 4.0 +6776,1,,,7/14/2019 11:59,,3,130,"

I have the latest version of cplex (12.9) installed on my computer. I use it very well with Jupyter notebook, but in IBM Q Experience, I did not get way to call it. IBM Q Experience warns me that the cplex is not installed. Any ideas?

+ +

Many thanks +Parfait

+",8042,,55,,12/3/2021 9:04,12/28/2022 12:01,How call from IBM Q Experience (Jupyter Notebook) cplex,,1,2,,,,CC BY-SA 4.0 +6777,2,,6775,7/14/2019 12:23,,0,,"

I guess what you may need is the Pauli operators:

+ +

https://qiskit.org/documentation/_modules/qiskit/quantum_info/operators/pauli.html

+ +

https://www.sciencedirect.com/topics/engineering/pauli-operator

+",8042,,26,,10/27/2019 9:33,10/27/2019 9:33,,,,0,,,,CC BY-SA 4.0 +6778,2,,6774,7/14/2019 14:44,,1,,"

i think you have done entaglment $\frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$ so when you measure the first qubit the second qubit forces to be collapses to the same state as the first qubit state.

+",4206,,,,,7/14/2019 14:44,,,,9,,,,CC BY-SA 4.0 +6779,1,,,7/14/2019 15:31,,4,134,"

In this paper, QAOA on Maxcut shows symmetries that allow them to restrict their search space intervals. But how do they find such intervals knowing that in the original QAOA angles $\gamma,\beta$ are set on the intervals $[0,2\pi], [0,\pi]$ ?

+",4127,,55,,9/28/2019 19:15,6/23/2021 20:46,QAOA and symmetry effects on the angles,,1,0,,,,CC BY-SA 4.0 +6780,2,,6775,7/14/2019 15:33,,1,,"

Conjugate by a CNOT, you'll see a controlled unitary of multiplying by $e^{\pm 2i a}$ depending on which CNOT you do and an overall phase of $e^{\mp i a}$.

+",434,,,,,7/14/2019 15:33,,,,0,,,,CC BY-SA 4.0 +6782,2,,6768,7/14/2019 19:07,,5,,"

So, let the system be $\rho$, and the environment $|0\rangle \langle 0|$.

+ +

The given operation (which you can check is unitary, and incidentally happens to be the CNOT operation), is applied on $\rho \otimes |0\rangle \langle 0|$.

+ +

So, you have: +$$(P_0 \otimes I + P_1 \otimes X)(\rho \otimes |0\rangle \langle 0|)(P_0 \otimes I + P_1 \otimes X)$$

+ +

Now, you just expand it and multiply to get: +$$P_0 \rho P_0 \otimes |0\rangle \langle 0| + +P_0 \rho P_1 \otimes |0\rangle \langle 1| + +P_1 \rho P_0 \otimes |1\rangle \langle 0| + +P_1 \rho P_1 \otimes |1\rangle \langle 1| $$

+ +

When you trace out the environment, you're left with: +$$P_0 \rho P_0 + P_1 \rho P_1$$

+ +

Thus the operator elements are $P_0$ and $P_1$.

+",2832,,,,,7/14/2019 19:07,,,,3,,,,CC BY-SA 4.0 +6783,2,,2724,7/14/2019 21:50,,3,,"

I just found this now: +https://brilliant.org/courses/quantum-computing/, I will start it today, at this moment I don't know how far I will go with the free subscription since I joined it following the link in the Microsoft Quantum blog post (where you can have more info about the content) .
+For late joiners and non campaign users only 2 chapters will be available for free.

+",7961,,7961,,7/14/2019 22:33,7/14/2019 22:33,,,,1,,,,CC BY-SA 4.0 +6784,1,6792,,7/14/2019 23:05,,8,1962,"

There seem to be two definitions of the Pauli group. In Nielsen and Chuang, the Pauli group on 1 qubit is defined as +\begin{align*} +\mathcal{P}_1 = \{\pm I, \pm iI, \pm X, \pm iX, \pm Y, \pm iY, \pm Z, \pm iZ\} = \langle X, Y, Z\rangle. +\end{align*} +But in other references, such as https://journals.aps.org/pra/abstract/10.1103/PhysRevA.57.127, +\begin{align*} +\mathcal{P}_1 = \{\pm I, \pm X, \pm iY, \pm Z\} = \langle X, Z\rangle. +\end{align*} +The second definition makes more sense in the stabilizer formalism, since we usually only consider the action of Pauli strings of $X$ and $Z$. What bothers me is that by the second definition, the phase gate $S$, which is an element of the Clifford group, results in +\begin{align*} +SXS^\dagger = Y \notin \mathcal{P}_1. +\end{align*} +I know that the prefactor $\pm i$ somehow doesn't matter, but can someone justify it from a more mathematical/group-theoretical perspective?

+",7745,,,,,7/16/2019 18:18,Definition of the Pauli group and the Clifford group,,2,0,,,,CC BY-SA 4.0 +6785,2,,6784,7/14/2019 23:23,,6,,"

The difference in definitions is from either taking the unitary group or the projective unitary group. That accounts for the constant prefactors of $\pm i$ that are missing.

+ +

In lieu of a tikz commutative diagram

+ +

\begin{align} +<X,Y,Z> & \hookrightarrow & U(2)\\ +\downarrow & & \downarrow\\ +<[X],[Z]> & \hookrightarrow & PU(2) +\end{align}

+ +

For both of the inclusion arrows $H \hookrightarrow G$, you can form normalizers $N_G (H)$ which fit in between on each row.

+",434,,434,,7/16/2019 18:18,7/16/2019 18:18,,,,2,,,,CC BY-SA 4.0 +6786,1,6787,,7/15/2019 3:28,,3,96,"

I'm studying the measurement in quantum computation. It's known that the trace is related to the expectation value and the probability of getting certain outcomes. However, when the trace is a complex value, how is it related to the probability or the counting number of outcomes in real world?

+",4178,,124,,7/15/2019 13:36,7/15/2019 13:36,What's the probability of measuring outcomes give measurement observable $M$ and state $\rho$ when $\mathrm{Tr}\!\:(\!\!\;M\rho)$ is a complex value?,,1,0,,,,CC BY-SA 4.0 +6787,2,,6786,7/15/2019 5:12,,5,,"

$\text{Tr}(AB)$ is always real and non-negative if $A,B$ are positive semi-definite hermitian matrices.

+ +

To see this note that $A = UDU^\dagger$, for some unitary $U$ and diagonal matrix $D$ with $d_{ii} \ge 0$.
+Then $\text{Tr}(AB) = \text{Tr}(UDU^\dagger B) = \text{Tr}(DU^\dagger B U).$
+But $B^\prime = U^\dagger B U$ is also positive semi-definite and hermitian, therefore it has non-negative numbers on diagonal $b^\prime_{ii} \ge 0$. Now $\text{Tr}(DB^\prime) = \sum_i d_{ii}b^\prime_{ii} \ge 0$.

+",5870,,5870,,7/15/2019 7:04,7/15/2019 7:04,,,,1,,,,CC BY-SA 4.0 +6788,2,,6764,7/15/2019 7:01,,0,,"

You dont have to reset classical registers they store the current measurment result of the quantum bits. I.e. the value of the classical register is not the matter what it matter is that the value they hold after the measurment.

+",4206,,,,,7/15/2019 7:01,,,,4,,,,CC BY-SA 4.0 +6789,2,,6768,7/15/2019 7:35,,3,,"

As an alternative to the other answer (which is perfectly valid), we can use the formalism specified in the question. We're given a $U=P_0\otimes I+P_1\otimes X$. We know that the environment starts in state $|e_0\rangle=|0\rangle$. We need to establish an orthonormal basis for the environment, $|e_k\rangle$. In this case, it's straightforward as the environment is only two-dimensional: +$$ +|e_0\rangle=|0\rangle\qquad |e_1\rangle=|1\rangle. +$$ +Now we can apply the formula $E_k=(I\otimes \langle e_k|)U(I\otimes |e_0\rangle)$. Note that I've added in some identity elements to make it clearer that the environment basis only applies to the second subsystem. Now, +$$ +U(I\otimes |e_0\rangle)=P_0\otimes|0\rangle+P_1\otimes|1\rangle, +$$ +and so we have +$$ +E_0=(I\otimes\langle 0|)(P_0\otimes|0\rangle+P_1\otimes|1\rangle)=P_0, +$$ +and $E_1=P_1$.

+",1837,,,,,7/15/2019 7:35,,,,1,,,,CC BY-SA 4.0 +6790,2,,6774,7/15/2019 8:00,,2,,"

You cannot force a superposition to collapse in a particular direction. When you perform a measurement that removes a superposition, that 'collapse' is random, and you cannot choose which way it collapses.

+ +

However, if you know what superposition you have, you can always convert it into any other state that you want to via unitary evolution (at which point you should not be using the 'collapse' terminology, which implies a non-unitary evolution).

+ +

Reading the comments, it seems that what you want to do is manipulate the probabilities with which the state collapses. This is better incorporated into the preparation procedure. Instead of performing a Hadamard rotation on the first qubit, perform a $Y$-rotation of some angle $2\theta$. I think this is provided by a command called ry. This will provide you with a state $\cos\theta|0\rangle+\sin\theta|1\rangle$ so that when you apply the controlled-not gate, you'll have $\cos\theta|00\rangle+\sin\theta|11\rangle$. This means that when you measure, you'll get the answer 0 (on both qubits) with probability $\cos^2\theta$, and 1 with probability $\sin^2\theta$.

+",1837,,,,,7/15/2019 8:00,,,,2,,,,CC BY-SA 4.0 +6791,2,,6775,7/15/2019 8:20,,7,,"

AHusain's answer is absolutely correct, but perhaps lacks some detail. The circuit that you want to implement is + +Basically, the key is to realise that you want to apply phase $e^{i\alpha}$ to the basis elements $|00\rangle$ and $|11\rangle$, and $e^{-i\alpha}$ otherwise. In other words, you care about the parity of the two bits. If you can compute that parity of the two bits somewhere, you can perform a phase gate on that output, then undo the computation. Controlled-not computes the parity.

+ +

Here, I'm assuming that +$$ +R_z(\alpha)=\left(\begin{array}{cc} e^{i\alpha} & 0 \\ 0 & e^{-i\alpha} \end{array}\right). +$$ +This might be inconsistent with whatever definition you wish to use by a global phase or by a factor of 2 on the angle.

+",1837,,,,,7/15/2019 8:20,,,,3,,,,CC BY-SA 4.0 +6792,2,,6784,7/15/2019 9:31,,5,,"

Note that the second definition actually doesn't make more sense in the context of the stabiliser formalism, as neither of $\pm i Y$ have a +1 eigenspace. That means that you can only describe states which are stabilised by operators with two or more factors of $\pm i Y$. This is only enough to simulate real stabiliser circuits, which is what you're noticing.

+ +

For that reason, I would use the first definition; and anyone whose work involves taking the Pauli operators first (which consist of $\mathbf 1$, $X$, $Z$, and also $Y$) and then generating a group from them will inevitably use the first definition, for the simple reason that this is the group $\langle X, Y, Z\rangle$. And because the operators $\mathbf 1$, $X$, $Y$, and $Z$ form an operator basis for the Hermitian operators on a single qubit, there are often very good theoretical reasons to include the operator $Y$ (in preference to $iY$) in one's analysis.

+ +

It must be said that [Phys. Rev. A 57 (127), 1998] is not just any old article which uses the Pauli group, nor will the point I made above have escaped its author. The reason (I believe) why Gottesman didn't make the distinction there, that I am making now, is because his main interest in that article is in describing error correcting codes — in which the scalar factors preceding the Pauli operators are in principle less important.

+ +
    +
  • To start with, many of the best liked and interesting codes — from the 9-qubit code and the Steane $[\! [7,1,3]\! ]$ code, to the toric code — happen to be CSS codes, whose stabiliser groups are generated by separate X and Z stabilisers; any stabiliser operators involving Y, will indeed have Y operators in pairs. So, in practise, the point I made about $iY$ not having a +1 eigenspace often doesn't come up.

  • +
  • Secondly, if one decides to just do a hand-wave and forget all scalars, then the important thing is not whether a state is a joint +1 eigenstate of the stabilisers, but just that the state is some eigenstate of all the stabilisers. Considering a stabiliser code, the important thing is that all of the states of the code have the same eigenvalues as each other. This second point gives rise to the notion of the Pauli Frame: the eigenvalues which the codespace has for the 'stabilisers', interpreted as a reference frame. The main thing is for the Pauli frame to be well-defined, and for it to change slowly enough to track how it is changing by stabiliser measurements. And if you're not actually responsible for realising a system to do so, but just want to explore the theory of quantum error correction codes itself, specific eigenvalues are largely a distraction.

  • +
+ +

The thing is, if you want to use the stabiliser formalism for a different purpose — say, to efficiently simulate stabiliser circuits on standard basis states — then you can't be quite so carefree with scalars: a collection of $n$-qubit stabiliser generators define a specific basis in which the state will live, but flip some signs and you change which of the $2^n$ states you are talking about. To perform the correct simulation, signs do matter here. Keeping track of them may be slightly tedious using the usual convention, but in the end it's important to do.

+",124,,124,,7/15/2019 13:35,7/15/2019 13:35,,,,6,,,,CC BY-SA 4.0 +6793,2,,6759,7/16/2019 9:23,,2,,"

You can't edit using python in the circuit composer. You can edit the OpenQASM which can be found on the left-hand side of the composer.

+ +

If you would like to use Qiskit, this is also available through the Q Experience, you need to click on the Jupyter Notebooks. Here you can create circuits of your own, or modify the given examples.

+",5955,,,,,7/16/2019 9:23,,,,0,,,,CC BY-SA 4.0 +6794,2,,6755,7/16/2019 10:05,,1,,"

This is occurring because you declare your definition rule on two registers, but the way nodes are added to the DAG, only one register will be added. It is defined over both the QuantumRegister ""q"" you define in the method, and also the register passed in to self.params.

+ +

To fix this therefore you need to update your definition to work on only one register. For example, the first qubit could be the control and the other qubits can be initialised.

+",5955,,,,,7/16/2019 10:05,,,,1,,,,CC BY-SA 4.0 +6795,2,,6733,7/16/2019 11:04,,3,,"

Qualitatively, fidelity is the measure of the distance between two quantum states. Fidelity equal to 1, means that two states are equal. +In the case of a density matrix, fidelity represents the overlap with a reference pure state. Fidelity equal to 1, means that the square of density matrix is equal to density matrix itself and equivalent to the pure reference state.

+ +

Like every distance in metric spaces, it is obtained by means of an inner product. The inner product of two states is the overlap. The square of that is the fidelity (in the same way that that distance is defined in Euclidean space). That is, $|\langle \psi_1 | \psi_2 \rangle |^2$, also known as spectroscopic factor in some physics context.

+ +

For mixed state is the equivalent operation, that is evaluation of the density matrix $\langle \psi_1 | \rho_1 |\psi_1 \rangle$.

+ +

This measure is particularly important because quantum devices are noisy devices, therefore the fidelity of a result respect to an exact solution represents the inverse of the noise.

+",8053,,9006,,2/16/2020 11:49,2/16/2020 11:49,,,,1,,,,CC BY-SA 4.0 +6796,1,,,7/16/2019 15:59,,2,94,"

I want to investigate the effect of the decoherence time on a qubit, and I followed the tutorial here. https://quantumexperience.ng.bluemix.net/proxy/tutorial/full-user-guide/002-The_Weird_and_Wonderful_World_of_the_Qubit/006-Decoherence.html +But my results don't really match up with the expected values where more gates would result in a higher P(0). Does anyone know why that is?

+ +
    # t1.py
+import numpy as np
+import matplotlib.pyplot as plt
+
+from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister, execute
+
+from qiskit import IBMQ
+IBMQ.load_accounts()
+print(""Available backends:"")
+IBMQ.backends()
+from qiskit.providers.ibmq import least_busy
+
+large_enough_devices = IBMQ.backends(filters=lambda x: x.configuration().n_qubits > 3 and not x.configuration().simulator)
+backend = least_busy(large_enough_devices)
+print(""The best backend is "" + backend.name())
+# Define the Quantum and Classical Registers
+q = QuantumRegister(1)
+c = ClassicalRegister(1)
+
+# Build the circuits
+pre = QuantumCircuit(q, c)
+pre.x(q)
+pre.barrier()
+meas = QuantumCircuit(q, c)
+meas.measure(q, c)
+circuits = []
+exp_vector = range(1,61)
+for exp_index in exp_vector:
+    middle = QuantumCircuit(q, c)
+    for i in range(45*exp_index):
+        middle.iden(q)
+    circuits.append(pre + middle + meas)
+
+# Execute the circuits
+
+
+shots = 1024
+job = execute(circuits, backend, shots=shots, max_credits=10)
+result = job.result()
+
+# Plot the result
+exp_data = []
+exp_error = []
+for exp_index in exp_vector:
+    data = result.get_counts(circuits[exp_index-1])
+    try:
+        p0 = data['0']/shots
+    except KeyError:
+        p0 = 0
+    exp_data.append(p0)
+    exp_error.append(np.sqrt(p0*(1-p0)/shots))
+
+plt.errorbar(exp_vector, exp_data, exp_error)
+plt.xlabel('time [45*gate time]')
+plt.ylabel('Pr(0)')
+plt.grid(True)
+plt.show()
+
+ +

+",8056,,,,,7/20/2019 19:05,Measuring the effect of energy relaxation with IBMQ Experience,,2,0,,,,CC BY-SA 4.0 +6797,2,,2667,7/16/2019 22:40,,5,,"

I just found this: https://brilliant.org/courses/quantum-computing/, I just did the intro but the remaining is very promising. +
+
In the end of the description:

+ +
+

Our focus is learning how to exploit the laws of quantum mechanics in + order to compute. By the end, you'll know your way around the world of + quantum information, have experimented with the ins and outs of + quantum circuits, and have written your first 100 lines of quantum + code — while remaining blissfully ignorant about detailed quantum + physics.

+
+",7961,,,,,7/16/2019 22:40,,,,0,,,,CC BY-SA 4.0 +6798,2,,6776,7/17/2019 0:11,,0,,"

As answered on slack, this is not currently possible.

+",332,,,,,7/17/2019 0:11,,,,3,,,,CC BY-SA 4.0 +6799,1,6801,,7/17/2019 22:07,,5,234,"

Is the statement in the question correct? +I would love to receive an explanation as to why it is or isn't.

+ +

I have a computer science degree background and I am a beginner learning the fundamental of QC from scratch.

+",7528,,,,,7/18/2019 12:46,A quantum computer that doesn't use entangled qubits has the same computational power as a classical one?,,2,3,,,,CC BY-SA 4.0 +6800,1,6805,,7/18/2019 6:38,,6,486,"

In a Hilbert space of dimension $d$, how do I calculate the largest number $N(\epsilon, d)$ of vectors $\{V_i\}$ which satisfies the following properties. Here $\epsilon$ is small but finite compared to 1.

+

$$\left\langle V_i\middle|V_i\right\rangle = 1$$

+

$$\left|\middle\langle V_i\middle|V_j\middle\rangle\right| \leq \epsilon, i \neq j$$

+

Some examples are as follows.

+
    +
  1. $N(0, d)$ = d

    +
  2. +
  3. $N\left(\frac{1}{2}, 2\right)$ = 3, this can be seen by explicit construction of vectors using the Bloch sphere.

    +
  4. +
  5. $N\left(\frac{1}{\sqrt{2}}, 2\right) = 6$, again using the same logic.

    +
  6. +
+

How do I obtain any general formula for $N(\epsilon, d)$. Even an approximate form for $N(\epsilon, d)$ in the large $d$ and small $\epsilon$ limit works fine for me.

+",2669,,10454,,1/25/2023 15:46,1/25/2023 15:46,"Maximum number of ""almost orthogonal"" vectors one can embed in Hilbert space",,2,0,,,,CC BY-SA 4.0 +6801,2,,6799,7/18/2019 6:42,,3,,"

Assuming you are talking about starting from a pure state, your statement is true. There are two steps to the proof:

+ +
    +
  • Show that a system without entanglement can implement any classical computation.

  • +
  • Show that a system that remains separable can be simulated by a classical computation, proving that there are no calculations it can implement that a classical computer cannot.

  • +
+ +

The first is straightforward. Every classical computation can be written as a classical reversible computation. The Toffoli gate (controlled-controlled-not) is universal for classical reversible computation, so any circuit can be entirely decomposed in terms of that. But Quantum computers can implement the Toffoli gate, so they can implement any classical computation, and the state of the system at any intermediate point must be the same as in the classical computation, and therefore separable.

+ +

The second is also reasonably straightforward. If we know that every qubit remains separable, then we can hold in memory just the set of $N$ qubit states, comprising $N$ 2-element normalised complex vectors (as compared to the general case of a single $2^N$ element normalised complex vector). Whatever set of gates we use to describe the computation will act on some finite number of qubits, say $k$ at maximum (independent of $N$). So each computational step requires the action of a $2^k\times 2^k$ matrix, which we just have to apply to the appropriate set of $k$ separable states. We extract the separable states at the end, and continue. The total simulation time is $O(NM)$ for a sequence of $M$ gates on a classical computer.

+",1837,,,,,7/18/2019 6:42,,,,1,,,,CC BY-SA 4.0 +6802,2,,6800,7/18/2019 7:36,,4,,"

This seems like it should be a known mathematical property of Hilbert spaces, but I can't immediately lay my hand on any such result. In lieu of that, this is very far from an answer to your question, but it perhaps indicates the difficulty of (some of) what you're asking...

+ +

First, perhaps we can clarify your problem statement. I assume you mean +$$ +|\langle V_i|V_j\rangle|\leq\epsilon,i\neq j? +$$ +This would be consistent with your statement that $N(1/\sqrt{2},2)=6$ because here you're be talking about the eigenvectors of the X,Y and Z Pauli operators. But Since you have both $|0\rangle$ and $|1\rangle$, for example, their overlaps are 0, not $1/\sqrt{2}$.

+ +

Assuming this is the statement that you wanted...

+ +

There is the concept of Mutually Unbiased Bases. Essentially, this is attempting to evaluate $N(1/\sqrt{d},d)$. (Strictly, it is a lower bound.) In the case that $d$ is the power of a prime, then there are $d+1$ mutually unbiased bases, meaning a set of $d(d+1)$ vectors. However, if $d$ cannot be written in this form, there are only bounds on the number of bases. For example, $d=6$, an answer is suspected but not known.

+ +

Of course, this doesn't rule out the possibility of getting the sort of limits you're after, but suggests that exact evaluation for arbitrary parameter values might be problematic. That said, you might want to clarify what you mean by the small $\epsilon$ limit - you've already given the answer for $\epsilon=0$, so that must be the small $\epsilon$ limit.

+ +

You might be able to get some mileage out of this paper. It's related to mutually unbiased bases, but gives some other bounds as well which might be adapted to your purposes.

+",1837,,,,,7/18/2019 7:36,,,,1,,,,CC BY-SA 4.0 +6803,1,7074,,7/18/2019 8:13,,3,804,"

I currently need to implement efficiently a quantum comparator, with one of the values that is known at generation-time.

+ +

In other words, I am searching for a quantum routine compare(n, rhs) that will produce a circuit taking as input

+ +
    +
  1. a quantum register $\vert a \rangle$ of size n that should be interpreted as a unsigned integer.
  2. +
  3. a single qubit initialised to $\vert 0 \rangle$ that will store the result of $a < rhs$ at the end of the routine.
  4. +
  5. at most one ancilla qubit, and preferably no ancilla qubit at all.
  6. +
+ +

There are a lot of quantum comparators in the wild (for example [1], [2] or [3]) but all of them are designed to compare values stored in two quantum registers, not one value from a quantum register and the other known at compile time.

+ +

I tried to modify [1] in order to be able to remove the need for the quantum register $\vert b \rangle$, but I ended up proving it was not possible (see my question).

+ +

Even if I have no rigorous proof, I think a similar argument applies to [2]. My ""intuition"" comes from the fact that in [2], both $\vert a \rangle$ and $\vert b \rangle$ are used to store intermediate results, which is impossible if we remove one of them.

+ +

On the other hand, [3] is relatively easy to adapt. The only operation involving $\vert b \rangle$ is a controlled-Phase, so we can easily ""remove"" the control and just apply a Phase gate when the corresponding bit of $b$ (known at generation-time) is $1$.

+ +

Draper's adder ([3]) is nice on multiple points:

+ +
    +
  1. No ancilla qubit needed.
  2. +
  3. Only QFT and phase gates, which should be easy to implement on hardware.
  4. +
  5. A depth in $O(n)$.
  6. +
+ +

But an ideal implementation would also:

+ +
    +
  1. have a number of gates that grows in $O(n)$. Draper's adder is $O(n^2)$ because of the QFT.
  2. +
  3. have more room for optimisation with respect to the number of gates / depth (for example a very low cost when the constant is $\vert 00000\rangle$ or has a lot of $0$.
  4. +
  5. be based on a logic/arithmetic approach like [1] or [2]. One of the problem with Draper's adder is that it requires very precise rotations angle, and it is hard to compute the error introduced if one of the rotations is only approximated and not exact.
  6. +
+ +

My question: do you know any paper that introduce an algorithm that may interest me, based on the lists above?

+",1386,,,,,8/22/2019 20:21,Quantum comparator with one fixed input,,1,0,,,,CC BY-SA 4.0 +6804,1,,,7/18/2019 9:02,,3,69,"

I'm studying how Quantum Metropolis Algorithm (QMA) works and I think that I've understood it. Generally, the basic Metropolis step for a gave hamiltonian at the inverse temperature $\beta$ is: 1) it starts with a initial state, 2) it changes it with a local random "kick operator", 3) it uses quantum phase estimation for evaluate the energy gap between the initial state and the new state, 4) it applies a controlled rotation (based on the energy gap) to rotate an ancilla qubit prepared in a computational base state, 5) and finally it measures this state to accept/reject the proposal new state.

+

First of all, I ask confirms whether this vague explanation is correct or not. Then I'll ask you the main question: in many articles on QMA, authors add to the general explanation of the Algorithm also a part where they use Quantum Simulated Annealing (QSA). I understand that this procedure is useful to switch from an initial state with high temperature to a state with lower, but I can't understand why this process is necessary: this "temperature correction" has not already done by the QMA previously described?

+

Maybe QSA is only an explanation of why QMA actually works...

+

Thank you in advance!

+",8063,,16606,,6/2/2022 12:36,6/2/2022 12:36,Quantum Metropolis Algorithm: why is Quantum Simulated Annealing necessary?,,0,1,,,,CC BY-SA 4.0 +6805,2,,6800,7/18/2019 9:24,,5,,"

There is no general exact formula for $N(\epsilon, d)$ and some special cases (for example SIC-POVM) is an area of active research.

+ +

However there is a Welch bound that gives $\epsilon^2 \ge \frac{n-d}{d(n-1)}, n=N(\epsilon, d)$ and hence bounds $N(\epsilon, d)$ from above.

+",5870,,,,,7/18/2019 9:24,,,,0,,,,CC BY-SA 4.0 +6806,2,,6799,7/18/2019 12:46,,2,,"

The linked question in the comments is akin to ""can we efficiently simulate a quantum computer without entanglement?"", while the question of the OP is more akin to ""if we handicap a quantum computer to not use entanglement, is such a quantum computer equivalent to a classical computer?""

+ +

@DaftWullie's great answer already shows that such a weakened quantum computer is equivalent up to a polynomial overhead to a classical ""reversible"" computer. That is, he mentions that the Toffoli ($\mathsf{CCNOT}$) gate is universal for classical reversible computation, much as a $\mathsf{NAND}$ gate is for classical irreversible computation. Because as we know all quantum gates are reversible, the OP's question can also be framed as ""is reversible computation equivalent to irreversible computation?""

+ +

Clearly a $\mathsf{CCNOT}$ gate can efficiently realize a $\mathsf{NAND}$ gate; a little though shows that a $\mathsf{NAND}$ gate can efficiently realize a $\mathsf{CCNOT}$ gate. However there is some non-trivial overhead in converting an algorithm that uses irreversible computation to one that uses reversible computation.

+ +

For example, this Quanta magazine article describes how classical irreversible computation can recursively perform operations, whereas the requirement of quantum/reversible computation to not delete information has hampered many quantum algorithms' ability to do such recursion.

+ +

The Quanta article describes a breakthrough by Craig Gidney of using ""tail call recursion"" in reversible computation, which as I understand it would be applicable to many recursive processes; however, there may still be a non-zero overhead in making such computations.

+ +
+ +

Furthermore, there are some non-trivial applications of physical qubits that do not seem to absolutely require entanglement - these also don't have a counterpart in the classical world.

+ +

For example, the BB84 quantum key distribution protocol does not require the two parties Alice and Bob to share any entanglement. Wiesner's quantum money, from which BB84 was developed, also does not require such entanglement.

+ +

These topics are usually introduced in lectures in quantum information/quantum computation before introduction of Deutsch-Josza, Shor, etc. because they have no classical counterpart, and also do not have ""spooky action at a distance"" - i.e., entanglement.

+",2927,,,,,7/18/2019 12:46,,,,1,,,,CC BY-SA 4.0 +6807,1,6811,,7/18/2019 14:49,,4,273,"

I have a problem with the conditional Hamiltonian. In the original article on HHL (p.3) they wrote that applying the conditional Hamiltonian correspond to: +$$ \sum_{\tau=0}^{T-1}|\tau\rangle\langle\tau|\otimes e^{2i\pi A\frac{\tau}{T}}$$
+Where $T=2^t$ the number of qubits in the clock register.

+

And I saw an implementation in this article (p.50), for a 2 qubits register they apply 2 gates $e^{i\pi A}$ and $e^{i\pi A/2}$.

+

What I don't understand, is that it doesn't correspond to the sum above which have 4 terms, but to this one (I change the index of the sum): +$$\sum_{\tau=1}^{2^{t-1}}|\tau\rangle\langle\tau|\otimes e^{2i\pi A\frac{\tau}{2^t}}$$.

+

Did I miss something ?

+",7762,,1859,,11/21/2020 18:22,11/21/2020 18:22,Apply the conditional Hamiltonian evolution (HHL),,1,2,,,,CC BY-SA 4.0 +6809,1,6810,,7/18/2019 23:17,,5,273,"

I was looking back over an old assignment and I came across a question I wasn't quite sure how to do the problem statement is as follows:

+ +

The Hadamard rotation is an element of the group $U(2)$.

+ +

(i) Find the global phase with which one needs to multiply the Hadamard gate to obtain an operation that is an element of the group $SU(2)$, and

+ +

(ii) propose the evolution operator that implements this operation, that is, propose the suitable Hamiltonian and the duration for which it needs to be turned on.

+ +

For (i) I think the answer was either due to this statement

+ +

$U(2)$ is the group of $2$ by $2$ unitary matrices or operators. In contrast to the elements $SU(2)$, the determinant of the elements of the group $u ∈ U(2)$ is not fixed to unity. Each element $u∈U(2)$ can be expressed in terms of an element of $SU(2)$ as $u = e^{i\alpha}g$ where $g \in SU(2).$

+ +

$$H=\begin{pmatrix}\tfrac{1}{\sqrt{2}} &\tfrac{1}{\sqrt{2}}\\\tfrac{1}{\sqrt{2}} &\tfrac{1}{-\sqrt{2}} \end{pmatrix}$$$$=e^{i \pi/2}\begin{pmatrix}\tfrac{e^{-i\pi/2}}{\sqrt{2}} &\tfrac{e^{-i\pi/2}}{\sqrt{2}}\\\tfrac{e^{-i\pi/2}}{\sqrt{2}} &\tfrac{e^{-i\pi/2}}{-\sqrt{2}} \end{pmatrix}$$$$=e^{i\pi/2}(\cos(\pi/2)-i\sin(\pi/2)(\tfrac{\sigma_x+\sigma_z}{\sqrt{2}}))$$$$=e^{\pi i /2}e^{-\pi i (\tfrac{\sigma_x+\sigma_z}{\sqrt{2}})/2}$$

+ +

The right hand side is now being expressed as an element of $SU(2)$. However given the following statement, Considering the determinant of the product of two n-by-n matrices $A and B$, $\det(AB) = \det A \det B$, and the determinant $\det(e^\alpha I )= e^{i2α}$ we obtain the map from the elements of $U(2)$ and $SU(2)$.

+ +

$$g=\tfrac{u}{\sqrt{\det(u)}}$$

+ +

Perhaps it actually looking for that transformation instead

+ +

As for (ii) I know that $$U=e^{\tfrac{-i}{\hbar} \hat{H}t}.$$

+ +

and that we can use the Pauli operators to form our Hamiltonian, I know how to do it for the nontrivial term that would appear if we transformed as we did in (i) but I'm not sure how to do it for $H$?

+",6254,,16606,,6/2/2022 11:02,6/2/2022 11:02,Finding a global phase that transform the Hadamard gate to an element of $SU(2)$ and propose an evolution operator which implements the operation,,1,0,,,,CC BY-SA 4.0 +6810,2,,6809,7/19/2019 1:05,,4,,"

You did more than you needed to in part i. You effectively did part ii already.

+ +

Because

+ +

$$ +g = \frac{u}{\sqrt{\det{u}}} +$$

+ +

is in $SU(2)$, the phase you need to multiply by is $\frac{1}{\sqrt{\det{u}}}$.

+ +

$$ +\det H = -1/2-1/2 = -1 +$$

+ +

So to get in $SU(2)$, you need to multiply $\sqrt{-1}=\pm i$. That is seen as the $e^{\pi i /2}$ you see as the prefactor in the way you did it. You can use either $e^{\pm \pi i/2}$.

+ +

For ii, you can drop the prefactor and only consider

+ +

$$ +H \propto e^{-\pi i \frac{\sigma_x+\sigma_z}{2\sqrt{2}}} +$$

+ +

You can match that exponent with $\frac{-it}{\hbar} H$ in order to suggest $H$ and $t$.

+ +

$$ +-\pi i \frac{\sigma_x+\sigma_z}{2\sqrt{2}} = \frac{-it}{\hbar} H\\ +\pi \frac{\sigma_x+\sigma_z}{2\sqrt{2}} = \frac{t}{\hbar} H\\ +t H = \frac{\pi}{\sqrt{2}} (\frac{\hbar}{2} \sigma_x+\frac{\hbar}{2} \sigma_z) +$$

+ +

So you can use $t=\frac{\pi}{\sqrt{2}}$ and $H=(\frac{\hbar}{2} \sigma_x+\frac{\hbar}{2} \sigma_z)$.

+ +

The reason for putting the Hamiltonian with $\frac{\hbar}{2} \sigma$ terms is because this is the spin operator

+ +

$$ +\vec{S} = \frac{\hbar}{2} \vec{\sigma} +$$

+ +

Of course you could replace $t \to \lambda t$ and $H \to \frac{1}{\lambda} H$ for any $\lambda$, but if you do it with very small $\lambda$ like $\hbar$, then you will get unreasonably short time-scales for applying the evolution. You're not going to have precision control to only apply a signal for $10^{-30}$ seconds.

+",434,,,,,7/19/2019 1:05,,,,0,,,,CC BY-SA 4.0 +6811,2,,6807,7/19/2019 9:56,,4,,"

Be careful! They don't apply $e^{i\pi A}$ and $e^{i\pi A/2}$. They apply +$$ +|0\rangle\langle 0|\otimes I\otimes I+|1\rangle\langle 1| \otimes I\otimes e^{i\pi A} +$$ +and +$$ +I\otimes |0\rangle\langle 0|\otimes I+I\otimes |1\rangle\langle 1|\otimes e^{i\pi A/2}, +$$ +i.e. controlled versions of the gates, controlled off two different qubits.

+ +

So, consider the 4 possible values of the first two registers: $|00\rangle, |01\rangle, |10\rangle$ and $|11\rangle$. On the third register, these give you respectively, $I,e^{i\pi A/2},e^{i\pi A},e^{i3\pi A/2}$, as required.

+",1837,,,,,7/19/2019 9:56,,,,0,,,,CC BY-SA 4.0 +6812,1,,,7/19/2019 17:59,,3,313,"

Very often in the standard textbooks on quantum mechanics, one finds that the joint Hilbert space of two systems is given by the tensor product of the individual Hilbert spaces. That is, if $H_1$ and $H_2$ are the Hilbert spaces associated with systems $S_1$ and $S_2$, then the composite Hilbert space of the entire system is given by $H_{1} \otimes H_{2}$, where $\otimes$ is the tensor product as defined here.

+ +

$\textbf{My question:}$ Under what conditions can a direct sum of two Hamiltonians, $H_1 \oplus H_2$, be used to represent the Hamiltonian in composite Hilbert space for the entire system?

+",5806,,5806,,7/21/2019 5:48,11/8/2019 11:29,Which representation describes the composite Hilbert space?,,2,2,,,,CC BY-SA 4.0 +6813,1,,,7/20/2019 0:00,,2,287,"

To find operation elements for the Amplitude Damping channel, Nielsen and Chuang (in Section 8.3.5 of my copy) use the action of a beamsplitter on an initial state $ \alpha |0\rangle + \beta |1\rangle$. The output of the beamsplitter is $\alpha|0_E0\rangle + \beta \cos\theta |0_E1\rangle + \beta \sin\theta|1_E0\rangle$ where $E$ denotes environment. They say after tracing out the environment we get $E_0\rho E_0^\dagger + E_1\rho E_1^\dagger$ where

+ +

$E_0 =\begin{pmatrix}1 & 0 \\ 0 & \sqrt{1-\gamma}\end{pmatrix}$,

+ +

$E_1 =\begin{pmatrix} 0 & \sqrt{\gamma} \\ 0 & 0\end{pmatrix}$

+ +

with $\gamma = \sin^2\theta$.

+ +

Here is what I do:

+ +

\begin{align*}tr_E(\rho^\prime) &= tr_E(\alpha^2|0_E\rangle \langle0_E|\otimes|0\rangle \langle0| + \beta^2 \cos^2\theta |0_E\rangle \langle0_E|\otimes|1\rangle \langle1| + \beta^2 \sin^2\theta|1_E\rangle \langle1_E|\otimes|0\rangle \langle0|) \\&= \alpha^2|0\rangle \langle0| + \beta^2 \cos^2\theta|1\rangle \langle1| + \beta^2 \sin^2\theta|0\rangle \langle0|\end{align*}

+ +

Another approach I tried:

+ +

$\langle0_E|B|0_E\rangle = \alpha|0\rangle + \beta \cos\theta|1\rangle$

+ +

which gives

+ +

$\rho^\prime = \alpha^2|0\rangle \langle0| + \beta^2 \cos^2\theta|1\rangle \langle1|$

+ +

and $\begin{pmatrix}1 & 0 \\0 & \sqrt{1-\gamma}\end{pmatrix}$ for $E_0$;

+ +

and

+ +

$\langle1_E|B|0_E\rangle = \beta \sin\theta|0\rangle$ with +$\rho^\prime = \beta^2 \sin^2\theta|0\rangle \langle0|$

+ +

which gives

+ +

$E_1 \rho E_1^\dagger= \begin{pmatrix}\beta^2\gamma & 0 \\0 & 0\end{pmatrix} = \begin{pmatrix}0 & \sqrt{\gamma} \\ 0 & 0 \end{pmatrix} \rho \begin{pmatrix}0 & 0 \\ \sqrt{\gamma} & 0 \end{pmatrix}$

+ +

Am I correct? If not, where am I wrong?

+ +

Here is a picture of the page for your reference: +

+",7805,,55,,10/18/2021 22:05,10/19/2021 8:44,"Find the Kraus operators of the amplitude damping channel, partial tracing after evolution through a beamsplitter",,2,6,,,,CC BY-SA 4.0 +6814,2,,6796,7/20/2019 11:44,,0,,"

You may want to try this tutorial: https://github.com/Qiskit/qiskit-tutorials/blob/master/qiskit/ignis/relaxation_and_decoherence.ipynb

+",332,,,,,7/20/2019 11:44,,,,0,,,,CC BY-SA 4.0 +6815,2,,6733,7/20/2019 16:39,,10,,"

It might be worth mentioning the physical motivation for these definitions and the concept of fidelity itself.

+ +

Unlike the classical computers we all know and love, quantum computers are fundamentally analog machines. what that means practically is that the gates you apply when you run code on a real quantum computer are going to be parameterized by a real variable. For example, in superconducting qubits, applying a single-qubit gate means driving your qubit with a (typically microwave-range) pulse from an arbitrary waveform generator. The amplitude, frequency, and time-duration of that pulse are all real-valued parameters, and as such they're all subject to some amount of error. These so-called 'unitary' errors are a separate issue from the errors that result from your qubit interacting with the environment. You've applied a real quantum gate, and prepared a real, coherent quantum state, but neither the gate nor the state are ever going to be exactly the ones you intended.

+ +

That's where measures of fidelity come in, as a way of keeping track of just how close you can expect to come on your actual, physical quantum computer to the circuits you are producing in code.

+ +

In a way, fidelity forms the essential link between the neat digital niceties of your high level implementation and the messy realities of the quantum hardware itself.

+ +

That, at least, is how I understand it. I'd welcome any corrections.

+ +

The following video gives some more specific examples of the same idea https://www.youtube.com/watch?v=MtD1Z8MMrgY, while this article gives a pretty friendly, historically motivated explanation of the math involved.

+",8081,,,,,7/20/2019 16:39,,,,1,,,,CC BY-SA 4.0 +6816,1,,,7/20/2019 17:40,,5,87,"

Does anyone know the solution of Exercise 6.14 of Nielsen and Cheung:

+ +
+

Prove that any classical counting algorithm with a probability at least + 3/4 for estimating $M$ correctly to within an accuracy $c \sqrt{M}$ for some constant $c$ + and for all values of $M$ must make $\Omega(N)$ oracle calls.

+
+ +

The same result is also stated in Mosca's phd thesis in Table 2.5 but with no references where this is proved.

+ +

Mosca's phd thesis cites

+ +
+

Ran Canetti, Guy Even, and Oded Goldreich. Lower bounds for sampling algorithms for estimating the average. Information Processing Letters, 1995.

+
+ +

and

+ +
+

Goldreich, Oded. ""A sample of samplers: A computational perspective on sampling."" Studies in Complexity and Cryptography. Miscellanea on the Interplay between Randomness and Computation. Springer, Berlin, Heidelberg, 2011. 302-332.

+
+ +

but from those I see a complexity of $\Omega(M)$ not $\Omega(N)$

+",7318,,7318,,7/20/2019 17:58,7/20/2019 17:58,complexity of classical counting algorithm,,0,1,,,,CC BY-SA 4.0 +6817,2,,6796,7/20/2019 19:05,,1,,"

The devices are imperfect and also are periodically recalibrated. Any textual examples characterizing decoherence will probably never match exactly what you encounter in running the same code live.

+",7744,,,,,7/20/2019 19:05,,,,0,,,,CC BY-SA 4.0 +6818,1,,,7/20/2019 19:13,,3,103,"

This question refers principally to the article where for a low-depth circuit QAOA, the output cannot be efficiently simulated classically. I am wondering how this kind of quantum supremacy matters for optimization. Any insights would be interesting here.

+",4127,,55,,9/28/2019 19:15,9/28/2019 19:15,How does the fact that the output of a quantum circuit cannot be efficiently simulated classically help for optimisation?,,1,0,,,,CC BY-SA 4.0 +6819,1,,,7/21/2019 5:12,,1,325,"

I recently made a quantum circuit that uses 32 qubits and try to run it on +IBM Q Experience qasm_simulator backend. But it always ends with ERROR_RUNNING_JOB.

+ +

When i retrieve the job and display the error, i only got

+ +
+

""The following experiments failed:\n"" + without any details.

+
+ +

How i can get more information about the error?

+ +

The following is my qiskit version information:

+ +
{'qiskit': None, 'qiskit-terra': '0.8.0', 'qiskit-ignis': '0.1.1', 'qiskit-aer': '0.2.0', 'qiskit-ibmq-provider': '0.2.2', 'qiskit-aqua': '0.5.2'}
+
+ +

According to @Bram suggestion i run

+ +
$ pip install qiskit
+Building wheels for collected packages: qiskit, qiskit-ibmq-provider
+  Building wheel for qiskit (setup.py) ... error
+  Complete output from command /home/userName/anaconda3/envs/quantum/bin/python -u -c ""import setuptools, tokenize;__file__='/tmp/pip-install-kavivdyx/qiskit/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))"" bdist_wheel -d /tmp/pip-wheel-eak_06_d --python-tag cp37:
+  running bdist_wheel
+
+  ----------------------------------------
+  Failed building wheel for qiskit
+  Running setup.py clean for qiskit
+  Building wheel for qiskit-ibmq-provider (setup.py) ... done
+  Stored in directory: /home/userName/.cache/pip/wheels/0c/56/e7/b07b4d2f19fd4c5fff7fe334c72eb313fecf04fa693a7c558e
+Successfully built qiskit-ibmq-provider
+Failed to build qiskit
+Installing collected packages: qiskit-terra, qiskit-aer, nest-asyncio, qiskit-ibmq-provider, pyscf, qiskit-chemistry, qiskit, more-itertools
+  Found existing installation: qiskit-terra 0.8.0
+    Uninstalling qiskit-terra-0.8.0:
+      Successfully uninstalled qiskit-terra-0.8.0
+  Found existing installation: qiskit-aer 0.2.0
+    Uninstalling qiskit-aer-0.2.0:
+      Successfully uninstalled qiskit-aer-0.2.0
+  Found existing installation: qiskit-ibmq-provider 0.2.2
+    Uninstalling qiskit-ibmq-provider-0.2.2:
+      Successfully uninstalled qiskit-ibmq-provider-0.2.2
+  Running setup.py install for qiskit ... done
+  Found existing installation: more-itertools 6.0.0
+    Uninstalling more-itertools-6.0.0:
+      Successfully uninstalled more-itertools-6.0.0
+Successfully installed more-itertools-5.0.0 nest-asyncio-1.0.0 pyscf-1.6.2 qiskit-0.11.0 qiskit-aer-0.2.3 qiskit-chemistry-0.5.0 qiskit-ibmq-provider-0.3.0 qiskit-terra-0.8.2
+
+ +

From this output i notice that wheel was failed in build, does that cause any problems?

+ +

I then run

+ +
$conda list | grep qiskit
+qiskit                    0.11.0                   pypi_0    pypi
+qiskit-aer                0.2.3                    pypi_0    pypi
+qiskit-aqua               0.5.2                    pypi_0    pypi
+qiskit-chemistry          0.5.0                    pypi_0    pypi
+qiskit-ibmq-provider      0.3.0                    pypi_0    pypi
+qiskit-ignis              0.1.1                    pypi_0    pypi
+qiskit-terra              0.8.2                    pypi_0    pypi
+enter preformatted text here
+
+ +

and run the following in IPython console

+ +
>>import qiskit
+>>qiskit.__qiskit_version__
+Out[2]: 
+{'qiskit': '0.11.0',
+ 'qiskit-terra': '0.8.2',
+ 'qiskit-ignis': '0.1.1',
+ 'qiskit-aer': '0.2.3',
+ 'qiskit-ibmq-provider': '0.3.0',
+ 'qiskit-aqua': '0.5.2'}
+
+ +

i will send another job and wait for the result.

+ +

Edit: +The same error , ERROR_RUNNING_JOB, still occur, appear after the above update.

+",8084,,55,,8/15/2020 6:43,11/18/2022 19:05,ERROR_RUNNING_JOB with 32 qubit circuit running on ibmq_qasm_simulator backend,,1,3,,,,CC BY-SA 4.0 +6820,2,,6812,7/21/2019 6:06,,0,,"

What you are modelling when you use a tensor product is a space that can accommodate tuples of basis states of different kinds.

+ +

For example, say you want to describe a three-level system. You can use a three-dimensional Hilbert space $\mathcal H$ to accommodate the possible states of this system. +But what if you have two three-level systems, each one of which can be in one of its three available states? In this case you have nine possible basis states ($00$, $01$, $02$, $10$, and $11$, $12$, $20$, $21$, and $22$), and thus need a nine-dimensional Hilbert space. As it happens, $\mathcal H\otimes\mathcal H$ has just the right dimensions (you could also use any other nine-dimensional Hilbert space, only it would make the notation more awkward when dealing with local operations).

+ +

On the other hand, $\mathcal H\oplus\mathcal H$ is a six-dimensional space, with basis the union of the bases of the two copies of $\mathcal H$ (see also this post over at math.SE). You could write this basis as +$$\{|0\rangle,|1\rangle,|2\rangle,|0'\rangle,|1'\rangle,|2'\rangle\},$$ +denoting with $|i'\rangle$ the $i$-th basis element of the second copy of $\mathcal H$.

+ +

Clearly, this does not describe a system that is obtained by combining multiple elementary systems. Rather, it can be used to describe how a high-dimensional system is ""composed"" of smaller-dimensional ones. +Indeed, one can always think of an $n$-dimensional Hilbert space as the direct sum of $n$ copies of one-dimensional spaces.

+ +

The direct sum is, therefore, what you always do ""under the hood"" when you build up higher dimensional spaces from lower dimensional ones.

+ +

Similar reasoning applies to Hamiltonians or other operators. As an example, if you have a five-dimensional space $\mathcal H$, and two operators $A_1$ and $A_2$ operating on three- and two-dimensional systems, respectively, then $A_1\oplus A_2$ is a valid operator acting on states in $\mathcal H$. This represents an operation which does not correlate the first three and the last two modes (because of the block structure of $A_1\oplus A_2$).

+",55,,55,,11/8/2019 11:29,11/8/2019 11:29,,,,0,,,,CC BY-SA 4.0 +6821,1,6825,,7/21/2019 9:40,,4,718,"

The Hibert Schmidt norm $\mathrm {tr}(A^{\dagger}B)$ works well for unitaries. +It has a value of one when the matrices are equal and less than one otherwise. But this norm is absolutely unsuitable for non-unitary matrices. +I thought maybe $\frac{\mathrm{tr}(A^{\dagger}B)}{\sqrt{\mathrm{tr}(A^{\dagger}A)} \sqrt{\mathrm{tr}(B^{\dagger}B)}}$ would be a good idea?

+",462,,26,,1/6/2020 16:37,3/9/2020 10:10,What would be an ideal fidelity measure to determine the closeness between two non unitary matrices?,,3,0,,,,CC BY-SA 4.0 +6824,2,,6818,7/21/2019 11:29,,2,,"

In the article you mentioned it is said that classical algorithms can beat some cases of (quantum ) QAOA's as is proved in this article. So finding cases where quantum QAOA can still beat classical algorithms and can run on NISQ devices with low depth circuits is still exciting and promissing.

+ +

The article uses plausible conjectures from complexity theory to show that there are choices of γ, β and cost function C for which the output of a quantum computer running the (p = 1) QAOA could not be mimicked with a classical device.

+ +

Quantum supremacy is not necessary for optimization problems but can it make more worthwhile. In a recent paper it is shown that you really can find quantum speedup using a few hundreds of qubits.

+ +

In the mean time you can try solving optimization problems with Qiskit or pyQuil with some max-cut examples on my github.

+",1773,,1773,,7/21/2019 13:25,7/21/2019 13:25,,,,0,,,,CC BY-SA 4.0 +6825,2,,6821,7/21/2019 12:41,,7,,"

When you ask about an 'ideal' fidelity measure, it assumes that there is one measure which inherently is the most meaningful or truest measure. But this isn't really the case.

+ +
    +
  • For unitary operators, our analysis of the error used in approximating one unitary by another involves the distance induced by the operator norm: $$ \bigl\lVert U - V \bigr\rVert_\infty := \max_{\substack{\lvert \psi\rangle \ne \mathbf 0}} \frac{\bigl \lVert (U - V) \lvert \psi \rangle \bigr\rVert_2}{\bigl \lVert \lvert \psi \rangle \bigr\rVert_2} $$ That is, it is the greatest factor by which the Euclidean norm (or 2-norm) of a vector will be increased by the action of $(U - V)$: if the two operators are very nearly equal, this factor will be very small.

    + +

    I know you asked for norms on non-unitary matrices, but if a norm is useful for non-unitary matrices, you might hope that it would also be useful for unitary matrices, and the point here is that the 'operator norm' is. It is also useful for (non-unitary) observables: for two Hermitian operators $E$ and $F$ — representing evolution Hamiltonians, for instance, or measurement projectors — the operator norm $\lVert E - F \rVert$ conveys how similar $E$ and $F$ are in a way which directly relates to how easily you can operationally distinguish one from the other.

  • +
  • On the other hand, for density operators $\rho$ and $\sigma$, the best distance measure to describe how easily you can distinguish them is the trace norm: $$\bigl\lVert \rho - \sigma \bigr\rVert_{\mathrm{tr}} := \mathrm{tr} \Bigl( \sqrt{(\rho - \sigma) ^2} \Bigr)$$ which is the same as (in fact, it's just a fancy way of writing) the sum of the absolute values of the eigenvalues of $(\rho - \sigma) $: if the two operators are very nearly equal, this sum will be very small.

  • +
+ +

So, which norm you want to use to describe distances on operators, depends on what those operators are and what you would like to say about them.

+",124,,23,,7/21/2019 12:50,7/21/2019 12:50,,,,0,,,,CC BY-SA 4.0 +6826,2,,6819,7/21/2019 13:41,,0,,"

You're qiskit information shows 'qiskit': None. This should be 0.11 or smaller. Furthermore qiskit-ibmq-provider : 0.2.2 should be 0.3 for the latest version.

+",1773,,,,,7/21/2019 13:41,,,,0,,,,CC BY-SA 4.0 +6828,1,6834,,7/21/2019 16:54,,2,700,"

Exercise 8.21 of Nielsen and Chuang asks us to show that the operation elements for a harmonic oscillator (system) coupled to another harmonic oscillator (environment) is

+ +

$E_k = \sum_n \sqrt{(^n_k)}\sqrt{(1-\gamma)^{n-k}\gamma^k} |n-k\rangle\langle n|$ (1)

+ +

with $\gamma = 1- cos^2(\chi\Delta t)$

+ +

The Hamiltonian is $H = \chi(a^\dagger b+b^\dagger a)$ (2)

+ +

$E_k$ should be found using $E_k = \langle k_b|U|0_b\rangle$ where subscript b denotes environment, and $U = e^{-iH\Delta t}$

+ +

This question has been asked here but has not been answered. The steps that I know:

+ +

Using $\langle k_b| = \langle 0_b| \frac{b^k}{\sqrt{k!}}$ (3)

+ +

$E_k = \langle k_b|e^{-i\chi(a^\dagger b+b^\dagger a)\Delta t}|0_b\rangle = \langle 0_b|\frac{b^k}{\sqrt{k!}} e^{-i\chi(a^\dagger b+b^\dagger a)\Delta t}|0_b\rangle$

+ +

$= \langle 0_b|\frac{b^k}{\sqrt{k!}} \sum_n \frac{[-i\chi \Delta t(a^\dagger b+b^\dagger a)]^n}{n!} |0_b\rangle$

+ +

$= \langle 0_b| \sum_n \sum_{k=0}^n \frac{b^k}{\sqrt{k!}}\frac{[-i\chi \Delta t(a^\dagger b+b^\dagger a)]^{n-k} [-i\chi \Delta t(a^\dagger b+b^\dagger a)]^k}{n!} |0_b\rangle$

+ +

$= \langle 0_b| \sum_n \sum_{k=0}^n \frac{1}{\sqrt{k!}}\frac{[-i\chi \Delta t(a^\dagger b+b^\dagger a)]^{n-k} [-i\chi \Delta t(a^\dagger b^2+bb^\dagger a)]^k}{n!} |0_b\rangle$ (4)

+ +

Considering $b|0_b\rangle = 0$ the above becomes

+ +

$= \langle 0_b| \sum_n \sum_{k=0}^n \frac{1}{\sqrt{k!}}\frac{[-i\chi \Delta t(b^\dagger a)]^{n-k} [-i\chi \Delta t(bb^\dagger a)]^k}{n!} |0_b\rangle$

+ +

Using $[b,b^\dagger] = bb^\dagger - b^\dagger b = 1$, and $bb^\dagger = 1+ b^\dagger b$ the above becomes

+ +

$= \langle 0_b| \sum_n \sum_{k=0}^n \frac{1}{\sqrt{k!}}\frac{[-i\chi \Delta t(b^\dagger a)]^{n-k} [-i\chi \Delta ta]^k}{n!} |0_b\rangle$ (5)

+ +

The Binomial expansion is

+ +

$(A + B)^n = \sum_{k=0}^n (^n_k) A^{n-k}B^k$

+ +

To make notation simpler, setting $A = -i\chi \Delta t(b^\dagger a)$ and $B = -i\chi \Delta ta$

+ +

(5) becomes

+ +

$\langle 0_b| \frac{1}{\sqrt{k!}}\sum_n \frac{1}{n!(^n_k)} (A+B)^n |0_b\rangle$ (6).

+ +

A simple calculation gives $A+B = (-i\chi \Delta t)^n (b^\dagger +1)^n a^n$

+ +

So (6) is

+ +

$\langle 0_b| \frac{1}{\sqrt{k!}}\sum_n \frac{1}{n!(^n_k)} [(-i\chi \Delta t) (b^\dagger +1) a]^n |0_b\rangle$ (7)

+ +

At this point we should trace out the environment/b terms. I understand that we can write (7) as an exponential again, and get sines and cosine terms; but they will not be squared, as required by (1). I'd appreciate any help with this. Thanks.

+",7805,,7805,,7/21/2019 23:26,4/11/2021 14:34,Amplitude Damping of a Harmonic Oscillator,,2,3,,,,CC BY-SA 4.0 +6829,2,,6812,7/21/2019 19:14,,1,,"

@glS gave a fine answer, but given who is asking, would be remiss to not answer with some functoriality.

+ +

In section 4 of Twisted Equivariant Matter, the Dirac-Nambu space is defined. For a free fermion Hilbert space based on $(\mathcal{M},b)$ with a symmetry $(G,\phi)$ where $\phi$ encodes anti-linearity. Take $G=e$ if you want.

+ +

$$ +H_{DN} \equiv \mathcal{M} \otimes \mathbb{C} +$$

+ +

A choice of complex structure on $\mathcal{M}$ gives a Hermitian structure on $H_{DN}$.

+ +

In the particle-hole picture $H_{DN} = V \bigoplus \bar{V}$ is the 1-particle and 1-hole.

+ +

The amalgam of two systems is then the direct sum $H_{DN,1} \bigoplus H_{DN,2}$. This is easily visualized as one-particle or one-hole of different types.

+ +

Fock: On objects, send a vector space $V$ to $\bigoplus_{i=0}^n \Lambda^i V$. +$\Lambda (V \bigoplus W) \simeq \Lambda (V) \otimes \Lambda (W)$. This is because above was talking about free fermions, so that's why alternating not $Sym$.

+ +

You can think as combine the systems as usual by tensor product, but when you apply the functor that gets you back to 1-particle/hole, you are picking out degree one summand which has a direct sum instead.

+ +

You may also like http://math.ucr.edu/home/baez/photon/tensor.htm

+",434,,,,,7/21/2019 19:14,,,,0,,,,CC BY-SA 4.0 +6830,1,6833,,7/21/2019 21:46,,2,45,"

In the paper, Quantum linear systems algorithms: a primer, available here page 23, the authors discuss encoding a vector in $\mathbb{R^n}$ into qRAM.

+ +

For $x \in \mathbb{R}^n$, let $|x \rangle := ||x||_2^{-1}\sum_{i=1}^{n}x_i |i\rangle$ be a quantum state on $\lceil logn \rceil$ qubits. We would like to have an operation $f$ that takes some finite precision representation of $x$, denoted $\tilde{x}$, and outputs the state $|x \rangle$ along with $||x||_2$.

+ +

So, $f:\tilde{x} \mapsto |\: \widetilde{||x||_2} \rangle |x \rangle$, where $\widetilde{||x||_2}$ is a computational basis state encoding of the value of $||x||_2$. The author/s state, $\widetilde{||x||_2}$ can be easily loaded into a computational register using CNOT gates. I'm not sure how this is achieved.

+ +

Take $n=3$, and a non-unit vector, say $(1,1,1)$. How can the norm of this vector be loaded into a register using CNOT gates?

+",7481,,7481,,7/21/2019 22:05,7/22/2019 7:07,Loading the finite precision representation of the norm of a vector into a computational register using CNOT gates,,1,0,,,,CC BY-SA 4.0 +6831,1,,,7/22/2019 4:46,,1,649,"

I am trying to run a circuit with 32 qubit on a local hpc (not IBM Q HPC) using statevector_simulator backend.

+ +

but i got the following error:

+ +
Traceback (most recent call last):
+  File ""testQiskit11.py"", line 156, in <module>
+    backend = Aer.get_backend('statevector_simulator', max_memory_mb=65536)
+  File ""/home/UserName/.conda/envs/quantum/lib/python3.7/site-packages/qiskit/providers/aer/aerprovider.py"", line 37, in get_backend
+    return super().get_backend(name=name, **kwargs)
+  File ""/home/UserName/.conda/envs/quantum/lib/python3.7/site-packages/qiskit/providers/baseprovider.py"", line 53, in get_backend
+    raise QiskitBackendNotFoundError('No backend matches the criteria')
+qiskit.providers.exceptions.QiskitBackendNotFoundError: 'No backend matches the criteria'
+
+ +

The part of the script that specify the backend and run the simulation is as follow:

+ +
backend = Aer.get_backend('statevector_simulator', max_memory_mb=65536)
+backend.MAX_QUBIT_MEMORY=32
+shots = 1024
+job = execute(QCirc, backend)
+result = job.result()
+
+",8084,,8084,,7/22/2019 14:01,8/15/2020 16:08,Qiskit No backend matches the criteria,,1,0,,,,CC BY-SA 4.0 +6832,1,,,7/22/2019 6:32,,1,116,"

I am trying to simulate quantum teleportation on ProjectQ using simulaqron (enabling me to use quantum internet for teleportation) however I am not sure if my approach is right. In the working paper of simulaqron its written that programming via another backend like ProjectQ is very much possible. However when I am testing quantum teleporation I am not getting any output

+ +

[Alice's code] followed by [Bob's code]

+ +
  from projectq.ops import All, CNOT, H, Measure, Rz, X, Z
+    from projectq import MainEngine
+    from projectq.meta import Dagger, Control
+    from cqc.pythonLib import CQCConnection, qubit
+    import simulaqron
+
+def main():
+
+    with CQCConnection(""Alice"") as Alice:
+        eng = MainEngine()
+        c1, c2 = create_bell_pair(eng)
+        tel1 = eng.allocate_qubit()
+        Alice.sendQubit((c1, ""Bob""))
+        H | tel1
+        CNOT | (tel1, c2)
+        H | tel1
+        Measure | tel1
+        Measure | c2
+        to_print = ""App {}: Measurement outcomes are: a={}, b={}"".format(Alice.name, int(tel1), int(c2))
+        print(""|"" + ""-"" * (len(to_print) + 2) + ""|"")
+        print(""| "" + to_print + "" |"")
+        print(""|"" + ""-"" * (len(to_print) + 2) + ""|"")
+
+        # Send corrections to Bob
+        Alice.sendClassical(""Bob"", int(tel1), int(c2))
+
+
+def create_bell_pair(eng):
+    b1 = eng.allocate_qubit()
+    b2 = eng.allocate_qubit()
+
+    H | b1
+    CNOT | (b1, b2)
+
+    return b1, b2
+
+main()    
+
+// new file for bob
+from projectq.ops import All, CNOT, H, Measure, Rz, X, Z
+from projectq import MainEngine
+from projectq.meta import Dagger, Control
+from cqc.pythonLib import CQCConnection, qubit
+import simulaqron
+
+#####################################################################################################
+#
+# main
+#
+def main():
+
+        # Initialize the connection
+        with CQCConnection(""Bob"") as Bob:
+
+            # Make an EPR pair with Alice
+            qB=Bob.recvQubit(c1, ""Alice"")
+
+            # Receive info about corrections
+            data=Bob.recvClassical()
+            message=list(data)
+            a=message[0]
+            b=message[1]
+
+            # Apply corrections
+            if b==1:
+                    X | qB
+            if a==1:
+                    Z | qB
+
+            # Measure qubit
+            Measure | qB
+            to_print=""App {}: Measurement outcome is:  {}"".format(Bob.name,int(qB))
+            print(""|""+""-""*(len(to_print)+2)+""|"")
+            print(""| ""+to_print+"" |"")
+            print(""|""+""-""*(len(to_print)+2)+""|"")
+
+##################################################################################################
+main()
+
+",8089,,10480,,1/31/2021 20:37,1/31/2021 20:37,How to integrate Simulaqron on ProjectQ,,1,0,,,,CC BY-SA 4.0 +6833,2,,6830,7/22/2019 6:59,,2,,"

The issue is not about loading the norm of the vector - this can be taken into account automatically. Let me give an example. This is not a complete explanation of how the state preparation procedure works, but illustrates the point.

+ +

Let's say that you want to make a state $\sum_ix_i|i\rangle$, up to normalisation, and let's assume you have a bound $x_i\leq\delta$ for some $\delta$ and all $i$ (you might argue this is as problematic to know as the normalisation, but that's another debate, and you can at least make some reasonable estimates often).

+ +

So, now imagine a matrix +$$ +A=\left(\sum_i|x_i\rangle\right)\langle 0|. +$$ +You can embed this in a Hermitian matrix $H$, using a structure like +$$ +H=\left(\begin{array}{cc} 0 & A \\ A^T & 0 \end{array}\right), +$$ +and you can implement an evolution +$$ +e^{-i\delta t X\otimes H}|0\rangle|0\rangle +$$ +for some $\delta t$ such that $\delta t\delta\ll 1$ ($X$ is the standard Pauli matrix, applied to some ancilla qubit), after which you measure the top qubit. If the answer is $|1\rangle$, with high probability you've produced the state you want in the second register, and it is correctly normalised by virtue of the renormalisation that happens upon collapse of the wavefunction. If the answer is $|0\rangle$, you can just try again, and keep going until you're successful. If you did actually want to compute the norm, you could simply estimate the probability of getting the $|1\rangle$ answer in the above procedure, but for what you're talking about, you don't need to.

+",1837,,1837,,7/22/2019 7:07,7/22/2019 7:07,,,,2,,,,CC BY-SA 4.0 +6834,2,,6828,7/22/2019 8:19,,2,,"

The way that I approach the maths is very different from the way that you do it (I imagine it can be approached as you're trying, it's just not how I think about it).

+ +

I start by introducing $|n,m\rangle$ as a basis denoting the excitation states of $a,b$ respectively. We recognise that $H$ preserves $n+m$, so the whole thing decomposes into a bunch of subspaces determined by the total $n+m$. This has several consequences, but for one, it means that what we want to calculate is the amplitude +$$ +\langle n-k,k|e^{-iH\Delta t}|n,0\rangle. +$$ +So, we can focus specifically on the $n^{th}$ subspace, which is described by an $(n+1)\times (n+1)$ matrix of the form +$$ +H_n=\chi\sum_{i=0}^{n-1}\sqrt{(i+1)(n-i)}(|i,n-i\rangle\langle i+1,n-i-1|+|i+1,n-i-1\rangle\langle i,n-i|). +$$ +These are matrices you might recognise, being the spin-$n/2$ rotation matrix $J_x$. Or, as in my case, you recognise it from perfect state transfer. Depending on where you recognise it from, and what level of detail you want the proof, it might be acceptable to quote the result +$$ +\langle n-k,k|e^{-iH\Delta t}|n,0\rangle=\sqrt{\binom{n}{k}}\cos^{n-k}(\chi\Delta t)\sin^{k}(\chi\Delta). +$$ +(I'm doing this from memory. I have the feeling there are suppose to be some phase factors like $e^{i\pi k/2}$.) Or you might take the eigenvalues/eigenvectors of the matrix and prove it. I know they can be found here, but require manipulation of hypergeometric functions.

+ +

Alternatively, there is a proof that doesn't require any hard maths, it's just a bit annoying. Consider a system of $n$ qubits, with a Hamiltonian +$$ +H'=\chi\sum_{i=1}^nX_i, +$$ +and let $|\psi_i\rangle$ be a uniform superposition of all states where $i$ of those qubits are in the $|1\rangle$ state, with the rest in $|0\rangle$. You can show that +$$ +H'|\psi_i\rangle=\chi\sqrt{i(n-i+1)}|\psi_{i-1}\rangle+\chi\sqrt{(i+1)(n-i)}|\psi_{i+1}\rangle, +$$ +Which is entirely equivalent to $H_n$ acting on $|i,n-i\rangle$. So, if we can work out the evolution of $H'$ acting on $|0\rangle^{\otimes n}$, evolving to $|\psi_k\rangle$, we're done! But this evolution is easy because it's actually just $n$ independent qubits, so +$$ +e^{-iH'\Delta t}|0\rangle^{\otimes n}=\left((\cos(\chi\Delta t)|0\rangle-i\sin(\chi\Delta t)\right)^{\otimes n}. +$$ +We can rewrite this as +$$ +\sum_{i=0}^n(-i)^k\sqrt{\binom{n}{k}}\cos^{n-i}(\chi\Delta t)\sin^i(\chi\Delta t)|\psi_i\rangle. +$$ +The origin of the binomial term is the normalisation of the state $|\psi_i\rangle$.

+",1837,,,,,7/22/2019 8:19,,,,7,,,,CC BY-SA 4.0 +6835,2,,6831,7/22/2019 10:13,,1,,"

You should probably read this tutorial to see how backend filtering works: https://github.com/Qiskit/qiskit-tutorials/blob/master/qiskit/basics/2_the_ibmq_provider.ipynb

+ +

Also, Aer is a local simulator, so the amount of memory available is determined by the computer you are running it on. Setting MAX_QUBIT_MEMORY manually will do nothing but cause your computer to freeze if you do not have enough memory to support 32 qubits.

+",332,,,,,7/22/2019 10:13,,,,2,,,,CC BY-SA 4.0 +6836,1,6844,,7/22/2019 13:17,,11,1689,"

I am doing self-study at the moment using primarily the book: Quantum Computing a Gentle Introduction by Eleanor Rieffel and Wolfgang Polak.

+ +

Getting through the earlier chapters and exercises went quite well (fortunately the earlier chapters had plenty of examples), however I got stuck on the 5th chapter on quantum circuits. Although I understand the concepts the authors present, perhaps due to a lack of examples, I have trouble applying said concepts to the exercises.

+ +

The exercises I have trouble with (and where I can't find a solution or thorough/ introductory explanation for) are the following:

+ +

$\\$

+ +

Questions:

+ +

Design a circuit for creating: +$\left| W_n \right> = \frac{1}{\sqrt{n}}(\left| 0 \dots 001 \right> + \left| 0 \dots 010 \right> + \left| 0\dots 100 \right>) + \cdots + \left| 1\dots 000 \right>)$ from $\left| 0 \dots 000 \right>$

+ +

And design a circuit for creating ""the Hardy state"": +$\frac{1}{\sqrt{12}}(3\left| 00 \right> + \left| 01 \right> + \left| 10 \right> + \left| 11 \right>)$

+ +

$\\$

+ +

Can somebody point me in the right direction or refer me to some literature/ tutorials so I can grasp these kind of exercises better?

+ +

$\\$

+ +

Perhaps a related question: +Tips and tricks for constructing circuits to generate arbitrary quantum states

+",8092,,8092,,7/22/2019 13:25,7/23/2019 18:04,How to create quantum circuits from scratch,,2,3,,,,CC BY-SA 4.0 +6837,1,6838,,7/22/2019 13:21,,0,778,"

What is the difference between 2 types of measurements depicted below?

+ +

+ +

+ +

At the end of unitary evolution, qubits are in superposition of states, and after measurement I get a set of probabilites for different states $(|0000\rangle...|0101\rangle...)$ in both cases. Each set have different size: 4 for 2 qubit measurement and 16 for 4 qubit measurement. I'm confused with interpretation these results.

+ +

If I want to know, what is the probability of getting $|0\rangle$ or $|1\rangle$ on the first and second qubits, what type of meashurement should I use?

+",6071,,,,,7/22/2019 13:43,Measurements in Qiskit,,1,0,,,,CC BY-SA 4.0 +6838,2,,6837,7/22/2019 13:43,,3,,"

In the first circuit you only use 2 measurement gates on the first and second qubits. This means that the amount of outputs will behave similarly to a circuit that has only 2 qubits. If we were to list out all possible outputs, it would look like this: 0000, 0001, 0010, 0011. This is because the third and fourth qubits will always be 0, so you only have 2 qubits which can result in either 0 or 1. This equates to $2^2=4$ amount of possible outputs.

+ +

In the second circuit, you measure all 4 of the qubits. If we were to list out all possible outputs of a 4 qubit circuit, it would look like this: 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111. Since now all 4 qubits can be either 0 or 1, the amount of possible outputs you can have is $2^4=16$.

+ +

The measurement gates should be used on any qubit that you want to know the value of. If you do not put a measurement gate on a qubit and run the circuit, that qubit's value will always result in 0. So if you only care about the probability of getting $|0\rangle$ or $|1\rangle$ on the first two qubits, then your first circuit is fine. However, if you care about the probabilities of all 4 qubits, you would need to use your second circuit.

+",6180,,,,,7/22/2019 13:43,,,,0,,,,CC BY-SA 4.0 +6839,1,,,7/22/2019 14:33,,2,635,"

I was going through the Qiskit documentation to see if there was a way to represent a mixture of quantum states as a density matrix or otherwise. Is there a way to do it? If so, how?

+",8093,,26,,10/9/2019 15:20,10/9/2019 15:20,How to represent an ensemble of pure quantum states in Qiskit?,,2,0,,,,CC BY-SA 4.0 +6840,1,,,7/22/2019 16:23,,1,2104,"

I'm working on a Hybrid classical-quantum linear solver. For this, they make a loop on a quantum circuit (ie. below), and each time they change the value of the classical register and apply a X gate on the quantum register conditioned on the state of the classical register.

+ +

Therefore, I ask myself, is there a way to initialize the classical register ?

+",7762,,,,,11/5/2020 12:51,How to initialize classical register in Qiskit?,,3,1,,,,CC BY-SA 4.0 +6841,2,,6832,7/22/2019 16:56,,2,,"

Be sure you have executed the command ""simulaqron set backend projectq"" in your shell, in order to set the projectq backend.

+ +

Moreover, in your Bob's code there is a reference to c1 which is undefined, in:

+ +

qB=Bob.recvQubit(c1, ""Alice"")

+",5551,,,,,7/22/2019 16:56,,,,1,,,,CC BY-SA 4.0 +6842,1,6858,,7/22/2019 17:15,,11,3050,"

I'm a newcomer to quantum computing and circuit construction, and I've been struggling to understand how to make a modular exponentiation circuit. From what I know, there are several papers on the matter (like Pavlidis, van Meter, Markov and Saeedi, etc.) but they are all so complicated and involve a lot of efficiency and optimization scheme that make it impossible for me to understand. When I read it in Nielsen and Chuang, specifically in Box 5.2 the author wrote them without any example, as if it is very easy to make (it probably is, but not for me).

+ +

Anyway, I've learned about the algorithm to do modular exponentiation using binary representation (it's simple enough at least this thing), but I don't know how to make a circuit out of it. Here's the picture I believe describing the process:

+ +

+ +

So how do I build those $U$ circuit? Can anyone, for example, tell me how do things changed when say I went from $11^x (\mod{15})$ to $7^x (\mod{21})$? I don't care if the circuit is not gonna be optimized and contain thousands of gates, but I want to at least understand the first step before going into more advanced stuffs like optimization.

+ +

Thank you very much!

+",7598,,,,,11/24/2020 1:18,"Is there a simple, formulaic way to construct a modular exponentiation circuit?",,3,2,,,,CC BY-SA 4.0 +6843,1,,,7/22/2019 19:15,,1,391,"

I simulated the circuit below in qiskit and used the statevector simulator to extract the statevector:

+ +

+ +

The resulting statevector that it gave me was:

+ +

array([ 0.5+0.j, -0.5+0.j, 0.5+0.j, 0.5+0.j])

+ +

The problem here is that it is assigning a minus sign to the second component which is for the state |01>, while it should actually assign the minus sign to the third component, which is for the state |10>, so I was expecting to get instead:

+ +

array([ 0.5+0.j, 0.5+0.j, -0.5+0.j, 0.5+0.j])

+ +

Can anyone help to clarify this. I was using qiskit for statevector simulation and need to check this.

+ +

Thanks,

+ +

C. Pedro

+",8094,,8094,,7/22/2019 19:22,7/22/2019 19:22,Please help: get_statevector gives wrong result in qiskit,,0,3,,,,CC BY-SA 4.0 +6844,2,,6836,7/22/2019 19:57,,8,,"

As DaftWullie pointed out, the question about $W_n$ has an excellent collection of answers here.

+ +

For the Hardy state question (and a lot of other tasks like it), you can approach it as follows.

+ +
    +
  • Start with the $|0...0\rangle$ state.
  • +
  • Start by putting the first qubit ""in the right state"", which is a state $(\alpha |0\rangle + \beta |1\rangle) \otimes |0...0\rangle$, where $\alpha$ and $\beta$ are the relative weights of all basis states which start with 0 and with 1, respectively. For Hardy state specifically, two basis states start with 0: $\frac{1}{\sqrt{12}}(3\left| 00 \right> + \left| 01 \right>)$ and two basis states start with 1: $\frac{1}{\sqrt{12}}(\left| 10 \right> + \left| 11 \right>)$; their relative weights are just the sums of squares of their amplitudes: $\frac{9}{12} + \frac{1}{12} = \frac{10}{12}$ and $\frac{1}{12} + \frac{1}{12} = \frac{2}{12}$, respectively. So you'll need to put the first qubit in the state $(\sqrt{\frac{10}{12}} |0\rangle + \sqrt{\frac{2}{12}} |1\rangle)$ using $R_y$ gate.
  • +
  • Continue by putting the second qubit in the right state, applying controlled $R_y$ gates with the first qubit as the control. To get the first two terms right, you need to convert the term $\sqrt{\frac{10}{12}} |0\rangle \otimes |0\rangle$ into the term $\frac{1}{\sqrt{12}}(3\left| 00 \right> + \left| 01 \right>)$, which is the same as convert normal state $|0\rangle \otimes |0\rangle$ into $\frac{1}{\sqrt{10}}(3\left| 00 \right> + \left| 01 \right>)$ without affecting the state $|1\rangle \otimes |0\rangle$ (note the renormalization when switching from terms of a larger expression to standalone states!) To do this, you can do a 0-controlled $R_y$ with the first qubit as control and the second qubit as target.
  • +
  • If you have more qubits, you will continue doing this, using more control qubits to make your rotations more and more specific.
  • +
+ +

You can see this paper by Shende, Bullock and Markov if you want a more formal and less ad-hoc explanation.

+",2879,,,,,7/22/2019 19:57,,,,1,,,,CC BY-SA 4.0 +6846,1,,,7/23/2019 1:00,,2,429,"

I'm trying to familiarise myself with OpenPulse but I'm confused about a few things.

+ +

Mainly, I would like to be able to take the pulse sequences that comprise standard gates on an IBMQ device and modify those sequences, but I'm having trouble doing that. If I call ""backend.defaults().cmd_def"", it brings up a list of Command objects that contain information about each gate's pulse sequence. However, ""backend.defaults().cmd_def[i].sequence"" is a list of PulseQobjInstructions. Is there a way to convert these lists of PulseQobjInstructions into pulse Schedule objects that operate on the correct channels and that I can simulate?

+ +

Additionally, I'm a little confused why each PulseQobjInstruction seemingly contains many more pulses (U-channels) than just the basic rotations that make up a gate. Is it necessary to recalibrate all the U-channels whenever a Drive channel is modified?

+",4841,,4841,,7/23/2019 14:14,8/22/2019 17:01,OpenPulse: Modifying pulse sequence for basic gates,,1,0,,,,CC BY-SA 4.0 +6847,1,,,7/23/2019 1:22,,2,168,"

We know that word error rate (WER) rather than qubit error rate (QER) is used to evaluate the performance of quantum Turbo codes and quantum LDPC codes. In classical coding theory, when we are computing the WER, we can either calculate the erroneous whole codeword rate, or only calculate the erroneous information part rate (e.g., the system codes). In QECCs, I find that most people always calculate the erroneous whole codeword rate rather than the erroneous information part rate when computing the WER. I want to know that can we calculate the erroneous information part rate when computing the WER, just like the system codes in classical coding theory? Is it possible to do this? Thanks.

+",8096,,55,,1/25/2021 11:58,1/25/2021 11:58,The merit of quantum error correction codes,,2,5,0,,,CC BY-SA 4.0 +6848,2,,6840,7/23/2019 5:24,,0,,"

You might find this section of the documentation helpful, it goes over initializing and using registers.

+ +

https://qiskit.org/documentation/terra/quantum_circuits.html

+",8081,,,,,7/23/2019 5:24,,,,4,,,,CC BY-SA 4.0 +6849,1,6850,,7/23/2019 6:28,,2,67,"

Equation 1.31 in Quantum Computation and Quantum Information a textbook by Isaac Chuang and Michael Nielsen is as follows,

+ +
+

$\left|\psi_2 \right> = \frac{1}{2}[\alpha(\left|0 +\right>+\left|1 +\right>)(\left|00\right>+\left|11\right>) + \beta(\left|0 +\right>-\left|1 +\right>)(\left|10\right>+\left|01\right>)]$

+
+ +

The book claims that after rearranging terms we obtain equation 1.32 as follows

+ +
+

$\left|\psi_2\right>=\frac{1}{2}[\left|00\right>(\alpha\left|0\right>+\beta\left|1\right>)+\left|01\right>(\alpha\left|1\right>+\beta\left|0\right>)+\left|10\right>(\alpha\left|0\right>-\beta\left|1\right>)+\left|11\right>(\alpha\left|1\right>-\beta\left|0\right>)]$

+
+ +

I don't know how to derive the second equation from the first. Can someone explain the steps please ?

+",2605,,,,,7/23/2019 7:42,Derive one equation from the other,,1,2,,,,CC BY-SA 4.0 +6850,2,,6849,7/23/2019 7:42,,1,,"

The tensor product is distributive, meaning that you can write +$$ +2|\psi_2\rangle=\alpha|000\rangle+\alpha|100\rangle+\alpha|011\rangle+\alpha|111\rangle+\beta|010\rangle+\beta|001\rangle-\beta|110\rangle-\beta|101\rangle. +$$ +Next you reorder the terms in the sum, +$$ +2|\psi_2\rangle=\alpha|000\rangle+\beta|001\rangle+\alpha|011\rangle+\beta|010\rangle+\alpha|100\rangle-\beta|101\rangle+\alpha|111\rangle-\beta|110\rangle. +$$ +Again, we can use distributivity to group these terms together based on the state of the first two qubits +$$ +2|\psi_2\rangle=|00\rangle(\alpha|0\rangle+\beta|1\rangle)+|01\rangle(\alpha|1\rangle+\beta|0\rangle)+|10\rangle(\alpha|0\rangle-\beta|1\rangle)+|11\rangle(\alpha|1\rangle-\beta|0\rangle), +$$ +as required

+",1837,,,,,7/23/2019 7:42,,,,1,,,,CC BY-SA 4.0 +6851,1,,,7/23/2019 8:23,,3,56,"

I am looking at the paper: Simulating Hamiltonian dynamics with a truncated Taylor series and I am explicitly interested in Eq (15) and (16). These read +$$ ||PA |0\rangle |\psi \rangle - |0\rangle U_r |\psi \rangle||=\mathcal{O}(\delta) \tag{15}$$ +and

+ +

$$ ||\text{Tr}_\text{anc}(PA |0\rangle |\psi \rangle) - U_r |\psi\rangle \langle\psi| U_r ||=\mathcal{O}(\delta) \tag{16}$$

+ +

and I would like to understand how to rigorously argue that they are true which I struggle with because I am not very seasoned when it comes to handling complexity and Landau-notation.

+ +

Some context: +The authors present a new technique that allows them to approximate $U_r |\psi \rangle$ by executing a circuit that acts like

+ +

$$PA |0\rangle |\psi \rangle = |0\rangle \left(\frac{3}{s}\tilde{U}-\frac{4}{s^3} \tilde{U}\tilde{U}^{\dagger}\tilde{U} \right)|\psi \rangle \tag{1}$$

+ +

and the two equations (15),(16) hold under the assumption that

+ +

$$ |s-2|=\mathcal{O}(\delta) \tag{2}$$ +$$ ||\tilde{U}-U_r||=\mathcal{O}(\delta) \tag{3}$$

+ +

where I suppose the norm $||\bullet||$ is the spectral norm of the operators.

+ +

What I know how to do: I am able to show that (3) implies that +$$|\tilde{U}\tilde{U}^\dagger-\boldsymbol{1}||=\mathcal{O}(\delta) \tag{4}$$ where I basically use that errors in unitaries only increase linearly which in turn I was able to prove from basic properties of the spectral norm.

+ +

What I struggle with: I want to apply (4) to (1) and replace $\tilde{U}\tilde{U}^{\dagger}$ by the identity plus some error and go from there but I do not know how I can do arithmetic with the Landau symbol.

+",5322,,,,,7/23/2019 8:23,Estimating errors in Hamiltonian Simulation paper,,0,0,,,,CC BY-SA 4.0 +6853,2,,6846,7/23/2019 16:05,,1,,"

Try using backend.defaults().pulse_library, and taking a SamplePulse object from there. If you want the samples of a SamplePulse you can just use my_pulse.samples

+",7764,,,,,7/23/2019 16:05,,,,1,,,,CC BY-SA 4.0 +6854,2,,6836,7/23/2019 17:58,,4,,"

You can simplify ""produce a state"" problems by breaking them into three parts:

+ +
    +
  1. Prepare the collection of magnitudes you'll need, without worrying about phase or which state has which magnitude.
  2. +
  3. Fix the phases.
  4. +
  5. Fix the ordering.
  6. +
+ +

Now consider the Hardy state. What are the magnitudes that we need to make? We need one instance of $3/\sqrt{12}$ and three instances of instance of $1/\sqrt{12}$. We can make them one at a time, by having a ""remaining amplitude"" state that we keep splitting off of.

+ +

We start with all the amplitude in one state with an excitation on the left, $\ell_0 |1000...00\rangle$ where $\ell_0=1$. What we want to do is move the excitation rightward while leaving behind the desired magnitudes. So to start we want to leave behind the magnitude $3/\sqrt{12}$. We can do that with a controlled $R_y(\theta_0)$ operation, where the control is the leftmost qubit and the target is the qubit just to its right. By picking just the right value for $\theta$, this will result in the state $3/\sqrt{12}|1000...00\rangle + \ell_1 |1100...00\rangle$. We then CNOT the second qubit back onto the first qubit to get to $\ell_1|1000...00\rangle + 3/\sqrt{12} |0100...00\rangle$. Next we want to pull off $1/\sqrt{12}$. We perform another $R_y$ controlled by the leftmost qubit followed by a backwards CNOT, but this time with the target is the qubit third from the left. By picking the perfect $\theta_1$ we will produce the state $\ell_2|1000...00\rangle + 3/\sqrt{12}|0100...00\rangle + 1/\sqrt{12} \ell_2 |0010...00\rangle$. And you just keep doing this until you've got all the amplitudes you need, conveniently addressed by individual qubits being excited.

+ +

Now you want to fix any incorrect phases produced by the Y rotations. For the Hardy state this is easy, because all the phases are positive. In general you target each qubit position $k$ with an $R_z(\phi_k)$ operation with appropriately chosen $\phi_k$ values, and that will get the phases right.

+ +

Now we want to get the ordering right. The easiest way to do this is to have some extra qubits that are your output qubits and, for each of the qubits we've prepared so far and each of the output qubits, either add a CNOT between the two or don't. For example, if the state with amplitude $3/\sqrt{12}$ is supposed to be a $|11\rangle$, then we need to CNOT from our leftmost qubit onto both of the output qubits. Then we need to uncompute the leftmost qubit by using a many-controlled NOT operation. There should be one control for each output qubit, and the control's type (qubit-must-be-on vs qubit-must-be-off) is determined by whether or not you toggled the qubit.

+ +

Applying these steps produces an inefficient, but correct, circuit for creating a Hardy state. You can open the circuit in Quirk:

+ +

+ +

If you want to produce a state without using so much workspace, the task gets harder. But you can still follow the magnitudes then phases then ordering pattern. Also, there are cleverer ways to prepare magnitude sets that have nice patterns. For example, when only one amplitude is different from the others, one round of partial amplitude amplification may be enough to prepare the state.

+",119,,119,,7/23/2019 18:04,7/23/2019 18:04,,,,0,,,,CC BY-SA 4.0 +6855,1,,,7/23/2019 20:31,,1,834,"

I am trying to implement the u3 controlled gate (able to rotate the qubit in any specified direction in 3 dimensions if the control is 1, for two qubits) using simpler gates. The simpler gates available are:

+ +

X(), Y(), Z(), H(), K(), T() Single-qubit gates.

+ +

rot_X(step), rot_Y(step), rot_Z(step) Single-qubit rotations with the angle (step⋅2π256)

+ +

CNOT(q), CPHASE(q) Two-qubit gates with q (qubit) as target.

+",8089,,,,,7/23/2019 20:31,How to implement controlled u3 gate from Qiskit using simpler gates?,,0,2,,,,CC BY-SA 4.0 +6856,2,,6588,7/23/2019 22:59,,4,,"

Here is an example of using Qiskit to benchmark quantum devices using the Quantum Volume metric. It generates the quantum volume model circuits, compiles them, runs them, and fits the result to find the volume.

+ +

The source code for how the fitting is done is here: +https://github.com/Qiskit/qiskit-ignis/blob/master/qiskit/ignis/verification/quantum_volume/fitters.py

+",2503,,,,,7/23/2019 22:59,,,,0,,,,CC BY-SA 4.0 +6857,2,,6847,7/24/2019 7:48,,2,,"

From my own experience working with QLDPC codes and what I have gleamed from the literature, using the erroneous whole codeword rate for the computation of the WER is the de facto procedure to evaluate quantum LDPC code performance. This is broached with relative simplicity in ""Fifteen Years of Quantum LDPC Coding and +Improved Decoding Strategies"" (https://doi.org/10.1109/ACCESS.2015.2503267). I'm sceptical with regard to it being the sole metric for Quantum Turbo code performance assessment, as I'm fairly certain to have seen publications where the erroneous information (the erroneous content of the pre-encoded message) was used to study the quality of Quantum Turbo codes. Perhaps skimming through existing papers related to the latter codes might help in providing better insight than what I've been able to muster in this answer.

+",7855,,,,,7/24/2019 7:48,,,,4,,,,CC BY-SA 4.0 +6858,2,,6842,7/24/2019 8:15,,5,,"

Here's, surely, a very non-optimal way of doing it. Imagine we have a unitary $V$ which performs the operation +$$ +V|x\rangle|y\rangle=|x\rangle|xy\text{ mod }N\rangle. +$$ +We can deal with how $V$ might work separately, but if you have that, we want to see how we can use it to calculate any $|x^{2^i}\text{ mod }N\rangle$. The trick is that if both inputs are $x^{2^j}\text{ mod }N$, then the output is $x^{2^{j+1}}\text{ mod }N$, so we only have to repeat this construction $i$ times. For example, in the circuit below: + +Here, I've used the control-not to denote transversal application to achieve copying of one (effectively classical) register to another. This lets you do any of the $U$ operations that you need, assuming that you know how to implement $V$. Don't forget that, as part of a larger circuit, you have to 'uncompute' the data on any auxiliary registers.

+ +

So, how do we implement $V$? Let me give some of the components. Let $x=x_1x_2x_3\ldots x_n$ and $y=y_1y_2\ldots y_n$ be the binary representations of $x$ and $y$. The product $xy$ is easy to calculate by long multiplication. For example, $x_iy_j$ is a bit value (so there are never any carries from the multiplication steps) that is equivalent to applying the Toffoli (controlled-controlled-not) with $x_i$ and $y_j$ as the two inputs. So you can calculate $y_1x$, $y_2x$, $y_3x\ldots$ on separate registers and then add them up.

+ +

Addition is another standard circuit. Imagine you want to add $x_1x_2\ldots x_n$ and $y_1y_2\ldots y_n$. We need to have additional two registers: one for the output, one for the carry bit. The least significant bit of output is $x_n\oplus y_n$, which can be calculated with controlled-nots. The carry bit has value $z_n=x_ny_n$. The next output is $x_{n-1}\oplus y_{n-1}\oplus z_{n}$, which we can again do with controlled nots. The carry bit is a majority vote - are two or more of $x_{n-1},y_{n-1},z_n$ value 1? One way to implement this is: + +You can keep repeating this process bit by bit to compute the sum. Then, again, don't forget to uncompute all the ancillas.

+",1837,,,,,7/24/2019 8:15,,,,7,,,,CC BY-SA 4.0 +6859,2,,6847,7/24/2019 8:50,,1,,"

To add some more insight regarding to the answer given before, I think that you confused when understanding the Word Error Rate as defined in Quantum serial turbo codes. In such paper, the authors describe the QBER as the fraction of logical qubits that have errors after the decoding, while saying that the WER is the probability that at least one qubit in the block is incorrectly decoded. In such description you undestood that such block refers to the whole codeword, but the authors are referring to the logical qubit block, that is, the block of information qubits.

+ +

Such thing can be seen more clearly when they describe the decoding algorithm in the paper, as such turbo decoder estimates the most probable logical error coset $\hat{\mathcal{L}}$ that affects to the information qubits rather than the most probable physical error, that would be $\hat{\mathcal{P}}$. Consequently, in the QTC paradigm at least, the WER refers to the figure of merit that you are looking for, and not to a WER that considers the estimation of the channel error, or the error that would affect the whole codeword sent through the depolarizing channel.

+",2371,,,,,7/24/2019 8:50,,,,3,,,,CC BY-SA 4.0 +6860,1,7093,,7/24/2019 9:21,,4,266,"

So I am preparing for an exam and stumbled upon this question which I am unable to answer:

+ +
+

The problem Binary Integer Linear Programming tries to find a binary vector $\vec x=(x_1,x_2, ...,x_n)^T$ with $x \in \mathbb{F_2}$ that maximizes the value of $\vec s * \vec b$ under the constraint that $S\vec x = \vec b$. The values $\vec s \in \mathbb{F_2^n}, b\in \mathbb{F_2^n}$ and $S \in \mathbb{F_2^{n\times m}}$ are given. + Construct an Ising-Hamiltonian for the optimization problem.

+ +

Hint: Construct a Hamiltonian for the constraints, a hamiltonian for the maximization and construct a superposition with the fitting coefficients

+
+ +

While I do understand that the Ising Model can help us with optimization problems and I kinda figured out what my constraints and maximization function would look like, I do not know how I should construct a superposition and what it would be useful for.

+ +

Thanks in advance!

+",8105,,,,,8/24/2019 18:16,How would I construct an Ising Hamiltonian for binary linear programming?,,1,4,,,,CC BY-SA 4.0 +6861,1,,,7/24/2019 11:32,,3,53,"

Density Evolution is a simulative tool that models the behaviour of SPA (sum-product) decoders. It is useful because it enables the optimization of code designs so that extensive simulations can be avoided and code constructions that approach the channel capacity can be found relatively quickly. It has been applied extensively in the framework of classical communications to find LDPC codes that approach the Shannon limits of channels very closely (""On the Design of Low-Density Parity-Check Codes within 0.0045 dB of the Shannon Limit"").

+ +

I am interested in applying this design optimization technique in the quantum paradigm, specifically to the work I am conducting on QLDPC codes. Although I'm fairly confident with regard to my understanding of density evolution itself and I believe I can transcend it (so to speak) to my QEC scenario, it would be of great aid to my research if I could get my hands on a small example or implemented version of the classical LDPC density evolution algorithm. I haven't been able to find much after a thorough web search, hence my posting of this question. In the absence of an example, I would also be grateful if I were to be directed towards publications regarding density evolution applied to LDPC codes.

+",7855,,55,,1/25/2021 11:58,1/25/2021 11:58,Density Evolution to Optimize QLDPC code design,,0,0,,,,CC BY-SA 4.0 +6862,1,6872,,7/24/2019 12:00,,5,534,"

In his lecture notes Scott Aaronson states:

+ +
+

Now, consider the $2$-qubit pure state $\frac{|00\rangle + |01\rangle + |10\rangle}{\sqrt{3}}$. We'll give the first qubit to Alice and the second to Bob. How does Bob calculate his density matrix? By picking some orthogonal basis for Alice's side. You can rewrite the state as $\sqrt{\frac{2}{3}}|0+\rangle + \sqrt{\frac{1}{3}}|10\rangle$, which lets you calculate Bob's density matrix as: + $$ +\frac{2}{3}|+\rangle\langle+| + \frac{1}{3}|0\rangle\langle0| = \frac{2}{3} \begin{bmatrix} \frac{1}{2} & \frac{1}{2} \\ \frac{1}{2} & \frac{1}{2} \end{bmatrix} + \frac{1}{3} \begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix} = \begin{bmatrix} \frac{2}{3} & \frac{1}{3} \\ \frac{1}{3} & \frac{1}{3} \end{bmatrix} +$$

+ +

In general, if you have a bipartite pure state, it'll look like + $$ +\sum_{i,j = 1}^N \alpha_{ij} |i\rangle|j\rangle = |\psi\rangle +$$ + And you can get Bob's local density matrix + $$ +(\rho_\text{Bob})_{j, j'} = \sum_i \alpha_{ij} \alpha_{ij'}^* +$$

+
+ +

I have two problems with this formulation.

+ +
    +
  1. I'm not sure how this generalizes to states with more qubits.
  2. +
  3. These indices are making my head explode.
  4. +
+ +

Is there another way to go about this, perhaps in terms of outer products as Aaronson hints at with his example, which doesn't have these shortcomings? An example computation would also be very welcome.

+",8107,,,,,7/26/2019 3:17,What's an easy way to determine a local density matrix?,,1,0,,,,CC BY-SA 4.0 +6863,2,,6840,7/24/2019 14:31,,2,,"

Classical registers are typically used for capturing measurement results, and may also be used for conditionally applying quantum operation. See: +https://github.com/Qiskit/openqasm/blob/master/spec/qasm2.rst

+ +

Given the problem you described, one approach would be to have a classical program that iteratively: +1) defines and executes a quantum circuit on a quantum processor or simulator +2) reads the results from the classical registers for guidance in defining the circuit for the next iteration

+",4863,,,,,7/24/2019 14:31,,,,0,,,,CC BY-SA 4.0 +6864,1,,,7/24/2019 20:14,,2,60,"

I read this article on quantum linear solver based on the Neumann-Ulam method (here is a lesson about it). But the article has not a lot of details. Therefore I don't understand what is the algorithm apart from the quantum walk.

+ +

Does somebody have an implementation of it ?

+",7762,,,,,7/24/2019 20:14,Hybrid classical-quantum linear solver based on the Neumann-Ulam method,,0,0,,,,CC BY-SA 4.0 +6865,1,6866,,7/24/2019 20:48,,3,171,"

I am reading the paper ""Quantum Amplitude Amplification and Estimation"", available here (pages 4 to 7 in particular). I will try to summarize my confusion over a statement on page $7$.

+ +

Suppose that $H$ is a finite-dimensional Hilbert space representing the state space of a quantum system spanned by the orthonormal basis states ${|x_i \rangle}_{i=1}^{n} \in H$. Every Boolean function $\chi: \mathbb{Z} \rightarrow \{0,1 \}$ induces a partition of $H$ into a direct sum of two subspaces, a good subspace, and a bad subspace.

+ +

Let $A$ be any quantum algorithm that acts on $H$ and uses no measurements, with $|\Psi \rangle = A |0 \rangle$. Decompose $|\Psi \rangle = |\Psi_0 \rangle + |\Psi_1 \rangle $, the projection of $|\Psi \rangle$ into the bad subspace and the good subspace, respectively. Define $Q(A, \chi) = -AS_0A^{-1}S_{\chi}$, where $S_\chi |y \rangle = -1^{\chi(y)} |y \rangle $, and $S_0$ changes the sign of the amplitude iff the state is the zero state $|0 \rangle$. The operator $Q$ is well-defined since we assume that $A$ has no measurements, and therefore has an inverse. Note that equivalently, $S_0 = (I-2|0 \rangle \langle 0|)$. Define $a = \langle \Psi_1 | \Psi_1 \rangle$.

+ +

Define $|\Psi_{\pm} \rangle = \frac {1}{\sqrt{2}} (\frac {1}{\sqrt{a}} |\Psi_1 \rangle \pm \frac {i}{\sqrt{1-a}} |\Psi_0 \rangle)$, which is an orthonormal basis of $H_{\Psi}$, the subspace spanned by $ |\Psi_0 \rangle$ and $|\Psi_1 \rangle$, with corresponding eigenvalues $\lambda_{\pm}=e^{-i2\theta_a}$ where $\theta_a$ satisfies $\sin^2{\theta_a}=a$.

+ +

The author then states:

+ +

The state $|\Psi \rangle = A|0 \rangle$ can be expressed in the eigenvector basis as $|\Psi \rangle = A|0 \rangle = \frac{-i}{\sqrt{2}}(e^{i\theta_a}|\Psi_+ \rangle -e^{-i\theta_a}|\Psi_- \rangle)$, and after $j$ applications of $Q$, we have that +$Q^j |\Psi \rangle = \frac {-i} {\sqrt{2}}(e^{i(2j+1)\theta_a} |\Psi_+ \rangle - e^{-i(2j+1)\theta_a}|\Psi_- \rangle)$ +$ = \frac {1}{\sqrt{a}}\sin((2j+1)\theta_a) |\Psi_1 \rangle + \frac {1}{\sqrt{1-a}}\cos((2j+1)\theta_a) |\Psi_0 \rangle$. If $0<a<1$, then the probability of producing a good state upon measurement is given by $\sin^2((2j+1)\theta_a)$

+ +

My question is what happened to the $\frac{1}{\sqrt{a}}$ in computing the probability of measuring $|\Psi_1 \rangle$? Is this a mistake or is there something simple I am missing?

+",7481,,23,,7/24/2019 22:05,7/24/2019 22:05,Clarification of a portion of the paper Quantum Amplitude Amplification and Estimation,,1,0,,,,CC BY-SA 4.0 +6866,2,,6865,7/24/2019 21:56,,2,,"

The quantum state $|\Psi_1\rangle$ is not normalized to $1$. Thus the probability +\begin{align} +&\left|\frac{1}{\sqrt{a}}\sin((2j+1)\theta_a)|\Psi_1\rangle\right|^2\\ +&= +\frac{|\langle\Psi_1|\Psi_1\rangle|}{a} +\left|\sin^2((2j+1)\theta_a)|\right|^2\\ +&= +\sin^2((2j+1)\theta_a) +\end{align}

+",5370,,,,,7/24/2019 21:56,,,,2,,,,CC BY-SA 4.0 +6867,1,,,7/25/2019 11:12,,4,233,"

I recently read in Section 7.5.2 of Quantum Computing: A Gentle Introduction by Eleanor Rieffel and Wolfgang Polak a section in which they criticize the view of quantum parallelism in quantum algorithms. Specifically they address the Bernstein-Vazirani problem from the point of view of N.D. Mermin in Copenhagen Computation: How I Learned to Stop Worrying and Love Bohr. I am still learning this topic so please correct me if I make mistakes below...

+ +

Background: +The Bernstein-Vazirani subroutine has an oracle function $U_{f_a}$ which takes input $\left| x_n \right>\left|y\right> \rightarrow \left| x_n \right>\left|y\oplus x \cdot u \right>$, where $\cdot$ implies the Hamming distance of $x \land y$ modulo $2$ (or as Mermin argued the inner product of $x$ and $y$ modulo $2$).

+ +

Now in the initial explanation the authors present the solution ""in terms of quantum parallelism""; they apply the Walsh-Hadamard and Hadamard gate to the $\left| x_n \right>\left|y\right>=\left| 0_n \right>\left| 1 \right>$ respectively $H_n \otimes H$ and input the, now in superposition, $n$-qubit and $1$-qubit registers into the $U_{f_a}$ subroutine. After applying this oracle function the states are put through $H_n \otimes H$ again returning $\left| a \right>$ and the initial $\left| 1 \right>$ respectively. All good so far...

+ +

$\\$

+ +

Question: +Now what I find intuitive is that the $H_n$ gate puts the register of $1$s in the state:

+ +

$\displaystyle W\left| 1_n \right> = \frac{1}{\sqrt{2^n}}\sum_z(-1)^{1 \cdot z}\left| z \right>,$

+ +

and that the oracle function phase shifts all $n$ qubits with $e^{2\pi i}=1$ if a qubit is not shared between the input and $a$ (the inner product of the compared qubits $=0$), and with $e^{\pi i}=-1$ if it is shared (inner product $=1$).

+ +

Due to the Walsh-Hadamard transformation on the register of $\left| 1_n \right>$, all $n$-qubit states possible are being compared from which I infer that the term quantum parallelism comes $-$ Comparable to the solution for the Deutsch problem in which through superpositions the entire function domain can be explored in one function call. By cleverly re-applying the Walsh-Hadamard transformation the non-trivial phase shift information can be extracted in the form of $\left| a \right>$.

+ +

$\\$

+ +

And what I understand but don't know how to feel about: is that the authors argue that the function $U_{f_a}$ is actually a series of $C_{not}$ gates that act upon the ancilla qubit if $a$ is $1$. Due to the Walsh-Hadamard and Hadamard transformations before and after $U_{f_a}$ the $C_{not}$ gates are inverted in the subroutine, thus, flipping the qubits in the $\left| x_n \right>$ register where $a$ is $1$.

+ +

The reason I do not know how to feel about this interpretation is that the authors emphasize that the $C_{not}$ flip interpretation is the right way of looking at this algorithm.

+ +

First of, it implies that the oracle function $U_{f_a}$ must be fixed or somehow able to be adaptively computed. But more importantly, this interpretation somewhat rids itself of the interpretation of linear combinations of the states $-$ i.e., apparently the ""right way"" of looking at this algorithm is that Hadamard gates flip a $C_{not}$ and not that the initial states are put into a linear combination of the standard bases through which an exponentially increasing domain of a function can be sampled and cleverly interfered yielding the final solution.

+ +

Thus, my question is:

+ +

TLDR; How should you view a quantum algorithm as utilizing quantum parallelism, and what is defined to be the ""right way"" of interpreting quantum parallelism in such algorithms.

+",8092,,,,,7/26/2019 6:59,Is the intuition of quantum parallelism always correct?,,2,1,,,,CC BY-SA 4.0 +6868,1,,,7/25/2019 17:05,,1,243,"

I was wondering after seeing ibmq_16_melbourne layout how it is possible to perform this circuit :

+ +

+ +

It seems when looking at ibm q computers that a qubits can at max target 3 qubits because the arrow representing connectivity between qubits (which mean the possible cnots) doesn't allow more.

+ +

+ +

So how does the compiler map virtual qubits to physical quits in this case?

+",8115,,434,,7/25/2019 20:09,9/15/2019 7:01,How is it possible to perform a c-not on 4 qubits using the same control qubits on IBM Q computers?,,1,1,,,,CC BY-SA 4.0 +6869,1,6874,,7/25/2019 19:04,,7,1520,"

As per wikipedia, no-cloning theorem states that it is impossible to create an identical copy of an arbitrary unknown quantum state.

+ +

But from which distribution is this unknown quantum state sampled from? What does the counterfeiter know about this distribution? What is the maximum probability that a counterfeiter could succeed?

+ +

Let's say if we randomly pick one of the 2 quantum states $|\psi_0\big>$ and $|\psi_1\big>$ and give it to a counterfeiter (the states $|\psi_0\big>$ and $|\psi_1\big>$ are fixed ahead of time and are known to the counterfeiter) . The counterfeiter could measure the given state in $|\psi_0\big>$ and $|\psi_0^\perp\big>$ basis and forge with non-zero probability.

+ +

I believe success probability of a counterfeiter depends on the distribution on which the unknown state is sampled from. I would like to know for what distribution of states the no cloning theorem is applicable.

+",8014,,8014,,7/25/2019 20:16,7/26/2019 7:33,No-cloning theorem does not seem precise,,2,7,,,,CC BY-SA 4.0 +6870,2,,6869,7/25/2019 19:47,,6,,"

To keep the problem small, let's say 1 qubit.

+ +

In the original statement $| \psi \rangle$ could be any state $\alpha | 0 \rangle + \beta | 1 \rangle$ for whatever $\alpha$ and $\beta$ produce a well defined state.

+ +

Quantifying over all so not a probabilistic statement. Say you uniformly draw over all possible states. It is impossible to guarantee that you have gotten $| \psi \rangle \otimes | \psi \rangle$.

+ +

However if you give a probability distribution with smaller support, then it does become possible. Let's say you know the state is either $|0\rangle$ or $|1\rangle$ with probabilities $p$ and $1-p$ respectively. Then you could guarantee that you have gotten $| \psi \rangle \otimes | \psi \rangle$. You just apply a $CNOT$ on $| \psi \rangle \otimes | 0 \rangle$.

+ +

Further example, suppose the state is either $|0\rangle$, $|1\rangle$, $| + \rangle$ or $|-\rangle$ with probabilities $p-\epsilon_1$, $1-p-\epsilon_2$, $\epsilon_1$ and $\epsilon_2$ respectively. Then you could use the same gate and it would still be likely to succeed because $\epsilon_1$ and $\epsilon_2$ are so small.

+ +

You could make a statement quantified like $\forall | \psi \rangle$ in the support of a given probability distribution. Then it would depend on the distribution. If it was the first one, supported only on 2 states, then it would be possible to get $| \psi \rangle \otimes | \psi \rangle$. But if it was the second it would be impossible to guarantee that result even if it would be quite likely.

+",434,,,,,7/25/2019 19:47,,,,2,,,,CC BY-SA 4.0 +6871,2,,6867,7/26/2019 1:12,,4,,"

So, this isn't a question with a single ""correct"" physical answer. In general, though I would say that the parallel nature of quantum algorithms is dramatically overplayed, especially in older literature and a lot of the popular science press. Remember that whatever parallelism is happening as your quantum state evolves, once you measure you're going to collapse all of that. Put another way, even if many worlds are involved in calculating your answer, in the end you're only going to have access to one of them. The trick to designing quantum algorithms is to find some feature of the problem that you can leverage to drive up the probability that the world you end up in is one with the right answer. The upshot of this is that you can take or leave parallelism as a matter of philosophical taste, or according to how useful it is to you grokking/designing a particular algorithm.

+ +

With that in mind I think it's fair to say that there are two main schools of thought about the role of parallelism in quantum computing. I'll call them ""Deutsch"" and ""Aaronson."" The ""Deutsch"" way of thinking goes heavy on the implications of parallelism and has connections to the many-worlds picture of quantum mechanics. Faced with the power of something like Shor's Algorithm, a Deutsch would ask ""where"" the numbers are factored, if not in many interfering worlds.

+ +

An Aaronson, on the other hand, might take a more instrumental approach. In other words, if it works, go with it, but don't try to shoehorn the whole field into your favorite way of thinking. Quantum algorithms that show speed-up over their known classical counterparts tend to rely on a sort of synergy between the specifics of the problem and the idiosyncrasies of quantum. There's a sort of Rube-Goldberg flavor to the whole endeavor, where things work thanks to careful alignment of pieces and parts and a good bit of luck, rather than because they rely on a single conceptual resource like parallelism. Many algorithms don't necessarily fit best into the parallelism way of thinking. Analog quantum simulators, for instance, or some of the algorithms being considered for benchmarking quantum supremacy like random circuit selection. In these cases you might be better off thinking about the benefits of running quantum software on its ""native"" hardware, or the classically confounding effects of entanglement respectively.

+ +

Finally, as far the the connection to many-worlds is concerned, as Scott Aaronson (in case it wasn't clear, the inspiration for this school of thought) noted in his excellent book ""Quantum Computing Since Democritus"", one thing that everyone can agree on is that interference between amplitudes is a key computational resource for a quantum computer. If you want to imagine that that is happening in parallel worlds, then those worlds are interacting with each other, and don't really seem very separate.

+ +

I hope this helps.

+",8081,,,,,7/26/2019 1:12,,,,0,,,,CC BY-SA 4.0 +6872,2,,6862,7/26/2019 3:17,,4,,"

For calculating a local density matrix or in other words taking a partial trace has a neat trick (IMHO):

+ +

The Trick:

+ +
    +
  1. Write the state given in density matrix form, if not already. Which means if $\vert \psi \rangle$ is the state, the density matrix is $\vert \psi \rangle \langle \psi \vert$.
  2. +
  3. Turn all the outer-products into inner-products for the dimensions you don't want.
  4. +
+ +

Example

+ +
    +
  1. $$\vert \psi \rangle =\frac{|00\rangle + |01\rangle + |10\rangle}{\sqrt{3}}$$ +$$\vert \psi \rangle \langle \psi \vert = \big(\frac{|00\rangle + |01\rangle + |10\rangle}{\sqrt{3}}\big)\big( \frac{\langle00| + \langle01| + \langle10\vert}{\sqrt{3}} \big) $$ +$$=\big( \frac{\vert00\rangle\langle00\vert+\vert00\rangle\langle01\vert+\vert00\rangle\langle10\vert+\vert01\rangle\langle00\vert+\vert01\rangle\langle01\vert+\vert01\rangle\langle10\vert+\vert10\rangle\langle00\vert+\vert10\rangle\langle01\vert+\vert10\rangle\langle10\vert}{3}\big)$$
  2. +
  3. Since you want the state of 2nd system, you would turn all the outer-products for 1st system to inner-prodcuts(This implies all the terms of form, $\langle0\vert1\rangle=\langle1\vert0\rangle=0$ and $\langle0\vert0\rangle=\langle1\vert1\rangle=1$, +$$\rho_2 = \big( \frac{1*\vert0\rangle\langle0\vert+1*\vert0\rangle\langle1\vert+0*\vert0\rangle\langle0\vert+1*\vert1\rangle\langle0\vert+1*\vert1\rangle\langle1\vert+0*\vert1\rangle\langle0\vert+0*\vert0\rangle\langle0\vert+0*\vert0\rangle\langle1\vert+1*\vert0\rangle\langle0\vert}{3}\big)$$ +$$\rho_2 = \big( \frac{\vert0\rangle\langle0\vert+\vert0\rangle\langle1\vert+\vert1\rangle\langle0\vert+\vert1\rangle\langle1\vert+\vert0\rangle\langle0\vert}{3}\big)$$ +$$\rho_2 = \big( \frac{2\vert0\rangle\langle0\vert+\vert0\rangle\langle1\vert+\vert1\rangle\langle0\vert+\vert1\rangle\langle1\vert}{3}\big)$$ +Which is the state in the example you quote. Now, this will become second nature when you become little experienced and you wouldnt even be doing all this algebra!
  4. +
+ +

Example on 3-qubit system:

+ +
    +
  1. I deliberately choose an state with 2 terms just to show the proof of principle, you can work out a complicated state if you wish so!, +$$\vert \psi \rangle = \sqrt{\frac{2}{3}}\vert 011 \rangle + \sqrt{\frac{1}{3}}\vert100\rangle$$ +$$ \vert \psi \rangle \langle \psi \vert = +\frac{2}{3}\vert011\rangle\langle011\vert ++\frac{1}{3}\vert100\rangle\langle100\vert ++\frac{\sqrt{2}}{3}\vert011\rangle\langle100\vert ++\frac{\sqrt{2}}{3}\vert100\rangle\langle011\vert$$
  2. +
  3. Lets say you want the state of 2nd qubit, turn all the outer-products for 1 and 3 qubit to inner-products. +$$\rho_2=\frac{2}{3}\langle0\vert0\rangle\vert1\rangle\langle1\vert\langle1\vert1\rangle ++\frac{1}{3}\langle1\vert1\rangle\vert0\rangle\langle0\vert\langle0\vert0\rangle ++\frac{\sqrt{2}}{3}\langle0\vert1\rangle\vert0\rangle\langle0\vert\langle1\vert0\rangle ++\frac{\sqrt{2}}{3}\langle1\vert0\rangle\vert0\rangle\langle0\vert\langle0\vert1\rangle$$ +$$\rho_2 = \frac{2}{3}\vert0\rangle\langle0\vert + \frac{1}{3}\vert1\rangle\langle1\vert$$
  4. +
+ +

Explaination of trick: +Trace on a single qubit state(in computational basis), $\sigma$ is given by sum of diagonal elements, +$$Tr(\rho) = \sum_{i|i\in\{0,1\}}\langle i \vert\sigma\vert i\rangle.$$ +Similarly for 2-qubit state $\rho$, +$$Tr(\rho) = \sum_{i,j |i,j\in\{0,1\} }\langle ij\vert\rho\vert ij\rangle.$$

+ +

Now, given this 2-qubit state if you want to know the local state of 1st qubit you would take a partial trace over 2nd qubit: +$$Tr_2(\rho) = \sum_{j|j\in\{0,1\}}\langle j \vert\rho\vert j\rangle.$$ +In above you can see that if there was an element of form $\vert0\rangle\langle1\vert,\vert1\rangle\langle0\vert$ for 2nd qubit, they will go to zero while the terms of form $\vert0\rangle\langle0\vert,\vert1\rangle\langle1\vert$ goes to 1, and hence the trick! +and if you want to know the local state of 2nd qubit you would take a partial trace over 1st qubit: +$$Tr_1(\rho) = \sum_{i|i\in\{0,1\}}\langle i \vert\rho\vert i\rangle.$$

+",5746,,,,,7/26/2019 3:17,,,,0,,,,CC BY-SA 4.0 +6873,2,,6867,7/26/2019 6:59,,4,,"

Intuition is just that - intuition. It's is not an absolute of ""this is how it works"", but rather something that helps you get some sort of intuition about what's happening. In that sense, there is no ""right"" or ""wrong"". It's what helps you. Different people understand things in different ways. You just have to be clear that every intuitive explanation has its limitations - they're rarely a complete description - and there's no substitute for actually doing the maths.

+ +

So, the quantum parallelism intuition is particularly useful because it is easily described even to a layman (which is what you want from intuition), which is why it has been over-played in the media. Its limitation is that it fails to explain why some algorithms get a speed-up and others don't - because it's not just about parallelism, but how you make the comparison at the end of the computation.

+",1837,,,,,7/26/2019 6:59,,,,0,,,,CC BY-SA 4.0 +6874,2,,6869,7/26/2019 7:33,,9,,"

The no-cloning theorem itself can be stated very precisely.

+ +
+

Given an unknown pure state $|\psi\rangle$ that is drawn from a distribution + $\{p_i,|\phi_i\rangle\}$ (known to the counterfeiter), it is impossible to create a perfect clone with unit probability + unless all the states are orthogonal, + $\langle\phi_i|\phi_j\rangle=\delta_{ij}\ \forall\ i,j$.

+
+ +

Of course, as you say, there are strategies that either (i) succeed perfectly but with some probability of success less than 1, or (ii) always succeed but create the target state with some finite accuracy, as measured by the fidelity (F<1). In my experience, (ii) is the more common case.

+ +

What these parameters are is highly dependant upon the distribution that the states are drawn from, and there's no universal answer. The sort of cases you will find that have been explicitly calculated include:

+ +
    +
  1. Universal cloning, where the distribution is uniform over all possible pure states of a fixed Hilbert space dimension.
  2. +
  3. Equatorial cloning (this is my name for it, many in the literature use 'phase covariant cloning' but I find that misleading). The system to be cloned is a qubit, equally likely to be any pure state on a great circle (usually the equator) of the Bloch sphere, i.e. $(|0\rangle+e^{i\phi}|1\rangle)/\sqrt{2}$ for any $\phi\in[0,2\pi)$.
  4. +
  5. Phase covariant cloning (again, my name for it). A qubit state $\cos\theta|0\rangle+\sin\theta e^{i\phi}|1\rangle$ for some arbitrary distribution $f(\theta)$, but still uniform over $\phi$. In other words, the distribution is invariant under rotations around the z axis of the Bloch sphere.
  6. +
  7. A discrete pair of non-orthogonal states.
  8. +
+ +

You can derive these success parameters for arbitrary numbers of clones, and you can even demand that different clones have different fidelities, and derive the optimal trade-off between them (full disclosure: I've worked on that quite a bit).

+ +

I should probably emphasise that what you want from cloning is highly dependant upon application. In a lot of theory, it is the simple fact that perfect cloning is impossible that is useful within other proofs. Figures of merit are only really relevant if you have a concrete scenario where you want to implement approximate cloning. I'm not aware of many. Note that, for example, it's not so useful in security proofs of e.g. quantum key distribution, because that might allow you to bound how well a particular class of strategies perform, but how do you know there aren't other strategies not included in your analysis?

+",1837,,,,,7/26/2019 7:33,,,,0,,,,CC BY-SA 4.0 +6875,1,,,7/26/2019 8:07,,9,2761,"

This is because if control qubit is in arbitrary state then how can it be made to control the CNOT gate? What is the interface between Control Qubit and CNOT Gate?

+",8120,,,,,7/26/2019 22:40,How is CNOT gate physically implemented in IBM Q?,,1,5,,,,CC BY-SA 4.0 +6876,2,,6875,7/26/2019 22:40,,7,,"

First of all let me welcome you to QCSE! I'm new myself.

+ +

IBM operates superconducting qubits based on josephson junctions. The basic architecture of the chip can be visualized as a graph with qubits at the vertices and superconducting, microwave resonators as the edges. Their native two-qubit operation is something called a cross-resonance gate. Basically, the control qubit is driven at the transition frequency of the target qubit. This induces a coupling between the two that depends on the amplitude of the drive signal. By tuning this amplitude, you can obtain an effective hamiltonian that corresponds to the generator of the clifford group $[ZX]^{1/2}$. This, combined with single-qubit rotations, can give you a CNOT gate. For more details I'd recommend this paper.

+ +

Hope this helps.

+",8081,,,,,7/26/2019 22:40,,,,3,,,,CC BY-SA 4.0 +6877,2,,6842,7/27/2019 10:56,,4,,"

The method of transversal copying by a CNOT is solid and you can stack up the building blocks for the quantum part of shor algorithm. However ad-hoc circuit synthesis based at a pattern of the function truth table could be efficiënt in some cases as described in arxiv 1310.6446v2. First case is for factoring N=15 and base a = 2 with period r = 4. In exponential formulation we have $$f(x)=a^{x}\text{ mod }15 +$$ +With values

+ +

+ +

Setup a truth table for input x between 0 and 3. Input x is represented by 2 qubits x2 and x1. Output y is represented by 4 qubits y4,y3,y2,y1 +For example if x = 2 then x2=1 and x1=0 then only y3 =1 so put a NOT on this line.

+ +

+ +

Furthermore underlined entries in table 1 are the ones that are modified by a toffoli gate to get the right output in the circuit according the table 1. +We can use this module in the overall algorithm according to +https://arxiv.org/pdf/0705.1398.pdf

+ +

+",1773,,1773,,7/27/2019 13:29,7/27/2019 13:29,,,,0,,,,CC BY-SA 4.0 +6878,1,,,7/27/2019 14:21,,7,223,"

I am reading about the phase damping quantum operation on page 384 of Nielsen & Chuang's Quantum Computation and Quantum Information (10th Anniversary Edition).

+

Nielsen & Chuang derived the operation elements from an interaction model of two harmonic oscillators where only the first two levels $|0\rangle$ and $|1\rangle$ are considered. Here's a clipping of the corresponding contents in the book:

+
+

Another way to derive the phase damping operation is to consider an interaction between two harmonic oscillators, in a manner similar to how amplitude damping was derived in the last section, but this time with the interaction Hamiltonian \begin{equation} \tag{8.126} +H = \chi a^\dagger a\left(b+b^\dagger\right), +\end{equation} +Letting $U = \exp\left(-iH\Delta t\right)$, considering only the $\left|0\right>$ and $\left|1\right>$ states of the $a$ oscillator as our system, and taking the environment oscillator to initially be $\left|0\right>$, we find that tracing over the environment gives the operation elements $E_k = \left<k_b|U|0_b\right>$, which are \begin{equation} \tag{8.127} +E_0 = \begin{bmatrix}1 & 0 \\ 0 & \sqrt{1-\lambda}\end{bmatrix}\end{equation} \begin{equation} \tag{8.128} +E_1 = \left[\begin{matrix} 0 & 0 \\ 0 & \sqrt{\lambda}\end{matrix}\right], +\end{equation} where $\lambda = 1-\cos^2\left(\chi\Delta t\right)$

+
+

I just could not work out the calculations. Anybody can help me with the $\sqrt{1-\lambda}$ and $\sqrt{\lambda}$ terms?

+

Actually, when I attempted to derive the operation elements along this way, I got the very different answer:

+

Firstly, we know that if $[A,[A,B]]=[B,[A,B]]=0$ then $e^{A+B}=e^A e^B e^{-[A,B]/2}$. So we have $$E_0=\langle 0_b| e^{-i\chi\Delta t a^\dagger a(b+b^\dagger)} |0_b\rangle +=\langle 0_b| e^{-i\chi\Delta t a^\dagger a b} e^{-i\chi\Delta t a^\dagger a b^\dagger} |0_b\rangle e^{(\chi\Delta t a^\dagger a)^2/2}$$Now using $$e^{-i\chi\Delta t a^\dagger a b^\dagger} |0_b\rangle = \sum_{n=0}^{\infty} \dfrac{(-i\chi\Delta t a^\dagger a)^n}{n!} (b^\dagger)^n |0_b\rangle = \sum_{n=0}^{\infty} \dfrac{(-i\chi\Delta t a^\dagger a)^n}{\sqrt{n!}} |n_b\rangle$$ and $$\langle 0_b| e^{-i\chi\Delta t a^\dagger a b} = +\sum_{n=0}^{\infty} \langle 0_b| b^n \dfrac{(-i\chi\Delta t a^\dagger a)^n}{n!} = +\sum_{n=0}^{\infty} \langle n_b| \dfrac{(-i\chi\Delta t a^\dagger a)^n}{\sqrt{n!}} $$ we are able to get $$E_0 = \sum_{n=0}^{\infty} \dfrac{(-i\chi\Delta t a^\dagger a)^{2n}}{n!} e^{(\chi\Delta t a^\dagger a)^2/2} = e^{-(\chi\Delta t a^\dagger a)^2/2}$$ Following the same line, using $$\langle 1_b| e^{-i\chi\Delta t a^\dagger a b} = +\sum_{n=0}^{\infty} \langle 1_b| b^n \dfrac{(-i\chi\Delta t a^\dagger a)^n}{n!} = +\sum_{n=1}^{\infty} \langle n_b| \dfrac{(-i\chi\Delta t a^\dagger a)^{n-1}}{\sqrt{n!}} n$$ we are to obtain $$E_1 = \sum_{n=0}^{\infty} \dfrac{(-i\chi\Delta t a^\dagger a)^{2n+1}}{n!} e^{(\chi\Delta t a^\dagger a)^2/2} = (-i\chi\Delta t a^\dagger a) e^{-(\chi\Delta t a^\dagger a)^2/2}$$

+

Therefore, my answer will be $E_{0}=\left[\begin{array}{cc}{1} & {0} \\ {0} & {e^{-(\chi\Delta t)^2/2}}\end{array}\right]$ and $E_{1}=\left[\begin{array}{cc}{0} & {0} \\ {0} & {-i\chi\Delta t e^{-(\chi\Delta t)^2/2}}\end{array}\right]$. What is the problem?

+",8131,,22825,,12/19/2022 22:26,12/19/2022 22:26,Derive phase damping quantum operation,,2,0,,,,CC BY-SA 4.0 +6879,1,,,7/27/2019 14:52,,4,132,"

Let $H$ be a hidden subgroup of $G_1$ that is indistinguishable from subgroup $H^{\prime}$ by quantum Fourier sampling. Now take a larger group $G_2$ such that it contains $G_1$. Now if I do quantum Fourier sampling over $G_2$ instead of $G_1$ are they still indistinguishable?

+",8132,,7528,,7/28/2019 22:37,7/28/2019 22:37,Hidden subgroup problem,,0,5,,,,CC BY-SA 4.0 +6880,1,,,7/27/2019 22:11,,7,149,"

I would like to understand this image, of a ""payload preparation"" gate. A single H gate will create a superposition, while the phase will rotate 45 degrees. What does the second H gate do in this commonly used subcircuit?

+ +

+",8133,,,,,7/28/2019 7:59,How to understand a phase operation between 2 Hadamard gates?,,1,0,,,,CC BY-SA 4.0 +6881,2,,6880,7/28/2019 7:59,,2,,"

""Payload preperation gate"" is just a fancy name for preparing the message with a more clear setting with the probability of 85.4% ∣0⟩ and 14.6% ∣1⟩ in this case. The chance of being a zero is less than that of one. A standard example of teleportation gives a 50% chance, in that case it is not a clear 0 or 1. +The second H gate changes the relative phase of Alice between the 0 and 1 bit. Without the H gate it is 45 and with H gate it is 90 degrees. It does not really matter what sort of message you will give, it depends on what you want to show. +Quantum teleporation with a payload

+",1773,,,,,7/28/2019 7:59,,,,0,,,,CC BY-SA 4.0 +6882,1,6885,,7/28/2019 15:12,,6,1522,"

I read in this article (Apendix III p.8) that for $A\in \mathcal{M}_2$, since the normalized Pauli matrices $\{I,X,Y,Z\}/\sqrt{2}$ form an orthogonal matrix basis. +$$A=\frac{Tr(AI)I+Tr(AX)X+Tr(AY)Y+Tr(AZ)Z}{2} $$

+ +

I don't understand, where does the Trace coefficient come from ?

+",7762,,55,,11/24/2020 18:58,7/26/2021 18:08,How are arbitrary $2\times 2$ matrices decomposed in the Pauli basis?,,1,3,,,,CC BY-SA 4.0 +6884,1,6886,,7/28/2019 19:39,,1,359,"

The Knill-Laflamme condition for a stabilizer $\mathcal{M}$ is

+ +
+

An error with Kraus operators $\{E_k\}$ is correctable if either $$E^\dagger_kE_l\in\mathcal{M}\quad\forall\, k,l $$ or there exists $M\in\mathcal{M}$ such that $$\{M,E_k^\dagger E_k\}=0\quad\forall \,k $$

+
+ +

But consider a unitary error $U$, then $U^\dagger U=I\in \mathcal{M}$. Does this mean that all unitary errors are always correctable by any stabilizer? It shouldn't, because for example Shor's code doesn't correct double bit flips. What am I missing?

+",5125,,5125,,7/28/2019 20:25,7/28/2019 20:30,All unitary errors are correctable,,1,5,,,,CC BY-SA 4.0 +6885,2,,6882,7/28/2019 20:12,,10,,"

The Pauli matrices form an orthogonal basis of $\mathcal{M}_2$, this vector space can be endowed with a scalar product called the Hilbert-Schmidt inner product

+

$$ \langle A,B\rangle=\mathrm{Tr}(A^\dagger B)$$ +since the Pauli matrices anticommute, their product is traceless, and since they are Hermitian this implies that they are orthogonal with respect to that scalar product, hence the decomposition noticing they have norm $2$ since their square is the identity.

+

More explicitly, if $$A=\alpha X +\beta Y +\gamma Z+ \delta I $$

+

then

+

$$\mathrm{Tr}(AX)=\alpha \mathrm{Tr}(X^2)+\beta\mathrm{Tr}(XY)+\gamma\mathrm{Tr}(XZ)+\delta\mathrm{Tr}(X)=2\alpha $$

+

and same for all the others

+",5125,,2293,,7/26/2021 18:08,7/26/2021 18:08,,,,0,,,,CC BY-SA 4.0 +6886,2,,6884,7/28/2019 20:30,,4,,"

If you only have one $E_k$ (i.e., $k=1$ can only take one value), and this $E_k=U$ is unitary, then - as you point out in the comments - the first condition is always satisfied, and the error can be corrected.

+ +

However, this also means that your ""error"" is the deterministic application of $U$. So after applying the ""error"" map, you just have to undo $U$, because you know which error has been applied.

+ +
+ +

On the other hand, if you have several unitary errors $U_k$ which occur with probability $p_k$, the channel would be something like $\rho\mapsto p_k U_k\rho U_k^\dagger + q\rho$, where $q$ is the probability that no error occurs. Thus, we have $E_k=\sqrt{p_k}U_k$, and additionally $E_0=\sqrt{q}I$. So if there are several unitary errors which can occur (or even just one error or no error), there is more than one $E_k$, and the first condition need not be satisfied for all pairs $E_k$, $E_l$.

+",491,,,,,7/28/2019 20:30,,,,3,,,,CC BY-SA 4.0 +6887,1,6894,,7/28/2019 23:21,,5,583,"

I'm currently trying to specify an initial_layout for a circuit on a IBM Q device.

+ +

+ +

Looking at the device's topology I would like to use the less noisy qubits in order to have the best performance.

+ +

Thus, I looked at how the circuit is transformed to fit the device topology by drawing the circuit returned by transpile :

+ +

It seems that the compiler is using q0,q1 and q2 to run the circuit. So my first question is : How does the compiler chose which virtual qubits are mapped to which qubits ? I heard that it try to minimize the depth and the number of cnot used by choosing the most connected qubits in the graph but I've never found any info about that in the qiskit documentation. I then tried to specify a initial_layout to use q10,q9 and q8 to see if it improves performance:

+ +

However the drawing still show q0,q1 and q2 being used. What am I missing ?

+",8115,,,,,7/29/2019 14:08,Chose how to map virtual qubits to physical qubits,,1,0,,,,CC BY-SA 4.0 +6888,1,6902,,7/29/2019 0:24,,3,267,"

I am continuing my studies of the HHL algorithm here. In applying the controlled rotation conditioned on the eigenvalues of the matrix, the authors use so called filter functions in order to filter out the portion of $|b \rangle$ that is in the ill-conditioned subspace of subspace of $A$, which the authors define as the eigenvalues $\lambda_j\geq \frac{1}{\kappa}$ where $\kappa$ is the condition number of the matrix defined to be the ratio $\lambda_{max} / \lambda_{min}$.

+ +

Consider a controlled rotation, say controlled on state $|a \rangle |0 \rangle $ with angle $\theta$ where $a \in \{0,1\} $ where $R_{\theta} |a \rangle |0 \rangle = |a \rangle (cos(\theta) |0 \rangle + sin (\theta) |1 \rangle$) if $a=1$, and which does nothing otherwise. In this case we have that the 1-bit ancilla register is what is being ""rotated"".

+ +

But in the HHL algorithm, we are left with a register S of the form +$|h(\tilde{\lambda_j}) \rangle : = \sqrt{1-f(\tilde{\lambda_k})^2 - g(\tilde{\lambda_k})^2} |$ nothing $\rangle + f(\tilde{\lambda_k})|$well$\rangle$ + $g(\tilde{\lambda_k})|$ill$\rangle$, where

+ +

""nothing"" corresponds to no inversion taking place

+ +

""well"" correspondins to a successful inversion

+ +

""ill"" indicates that part of $|b \rangle$ is in the ill-conditioned subspace of $A$. The discussion section describes that formally we are transforming $|b \rangle$ to the state $\sum_{j, \lambda_j < 1 / \kappa} \lambda_j^{-1}\beta_j |u_j \rangle | well \rangle + \sum_{j, \lambda_j \geq 1 / \kappa} \beta_j |u_j \rangle | ill \rangle$

+ +

The authors describe the register $S$ as being of dimension $3$. I'm not sure why the dimension is $3$ and not $1$ as in my above description of a controlled rotation.

+",7481,,,,,7/31/2019 8:54,Understanding the filter functions in the HHL algorithm,,1,0,,,,CC BY-SA 4.0 +6889,1,6891,,7/29/2019 1:34,,0,249,"

One well-known fidelity is defined as $(Tr\sqrt{\sqrt{\rho}\sigma\sqrt{\rho}})^2$. And for pure states, fidelity is always in the form $|\langle\psi|\phi\rangle|^2$. +As we know, in the context of two-qubit quantum computation, we cannot tell the difference between $|\psi\rangle$ and $e^{ia}|\psi\rangle$($a$ is real and perhaps $|\psi\rangle$ need to be a pure state). And the definitions of fidelity above are all modes of some complex values. So does that means the phase factor of quantum states is negligible in calculating the fidelity?

+ +

And could we generalize it to quantum operation and say that $U$, a unitary, cannot be distinguished from $e^{ia}U$?

+",4178,,,,,6/8/2020 14:30,Is phase factor negligible in fidelity of quantum states?,,1,2,,,,CC BY-SA 4.0 +6890,1,6893,,7/29/2019 9:35,,3,223,"

I am reading the very basics about CSS codes in the Nielsen & Chuang.

+ +

On page 450 of this book is explained how the ancillas are used to detect a bit-flip error on the encoded data.

+ +

We consider $C_2 \subset C_1$ two classical linear error correcting codes, and we focus on $CSS(C_1,C_2)$.

+ +

We consider the state:

+ +

$$ |x+C_2 \rangle = \frac{1}{\sqrt{|C_2|}} \sum_{y \in C_2} |x+y\rangle$$

+ +

We assume this state has received bit-flip and phase errors described by $e_1$ and $e_2$ respectively. Thus it becomes:

+ +

$$ |\psi\rangle = \frac{1}{\sqrt{|C_2|}} \sum_{y \in C_2} (-1)^{(x+y).e_2}|x+y+e_1\rangle $$

+ +

Now, the book says:

+ +
+

To detect where bit flips occurred it is convenient to introduce an + ancilla containing sufficient qubits to store the syndrome for the + code C1, and initially in the all zero state $|0\rangle$.We use reversible + computation to apply the parity matrix H1 for the code C1,taking + $|x+y+e_1\rangle |0\rangle$ to $|x+y+e_1\rangle |H_1(x+y+e_1)\rangle=|x + y + e \rangle |H_1e_1 \rangle$

+
+ +

My question is simply: How do we do the transformation $|0\rangle \rightarrow |H_1(x+y+e_1)\rangle$ for the ancilla ? For me it would require to know $|H_1(x+y+e_1)\rangle$ and then find the appropriate unitary to make the transformation $|0\rangle \rightarrow |H_1(x+y+e_1)\rangle$. But we are not supposed to know the state that is encoded and if we measure it we may destroy it.

+ +

So how can we know which transformation to apply to make: $|0\rangle \rightarrow |H_1(x+y+e_1)\rangle$ ? I don't understand the argument of reversible computation.

+ +

[edit] : I actually just thought about using CNOT between the qubits and the ancillas to first to $|x+y+e_1\rangle |0\rangle \rightarrow |x+y+e_1\rangle |x+y+e_1\rangle$. But then we need to apply $H_1$ on the ancillas. But it is not a unitary operation so how can we do it on a quantum circuit ?

+",5008,,,,,7/31/2019 9:01,Basics on CSS codes: manipulation of the ancillas to detect error,,1,0,0,,,CC BY-SA 4.0 +6891,2,,6889,7/29/2019 9:57,,2,,"

You are correct in both assumptions.

+ +

A total phase on a qubit state $|{\psi}\rangle$ is often referred to as the global phase. Any measurement of a quantum state is the expectation value $\lambda_{M}$ of some (Hermitian) observable $M$: $\lambda_{M} = |\langle\psi|M|\psi\rangle|^{2}$. Because this is invariant to the global phase, there is no physical meaning to adding said global phase $e^{i\alpha}$ to the state $|\psi\rangle$, and therefore it is often omitted.

+ +

This also means, as you correctly observed, that such a phase can be omitted from a Unitary $e^{i\alpha}U$ as well. Even more, we often restrict ourselves to only use elements from $SU(2)$; the group of unitary $2\times2$ matrices with $\det(U) = 1$; this is essentially the same as choosing a particular phase $\alpha_{1}$ for the unitary (although not necessarily $\alpha_{1} = 0$!).

+",8141,,8141,,6/8/2020 14:30,6/8/2020 14:30,,,,0,,,,CC BY-SA 4.0 +6892,1,,,7/29/2019 12:53,,2,105,"

I have a classical vector of size $2^{n}$ (normalized) and I want to use this value as amplitude for my $n$ qbits, in the canonical basis $|00000\rangle$, $|00001\rangle$ etc. +I want to use real feasible gates ($RX$, $RY$ $RZ$, $H$, Pauli gates, $CNOT$, $CRX$ etc) starting from the $|0000\rangle$ state.

+ +

Is there a general algorithm for that?

+ +

More Precisely, I'm interested in the length of such circuit and the numbers of gates (in worst case) according to $n$.

+ +

Do you have any idea or reference on the subject? I'm a bit lost here...

+ +

best regards,

+ +

b

+",8142,,434,,7/29/2019 13:48,9/1/2020 20:06,quantum circuit with feasible gates for state preparation,,1,0,,,,CC BY-SA 4.0 +6893,2,,6890,7/29/2019 14:01,,1,,"

Let's express this slightly differently. You need a unitary operation that implements +$$ +|x\rangle|0\rangle\mapsto |x\rangle|H_1x\rangle. +$$ +I'm not saying this is necessarily the best way of doing it (there will be far more insightful strategies), but you could certainly write this out for all possible values of $x$. As such, you'd be able to write out the matrix operation corresponding to the unitary. The point is that this must work for every input $x$, not only for the $x+y+e_1$ that is relevant to you at a specific moment.

+ +

If you now want a more reasonable strategy to approach this calculation, just think about calculating a single bit of the ancilla, corresponding to a single row of the parity check matrix. What calculation is it you're actually performing? What does a 1 in the parity check matrix tell you? (bitwise addition of all the bits in $x$ where the corresponding bit value in the row is 1). Controlled-not is great at performing bitwise addition between the two inputs, writing the output on the target qubit.

+ +

Let's imagine the first row of the parity check matrix is $(1,0,1,1)$. There are 4 bit values, so we have $x=(x_1,x_2,x_3,x_4)$. Hence the inner product between the two just gives $x_1\oplus x_3\oplus x_4$. How do we compute this value with a quantum circuit?

+",1837,,1837,,7/31/2019 9:01,7/31/2019 9:01,,,,1,,,,CC BY-SA 4.0 +6894,2,,6887,7/29/2019 14:08,,2,,"

transpile has a parameter called optimization_level, which can be set to either 0, 1, 2, or 3. Depending on what optimization_level is set to, the transpiler will apply a list of passes which alter or analyze the circuit in some way. By default, the optimization_level is set to 1. You can view all of the passes that are applied to a circuit depending on that level here.

+ +

As for the initial_layout, I would try setting the layout to include the entire list of qubits in the device, and not just the ones that you will be changing. I believe this should make the circuit use the qubits you want.

+",6180,,,,,7/29/2019 14:08,,,,0,,,,CC BY-SA 4.0 +6895,1,6896,,7/29/2019 16:09,,3,101,"

I'm looking at the following lecture notes where we start with the circuit below for some state $\vert\psi\rangle_L$ that picks up an error to become $E\vert\psi\rangle_L$

+ +

+ +

It is later claimed in the notes that the syndrome extraction part of the circuit can be represented by the following operation on $E\vert\psi\rangle_L$.

+ +

$$E|\psi\rangle_{L}|0\rangle_{A} \rightarrow \frac{1}{2}\left(I_{1} I_{2}+Z_{1} Z_{2}\right) E|\psi\rangle_{L}|0\rangle_{A}+\frac{1}{2}\left(I_{1}I_{2}-Z_{1} Z_{2}\right) E|\psi\rangle_{L}|1\rangle_{A}$$

+ +

How does one see this? I can write the Hadamard and the control $Z_1Z_2$ gates as 8x8 matrices but this seems like a tedious way to do it. The alternative is to express the control $Z_1Z_2$ gates using something like this answer. However, I was unable to do it this way either.

+ +

So the question is - how do I see that the following line is true just by looking at the circuit?

+ +

$$E|\psi\rangle_{L}|0\rangle_{A} \rightarrow \frac{1}{2}\left(I_{1} I_{2}+Z_{1} Z_{2}\right) E|\psi\rangle_{L}|0\rangle_{A}+\frac{1}{2}\left(I_{1}I_{2}-Z_{1} Z_{2}\right) E|\psi\rangle_{L}|1\rangle_{A}$$

+",4831,,,,,7/29/2019 18:53,Going from a circuit to the quantum state output of the circuit,,1,0,,,,CC BY-SA 4.0 +6896,2,,6895,7/29/2019 18:53,,5,,"

Let's represent controlled $Z_1Z_2$ gate in the projector formalism, as described in this answer:

+ +

$$C_AZ_1Z_2 = |0\rangle\langle0|_A I_1I_2 + |1\rangle\langle1|_A Z_1Z_2 $$

+ +

This just tells you to apply identity gates to qubits 1 and 2 if the ancilla is in the $|0\rangle$ state and to apply Z gates to qubits 1 and 2 if the ancilla is in the $|1\rangle$ state - which is the definition of the controlled gate.

+ +

Now let's apply this to the state $\color{blue}{|+\rangle}_{A}E|\psi\rangle_{L}$ (this is the state of the system after the first Hadamard gate of syndrome extraction):

+ +

$$C_AZ_1Z_2 \big( \color{blue}{|+\rangle}_{A}E|\psi\rangle_{L} \big) = \big( \color{blue}{|0\rangle\langle0|}_A I_1I_2 + \color{blue}{|1\rangle\langle1|}_A Z_1Z_2 \big) \bigg( \frac{1}{\sqrt2}\color{blue}{(|0\rangle + |1\rangle)}_AE|\psi\rangle_{L} \bigg) = $$

+ +

$$= \frac{1}{\sqrt2} \big( \color{blue}{|0\rangle}_A \otimes I_1I_2 E|\psi\rangle_{L} + \color{blue}{|1\rangle}_A \otimes Z_1Z_2 E|\psi\rangle_{L} \big)$$

+ +

Finally, apply the last Hadamard gate to the ancilla; after that the state of the system becomes

+ +

$$\frac{1}{\sqrt2} \big( \color{blue}{|+\rangle}_A \otimes I_1I_2 E|\psi\rangle_{L} + \color{blue}{|-\rangle}_A \otimes Z_1Z_2 E|\psi\rangle_{L} \big) = $$

+ +

$$= \frac{1}{2} \big( \color{blue}{(|0\rangle + |1\rangle)}_A \otimes I_1I_2 E|\psi\rangle_{L} + \color{blue}{(|0\rangle - |1\rangle)}_A \otimes Z_1Z_2 E|\psi\rangle_{L} \big) = $$

+ +

(after reordering the terms and grouping same ancilla states together)

+ +

$$= \frac{1}{2} \color{blue}{|0\rangle}_{A} \otimes \left(I_{1} I_{2}+Z_{1} Z_{2}\right) E|\psi\rangle_{L} + \frac{1}{2} \color{blue}{|1\rangle}_{A} \otimes \left(I_{1}I_{2}-Z_{1} Z_{2}\right) E|\psi\rangle_{L}$$

+ +

which is exactly the state you need to get.

+",2879,,,,,7/29/2019 18:53,,,,0,,,,CC BY-SA 4.0 +6897,1,,,7/29/2019 20:42,,3,47,"

I have been examining problems where gate timing is important. When implementing an identity gate, the issue of timing has resulted in a few verification experiments to compare the gate time to that of a u3(0,0,0) gate. According to the source code, the identity gate should be equivalent to a u3(0,0,0) gate; however, when comparing a series of identity operations via a Ramsey experiment to a series of u3(0,0,0) operations, they do not match up. It appears that the identity gate is approximately half the time of the u3 gate. While I have been able to verify the timing through experiments, my concern is that there seems to be a discrepancy between my experiments and the documentation. Can someone please verify my findings?

+",8146,,,,,7/29/2019 20:42,Identity Gate Timing Discrepancy,,0,2,,,,CC BY-SA 4.0 +6898,1,6899,,7/30/2019 14:35,,5,853,"

Suppose we have a stabilizer group $\mathcal{M}$, the Knill-Laflamme condition for error correction states

+ +
+

An error with Kraus operators $\{E_k\}$ is correctable if either $$E^\dagger_kE_l\in\mathcal{M}\quad\forall\, k,l $$ or there exists $M\in\mathcal{M}$ such that $$\{M,E_k^\dagger E_l\}=0\quad\forall \,k,l $$

+
+ +

I really don't understand how either of these conditions being true helps us correct errors. Every source I can find then goes on and talks about if an error $E$ occurs that anticommutes with some $M$, then

+ +

$$ME|\psi\rangle=-E|\psi\rangle $$

+ +

so we measure $-1$ for $M$ and hence we can correct $E$. But I fail to see how this is what the condition is talking about, $E$ here seems to be some unitary and $M$ anticommutes with it, while the condition talks about Kraus operators and $M$ anticommuting with products of them, if the error of the condition occurs I expect a transformation like

+ +

$$\rho=|\psi\rangle\langle \psi|\rightarrow\rho'=\sum_k E_k|\psi\rangle\langle\psi|E_k^\dagger $$

+ +

Which in general cannot be expressed as $E|\psi\rangle$ for some unitary $E$. Moreover, in this case I cannot see how $M$ anticommuting with $E_k^\dagger E_k$ helps us correcting the error, or for that matter how $E_k^\dagger E_l$ being in $\mathcal{M}$ helps.

+ +

How can I see how the conditions allow us to detect and correct errors?

+",5125,,5125,,7/30/2019 17:38,7/28/2020 11:18,Knill-Laflamme condition and requirements for error correction,,1,1,,,,CC BY-SA 4.0 +6899,2,,6898,7/30/2019 15:16,,3,,"

I believe that this is actually two separate questions; I'll try to explain the issue concerning errors as channels with multiple Kraus operators instead of unitaries first:

+

You are correct in saying that errors, in general, are not unitary operations. Rather, they are quantum channels that most often have more than 1 Kraus operators. Consider, for instance, the dephasing channel, which has Kraus operators:

+

\begin{equation} +A_{1} = (\sqrt{1-p}I, A_{2} = \sqrt{p}Z, +\end{equation} +i.e. some channel that does nothing with probability $1-p$ and applies a $Z$ operation that is applied with probability $p$.

+

If we start with some pure state $|\psi\rangle\langle\psi|$, after this channel we will have some statistical mixture $\rho$ of $I|\psi\rangle\langle\psi|I$ and $Z|\psi\rangle\langle\psi|Z^{\dagger}$. How can we ever happen to correct this?

+

The trick is, that we measure (for instance, by stabilizer measurement) if an error has happened. Lets say that we have entangled the qubit with another qubit (the ancilla) in such a way that the ancilla is in the $|1\rangle$ state when a $Z$ error/unitary has happened, whereas it is in the $|1\rangle$ state when nothing (i.e. $I$) has happened. What does our state look like, before measurement?. Well:

+

\begin{equation} +\rho_{total} = (1-p)I|\psi\rangle\langle\psi|I \otimes |0\rangle_{anc} + pZ|\psi\rangle\langle\psi|Z^{\dagger} \otimes |1\rangle_{anc}. +\end{equation}

+

Now comes the trick: we only measure the ancilla. Upon this measurement, our (data) qubit state collapses to either $I|\psi\rangle$ or $Z|\psi\rangle$. By measuring the (possible) error, we have forced it to discretise itself into a unitary error! If our code is actually well designed, we can now infer from only the ancilla measurements (called the error syndrome) if, and what kind of error there happed.

+

Now, on to the first part: we can always write any set of Kraus operators as a linear combination of unitaries; for simplicity we always use the Paulis. If our code can correct these Paulis, it can also correct any linear combination of these Paulis (because measuring if anything happened discretises the error into these Paulis. So we don't need to keep track of all possible (literally uncountably many) different Kraus operations, but only a (relatively) small discrete set of Paulis (or other unitaries if you want to)!

+

Can we then correct all errors? No, unfortunately not. We can never, with one stabilizer code, correct for all different Paulis, but only a subset $\mathcal{E}$, called the set of correctable errors. So if (at least) one of our Kraus operators can't be written as a linear combination of only elements of $\mathcal{E}$, we can't correct for that Kraus operator.

+

The conditions you use for QECC's are a bit finicky I believe; the first one is (somewhat) like the actual Knill-LaFlamme conditions, the other one only applies to the (subclass) of stabilizer codes (although most people only consider these types of codes). Also, I don't think it matters very much concerning your confusion.

+",8141,,8141,,7/28/2020 11:18,7/28/2020 11:18,,,,7,,,,CC BY-SA 4.0 +6900,1,6901,,7/30/2019 22:54,,12,2269,"

Of course I am not implying that I am right and the no cloning theorem is wrong, but I am trying to figure out what is wrong with my reasoning and yet I couldn't find the mistake.

+ +

Based on Wikipedia

+ +
+

In physics, the no-cloning theorem states that it is impossible to create an identical copy of an arbitrary unknown quantum state.

+
+ +

So we start with a standard qubit $|\psi\rangle$ with completely unknown state where:

+ +

$$|\psi \rangle = \alpha |0\rangle + \beta|1\rangle$$

+ +

That qubit has probability $\alpha^2$ of being $0$ and probability $\beta^2$ of being 1 and if I understand the theory correctly it will not be possible to duplicate this qubit without knowing both $\alpha$ and $\beta$.

+ +

Now, if we plug this qubit along with a $|0\rangle$ into a $CNOT$ it seems to me that we end up with 2 identical qubits, each of them has probability $\alpha^2$ of being $0$ and probability $\beta^2$ of being 1.

+ +

Here is the math:

+ +

$$ +CNOT |\psi, 0\rangle = \\ +CNOT [(\alpha |0\rangle + \beta|1\rangle)\otimes |0\rangle] = \\ +\begin{bmatrix}1&&0&&0&&0\\0&&1&&0&&0\\0&&0&&0&&1\\0&&0&&1&&0\end{bmatrix} \begin{pmatrix}\alpha\\\beta\end{pmatrix}\otimes \begin{pmatrix}1\\0\end{pmatrix} =\\ +\begin{bmatrix}1&&0&&0&&0\\0&&1&&0&&0\\0&&0&&0&&1\\0&&0&&1&&0\end{bmatrix} \begin{pmatrix}\alpha\\0\\\beta\\0\end{pmatrix} =\\ +\begin{pmatrix}\alpha\\0\\0\\\beta\end{pmatrix} = \alpha \begin{pmatrix}1\\0\\0\\0\end{pmatrix}+\beta \begin{pmatrix}0\\0\\0\\1\end{pmatrix}=\\ +\alpha |00\rangle + \beta |11\rangle +$$ +So the result becomes 2 exactly identical qubits, both have identical probabilities of being zero and identical probabilities of being one.

+ +

Since I am sure that the no-cloning theorem can't be wrong, I am asking what is wrong with my reasoning.

+",8157,,8157,,7/31/2019 17:12,12/31/2019 21:10,Why isn't there a contradiction between the existence of CNOT gate/entanglement and the no-cloning theorem?,,1,1,,,,CC BY-SA 4.0 +6901,2,,6900,7/30/2019 23:36,,16,,"

The cloning theorem requires that the result of the cloning is two independent copies of the starting qubit, i.e., the state of the system in the end should be $\big(\alpha |0\rangle + \beta |1\rangle \big) \otimes \big(\alpha |0\rangle + \beta |1\rangle \big)$. This is not the state CNOT will give you.

+ +

The qubits you get after applying CNOT as you described do not, in fact, gave identical probabilities of measuring 0 and 1: as soon as you measure the first qubit, the measurement result of the second qubits will always the measurement result of the first qubit! If you were able to actually clone the qubit, the measurement results of the second qubit would not depend on the results of measuring the first one.

+ +

(You can also browse other questions about no-cloing theorem to find different explanations.)

+",2879,,,,,7/30/2019 23:36,,,,0,,,,CC BY-SA 4.0 +6902,2,,6888,7/31/2019 8:54,,2,,"

Note that the ancilla qubit in your example has dimension 2, not 1, because it goes into a superposition of 2 basis states, $|0\rangle$ and $|1\rangle$.

+ +

For the HHL algorithm, you need an ancilla capable of recording the three options ""nothing"", ""well"" and ""ill"". As such, you need a Hilbert space of dimension 3 (also called a qutrit).

+ +

Now, it is true that in the equation you've written, it appears as if they're only using a two-dimension system spanned by ""well"" and ""ill"", but that's just because you're only taking a snapshot of the process at a particular moment (presumably when you've post-selected on that ancilla not being in the ""nothing"" state, since that's part of the repeat until success procedure).

+",1837,,,,,7/31/2019 8:54,,,,4,,,,CC BY-SA 4.0 +6903,1,6904,,7/31/2019 8:59,,12,3107,"

The Gottesman-Knill theore states (from Nielsen and Chuang)

+ +
+

Suppose a quantum computation is performed which involves only the following elements: state preparations in the computational basis, Hadamard gates, phase gates, controlled-NOT gates, Pauli gates, and measurements of observables in the Pauli group (which includes measurement in the computational basis as a special case), together with the possibility of classical control conditioned on the outcome of such measurements. Such a computation may be efficiently simulated on a classical computer.

+
+ +

How does this not render quantum computation largely useless? I understand that the Toffoli gate cannot be generated by the Clifford gates, but nonetheless there are important algorithms that do not use the Toffoli gate, for instance Shor's algorithm, Grover's algorithm, quantum teleportation and I'm sure many more. It seems to me that due to this theorem, we should be able to factor numbers in polynomial time using a classical computer, by simulating Shor's algorithm, or order finding specifically, yet Shor's algorithm is celebrated as one of the most important quantum advantages, so I guess this is not possible, but why?

+",5125,,2927,,2/1/2020 0:29,2/1/2020 0:29,Why doesn't the Gottesman-Knill theorem render quantum computing almost useless?,,2,1,,,,CC BY-SA 4.0 +6904,2,,6903,7/31/2019 9:30,,14,,"

To my mind, this theorem is not very well stated in this form, if taken out of context. Where it says ""phase gates"", this may be misleading. It means specifically just $S=\sqrt{Z}$ and not what I think of as a phase gate, which can have an arbitrary phase (but they have very specifically introduced their terminology about 3 pages earlier). This is a key difference as it means that the Toffoli gate that is not the only one missing from this gate set. Most single-qubit gates are also missing. The most commonly cited example is the $T=\sqrt{S}$ gate, +$$ +T=\left(\begin{array}{cc} 1 & 0 \\ 0 & e^{i\pi/4} \end{array}\right). +$$ +Any efficient quantum algorithm (which doesn't have an efficient classical counterpart), such as Shor's algorithm, include a gate that is not in this set of gates. For example, Shor's algorithm includes the quantum Fourier transform (in that specific context, you'd probably use the semi-classical version) for which you have to implement phase gates with phases $\pi/4$, $\pi/8$, $\pi/16$... whose implementation cannot be efficiently simulated. (In the standard, not semi-classical, version, you need controlled-phase-gates with identical phases).

+ +

However, a comment about a couple of your other examples is warranted:

+ +
    +
  • quantum teleportation: this is a specific method that achieves a particular quantum task using, and providing, specific resources (bell pair+2 bits of classical communication=transmission of one unknown qubit state). You might be able to simulate it on a classical computer (if you had a good description of the input state), but the resources would be different. This is not a question about scaling properties of an algorithm, so the basic argument of the Gottesman-Knill theorem is irrelevant.

  • +
  • Quantum search. Quantum search generally does include Toffoli gates. However, the point that I wanted to make here is that quantum search does not exhibit an exponential speed-up, but only a polynomial speed-up. So there's no problem doing a classical simulation of it with polynomial overhead. The Gottesman-Knill theorem is only relevant to rule out the possibility of an exponential (or, at least, super-polynomial) speedup over the classical case.

  • +
+",1837,,,,,7/31/2019 9:30,,,,3,,,,CC BY-SA 4.0 +6906,1,6908,,7/31/2019 15:59,,2,323,"

I am reading some quantum papers (In particular, this one page 34) . One of the theorem statement reads,

+ +
 ""For every CPTP operator M, we have that .... "" 
+
+ +

I know that we usually apply unitary operations on quantum states. Is completely positive trace preserving (CPTP) operator same as unitary operator? What's the difference between them? What's the advantage of proving theorems for CPTP operators rather than unitary operators?

+",8014,,8014,,7/31/2019 16:42,7/31/2019 18:36,Are CPTP operators and unitary operators the same thing?,,1,0,,,,CC BY-SA 4.0 +6907,1,6909,,7/31/2019 18:21,,6,400,"

I have several (rather basic) questions on matrix representation of circuits and I would be very grateful to anyone that could clear up my confusion, thank you in advance.

+ +

1) When reading circuit diagrams I know that the input qubit goes in the left hand side. So If we are reading a circuit and it's gates go in the order a,b,c does that mean when we want to write out its matrix representation we multiply the matrices in the order c,a,b . For example if we have a circuit which consists of a swap gate followed by a Hadamard gate on the second qubit , followed by a Hadamard gate on the first qubit , then to calculate it's matrix representation we would have to calculate it in the order $(H_1\otimes I)(I\otimes H_2)Swap$, correct ? (as this reflects the order of application of gates on the qubit state).

+ +

2)If we are given a gate $S=\begin{pmatrix}1 &0 \\0 &i \end{pmatrix}$, but it is on the top line of a two line circuit with a line connecting it to the second (In other words it's a control gate ), I know that the first qubit is the control and the second is the target but I'm unsure of how to write it , should it be $S=\begin{pmatrix}1 & 0 &0&0 \\ 0 &-i &0&0\\0&0&1&0\\0&0&0&-i \end{pmatrix}$,

+ +

or should it be

+ +

$ S=\begin{pmatrix}1 & 0 &0&0 \\ 0 &1 &0&0\\0&0&-i&0\\0&0&0&-i \end{pmatrix}$,

+",6254,,,,,7/31/2019 20:45,A basic question on circuits and matrix representation,,1,0,,,,CC BY-SA 4.0 +6908,2,,6906,7/31/2019 18:36,,4,,"

Unitary operations are a subset of CPTP operations. You can think of a CPTP operation as the description of a unitary over a larger system.

+ +

The advantage of using CPTP maps is that you increase the generality of your statement. Think about, for example, a proof of the no-cloning theorem. People usually start talking about the input state, the target state, and an ancilla, so you want to achieve some rotation +$$ +|0\rangle|0\rangle|0\rangle\mapsto |0\rangle|0\rangle|a\rangle,\qquad|1\rangle|0\rangle|0\rangle\mapsto |1\rangle|1\rangle|b\rangle +$$ +where the third system is any dimension. We then assume that the process is unitary over that whole space. This is equivalent to allowing a CPTP map on the first two systems. Why don't we just completely ignore the third system and only assume a unitary on the first two? Well, what use would our no-cloning theorem be if it turned out that by adding some extra ancillas, our proof was completely invalidated and that cloning were possible? You want to perform your proof using the full generality of what's available, which means not making any assumptions about availability of ancillas, for example.

+",1837,,,,,7/31/2019 18:36,,,,4,,,,CC BY-SA 4.0 +6909,2,,6907,7/31/2019 20:45,,6,,"
    +
  1. Yes, in the circuit the qubit ""enters"" to the left, and exits to the right, but when applying the gates to a state you must apply the one on the far left first, then the next and so on, so concretely you do write them down right to left, but it's just a consequence of writing the operator that we want to apply on the left of the vector, while our natural way of writing dictates a ""time direction"" left to right. As an example the following circuit
  2. +
+ +

+ +

implements the operation

+ +

$$(I\otimes \mathrm{CNOT})(\mathrm{CNOT}\otimes I)(H\otimes I\otimes I)|000\rangle $$

+ +
    +
  1. A controlled gate does nothing if the first qubit is $0$ and performs the gate if it is $1$, you can represent it this way
  2. +
+ +

$$\mathrm{CS}=|0\rangle\langle0|\otimes I + |1\rangle\langle1|\otimes S $$ + Hence in matrix form it would be

+ +

$$\mathrm{CS}=\begin{pmatrix} +I&0\\0&S +\end{pmatrix} =\begin{pmatrix} +1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&i +\end{pmatrix}$$

+",5125,,,,,7/31/2019 20:45,,,,1,,,,CC BY-SA 4.0 +6910,1,6920,,7/31/2019 22:29,,2,423,"

Choi's theorem states that any completely positive map $\Phi(\cdot) : C^*_{n\times n} \rightarrow C^*_{m \times m}$ can be expressed as $\Phi(\rho) = \sum_{j=1}^r F_j^\dagger \rho F_j$, for some $n \times m$ matrices $F_j$. +In order for the map to be trace preserving one needs to have $\sum_j F_j F_j^\dagger = I_n$.

+ +

How is this trace preserving condition derived? I couldn't see it.

+",8014,,55,,5/26/2022 12:12,5/26/2022 14:35,Why for $\Phi(\rho)=\sum_j F_j^\dagger\rho F_j$ to be trace preserving we need the condition $\sum_j F_j F_j^\dagger=I$?,,3,0,,,,CC BY-SA 4.0 +6911,1,6913,,7/31/2019 22:59,,5,205,"

Complete Positive Trace Preserving Map (CPTP) operator is the most general operation that can be performed on a quantum system. This post mentioned that a CPTP operator is nothing but a unitary operator on the system after adding few ancilla bits. I would like to know how to realize a given CPTP operator.

+ +

Choi's theorem states that any CPTP operator $\Phi(\cdot) : C^*_{n\times n} \rightarrow C^*_{m \times m}$ can be expressed as $\Phi(\rho) = \sum_{j=1}^r F_j^\dagger \rho F_j$, for some $n \times m$ matrices $F_j$ such that $\sum_j F_j F_j^\dagger = I_n$.

+ +

Using this fact, can we come up with unitary operation corresponding to the given CPTP operator $\Phi$?

+",8014,,491,,7/17/2020 23:20,7/17/2020 23:20,What is the unitary operator realizing a given CPTP operator,,1,0,,,,CC BY-SA 4.0 +6912,2,,6910,7/31/2019 23:27,,4,,"

Recall that the trace is both linear and invariant under cyclic permutation of the operators

+ +

$$ \mathrm{Tr}(\Phi(\rho))=\mathrm{Tr}\left(\sum_j F_j^\dagger \rho F_j\right)=\sum_j\mathrm{Tr}\left( F_j^\dagger \rho F_j\right)=\sum_j \mathrm{Tr}\left(F_jF_j^\dagger \rho \right)= \mathrm{Tr}\left(\sum_jF_jF_j^\dagger \rho \right)$$

+ +

You can clearly see that if $\sum_jF_jF_j^\dagger=I$ $\mathrm{Tr}(\Phi(\rho))=\mathrm{Tr}(\rho)$ for all $\rho$. To prove the converse, suppose $A$ is such that

+ +

$$\mathrm{Tr}(A\rho)=\mathrm{Tr}(\rho) $$ for all $\rho$, this corresponds to

+ +

$$ \sum_{ij}A_{ij}\rho_{ji}-\sum_i \rho_{ii}=0$$

+ +

By taking $\rho_{ij}=\delta_{ki}\delta_{lj}$

+ +

we get

+ +

$$A_{lk}-\delta_{lk}=0 $$

+ +

thus $A=I$.

+",5125,,,,,7/31/2019 23:27,,,,2,,,,CC BY-SA 4.0 +6913,2,,6911,7/31/2019 23:38,,6,,"

An isometry $U:S\rightarrow S\otimes E$, where $S$ is your system and $E$ is an environment, such that

+ +

$$\mathrm{Tr}_E(U\rho U^\dagger)=\Phi(\rho)$$ is called a Stinespring dilation of $\Phi$. An easy way to construct a Stinespring dilation from the Kraus operators is to consider $\mathcal{H}_E=\mathrm{span}\{|j\rangle\}_{j=1}^r$ and

+ +

$$U=\sum_j F_j^S\otimes|j\rangle^E $$

+ +

it is easy to see that

+ +

$$\mathrm{Tr}_E(U\rho U^\dagger)= \mathrm{Tr}_E\left(\sum_jF_j\rho F_k^\dagger \otimes |j\rangle\langle k|\right)= \sum_jF_j\rho F_j^\dagger=\Phi(\rho)$$

+ +

but notice that since the set of Kraus operators for a channel is not unique, neither is the Stinespring dilation.

+",5125,,5125,,5/26/2020 9:24,5/26/2020 9:24,,,,1,,,,CC BY-SA 4.0 +6914,2,,6002,8/1/2019 1:22,,0,,"

To answer my own question after all this time …… The circuit $(H_1 \otimes H_2\otimes H_3)(I \otimes Z_2\otimes I)(I \otimes CNOT_{32})(CNOT_{21}\otimes I)(I \otimes H_2\otimes I)|000> $ accomplishes the task , the reason being that we know we want a square root two out at the front hence the first Hadamard, it also allows us to begin building $|111>$ we finish of building that with the $CNOT$ gates then we want to change the sign so we apply a phase gate and finally three hadamards to get $|+++>,|--->$ from $|000>,|111>$.

+",6254,,,,,8/1/2019 1:22,,,,1,,,,CC BY-SA 4.0 +6915,1,,,8/1/2019 2:04,,5,204,"

Many good questions on this site have explored how entanglement lies at the boundary between the quantum world and the classical. For example in computational speedups, or teleportation or superdense coding, at least two qubits are entangled in some form or another, and entanglement seems to be at the heart of, or required for, the quantum improvement.

+ +

The no-cloning theorem, on the other hand, is a statement applicable to even a single qubit. Nonetheless, there is no classical analogue of the no-cloning theorem, and yet the no-cloning theorem can be the basis for interesting applications of quantum mechanics/quantum information theory.

+ +

Two ""entanglement-free"" applications of the no-cloning theorem that come to immediate mind are:

+ +
    +
  1. Weisner's quantum money scheme, which begat
  2. +
  3. The BB84 quantum key distribution scheme.
  4. +
+ +

Although there are ""entangled"" versions of the above (e.g. the E91 scheme), the ""entanglement-free"" versions are just as valid applications of qubits.

+ +
+

Can qubits that are not entangled and instead in a product state be used in other interesting applications, in a manner that does not seem to have a classical analogue?

+
+ +

If so, are the applications merely also a version of the no-cloning theorem, or is there some other aspect of quantum information theory at play?

+",2927,,,,,4/27/2020 16:04,In what ways can qubits be used for applications that do not require entanglement?,,3,0,,,,CC BY-SA 4.0 +6916,2,,6915,8/1/2019 7:09,,4,,"

Certainly not exhaustive, but to get the ball rolling...

+ +

One possible application is blind quantum computation. In this, there is a user who wants to complete a computation, but only has the capability of producing single-qubit (non-entangled) states. These are sent to a server who can (locally) entangle them for the purposes of performing a measurement-based quantum computation. However, the trick is that the server never find out what computation is being performed.

+ +

In general, it seems likely that any security-related protocol will be using the indistinguishability of non-orthogonal states to achieve part of that security, and hence you can relate it to no-cloning.

+ +

Moving away from security-related applications, one might think about quantum metrology. Usually, quantum metrology is referring to the enhancement in measurement achieved by using entangled states. However, think about a qubit whose energy gap between $|0\rangle$ and $|1\rangle$ is affected by a magnetic field. If you prepare many qubits in the $|+\rangle$ state, leave them for some time in the magnetic field, and then measure how many are in the $|+\rangle$ or $|-\rangle$ state, you get a measurement of the magnetic field. This might almost be considered a classical technique, and is more or less the process that goes on inside e.g. MRI machines. This would not seem to have anything to do with no-cloning.

+",1837,,,,,8/1/2019 7:09,,,,0,,,,CC BY-SA 4.0 +6917,1,6926,,8/1/2019 7:22,,3,354,"

I understand that, according to amplitude amplification, I can amplify states according to a partition over the state space. However, suppose I want to amplify or de-amplify a specific portion of the state after putting it into a superposition, (e.g. I have $\frac{1}{2\sqrt(2)}\sum_{x=000}^{111}\left|x\right>$ and I want to amplify/de-amplify $\left|000\right>$). Is this possible without amplitude amplification?

+",5472,,,,,8/2/2019 7:33,How to amplify a specific part of the quantum state,,3,2,,,,CC BY-SA 4.0 +6918,1,,,8/1/2019 9:43,,0,122,"

How to increase the amplitude of a specific quantum state?

+ +

If my quantum circuit produces the state $a|0000\rangle+b|0011\rangle$, how to make $b>a$?

+",6098,,55,,8/2/2019 9:25,8/2/2019 9:25,"If I have a state $a|0000\rangle+b|0011\rangle$, how do you change it to make $b>a$?",,1,3,,,,CC BY-SA 4.0 +6919,2,,6917,8/1/2019 10:25,,1,,"

There is a method called inversion about the mean, which is used in Grover's search algorithm (and many more algortihms). In Grover's search algorithm, the preferred outcome (e.g. what you are searching for) is a certain measurement outcome. To increase the possibility of this outcome (compared to other outcomes), the probability of this outcome (e.g. its amplitude) is increased through this 'inversion about the mean' method.

+ +

Essentially what it does, is flipping (through phase-inversion) a certain outcome's phase (in your case the $|000\rangle$ state) about the mean of all the states. Then this outcome is further apart from the mean - updating all the states in some way that bring them close to the mean then can increase the amplitude of this outcome.

+ +

A nice introduction can be found here, but it doesn't have any graphical explanation. That can be found here instead.

+",8141,,,,,8/1/2019 10:25,,,,2,,,,CC BY-SA 4.0 +6920,2,,6910,8/1/2019 11:01,,3,,"

This is a slight variation of the ideas behind the other answer.

+ +

Note that $\operatorname{Tr}(\Phi(\rho))=\operatorname{Tr}(\rho)$ for all states $\rho$ (read, all positive trace-1 operators) is equivalent to $\operatorname{Tr}(\Phi(X))=\operatorname{Tr}(X)$ holding for all operators $X$ (essentially because any operator can be written as a linear combination of positive operators, and the trace operation is linear).

+ +

Note that if $\Phi(X)=\sum_k A_k X A_k^\dagger$, then $\operatorname{Tr}(\Phi(X))=\operatorname{Tr}(X)$ is equivalent to +$$\operatorname{Tr}\left[X\left(\sum_k A_k^\dagger A_k\right) \right]=\operatorname{Tr}(X).$$

+ +

Because this must hold for any operator $X$, we can see what it amounts to for $X=\lvert i\rangle\!\langle j\rvert$. +Noting that $\operatorname{Tr}[|i\rangle\!\langle j| B]=\langle j|B| i\rangle$ and $\operatorname{Tr}[|i\rangle\!\langle j|]=\delta_{ij}$, this gives us +$$\langle i|\sum_k A_k^\dagger A_k |j\rangle=\delta_{ij}.$$

+ +

This is nothing but the componentwise version of $\sum_k A_k^\dagger A_k=I$.

+ +
+ +

Note that here I used a slightly different notational convention for the Kraus decomposition than the one used in the original post. The reason is simply that I am more used to this one, but you might simply replace each $A_k\to A_k^\dagger$ switch between the two conventions.

+",55,,55,,8/1/2019 14:10,8/1/2019 14:10,,,,0,,,,CC BY-SA 4.0 +6921,1,6924,,8/1/2019 11:13,,0,259,"

Does the simulator of the IBM-Q supercomputer involves a CNOT gate error rate ?

+ +

What are the main differences reasons in outcome between simulators and real backends in IBM-Q ?

+ +

Best,

+",7405,,,,,8/1/2019 14:37,Gate error in IBM-Q simulator vs real backend,,1,0,,,,CC BY-SA 4.0 +6922,1,,,8/1/2019 13:21,,2,273,"

I have noticed that a few papers, such as this one, provide models two for typical noise that a qubit encounters during network transmission:

+
    +
  1. Λ is the dephasing channel
    +Λ(ρ) = Pq(ρ) = qρ + (1 − q)ZρZ
    +where ρ is a single qubit state, Z is the Pauli Z gate, and q ∈ [0, 1] is the noise parameter.

    +
  2. +
  3. Λ is the depolarizing channel
    +Λ(ρ) = Dq(ρ) = qρ + (1 − q)1/2
    +where ρ is a single qubit state, 1/2 is a maximally mixed single-qubit state, and q ∈ [0, 1] is the noise parameter.

    +
  4. +
+

I would like to implement this in the SimulaQron program, but I don't really understand how to calculate the effect on the qubit. What exactly do I have to do to the qubit to apply this noise?

+

Nor do I understand the value of q. My interpretation is that q would occasionally be 1, and occasionally be 0, to vary the effect on the qubit. However, if I change q probabilistically, doesn't that eliminate the point of modelling the noise?

+",8173,,-1,,6/18/2020 8:31,8/1/2019 13:43,Implementing noise model in Quantum simulator,,1,0,,,,CC BY-SA 4.0 +6923,2,,6922,8/1/2019 13:43,,2,,"

It is important to realize that the depolarizing and dephasing channel (and pretty much any other noise model for that matter) do not represent unitary operations. This means there is no unitary operation (that takes qubit states to qubit states) corresponding to these channels.

+ +

Rather, channels are more general: they map density operators to density operators. If you are not familiar with density operators (often denoted with $\rho$), I strongly advice you to first familiarize yourself with the concept. They are a framework that allows for the (more general than 'normal' or* pure states, denoted with the ket notation:$|\psi\rangle$) statistical mixtures: a statistical mixture of actual pure qubit states. The population of the various pure states determines the density matrix.

+ +

A typical noise channel creates statistical noise: therefore you need the density operator framework to describe these channels. As far as I am aware, the simulaqron software was not designed to account for density operators - it only works with pure states. This limits the possibility of simulating a quantum channel as a noise process significantly.

+ +

The only thing that would be possible tom simulate the dephasing channel is to gather statistics by repeating the same circuit over and over, but sometimes injecting a Z error (with probability $1-q$). (*see bottom note)

+ +

For the depolarizing channel, a different but equivalent definition of this channel is:

+ +

\begin{equation} +\Lambda_{depo}(\rho) = (1-p)\rho + \frac{p}{3} X\rho X+ \frac{p}{3} Y\rho Y+ \frac{p}{3} Z\rho Z, +\end{equation} +so you could apply a random $X$,$Y$ or $Z$ with equal probability of $\frac{p}{3}$, instead of only the $Z$ operation as with the dephasing channel.

+ +
    +
  • Note that it is customary to write the dephasing channel as $\Lambda_{deph}(\rho) = (1-p)\rho + p Z\rho Z$, so with the probabilities flipped compared to your definition.
  • +
+",8141,,,,,8/1/2019 13:43,,,,0,,,,CC BY-SA 4.0 +6924,2,,6921,8/1/2019 14:37,,0,,"

The IBM Q simulator does not incorporate any error rates. The simulator is set to run in an ""ideal"" environment, so you do not see the affect of any noise or errors. It is possible to add a noise model to your simulation to have the run be closer to running on the real device, but by default this is not set.

+ +

The main difference between the outcomes from the simulator and the outcomes from the real devices are the effects of noise. The simulator will only ever give you your expected results, whereas the real devices will return some outcomes that are unexpected. The real devices are affected by gate errors, readout errors, general environment noise, and decoherence and relaxation of the qubits. All of these things contribute to the few unexpected outcomes from the real devices.

+",6180,,,,,8/1/2019 14:37,,,,2,,,,CC BY-SA 4.0 +6925,2,,6917,8/1/2019 14:42,,1,,"

The probability amplitudes of a quantum system comprising of several qubits can be changed (amplified / de-amplified) with the application of suitable Rotation Gate. However, the sum of probabilities of collapsing to all possible states will remain unity, so if some states are getting amplified then others will get de-amplified. Is there any practical utility of such a gate or is it a hypothetical question?

+",8120,,,,,8/1/2019 14:42,,,,2,,,,CC BY-SA 4.0 +6926,2,,6917,8/2/2019 7:33,,4,,"

If you know, in advance, that the state you want to deamplify is specifically $|000\rangle$, there are a couple of strategies that you could follow.

+ +

For example, introduce an ancilla and perform the multi-controlled not, targeting the ancilla, where it is controlled off every qubit in the original state being in the $|0\rangle$ state. So, you'd be doing +$$ +\frac{1}{\sqrt{8}}\sum_x|x\rangle|0\rangle\mapsto \frac{1}{\sqrt{8}}\left(|000\rangle|1\rangle+\sum_{x\neq 000}|x\rangle|0\rangle\right). +$$

+ +

If you want to completely get rid of the $|000\rangle$ term, just measure your ancilla in the standard (0/1) basis. If you get the 0 answer, you've succeeded (here, this happens with probability 7/8). If you get the 1 answer, you've failed. You produce your state again and repeat until success.

+ +

If all you want to do is decrease the amplitude of $|000\rangle$ rather than completely remove it, you can correspondingly increase your probability of success. A simple strategy is to apply the POVM/filtering operation +$$ +\left(\begin{array}{cc} 1 & 0 \\ 0 & \alpha \end{array}\right) +$$ +for $\alpha<1$. Afterwards, you'd repeat your multi-controlled-not operation to disentangle the ancilla.

+ +

These strategies are perhaps conceptually simpler to understand than amplitude amplification, and work well if the amplitude you're trying to de-amplify is small enough. However, if the amplitude you're trying to amplify is too small, you won't do any better than the scaling resulting from amplitude amplification, and you'd be much better off seeing if you can change the circuit that's producing your state so that you don't have so much of the $|000\rangle$ component in the first place. For instance, in your example, instead of applying $H^{\otimes 3}$, you'd find a slightly more complicated circuit such as + +where $U|0\rangle=(\sqrt{3}|0\rangle+2|1\rangle)/\sqrt{7}$ and $V|0\rangle=(|0\rangle+\sqrt{2}|1\rangle)/\sqrt{3}$.

+",1837,,,,,8/2/2019 7:33,,,,5,,,,CC BY-SA 4.0 +6927,2,,6918,8/2/2019 7:46,,3,,"

Your question is rather unclear. Amplitude amplification is a specific algorithm that you can run, but it doesn't make any sense to apply it to the example state that you're giving.

+ +

You don't specify whether or not the parameters $a,b$ are known. If they are, then the task is trivial. First, apply a controlled-not from qubit 3 to qubit 4, leaving you in the state +$$ +|00\rangle(a|0\rangle+b|1\rangle)|0\rangle. +$$ +Now apply a unitary on qubit 3 (e.g. a Y-rotation by some angle of your choosing), so that you change to a state +$$ +|00\rangle(c|0\rangle+d|1\rangle)|0\rangle. +$$ +Then you apply controlled-not again to give the final state +$$ +|00\rangle(c|00\rangle+d|11\rangle). +$$ +However, I suppose this is not what you had in mind?

+ +

Alternatively, I might infer that you're intending $a>b$, perhaps you don't know $a,b$, but all you care about is changing the coefficients so that the amplitude of the 11 component is larger than that of the 00 component. In that case, it's even easier: apply Pauli X on both qubits 3 and 4. It'll convert you to +$$|00\rangle(b|00\rangle+a|11\rangle),$$ +satisfying those requirements.

+",1837,,,,,8/2/2019 7:46,,,,2,,,,CC BY-SA 4.0 +6928,1,,,8/2/2019 13:11,,3,113,"

What are the advantages and applications of using the resource theory approach in QIP ? What specific problems can be solved using in particular this approach ?

+",7446,,55,,1/21/2021 11:10,1/21/2021 11:10,Why is the resource theory approach used in quantum information processing?,,0,1,,1/22/2021 16:06,,CC BY-SA 4.0 +6929,1,,,8/2/2019 14:15,,2,269,"

I have some basic questions around the theorem giving quantum error correction conditions that give necessary & sufficient conditions to have an error correcting operation.

+

The theorem is stated this way (page 436 of Nielsen & Chuang)

+
+

Let C be a quantum code, and let P be the projector onto C.

+

Suppose $E$ +is a quantum operation with operation elements ${E_i}$.

+

A necessary and +sufficient condition for the existence of an error-correction +operation $R$ correcting $E$ on C is that $PE_i^{\dagger}E_jP = \alpha_{ij} P$, for some +Hermitian matrix $\alpha$ of complex numbers.

+

We call the operation elements +${E_i}$ for the noise $E$ errors,and if such an $R$ exists we say that ${E_i}$ +constitutes a correctable set of errors.

+
+

So said differently, we have a noise map that act as:

+

$$E(\rho) = \sum_i E_i(\rho) E_i^{\dagger}$$

+

And the theorem given the projector $P$ on the code space gives us relations that the noise Kraus operator must follow to ensure us we are able to correct the error.

+
+
+

My questions

+

Question about the theorem itself:

+

If I take the example of a 3 dimensional code space (the one for 3qb code). If I take the noise map allowing only single bit-flips, then the theorem will tell me that I can find a recovery operation.

+

But if I considered double or 3 bits-flip then the theorem would tell me it is not possible ? Because 3qb code can only correct single errors. Am I correct with this statement (I would like to avoid to do big calculations I want to see if I understand well the things).

+

Question about the proof

+

He does it in two steps : sufficient condition check and then necessary check. My question is for the sufficient condition.

+

Results he uses: +He started to show that actually we can rewrite:

+

$$N(\rho)=\sum_i F_i \rho F_i^{\dagger} $$

+

With: $F_i=\sum_k u_{i,k} F_k$ where $u$ is the unitary matrix that diagonalise the matrix $\alpha$ in the statement of the theorem: $u^{\dagger}.\alpha.u=d$

+

He also says that there exist a unitary $U_k$ such that $F_k P= \sqrt{d_kk} U_k P$

+

My question

+

And then he says that $F_k$ acting on the code space changes the code space. The resulting code space has a projector:

+

$$P_k = U_k P U_k^{\dagger}$$

+

How was he able to find this ? I agree with the result. We indeed have:

+

$$\forall |\psi\rangle \in C, ~ P_k \left( F_k |\psi\rangle \right) = F_k |\psi\rangle$$

+

But how was he able to find that the projector was this one ??

+

Other question

+

He assumes in the proof that $E$ is not necesseraly trace-preserving: why not. But that $R$ is trace preserving. Why would we have $R$ trace preserving but not $E$ ?

+",5008,,-1,,6/18/2020 8:31,8/4/2019 8:28,"Questions about theorem and proof: ""Quantum error correction condition"", Thm 10.1 Nielsen & Chuang",,1,0,,,,CC BY-SA 4.0 +6930,1,6933,,8/2/2019 18:14,,2,152,"

If I denote by $U^c$ the controlled version of the quantum operation $U$ +$$U^c=|0\rangle \langle 0|\otimes \mathbb{1}+|1\rangle \langle 1|\otimes U$$

+ +
    +
  1. I can first apply $U^c$ and afterward measure the control qubit.
  2. +
  3. Or I can first measure the control qubit and then apply $U$ only if +the measurement outcome was 1.
  4. +
+ +

This is a trick to save qubits when performing quantum phase estimation. +I tried to sketch this with quantum logic gates - I am not sure if I did it right.

+ +

+ +

Now I want to show that these two methods give the same result.

+ +
    +
  1. \begin{align*} +&\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)U^c|\Psi\rangle\\ +&= \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)(|0\rangle \langle 0|\otimes \mathbb{1}+|1\rangle \langle 1|\otimes U)|\Psi\rangle\\ +&=\frac{1}{\sqrt{2}}(|0\rangle \langle 0|0\rangle\otimes 1 + |1\rangle \langle 1|0\rangle \otimes U +|0\rangle \langle 0|1\rangle\otimes 1 +|1\rangle \langle 1|1\rangle \otimes U)|\Psi\rangle\\ +&=\frac{1}{\sqrt{2}}(|0\rangle \otimes 1 + |1\rangle \otimes U)|\Psi\rangle + \end{align*}

    + +

    I hope my calculations are correct.

  2. +
  3. Now I can say, this is the same as measuring the control qubit and if it is $|1\rangle $ I calculate $|1\rangle \otimes U |\Psi\rangle$

  4. +
+",8189,,2879,,8/2/2019 19:17,8/2/2019 19:39,Sketch the quantum logic gates correctly and give a proof for the identity,,1,0,,,,CC BY-SA 4.0 +6931,2,,6719,8/2/2019 18:44,,2,,"

This questions seems to be less about Q# implementation and more about the algorithm itself. It is not possible to implement the transformation you described, since it is not unitary. Consider an example for just 1 bit (to distinguish between Coke and Pepsi in your example): the matrix would have to be

+ +

$$U = \begin{bmatrix} 1.5 & 0 \\ 0 & 0.5 \end{bmatrix}$$

+ +

and the condition of it being a unitary transformation is $U^\dagger U = I$, which clearly doesn't hold:

+ +

$$U^\dagger U = \begin{bmatrix} 2.25 & 0 \\ 0 & 0.25 \end{bmatrix} \neq \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} = I$$

+ +

For a transformation with a diagonal matrix to be unitary, all elements on the diagonal must have absolute values of 1, which is not the case for your example.

+ +
+ +

If you have detailed information about which outcome you want to get with which probability, you can just prepare a superposition state that will give you these outcomes with these probabilities when measured, i.e.

+ +

$$0.57|Coke\rangle + 0.1|Pepsi\rangle + \alpha \sum_{other\ drinks} |drink\rangle$$

+ +

(here $\alpha$ is a normalization coefficient that depends on the number of other drinks you consider).

+ +

You can use the Q# library operation PrepareArbitraryState to do this.

+",2879,,1978,,8/2/2019 18:50,8/2/2019 18:50,,,,1,,,,CC BY-SA 4.0 +6932,1,,,8/2/2019 18:48,,3,785,"

I wonder if anyone might have some insight into Mosca’s Inequality "Theorem". It states when users need to be worried about quantum computers factoring traditional cryptography.

+

Mosca’s theorem says, “We need to start worrying about the impact of quantum computers when the amount of time that we wish our data to be secure for (X) is added to the time it will take for our computer systems to transition from classical to post-quantum (Y) is greater than the time it will take for quantum computers to start breaking existing quantum-susceptible encryption protocols.” Or X + Y > Z.

+

I’m having a bit of a problem understanding it and was hoping you might be able to help. I’m not sure why Y and X are additive. It seems to me that they could easily be concurrent.

+

For example, if X is 10 years and Y is 5 years and Z is 10 years…if I start now on Y, won’t I have the ability to fully protect my data in Y (i.e. in 5 years)?

+

Continuing my example, suppose I put a quantum-susceptible key around my critical data at 0 years. In 5 years (Y), I’ll be able to put a quantum-resistant key around that data. So in Y years, my data is protected and we still have 5 years (time between Y and Z) to go.

+

A few people I've asked said that it is due to the fact that Z might equal a quantum adversary scooping up the data right from the start, and hence if Z is less than X, you have a problem. But I still don't understand why Y can't be or isn't parallel to X and Z?

+",8193,,16606,,5/26/2022 11:36,5/26/2022 11:36,Clarifying Mosca's Inequality Theorem - parallel vs additive,,1,1,,,,CC BY-SA 4.0 +6933,2,,6930,8/2/2019 19:39,,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 before the measurement is done.

+ +

Let's take a look at how QPE works for the case of 1 control qubit if we know that the eigenvalue of $U$ is either $+1$ or $-1$ (i.e., the phase estimated is either 0 or 0.5). We can use the $Z$ gate as $U$ to make our calculations more specific.

+ +

The inverse QFT for 1 qubit is just the Hadamard gate, so the circuit for QPE looks as follows:

+ +

+ +

You can check that the measurement result will be 0 if the second qubit starts in the $|0\rangle$ state and 1 if it starts in the $|1\rangle$ state - which allows you to estimate the phase you're looking for.

+ +

The circuits you started with give you a 50-50 chance of measuring 0 or 1 on the first qubit regardless of the starting state of the second qubit, and thus do not help you estimate the phase.

+",2879,,,,,8/2/2019 19:39,,,,5,,,,CC BY-SA 4.0 +6934,2,,6719,8/3/2019 9:57,,1,,"

As far as Grover's Search Algorithm is concerned, it will amplify each marked state to the maximum possible probability (which may not be 1) and then de-amplify to minimum value cyclically depending on the number of marked states and the number of iterations. However, if the initial probability of marked states is different then they will reach their maximum probability at different iterations of the algorithm.

+",8120,,,,,8/3/2019 9:57,,,,0,,,,CC BY-SA 4.0 +6935,1,7119,,8/3/2019 13:33,,17,1873,"

The Knill Laflamme QEC conditions are stated this way:

+ +

We consider a code space $C$ and its associated projector $P_C$.

+ +

We consider a noise acting on our system: $E(\rho)=\sum_a E_a \rho E_a^{\dagger}$

+ +

A necessary & sufficient condition for the existence of an error correction operation correcting $E$ is the Knill-Laflamme QEC condition:

+ +

$$P_C E_i^{\dagger} E_j P_C=\alpha_{ij} P_C $$

+ +

Where $\alpha_{ij}$ are coefficient of an Hermitic matrix.

+ +

For me this mathematical condition is a little ""abstract"". I would be interested to have some feeling about what it means geometrically on the Hilbert space.

+ +

In Nielsen & Chuang it seems to mean that the different errors $E_i$ are associated with orthogonal subspace that preserve the orthogonality (two orthogonal vector of the code space will still be orthogonal after an error). But I don't understand why this is equivalent to Knill-Laflamme QEC condition.

+",5008,,5008,,8/26/2019 12:55,1/8/2023 18:07,Intuition about Knill-Laflamme QEC conditions,,3,0,,,,CC BY-SA 4.0 +6936,1,6945,,8/3/2019 22:31,,3,164,"

I am continuing to try and fully understand the argument why Matrix inversion is BQP-complete according to the proof given in the HHL paper here, and I have hit another snag.

+ +

In this question here, I got clarification about the operator $U$ so-defined, where eventually we get for $A = I - U^{-1/T}$.

+ +

$A^{-1} = \sum_{k \geq 0} U^k e^{-k/T}$ where $U^{3T} = I$. The author then writes

+ +
+

This (applying $A^{-1}$) can be interpreted as applying $U^t$ for $t$ a geometrically-distributed random variable. [...]

+
+ +

I'm not sure why this statement is true.

+ +

From what I understand, $U$ is an operator that operates on two registers, one of size $3T$ where $T$ is the number of gates, and the other register of size $n$ initialized to $|0 \rangle ^{\otimes n}$. $A^{-1}$ is a matrix consisting of a convergent series of powers of $U$ where the coefficients are exponentials. As $k \rightarrow \infty$, the powers of $U$ are divided by such large exponentials that they vanish. I have reasoned why $A^{-1}$ is given by this sum since by left/right multiplying it by $A$ we get a telescoping series where the only value of $k$ that doesn't vanish is $k=0$.

+ +

The point of all this is that if we apply $U^t$ for $T+1 \leq t \leq 2T$, then we will be left with a state $|t+1 \rangle U_1 \ldots U_T |0 \rangle ^{\otimes n}$, where the second register will correspond to applying the $T$ gates to our initial state. I do not understand the portion of this argument consisting of interpreting the application of $A^{-1}$ as a geometric random variable.

+ +

Moreover the author/s state that measuring $t$ in the range $T+1 \leq t \leq 2T$ occurs with probability $\frac {e^{-2}}{1+e^{-2}+e^{-4}}$, and I am not sure how they got this. Any hints appreciated in order to understand this computation.

+ +

Edit: Working on this I find that the probability of measuring $T+1 \leq t \leq 2T$ should be something like :

+ +

$(\sum_{k=T+1}^{2T}(\sum_{j=0}^{\infty}e^{-(k+3j)/T}) )/ (\sum_{n=0}^{\infty}e^{-n/T}) = (\sum_{k=T+1}^{2T}e^{-k/T}(\frac{1}{1-e^{-3/T}}))/(\frac{1}{1-e^{-1/T}}) += (\frac{1}{1-e^{-3/T}})/(\frac{1}{1-e^{-1/T}}) \sum_{j=0}^{T-1} e^{-(j+T+1)/T} = (\frac{1}{1-e^{-3/T}})/(\frac{1}{1-e^{-1/T}}) e^{-(T+1)/T}(\frac{1 - e^{-1}}{1-e^{-1/T}})$

+ +

Thanks!

+",7481,,7481,,8/5/2019 6:15,8/5/2019 9:04,Matrix Inversion is BQP-complete proof in HHL and the probability of measuring $T+1 \leq t \leq 2T$,,1,3,,,,CC BY-SA 4.0 +6937,2,,6248,8/4/2019 5:20,,4,,"

Let's take a look at the part of the diffusion operator between the columns of Hadamard gates. This part is supposed to perform a conditional phase shift, giving a phase of $-1$ to the state $|0...0\rangle$ and leaving the rest of the basis states unmodified.

+ +
+ +

For the first circuit, the bottom 3 wires are controls, wrapped in NOT gates, i.e., they are anti-controls: the operator applied on the 4th wire from the bottom only if each of the bottom 3 wires is in the $|0\rangle$ state. The operator performed on the 4th wire in this case is described by this circuit (two of the three NOT gates in the middle cancel right away):

+ +

+ +

Here are the transformations done by this circuit to a qubit in the starting state $\alpha |0\rangle + \beta |1\rangle$:

+ +

$$\alpha |0\rangle + \beta |1\rangle \xrightarrow{\oplus} + \beta |0\rangle + \alpha |1\rangle \xrightarrow{\text{H}} + \beta |+\rangle + \alpha |-\rangle \xrightarrow{\oplus} + \beta |+\rangle - \alpha |-\rangle \xrightarrow{\text{H}} + \beta |0\rangle - \alpha |1\rangle \xrightarrow{\oplus} + -\alpha |0\rangle + \beta |1\rangle$$

+ +

This is exactly what we're looking for - a $-1$ phase applied to the $|0...0\rangle$ state.

+ +
+ +

For the second circuit, the bottom 3 wires are already anti-controls, so the circuit we need to apply to the top two wires is the following:

+ +

+ +

The transformation is the following:

+ +

$$(\alpha |0\rangle + \beta |1\rangle) \otimes |-\rangle = + \frac{1}{\sqrt2} (\alpha |0\rangle |0\rangle - \alpha |0\rangle |1\rangle + \beta |1\rangle |0\rangle - \beta |1\rangle |1\rangle \xrightarrow{\text{CNOT}_0} $$

+ +

$$\frac{1}{\sqrt2} (\alpha |0\rangle \color{blue}{|1\rangle} - \alpha |0\rangle \color{blue}{|0\rangle} + \beta |1\rangle |0\rangle - \beta |1\rangle |1\rangle = +(\color{blue}{-} \alpha |0\rangle + \beta |1\rangle) \otimes |-\rangle$$

+ +

This transformation applies the same conditional phase shift to the bottom wire and does not modify the $|-\rangle$ state of the top wire, so it turns out to be equivalent to the first circuit.

+",2879,,,,,8/4/2019 5:20,,,,0,,,,CC BY-SA 4.0 +6938,2,,6929,8/4/2019 8:28,,1,,"

The answers to:

+ +

Question about the theorem itself:

+ +

Basically, the conclusion you drew is correct. But I should give you this caveat: the dimension of the code space of the 3-qubit code is two, not three, since the code space is expanded by states $ \left|0_{L}\right\rangle \equiv|000\rangle $ and $ \left|1_{L}\right\rangle \equiv|111\rangle $.

+ +

Question about the proof

+ +

The way he obtained the projector $ P_k $, I guess, was as follows. As you have mentioned, using polar decomposition, we can find a unitary $ U_k $ such that $ F_{k} P=\sqrt{d_{kk}} U_{k} P $. The effect of operation element $ F_k $ is to transform state $ \rho $ into $ F_k \rho F_k^\dagger $. But if $ \rho $ is initially in the code space (i.e. $ \rho $ has support entirely in the code space), then we can write $ F_k \rho F_k^\dagger $ equivalently as $ F_k P \rho P F_k^\dagger $ since $ P $ is the projector onto the code space and therefore does nothing when applied to $ \rho $. So, we can do the substitution and get $ F_k P \rho P F_k^\dagger = d_{kk} U_k P \rho P U_k^\dagger = d_{kk} U_k \rho U_k^\dagger $. So we can see that the effect of $ F_k $ acting on density operator in the code space is to rotate it following some unitary (up to some normalization multiplicative factor) and we conclude that the rotated state is in the subspace defined by the rotated projector as well: $ P_{k}=U_{k} P U_{k}^{\dagger} $.

+ +

Other question

+ +

Because noise process $\mathcal{E}$ is not generally trace-preserving. There are many cases this may occur.

+ +

The obvious one is that involves measurement and information-extraction from the principal system, where with respect to different measurement outcomes $m$, the system evolves (or collapses) into different states and is described by different quantum operations $\mathcal{E}_m$. Although when summed up, $\sum_m \mathcal{E}_m(\rho)$ is trace-preserving, for each specific $m$ (in case you are informed of the measurement outcome and thus able to exclude other circumstances), $\mathcal{E}_m(\rho)$ might not be. Of course you can argue that why wouldn't I add another normalization factor to render $\mathcal{E}_m(\rho)$ equal to one again, the rightfulness to not do so is perhaps for mathematical convenience. You can refer to section 8.2.4 Axiomatic approach to quantum operations in the same book and see that $\operatorname{tr}(\mathcal{E}_m(\rho))$ has the interpretation of the propability that this quantum operation occurs.

+ +

What's more, quite often, we are not able to correct all the possible errors from a noisy channel. For example, the bit-flip channel that flips each qubit of the three independently with probability $p$ as you mentioned. Mathematically, this channel is of course trace-preserving, but it also involves terms where more than one qubit is flipped and in that case error-correcting is impossible. Therefore, in this specific example non-trace-preserving operations are essential for us to focus on the situations where only one qubit is flipped: we just discard those higher oder terms and suppose that it is the right operation with theoretical significance.

+ +

Well, though quite a mouthful of words here, the answer in conclusion: For mathematical convenience.

+",8131,,,,,8/4/2019 8:28,,,,0,,,,CC BY-SA 4.0 +6940,1,6944,,8/4/2019 12:05,,13,4481,"

I'm trying to implement the Variational Quantum Eigensolver in Qiskit.

+ +

Suppose, I have an operator $A = \sigma_1^z\sigma_2^z$ acting on some two-qubit state $|\psi\rangle$. After a measurement I get a set of probabilities corresponding to states $|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle$.

+ +

My question is: How to calculate $\langle\psi|A|\psi\rangle$ using known set of probabilities?

+",6071,,55,,12/30/2020 10:52,5/30/2022 19:46,How to calculate an Expected Value of some operator acting on qubits?,,3,0,,,,CC BY-SA 4.0 +6941,1,,,8/4/2019 16:58,,5,1480,"

all. I am a high-school student who has recently familiarized himself with linear algebra and is looking to understand quantum computing. So, I bought the classic textbook ""Quantum Computation and Quantum Information"" by Nielsen and Chuang.

+ +

In the book, I came across the problem: find the eigenvalues and eigenvectors of the Pauli matrices.

+ +

I started out with the Pauli-X matrix and correctly found its eigenvalues to be 1 and -1.

+ +

When I set about finding the eigenvectors (using the standard methods of linear algebra), however, I found that for an eigenvalue of 1, any scalar multiple of (1 1) would do, and for -1, it could be any scalar multiple of (-1 1).

+ +

So suppose that a qubit has a Hamiltonian of hωX (this is an example in the book). Its energy eigenvalues are hω and -hω, and its energy eigenstates are the same as the unit eigenvectors of X.

+ +

But based on the results of my above calculation, there are two options per eigenvalue. For hω they are $\frac{1}{\sqrt2}(|0\rangle + |1\rangle)$ and $\frac{1}{\sqrt2}(-|0\rangle -|1\rangle)$, and for -hω they are $\frac{1}{\sqrt2}(|0\rangle - |1\rangle)$ and $\frac{1}{\sqrt2}(-|0\rangle + |1\rangle)$. For each case, aren't these states distinct? Are they both right? The textbook only acknowledges the first state in each case.

+",8202,,2879,,8/4/2019 17:03,8/4/2019 20:57,Can there be multiple energy eigenstates corresponding to the same eigenvalue of a Hamiltonian (Pauli-X)?,,2,0,,,,CC BY-SA 4.0 +6942,2,,6941,8/4/2019 17:08,,7,,"

The quantum states that differ by a global phase (i.e., by a complex number multiple which has absolute value of 1) are considered the same quantum state, since they can not be distinguished using any operations or measurements.

+ +

Thus, the eigenstates for hω are

+ +
    +
  • $|+\rangle = \frac{1}{\sqrt2}(|0\rangle + |1\rangle)$,
  • +
  • $-|+\rangle = \frac{1}{\sqrt2}(-|0\rangle -|1\rangle)$,
  • +
  • $i|+\rangle = \frac{1}{\sqrt2}(i|0\rangle + i|1\rangle)$
  • +
  • and any other state you can obtain from $|+\rangle$ by multiplying it by a complex number and normalizing it.
  • +
+ +

The convention is usually to pick coefficients so that the state has a real positive number as the first coefficient.

+",2879,,,,,8/4/2019 17:08,,,,1,,,,CC BY-SA 4.0 +6943,2,,6941,8/4/2019 20:57,,2,,"

For your more general question in the title, the answer is yes. This is more of a lesson in linear algebra than in quantum computing. What you found out is that actually the set of eigenvectors of a matrix $A$ corresponding to a given eigenvalue $\lambda$ forms a vector subspace of the space upon which $A$ acts, this is called the eigenspace of $\lambda$, $E_\lambda$. As a matter of fact, if $A v_1=\lambda v_1$ and $Av_2=\lambda v_2$, then $A(\alpha v_1+v_2)=\lambda(\alpha v_1+v_2)$, hence if $v_1,v_2\in E_\lambda$ then $\alpha v_1+v_2\in E_\lambda$ for all $\alpha \in \mathbb{C}$.

+ +

Now you might ask, are there even cases where there are two different vectors $v_1$ and $v_2$ that are in the same eigenspace? Well you found a trivial one, where the eigenspace is one dimensional, i.e.

+ +

$$ E_{\pm1}=\mathrm{span}\left(\frac{1}{\sqrt{2}}(|0\rangle\pm|1\rangle)\right)$$

+ +

they're one dimensional vector spaces, as as you noticed you can multiply the vector by any constant and it stays an eigenvector, but consider the matrix

+ +

$$ A=\begin{pmatrix} +0&1&0\\1&0&0\\0&0&1 +\end{pmatrix}$$

+ +

you still have the eigenvalue $1$, but now it's different as

+ +

$$v_1=\begin{pmatrix}1\\1\\0 +\end{pmatrix}v_2=\begin{pmatrix}0\\0\\1 +\end{pmatrix} $$ +are two linearly independent eigenvectors with the same eigenvalue, meaning that in this case

+ +

$$ E_1=\mathrm{span}(v_1,v_2)$$ +the eigenspace is two dimensional, all linear combination of these two is an eigenvector with eigenvalue one. In this case we say that the eigenvalue is degenerate, specifically twofold degenerate or with degeneracy 2.

+ +

The most extreme example if of course the identity matrix, which has only one eigenvalue, $1$, and the eigenspace is the whole vector space.

+",5125,,,,,8/4/2019 20:57,,,,0,,,,CC BY-SA 4.0 +6944,2,,6940,8/5/2019 5:21,,8,," +

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 the eigenbasis of an arbitrary operator $A$:

+
    +
  1. First, we need to compute the eigendecomposition of our Hermitian observable $A|v_i\rangle=\lambda_i|v_i\rangle$.

    +
  2. +
  3. Since $A$ is Hermitian, we are always able to diagonalize $A$ in this eigenbasis:

    +

    $$A = \sum_{i}\lambda_i |v_i\rangle \langle v_i|= U^\dagger \Lambda U$$

    +

    where $\Lambda = \text{diag}(\lambda_1,\dots,\lambda_n)$ and $U$ is a unitary matrix composed of the eigenvectors down the columns.

    +
  4. +
  5. Next, we apply the unitary operation $U$ to the end of our quantum circuit, using qc.unitary.

    +

    To see why, note that $$\langle\psi|A|\psi\rangle = \langle\psi|U^\dagger \Lambda U|\psi\rangle = \langle\psi'|\Lambda|\psi'\rangle $$ where $|\psi'\rangle = U|\psi\rangle.$ Since $\Lambda$ is diagonal, we have transformed the problem from one where we must perform a measurement in an arbitrary basis, to one where we simply measure in the computational basis.

    +
  6. +
  7. Finally, we measure the state $|\psi'\rangle$ in the computational basis $|i \rangle$ using qc.measure(q, c), and execute the jobs to get the counts and probabilities $\mathbb{P}_i = |\langle i|\psi'\rangle|^2$. Using the previously computed eigenvalues of $A$, we can now reconstruct the expectation value:

    +

    $$\langle \psi | A | \psi\rangle = \langle\psi'|\Lambda|\psi'\rangle = \sum_i \langle\psi'|i\rangle \langle i | \Lambda | i\rangle \langle i|\psi'\rangle = \sum_i \lambda_i \mathbb{P}_i$$

    +
  8. +
+

For example,

+
shots = result.results[0].shots
+counts = result.get_counts()
+probs = sorted([(i, c/shots) for i, c in counts.items()])
+P = np.float64(np.array(probs)[:, 1])
+A_expectation = lambda @ p
+
+
+

For a more high-level interface to coding and running variational quantum algorithms, you can also check out the PennyLane Python library, which has a Qiskit plugin available for using Qiskit simulators and IBM hardware as a backend.

+

For example, a expectation values of arbitrary operators in PennyLane using qiskit looks like this:

+
import pennylane as qml
+
+dev = qml.device('qiskit.basicaer', wires=2)
+# use 'qiskit.ibm' instead to run on hardware
+
+@qml.qnode(dev)
+def circuit(x, y, z):
+    qml.RX(x, wires=0)
+    qml.RY(y, wires=1)
+    qml.RZ(z, wires=0)
+    qml.CNOT(wires=[0, 1])
+    return qml.expval(qml.Hermitian(A, wires=[0, 1]))
+
+def cost(x, y, z):
+    return (1-circuit(x, y, z))**2
+
+# optimization follows
+
+

You can use NumPy, TensorFlow, or PyTorch to do the optimization - check out some of the tutorials.

+

Disclaimer: I am one of the developers on PennyLane.

+",371,,19011,,5/30/2022 19:46,5/30/2022 19:46,,,,3,,,,CC BY-SA 4.0 +6945,2,,6936,8/5/2019 9:04,,3,,"

I tend to find the bit about the geometric random variable a bit misleading. What they're trying to say is that if you apply $A^{-1}$ to $|1\rangle|\psi\rangle$ and you measure the first register, you'll get the answer $t$ with a probability that goes like $e^{-t/T}$ (approximately, assuming large $T$), and that's a geometric distribution.

+ +

Now, I think the calculation they actually perform is the following: (the wording suggests it's an exactly calculation, but I don't believe it is) +The probability of getting answer $t$ is, to leading order, $e^{-2t/T}$. Hence, the probability of getting an answer $t$ in the range $T+1$ to $2T$ is +$$ +\frac{\sum_{t=T+1}^{2T}e^{-2t/T}}{\sum_{t=1}^{3T}e^{-2t/T}} +$$ +where I have renormalised over all the possible outputs. If we do this as a sum over a geometric progression, you get the answer +$$ +\frac{e^{-2}(1-e^{-2})}{1-e^{-6}}. +$$ +The numerator and denominator have a common factor of $1-e^{-2}$ leaving the answer +$$ +\frac{e^{-2}}{1+e^{-2}+e^{-4}}, +$$ +as required.

+",1837,,,,,8/5/2019 9:04,,,,0,,,,CC BY-SA 4.0 +6947,2,,4149,8/5/2019 13:52,,4,,"

A tensor is a multi-dimensional array. A vector is a 1d tensor, a matrix is a 2d tensor, and so forth.

+ +

Tensor contraction is a generalization of matrix multiplication. In matrix multiplication, you pair up the second axis of the first matrix with the first axis of the second matrix and sum over their pointwise product to produce new entries. A tensor contraction allows you to pick which axes get paired up.

+ +

A tensor network is a configuration of tensors and contractions, drawn as a graph where the nodes are tensors and the contractions are edges.

+ +

Quantum circuits are a kind of tensor network. The gates are matrices (a specific kind of tensor) and the qubits are series of contractions (lines connecting the tensors). In some cases even the vertical lines in a circuit diagram (e.g. the line from a CNOT's control to its target) correspond to some sort of contraction, though circuit notation has strayed far enough from tensor network notation that this is not always the case.

+",119,,,,,8/5/2019 13:52,,,,0,,,,CC BY-SA 4.0 +6948,1,,,8/6/2019 0:18,,2,157,"

Starting with $|0\rangle$, I would like to understand how the probability values of 85.4% $|0\rangle$ and 14.6% $|1\rangle$ are derived from the payload circuit below?

+ +

+ +

After applying the 45 degree phase gate, I get:

+ +

+ +

And after applying the second Hadamard, I get the original $|0\rangle$ value. I am interested in the specific math operations involved in the matrix multiplications.

+",8214,,2879,,8/6/2019 2:21,8/6/2019 8:11,Explain matrix multiplication math operations of a Hadamard gate after a phase gate,,1,0,,,,CC BY-SA 4.0 +6949,2,,6948,8/6/2019 2:36,,1,,"

You can obtain the effect of this sequence of gates as the matrix product:

+ +

$$H T H |0\rangle = \frac{1}{\sqrt2} \begin{bmatrix} 1 & 1 \\ 1 & -1\end{bmatrix} \begin{bmatrix} 1 & 0 \\ 0 & e^{i\pi/4}\end{bmatrix} \frac{1}{\sqrt2} \begin{bmatrix} 1 & 1 \\ 1 & -1\end{bmatrix} \begin{bmatrix} 1 \\ 0\end{bmatrix}$$

+ +

Alternatively, if you prefer Dirac notation you can apply the gates to the $|0\rangle$ state in order:

+ +

$$|0\rangle \xrightarrow{\text{H}} \frac{1}{\sqrt2}(|0\rangle + |1\rangle) \xrightarrow{\text{T}} \frac{1}{\sqrt2}(|0\rangle + e^{i\pi/4} |1\rangle) \xrightarrow{\text{H}} \frac{1}{2}\big(|0\rangle + |1\rangle + e^{i\pi/4} (|0\rangle - |1\rangle)\big) = \frac{1}{2}\big( 1 + e^{i\pi/4} \big)|0\rangle + \frac{1}{2}\big( 1 - e^{i\pi/4} \big)|0\rangle$$

+ +

To get the probabilities of measuring 0 and 1 in this state, you have to simplify the amplitudes further using the fact that $e^{i\pi/4} = \frac{1 + i}{\sqrt2}$:

+ +

$$P(0) = \frac{|1 + e^{i\pi/4}|^2}{|1 + e^{i\pi/4}|^2 + |1 - e^{i\pi/4}|^2} = \frac{2 + \sqrt2}{(2 + \sqrt2) + (2 - \sqrt2)} = \frac{2+\sqrt2}{4} \approx 0.8536$$

+",2879,,2879,,8/6/2019 8:11,8/6/2019 8:11,,,,0,,,,CC BY-SA 4.0 +6950,1,,,8/6/2019 2:43,,0,228,"

Its a Problem from +Michael Nielsen quantum computation and quantum information

+",8216,,2879,,8/6/2019 8:12,8/8/2019 12:47,"Prove that a C2(U) gate (for any single qubit unitary U) can be constructed using at most eight one-qubit gates, and six controlled- NOTs",,0,0,0,9/4/2019 21:17,,CC BY-SA 4.0 +6951,2,,7082,8/6/2019 7:49,,12,,"

This is a little bit fiddly and non-obvious. If you start with the given Figure 4.8, and apply the construction of Figure 4.6, with $AXBXC=V$ and $V^2=U$, then you'll have a circuit with 8 single-qubit unitaries and 8 controlled-nots, so you're almost there. + +Note that we have a lot of freedom to move the phase gates around, so I'll move them like this: + +Now, I'm going to move the 6th cNot forward, past cNots 4 and 5. To compensate, I'm going to have to add in extra cNots. This probably requires some further explanation. The third cNOT is computing the parity of the first two qubits (which is uncomputed by the 6th), so that cNots 4 and 5 are controlled off this parity. An alternative way of achieving this is using two cNots, with the same target, controlled off qubits 1 and 2 - if the two qubits are different, one $X$ is applied to the target. If the two are the same, an even number of $X$s are applied to the target, with the net effect being identity. + +Now, notice that the dashed region is diagonal, and so we can commute it past any controls (i.e. anything else that acts on the top 2 qubits). I'll move it all the way to the end for simplicity. Then you should notice that there are two pairs of controlled-nots that cancel each other, leaving the final circuit: +

+ +

An essential set of identities in verifying the functioning of this circuit is +$$AXBXB^\dagger XBXC=(VC^\dagger)B^\dagger(A^\dagger V)=V(ABC)^\dagger V=V^2=U$$

+",1837,,1837,,8/8/2019 12:47,8/8/2019 12:47,,,,6,,,,CC BY-SA 4.0 +6952,1,,,8/6/2019 10:59,,6,117,"

If I want to implement the measurement operation corresponding to filtering, i.e. +$$ +M_1=\left(\begin{array}{cc}1 & 0 \\ 0 & \alpha \end{array}\right)\qquad M_2=\left(\begin{array}{cc}0 & 0 \\ 0 & \sqrt{1-\alpha^2} \end{array}\right), +$$ +how would I do that?

+",1837,,,,,8/6/2019 10:59,Implementation of filter operation,,1,0,,,,CC BY-SA 4.0 +6953,2,,6952,8/6/2019 10:59,,4,,"

These measreuements describe a non-projective measurement. We typically convert these into projective measurements by introducing ancilla qubits.

+ +

In this case, define a unitary $U$ such that +$$ +U|0\rangle=\alpha|0\rangle+\sqrt{1-\alpha^2}|1\rangle. +$$ +Take the qubit that we want to measure, and introduce an ancilla in the state $|0\rangle$. Apply controlled-$U$ controlled from your qubit to be measured, and targeting the ancilla. Finally, perform a standard, $Z$, measurement on the ancilla qubit. Answers 0 and 1 correspond to implementing $M_1$ and $M_2$ respectively.

+ +

To see this explicitly, consider the possible inputs of $|0\rangle$ and $1\rangle$. Everything else will follow by linearity. +$$ +|0\rangle|0\rangle\mapsto |0\rangle|0\rangle\qquad |1\rangle|0\rangle\mapsto |1\rangle(\alpha|0\rangle+\sqrt{1-\alpha^2}|1\rangle). +$$ +So, input $|0\rangle$ always returns $|0\rangle$ (good since $M_1|0\rangle=|0\rangle$ and $M_2|0\rangle=0$), while $|1\rangle$ returns either $M_1|1\rangle$ or $M_2\rangle$ depending on the measurement result.

+",1837,,,,,8/6/2019 10:59,,,,0,,,,CC BY-SA 4.0 +6954,1,,,8/6/2019 13:37,,3,398,"

In Qiskit, I am trying to perform controlled-Swap (cswap) of two registers, but an error occurs:

+ + + +
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
+from qiskit import execute, IBMQ, Aer
+
+c = ClassicalRegister(1)
+ancilla = QuantumRegister( 1 )
+phi = QuantumRegister(4, 'phi')
+psi = QuantumRegister(4, 'psi')
+qc = QuantumCircuit(ancilla, phi, psi, c)
+qc.h(ancilla)
+qc.swap(phi, psi)
+qc.cswap(ancilla[0], phi, psi)
+
+ +

The swap works, exchanging each qubit of the first register (phi) with each qubit of the second register (psi), I expected that the cswap would work in the same way but the following error occurs:

+ +
qiskit.qiskiterror.QiskitError: ""QuantumRegister(4, 'phi') is not a tuple.A qubit should be formated as a tuple.""
+
+ +

I have read this answer but it didn't help

+",6310,,285,,8/7/2019 12:03,11/2/2021 12:38,"Why does Qiskit swap gate accept registers, but cswap doesn't?",,1,4,,,,CC BY-SA 4.0 +6955,1,6956,,8/6/2019 16:15,,6,611,"

If $\mathcal{E}$ is a CPTP map between hermitian operators on two Hilbert spaces, then we can find a set of operators $\{K_j\}_j$ such that

+ +

$$\mathcal{E}(\rho)=\sum_j K_j\rho K_j^\dagger $$

+ +

in the same spirit as any density matrix $\rho$ can be decomposed in a pure states ensemble

+ +

$$\rho=\sum_k p_k |\psi_k\rangle\langle\psi_k| $$

+ +

with $\sum_k p_k=1$ and be intepreted as a classical statistical mixture of pure states, can I always find a Kraus decomposition such that $K_j= \sqrt{p_j} U_j$ with $U_j U_j^\dagger=\mathbb{1}$ and $\sum_j p_j=1$ and interpret it as a classical statistical mixture of unitary evolutions?

+",5125,,55,,1/21/2021 11:05,1/21/2021 11:05,Can the Kraus decomposition always be chosen to be a statistical mixture of unitary evolutions?,,1,0,,,,CC BY-SA 4.0 +6956,2,,6955,8/6/2019 16:53,,9,,"

You cannot always find such a Kraus decomposition. Notice that any CPTP map $\mathcal E$ which does have a decomposition as a probabilistic mixture unitaries is unital, which is to say that it maps the identity to the identity, and in particular it maps the maximally mixed state to the maximally mixed state: +$$ \mathcal E(\tfrac{1}{d} \mathbf 1) = \tfrac{1}{d} \mathbf 1 . $$ +This is true because $U \cdot \mathbf 1 \cdot U^\dagger = \mathbf 1$ for each unitary $U$, and taking a mixture over several unitaries $U$ does not change the result for the operator $\mathbf 1$. +But it is easy to find maps that don't have this property — so for such maps, there is no interpretation as a probabilistic mixture of unitary processes. +For instance, the map $\mathcal R$ that resets a qubit to $\lvert 0 \rangle$ does not preserve the maximally mixed state on a qubit: +$$ \mathcal R(\rho) \,=\, \mathrm{tr}(\rho) \cdot \lvert 0 \rangle\!\langle 0 \rvert . $$ +Of course, this map can be expressed using Kraus operators: for instance, you could take $K_0 = \lvert 0 \rangle\!\langle 0 \rvert$ and $K_1 = \lvert 0 \rangle\!\langle 1 \rvert$, which would suffice for $\mathcal R(\rho) = K_0^{\phantom\dagger} \rho K_0^\dagger + K_1^{\phantom\dagger} \rho K_1^\dagger$.

+ +

Edited to add: Following up on Norbert Schuh's comment below, not all unital channels are mixtures of unitaries either. An example for qutrits can be found in John Watrous' Theory of Quantum Information (which is freely available online here), in Example 4.3: +$$ +\begin{gathered} +\Phi(\rho) = A_1^{\phantom\dagger} \rho A_1^\dagger + A_2^{\phantom\dagger} \rho A_2^\dagger + A_3^{\phantom\dagger} \rho A_3^\dagger, +\\[1ex] +A_1 = \tfrac{1}{\sqrt 2}\mbox{$\scriptstyle\begin{bmatrix} +0 \!&\! 0 \!&\! 0 +\\ 0 \!&\! 0 \!&\! 1 +\\ 0 \!&\! -1 \!&\! 0 +\end{bmatrix}$}\,, +\quad +A_2 = \tfrac{1}{\sqrt 2}\mbox{$\scriptstyle\begin{bmatrix} +0 \!&\! 0 \!&\! 1 +\\ 0 \!&\! 0 \!&\! 0 +\\ -1 \!&\! 0 \!&\! 0 +\end{bmatrix}$}\,, +\quad +A_3 = \tfrac{1}{\sqrt 2}\mbox{$\scriptstyle\begin{bmatrix} +0 \!&\! 1 \!&\! 0 +\\ -1 \!&\! 0 \!&\! 0 +\\ 0 \!&\! 0 \!&\! 0 +\end{bmatrix}$}\,. +\end{gathered} +$$ +As Watrous observes, it is possible to show that this is an extreme point among the channels on a qutrit (i.e., not a convex combination of any other channels) by showing that the operators $A_j^\dagger A_k^{\phantom\dagger}$ are a linearly independent set of operators; then as $\Phi$ is not itself unitary, it isn't a mixture of unitaries either.

+ +

Watrous also notes the following characterisation of channels which are mixtures of unitaries:

+ +
+

Theorem 4.8 (paraphrased) — + Let $\Phi$ be a channel on a Hilbert space $\mathcal X$, characterised by a Stinespring dilation $$\Phi(\rho) = \mathrm{Tr}_{\mathcal Z}(A \rho A^\dagger)$$ for some unitary embedding $A: \mathcal X \to \mathcal X \otimes \mathcal Z$. Then $\Phi$ is a mixture of unitaries if and only if there exists a POVM $\{E_k\}_{k \in K}$ on $\mathcal Z$ with outcomes labeled by elements of some set $K$, and some channels $\Psi_k$ on $\mathcal X$ for $k \in K$, such that + $$ \rho = \sum_{k \in K} \Psi_k\bigl(\tilde \rho_k\bigr), $$ + where $\tilde \rho_k = \mathrm{Tr}_{\mathcal Z}\bigl(\bigl[\mathbf 1 \!\otimes\! E_k\bigr]\bigl[A \rho A^\dagger\bigr]\bigr)$.

+
+ +

That is to say: if (and only if) $\Phi$ can be characterised by an interaction of an input system $\mathcal X$ with an environment $\mathcal Z$, in such a way that there is a way in principle that you could measure the environment and use the outcome to control a 'correction' operation to recover the original input, then $\Phi$ is a mixture of unitaries.

+",124,,124,,8/8/2019 22:30,8/8/2019 22:30,,,,3,,,,CC BY-SA 4.0 +6957,1,,,8/6/2019 21:02,,3,48,"

What do we mean by exciting a superconducting circuit--which represent a qubit, how they are get excited inside? how the two states of the qubit are represented in this circuit?

+",8009,,8009,,8/6/2019 21:08,8/6/2019 21:08,Excitation of a superconducting circuit,,0,2,,,,CC BY-SA 4.0 +6958,1,,,8/7/2019 4:42,,7,324,"

Superconducting qubits generally have frequencies within the range of 4 - 8 GHz. What design considerations give the upper and lower bounds for what is a feasible design. I.e, why can't they be higher or lower in frequency?

+",1867,,55,,9/19/2019 20:42,10/4/2022 3:09,What design considerations set the frequency bounds for superconducting qubits?,,1,3,,,,CC BY-SA 4.0 +6959,1,6961,,8/7/2019 14:26,,4,462,"

Problem: trying to implement and test quantum subroutines on quantum simulators I run into multiple challenges:

+ +
    +
  1. Quantum simulation is a very hard problem: a very low number of simulated qubits is supported
  2. +
  3. The toolkit does not offer arithmetic operations, often not even a structure representing numbers, e.g., a ""quantum"" integer. The simulators work on basis of distinct qubits only.
  4. +
+ +

Solution: Assuming I am interested in translating a classical subroutine into a quantum circuit. The translation can be done without the use of entanglement and thus it would be sufficient to simulate a reversible ciruit (hence remove the overhead of simulating superpositons). Merely testing for functionality of such a translation does not require quantum effects.

+ +

Looking for: I am looking a tool(kit) that allows to construct and simulate reversible circuits for a large (a few thousands) number of (qu)bits. The toolkit should, if possible, allow the following:

+ +
    +
  • (Classical) simulation of the circuit
  • +
  • Definition of subroutines (functions)
  • +
  • Definition of structures (e.g. array of (qu)bits to represent an integer)
  • +
  • Support a gate set that allows to construct arbitrary operations, e.g., Toffoli (no need to create superpositions though)
  • +
  • Predefined (reversible) arithmetic operations (optional)
  • +
  • GUI representation of the circuits, drag and drop (optional)
  • +
+ +

I would also be happy about a quantum simulator that allows to restrict to ""classical"" simualtion. Perhaps a quantum simulator is overkill and there are ""classical"" circuit construction tools that allow me to do this very easily (maybe VHDL?).

+ +

Question: Can anyone point me to simulators for reversible circuits?

+ +
+ +

I am aware of the extensive list of quantum simulators in quantiki, and must admit, that I did not try all of them. However, I do have some experience with the following:

+ +

Microsoft Liquid

+ +
    +
  • Plenty example code
  • +
  • can simulate $\approx 22$ qubits (on my laptop)
  • +
  • can restrict oneself to stabilizer circuits (Clifford group) for larger number of qubits, but that does not give me Toffoli gates :(
  • +
+ +

Microsoft QSharp Programming Language

+ +
    +
  • can simulate $< 30$ qubits
  • +
  • allows construction of structs; has integer/ floating-point representations
  • +
  • predefined quantum arithmetic
  • +
+ +

Simulator University Linz

+ +
    +
  • seems to allow to simulate larger number of qubits for certain problem
  • +
  • poorly documented
  • +
  • only (qu)bit level operations
  • +
  • not actively developed
  • +
+ +

revkit/ cirkit RevKit

+ +
    +
  • apparently simulation for reversible circuits
  • +
  • has a GUI representation of circuits
  • +
  • did not actually get this to run (only the gui)
  • +
+ +

Drag an Drop Quirk

+ +
    +
  • GUI cuircit representation
  • +
  • allows to defined functions
  • +
  • works very well for small examples (great tool!)
  • +
+ +

IBM Qiskit

+ +
    +
  • GUI circuit representation
  • +
  • allows to define structures and functions
  • +
  • no predefined arithmetic operations, but sample code for addition/ multiplication etc available on githut
  • +
  • simulation limited to $< 30$ (qu)bits
  • +
+",7824,,,,,8/7/2019 16:15,Reversible Circuit Simulation (for classical tests of quantum subroutines),,1,0,,,,CC BY-SA 4.0 +6960,2,,4887,8/7/2019 14:34,,4,,"

The answer is yes, you need $d_1 d_2$ operators, as already pointed out in the other answer. Here I'll show explicitly why this is the case.

+ +

Let $\Phi\in\mathrm{T}(\mathcal X,\mathcal Y)$ be a CPTP operator sending maps in $\mathcal X$ into maps in $\mathcal Y$. The spaces $\mathcal X$ and $\mathcal Y$ have dimensions $d_1$ and $d_2$, respectively.

+ +

Short proof

+ +

The Kraus decomposition is essentially the spectral decomposition of the Choi operator $J(\Phi)$ of $\Phi$ (or rather, one can always choose Kraus operators that are eigenvectors, up to ""unvectorisation"", of the Choi), as shown for example in this question. The Choi operator $J(\Phi)$ is a linear operator in $\mathcal Y\otimes\mathcal X$, which is a space of dimension $d_1 d_2$. Therefore, the maximum rank of $J(\Phi)$ is $d_1d_2$.

+ +

The rank of a positive operator corresponds to the number of its non-zero eigenvalues, which in this case is the number of Kraus operators in the decomposition of the channel. You can thus see why the conclusion follows.

+ +

Longer proof

+ +

This is a longer proof that doesn't need to introduce the notion of Choi operator (although we are of course using it under the hood).

+ +

Complete positivity means that any extension $\Phi\otimes I_n\in\mathrm{T}(\mathcal X\otimes\mathcal Z,\mathcal Y\otimes \mathcal Z)$ is a positive map.

+ +

Let us write the action of $\Phi$ on a generic operator $X$ in terms of its matrix elements as $[\Phi(X)]_{ij}=\Phi_{ijk\ell}X_{k\ell}$ (this essentially amounts to be using the natural representation of the map). +The action of an extension $\Phi\otimes I_n$ onto a generic map $Y\in\mathrm{Lin}(\mathcal X\otimes\mathcal Z)$ then reads +$$[(\Phi\otimes I_n)Y]_{ij}^{\alpha\beta}=\sum_{k\ell}\Phi_{ijk\ell} Y_{k\ell}^{\alpha\beta},\tag A$$ +where I use $\alpha,\beta$ to denote the indices of $\mathcal Z$. +This must hold true for any such operator $Y$.

+ +

The complete positivity implies that $(\Phi\otimes I_n)Y$ must be a positive operator. Remembering that an operator $A$ is positive iff it can be written as $A_{ij}=\sum_k u^k_i\bar u^k_j$ with $\sum_i u^k_i \bar u^\ell_i=\lambda_k\delta_{k\ell}$, upon some reflection we can see that this means that we can ""separate"" the matrix elements of our operator $(\Phi\otimes I_n)Y$ as follows: +$$[(\Phi\otimes I_n)Y]_{ij}^{\alpha\beta}=\sum_a A^a_{i\alpha} \bar A^a_{j\beta}\tag B$$ +for some objects $A$. This must hold true for any choice of positive operator $Y$.

+ +

In particular, it must hold true for the positive operator with components $Y_{k\ell}^{\alpha\beta}=\delta_{\alpha k}\delta_{\beta \ell}$ (which corresponds to the/a maximally entangled state). +With this choice, (B) becomes +$$\Phi_{ij\alpha\beta}=\sum_a A^a_{i\alpha} \bar A^a_{j\beta},$$ +which you should recognise as the Kraus decomposition of the channel written in terms of the matrix elements. +The number of elements in this sum equals the rank of the operator sending second and fourth indices into first and third (which is nothing but the Choi operator $J(\Phi)$ of $\Phi$). This is a linear operator in $\mathrm{Lin}(\mathcal Y\otimes \mathcal X)$, and as such can have maximum rank equal to $\operatorname{dim}(\mathcal X)\operatorname{dim}(\mathcal Y)=d_1 d_2$.

+",55,,55,,2/5/2020 11:17,2/5/2020 11:17,,,,0,,,,CC BY-SA 4.0 +6961,2,,6959,8/7/2019 16:15,,4,,"

One of the simulators in Microsoft Quantum Development Kit is Toffoli simulator which seems to do exactly what you want.

+ +
    +
  • It supports a limited set of primitive gates (X, CNOT and Toffoli gates, as well as other gates when their effect is X or identity), measurements in the computational basis and DumpMachine to output the state of the simulator.
  • +
  • It is a simulator for Q#, so all language features and libraries (including arithmetic) are available to it. The restriction on 30 simulatable qubits you mentioned comes not from Q# language itself but from the full-state simulator that is typically used with the Q# programs. Since Toffoli simulator doesn't create entanglement, it can simulate thousands of qubits - the default is 65k, but you can allocate more if you need.
  • +
  • It is available with IQ# and from qsharp Python package using %toffoli magic command and toffoli_simulate method, respectively.
  • +
+ +

You can find examples of using it with Q# in the Samples repository.

+ +

Full disclosure: I am part of the team working on Quantum Development Kit.

+",2879,,,,,8/7/2019 16:15,,,,1,,,,CC BY-SA 4.0 +6962,1,11448,,8/7/2019 17:54,,3,443,"

On this page, it is stated that the Holevo quantity is an upper bound to the accessible information of a quantum state. In the scenario where Alice encodes classical information into a quantum state and sends it to Bob, the accessible information is the maximum of the mutual information between Alice and Bob's registers over all possible measurements that Bob makes.

+ +

On the other hand, the classical capacity of a quantum channel also looks at the mutual information between Alice and Bob. The maximization of this mutual information is the Holevo quantity.

+ +

I do not understand the difference in the two settings. In particular, why is the Holevo quantity only an upper bound in the first linked page but is equal to the maximum mutual information in the second linked page?

+",4831,,55,,7/10/2021 23:31,7/10/2021 23:31,What exactly is the relation between the Holevo quantity and the mutual information?,,1,0,,,,CC BY-SA 4.0 +6963,1,,,8/7/2019 20:19,,0,111,"

Qsharp have Rx Ry and Rz gates for rotation, but I need to apply a gate that leaves the Qbuit rotating continuosly like in Quirk spinning gates. +https://algassert.com/quirk#circuit=%7B%22cols%22%3A%5B%5B%22H%22%5D%2C%5B%22%E2%80%A2%22%2C%22X%22%5D%2C%5B%22X%5Et%22%5D%2C%5B1%2C%22Chance%22%5D%2C%5B%22ZDetectControlReset%22%5D%5D%7D +This is because later I will entangled it with another Qbuit, so both will be rotating, to try to sincronize meseaures

+",7933,,2879,,8/7/2019 21:15,8/15/2019 17:55,How to make a time rotation in Qsharp like in Quirk spinning gates?,,1,0,,,,CC BY-SA 4.0 +6964,1,,,8/7/2019 21:24,,3,1001,"

For example, the ibmqx2 computer has the most recent readout error of $4.40 \cdot 10^{-2}$. Does this mean per 1000 measurements, 44 faulty results exist?

+",5747,,1867,,8/14/2019 17:14,8/14/2019 17:14,How do I interpret the readout error for a quantum computer?,,1,1,,,,CC BY-SA 4.0 +6965,1,6966,,8/7/2019 21:52,,3,156,"

Suppose I have a $d$-bit estimate of $\theta \in (0, 2 \pi]$, say a register of qubits $|\tilde{\theta} \rangle = |z_1 \rangle \ldots |z_d \rangle$ for $|z_i \rangle \in \{|0 \rangle, |1 \rangle \}$ where $\theta \approx \sum_{i=1}^{d} z_i \pi /2^{i}$, and I wish to implement a transformation +$|\tilde{\theta} \rangle |0 \rangle \mapsto |\tilde{\theta} \rangle (cos(\theta) |0 \rangle + sin(\theta)|1 \rangle)$ using a quantum circuit consisting of two-qubit gates which can be represented by the controlled unitary transformation

+ +

$U_{c_i} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ + 0 & 1 & 0 & 0 \\ + 0 & 0 & cos(\pi / 2^i) & -sin(\pi / 2^i) \\ + 0 & 0 & sin(\pi / 2^i) & cos(\pi / 2^i) \\ \end{bmatrix}$

+ +

I am trying to come up with a formula for how a sequence of these controlled operations would be applied to the ancilla qubit $|0 \rangle$ (maybe more than a single qubit?) to result in an overall rotation by $\approx \theta $ but I am not sure how to proceed. Any insights appreciated.

+ +

Edited the matrix as in the answer.

+",7481,,7481,,8/8/2019 3:02,8/8/2019 3:02,Circuit for controlled rotations conditioned on a $d$ bit precision estimate of $\theta$ for $O(d)$ gates,,1,0,,,,CC BY-SA 4.0 +6966,2,,6965,8/8/2019 2:36,,3,,"

$U_{c_i}$ should not have $z_i$ in it. That information is on the input. It is not in the gate.

+ +

So instead

+ +

$$ +U_{c_i} = \begin{pmatrix} +1&0&0&0\\ +0&1&0&0\\ +0&0&\cos(\pi/2^i)&-\sin(\pi/2^i)\\ +0&0&\sin(\pi/2^i)&\cos(\pi/2^i)\\ +\end{pmatrix} +$$

+ +

If this gate acts on the $i$'th qubit of $| \tilde{\theta} \rangle$ and the target, this will give the appropriate controlled rotation.

+ +

To do all of $\tilde{\theta}$ just do all these $U_{c_i}$ on the appropriate pairs as described above. This is thanks to the fact that all of these operations are rotating along the same axis. You are just building up

+ +

$$\prod_{i=1}^d R_z (\frac{z_i}{2^i}\pi) = R_z (\sum_{i=1}^d \frac{z_i \pi}{2^i}) = R_z (\tilde{\theta})$$

+",434,,,,,8/8/2019 2:36,,,,0,,,,CC BY-SA 4.0 +6967,1,,,8/8/2019 8:23,,0,231,"

I know that I can just use the $RZ$ gate to replace the $PH$ phase gate. But I need a way to implement the controlled phase gate $C-PH$ this cannot just be replaced with a $CRZ$ gate.

+",5791,,,,,8/9/2019 22:12,How to do a $C-PH$ gate in google cirq,,1,6,,,,CC BY-SA 4.0 +6968,1,6970,,8/8/2019 12:00,,5,1084,"

Let $\Phi\in\mathrm T(\mathcal X,\mathcal Y)$ be a CPTP map. +Any such channel admits a Kraus decomposition of the form +$$\Phi(X)=\sum_a A_a X A_a^\dagger,$$ +for a set of operators $A_a\in\mathrm{Lin}(\mathcal X,\mathcal Y)$ satisfying $\sum_a A_a^\dagger A_a=I_{\mathcal X}$.

+ +

The standard way to prove this passes through the Choi representation $J(\Phi)$ of the channel, showing that CP is equivalent to $J(\Phi)$ being a positive operator, and therefore $J(\Phi)$ admits a spectral decomposition with positive eigenvalues, and finally realise that the eigenvectors of $J(\Phi)$ are essentially equivalent to the Kraus operators $A_a$ (upon some reinterpretation of the indices). This is shown for example at pag. 83 (theorem 2.22) of Watrous' TQI book, and in some form also in this other answer here, as well as in a slightly different formalism in this other answer of mine.

+ +

What puzzles me about this is the following. The components in the spectral decomposition of the Choi operator $J(\Phi)$ will also have to satisfy an additional property, one that I haven't seen discussed in this context: the orthogonality of the eigenvectors.

+ +

If $J(\Phi)=\sum_a v_a v_a^\dagger$, then we also know that the vectors $v_a$ are orthogonal. More specifically, we can always write $J(\Phi)=\sum_a p_a v_a v_a^\dagger$ for some $p_a\ge0$ and $\langle v_a,v_b\rangle=\delta_{ab}$. +Remembering that here $v_a\in\mathcal Y\otimes\mathcal X$, these vectors are essentially the Kraus operators of the channel in the sense that $(v_a)_{\alpha i}=(A_a)_{\alpha i}$ (using greek and latin letters to denote indices in $\mathcal Y$ and $\mathcal X$, respectively).

+ +

The orthogonality of the $v_a$ is thus equivalent to the fact that Kraus operators must satisfy +$$\operatorname{Tr}(A_a^\dagger A_b)\equiv \sum_{i\alpha}(A_a^*)_{\alpha i} (A_b)_{\alpha i}=p_a\delta_{ab}.\tag A$$

+ +

However, this property doesn't seem to be usually remarked. Moreover, people often refer to Kraus operators that do not satisfy this orthogonality condition. An example is the Kraus operators used for the dephasing channel in this answer.

+ +

The question is therefore as follows: should the property (A) be considered as a necessary condition for a set $\{A_a\}_a$ to be called a set of Kraus operators of a channel? Moreover, regardless of the terminology that one chooses to use, is there any advantage in choosing a ""Kraus decomposition"" for the channel that is made out of orthogonal operators, rather than non-orthogonal ones?

+",55,,55,,6/29/2021 22:49,6/29/2021 22:49,Do the Kraus operators of a CPTP channel need to be orthogonal?,,2,0,,,,CC BY-SA 4.0 +6969,2,,6968,8/8/2019 12:38,,0,,"

To answer your two questions separately:

+ +

1) The property (A) is not a necessary condition for a set to be a Kraus decomposition. Your derivation is right - Kraus operators obtained from the eigenvectors of the Choi matrix (or the process matrix, for that matter), are almost always orthogonal to each other. Almost, because if the Choi matrix is degenerate, you can find a non-orthogonal eigenbasis $\{c_{\lambda_{i}}\}$ for an eigenspace $\lambda_{i}$ with $a.m. > 1$. This results in non-orthogonal Kraus operators as well.

+ +

2) There is yet another option: Kraus operators may be linear combinations of each other (e.g. the operators in the other answer you linked). That also means that they never can all be orthogonal to each other. It also introduces some form of ambiguity, because there are then multiple ways to express the action of the channel.

+ +

For instance, the canonical way of expressing the dephasing channel is with Kraus operators $A_{1} = \sqrt{1-p}I$ and $A_{2} = \sqrt{p}Z$ (which are, in fact, orthogonal). By limiting your answer to orthogonal Kraus operators, you omit this ambiguity.

+",8141,,,,,8/8/2019 12:38,,,,0,,,,CC BY-SA 4.0 +6970,2,,6968,8/8/2019 13:32,,9,,"

There is an ambiguity in the choice of Kraus operators: If $\{E_a\}$ is a set of Kraus operators for a channel $\mathcal E$, so is $\{F_b\}$ with $F_b=\sum_a v_{ab} E_a$, with $(v_{ab})$ an isometry.

+ +

In particular, you can choose a $(v)$ which diagonalizes the matrix $X_{ac}=\mathrm{tr}[E_a^\dagger E_b]$, in which case $\{F_b\}$ satisfies your orthogonality property.

+ +

However, this is an ambiguity in the Kraus representation, and all such representations are called Kraus representations. That's the way it is, without a condition (A). If you think condition (A) is good to have, then you should give it a different name.

+ +

It is likely that this representation has certain advantages, just as an eigenvalue decomposition. Off the top of my head, it should e.g. mean that the different errors introduced by the different Kraus operators are orthogonal, so it should be a convenient representation in terms of error correction. Also, it is one representation with the minimal number of Kraus operators. I'm sure there are others.

+",491,,,,,8/8/2019 13:32,,,,0,,,,CC BY-SA 4.0 +6972,1,6976,,8/8/2019 17:54,,0,51,"

I was wondering if the complete set of measurement operators for a state :

+ +

$|\phi \rangle=c_{00}|00\rangle+c_{01}|01\rangle+c_{10}|10\rangle+c_{11}|11\rangle$

+ +

Would be given by :

+ +

$P_0\otimes I=|00\rangle\langle00|+|01\rangle\langle01|$

+ +

$P_1\otimes I=|10\rangle\langle10|+|11\rangle\langle11|$

+ +

$I\otimes P_0=|00\rangle\langle00|+|10\rangle\langle10|$

+ +

$I\otimes P_1=|01\rangle\langle01|+|11\rangle\langle11|$

+ +

Or would it be given by :

+ +

$P_0\otimes I=|00\rangle\langle00|+|01\rangle\langle01|$

+ +

$P_1\otimes I=|10\rangle\langle10|+|11\rangle\langle11|$

+ +

$I\otimes P_0=|00\rangle\langle00|+|10\rangle\langle10|$

+ +

$I\otimes P_1=|01\rangle\langle01|+|11\rangle\langle11|$

+ +

$P_0\otimes P_0=|00\rangle\langle00|$

+ +

$P_1\otimes P_1=|11\rangle\langle11|$

+ +

$P_0\otimes P_1=|01\rangle\langle01|$

+ +

$P_1\otimes P_0=|10\rangle\langle10|$.

+ +

I feel like it may be the second one by intuition as it seems to allow for more distinction between measurements but intuition is often misleading in mathematical contexts and I feel like I recall seeing the first one written somewhere. Could anyone clear this up for me please?

+",6254,,434,,8/8/2019 18:37,8/8/2019 18:40,The correct set of measurement operators on a mutiple qubit system,,2,0,,,,CC BY-SA 4.0 +6973,2,,6903,8/8/2019 18:13,,4,,"

Another way to think about this: To simulate what goes on in a quantum computer we have to do a lot of matrix math using $(2^N \times 2^N)$ matrices$^1$, and the action of (most) of the clifford gates can be actually be accomplished by applying some non-linear, low complexity matrix operation instead of a matrix multiplication.

+ +

For example, the Pauli-X gate, CNOT, and SWAP gates are both permutation matrices. If you think carefully about which qubits they act on, you don't have to do matrix math at all, you just copy and/or shuffle around the amplitudes of $|\psi \rangle$ in a clever way. Similarly with Pauli-Z - you just negate a subset of your amplitudes and sidestep the matrix math.

+ +

But quantum computing is about more interesting operations than permutations, and the effects of gates involving rotation ($R_x$, $R_y$, $R_z$) and ugly phases ($T$) don't have nice shortcuts. And for whatever we can't efficiently simulate, we expect the quantum computer to have an advantage.

+ +
+ +
    +
  1. This is not the most efficient method, but the operations I'm describing can often perform multiplication by single-qubit clifford gate saturating the $\mathcal{O}(2^N)$ lower bound on complexity for computing amplitudes of an $N$-qubit state, making these methods better than or equal to any other method available.
  2. +
+",1939,,,,,8/8/2019 18:13,,,,0,,,,CC BY-SA 4.0 +6974,2,,6892,8/8/2019 18:34,,1,,"

The task of how to perform ""Amplitude encoding"" - given $\vec{x}$, prepare $|\psi\rangle = \sum_k x_k |k\rangle$ - doesn't have a general answer. It could be accomplished by a depth-one circuit for a ""one-hot"" vector $x_k = \delta_i^k$. Or it could take an arbitrarily deep circuit to produce a set of amplitudes resembling a discretized gaussian like $x_k \propto e^{-(\bar{x} - k)^2/\mu}$.

+ +

In earlier ""quantum machine learning"" algorithms, its usually proposed that this task will be accomplished by an ""oracle"" (i.e. black box) or aided by ""qRAM"", neither of which represent a near-term or mainstream technology. A good reference to check out is Scott Aaronson's critique on these types of devices and algorithms.

+",1939,,,,,8/8/2019 18:34,,,,0,,,,CC BY-SA 4.0 +6975,2,,6972,8/8/2019 18:39,,0,,"

A valid measurement consists of operators $\{M_k\}$ such that $\sum_k M^\dagger_k M_k = I$.

+ +

You need appropriate normalization factors in front for both cases but since $P_i^\dagger P_i = P_i$ and $P_0 + P_1 = I$, they both do correspond to valid measurements.

+",4831,,,,,8/8/2019 18:39,,,,0,,,,CC BY-SA 4.0 +6976,2,,6972,8/8/2019 18:40,,2,,"

There is no single set that is ""the"" complete set of measurement operators. You can have any set that you want so long as they add up to the identity. So, one such set is $P_0\otimes I, P_1\otimes I$, which describes measuring only qubit 1 in the standard basis, and there's $I\otimes P_0, I\otimes P_1$ which describes only measuring qubit 2 in the standard basis, and there's also $P_0\otimes P_0, P_0\otimes P_1, P_1\otimes P_0, P_1\otimes P_1$ which describes measuring both qubits in the standard basis.

+",1837,,,,,8/8/2019 18:40,,,,0,,,,CC BY-SA 4.0 +6978,1,6991,,8/9/2019 2:28,,6,759,"

It's well known that, given an oracle for a function $f$ from a very large set $S$ (of order $N \gg 1$) to $\{0, 1\}$, Grover's algorithm can find an element of $S$ that maps to 1 with $\sim \sqrt{N}$ oracle queries, whereas the best classical oracle search algorithm requires $\sim N$ queries.

+ +

From this, it's often claimed that a quantum computing running Grover's algorithm could give useful speedups for many practical computational problems (since many such problems, e.g. numerical optimization, can be framed in this form).

+ +

But Grover's algorithm is a ""black-box"" algorithm that treats the oracle as the only method of getting any information at all about the solution to your problem. It completely ignores any possible correlations between the oracle's responses for different inputs, or any other ""structure"" behind the computation to be solved. Grover's algorithm therefore gives a square-root speedup over completely naive, brute-force search of every possible solution.

+ +

But it seems to me that (loosely speaking), most ""interesting"" or ""practical"" computational problems have enough structure that complete brute-force guessing is rarely the best classical approach. As a simple example, for numerically optimizing some complicated but differentiable function, gradient descent (plus some means of escaping from local minima) is typically vastly more efficient than random sampling.

+ +

Now an exponential (classical) speedup over brute-force guessing is too much to hope for in general: if $\mathrm{P} \neq \mathrm{NP}$ (which is presumably the case), then there exist problems in NP that do not admit exponential (classical) improvements over brute-force guessing that work even in the worst case. But even NP-complete problems often admit heuristic algorithms that allow for efficient solutions ""in practice"", e.g. they work for most problem instances. Even when this is not the case, my intuition is that most ""practical"" problems admit classical algorithms that provide an algebraic speedup over brute-force guessing that is better than square-root, at least for many problem instances. So my intuition is that for most ""practical"" problems, there's usually a heuristic classical algorithm that's more efficient than using Grover's algorithm for a square-root speedup over brute-force search.1

+ +

Is my intuition correct? Are they many practical problems for which the best known classical algorithms deliver less than a square-root speedup over brute force guessing ""in practice""? (I guess the somewhat sharper version of ""in practice"" means ""in the average case"", but I'm also interested in less formal interpretations of ""in practice"" as well.) More bluntly, would a quantum computing running Grover's algorithm actually be that useful for many practical computational problems?

+ +

(Strictly speaking, this is just a question about classical algorithms, but I think this is the right place to ask it, because people here are more likely to have thought about quantum speedups for these kind of problems.)

+ +
+ +

1 The only type of problem for which I wouldn't expect any classical algorithm to provide a significant improvement over brute-force search is one where the mathematical structure has been deliberately chosen to be as complicated and obfuscated as possible. For example, inverting cryptographic hash functions or cracking a symmetric-key encryption algorithm like AES. This means that, ironically, the only type of math problem for which I can intuitively see Grover's algorithm delivering a clear quantum speedup is breaking symmetric-key encryption and hashes. (This is ironic because the main application for the other most famous quantum algorithm, Shor's algorithm, is of course also for breaking cryptography, although public-key rather than symmetric-key.)

+",551,,,,,1/12/2023 21:29,Are there many practical problems for which Grover's algorithm beats the best heuristic classical algorithm?,,3,6,,,,CC BY-SA 4.0 +6979,2,,6978,8/9/2019 4:44,,0,,"

Grover Search Algorithm has complexity of O(√(N/n) oracle queries, where N is the total no. of elements in search space & n is the number of acceptable solutions. And is very useful for all problems where we do not know the structure or insight about the problem. Further, even if we know the structure / insight / domain information about the practical / real world problems, we still have to perform some search either random or deterministic, which may in turn benefit from Grover's Algorithm depending on the specific problem being solved. Therefore, even if an efficient algorithm (O(log(N))) exists in classical computation it can be made still more efficient by using Grover's Search.

+ +

Further, Quantum Oracles, in theory, can be implemented for any problem that can be solved using classical Digital Computation as all such logic can be implemented using reversible logic gates. Therefore, Oracle can be designed to incorporate the some structures like feasibility checks in constrained Numerical Optimization problem. Though Oracle will answer only in {0, 1}, but for which inputs it will give 1, can be designed in the Oracle by using the domain information. Thus, Grover search will find more applications in Real World Optimization Problems than in unsorted database search.

+",8120,,,,,8/9/2019 4:44,,,,0,,,,CC BY-SA 4.0 +6980,2,,6915,8/9/2019 9:58,,5,,"

One (obvious) application is the generation as True Random Number Generators, +e.g. IDQ, or you can download some here Free True Random Numbers (please do not use these for security relevant application).

+ +

In order to build such a TRNG, from a quantum circuit perspective, all you need is a single qubit, a Hadamard gate and a measurement. Although there might be more efficient ways to do it.

+",7824,,,,,8/9/2019 9:58,,,,0,,,,CC BY-SA 4.0 +6981,1,,,8/9/2019 12:54,,2,350,"

Suppose Alice wants to send Bob information. Each of them has been sent each of the qubits of the Bell state in advance. Suppose Alice has the first qubit and Bob has the second.

+ +

$|\Phi^+\rangle = \frac{1}{\sqrt2} (|00\rangle + |11\rangle)$

+ +

Reference: Dense Coding Topic
+QUANTUM COMPUTING
+From Linear Algebra to Physical Realizations
+Mikio Nakahara

+ +

Q1) What are the individual qubits received by Alice and Bob? +Q2) If Alice wants to send her first qubit to Charles then is it possible to send her individual qubit? (or is it required to send complete $|\Phi^+\rangle$?)

+",8249,,55,,8/9/2019 23:55,8/9/2019 23:55,"If Alice and Bob share a Bell state, can Alice send her individual qubit to a third party?",,1,0,,,,CC BY-SA 4.0 +6982,1,,,8/9/2019 13:48,,6,430,"

Let $\Phi\in\mathrm T(\mathcal X,\mathcal Y)$ be a CPTP map, and let $J(\Phi)$ be its Choi representation. +As is well known, any such map can be written in a Kraus representation of the form +$$\Phi(X)=\sum_a p_a A_a X A_a^\dagger,\tag A$$ +where $p_a\ge0$ and $\operatorname{Tr}(A_a^\dagger A_b)=\delta_{ab}$ (as mentioned for example in this other question of mine). The positive numbers $p_a$ appearing here can be seen to be the eigenvalues of $J(\Phi)$.

+ +

Is there a way to directly relate the eigenvalues $p_a$ to some properties of the channel, or to how the channel acts on states?

+",55,,55,,8/10/2019 16:35,8/12/2019 8:35,Do the eigenvalues of the Choi matrix have any direct physical interpretation?,,1,0,,,,CC BY-SA 4.0 +6983,2,,6981,8/9/2019 16:04,,3,,"

Q1) The qubits in the $|\Phi^+\rangle$ state are entangled - this means that (by definition) you can not represent the state of one of them individually without talking about the second one (mathematically this would be represented as tensor product of two single-qubit states). The best description of the individual qubits received by Alice and Bob is that each of them is part of this pair; this specifies their behavior when measured or transformed in the best possible way.

+ +

Q2) Note though that the entangled qubits remain separate entities, stored in separate physical objects. This means that they can be sent around (for example, as photons) individually. So Alice can send her qubit to Charles without also sending him the second part of the $|\Phi^+\rangle$.

+",2879,,,,,8/9/2019 16:04,,,,2,,,,CC BY-SA 4.0 +6984,2,,6967,8/9/2019 22:03,,1,,"

cirq.ZPowGate(exponent=t/pi).controlled_by(control_qubit).on(target_qubit)

+ +

or equivalently

+ +

cirq.CZ(control_qubit, target_qubit)**(t / pi)

+",434,,119,,8/9/2019 22:12,8/9/2019 22:12,,,,0,,,,CC BY-SA 4.0 +6985,1,,,8/10/2019 0:21,,10,279,"

Most quantum algorithms proposed, including Deutsch-Jozsa, Simon's, Bernstein-Vazirani etc, involve querying an oracle. If I understand correctly, the speedups depend on the oracle being efficiently constructible.

+ +

Recently, Bravyi et al proposed a quantum algorithm which essentially replaces the oracle in Bernstein-Vazirani with a grid-like 2D structure.

+ +

What are some other examples of non-oracular versions of famous oracular problems? Also, is it known that the oracles are always efficiently constructible for the famous cases I mentioned?

+",1351,,55,,8/10/2019 16:51,9/1/2021 2:38,What are examples of non-oracular versions of famous oracular problems?,,1,4,,,,CC BY-SA 4.0 +6986,1,,,8/10/2019 10:02,,6,112,"

Why aren't non maximally entangled states produced and used in quantum key distribution schemes? What would be the advantage/disadvantage to use such states rather than maximally entangled ones?

+",4235,,55,,1/21/2021 11:05,1/21/2021 12:39,Non maximally entangled states for QKD,,2,4,,,,CC BY-SA 4.0 +6987,1,13478,,8/10/2019 19:16,,12,1624,"

I recently read this report from BCG, which stated:

+ +
+

For scientists trying to design a compound that will attach itself to, + and modify, a target disease pathway, the critical first step is to + determine the electronic structure of the molecule. But modeling the + structure of a molecule of an everyday drug such as penicillin, which + has 41 atoms at ground state, requires a classical computer with some + $10^{86}$ bits—more transistors than there are atoms in the observable + universe. Such a machine is a physical impossibility. But for quantum + computers, this type of simulation is well within the realm of + possibility, requiring a processor with 286 quantum bits, or qubits.

+
+ +

Along with this resource estimate for penicillin, I've also seen similar mentions of the number of qubits required to model the ground state of caffeine (160 qubits). Given that the above report offers no reference(s) (probably in the name of business intelligence) and much Internet searching and looking into the quantum chemistry literature has come up short, my question is: Where are these resource estimates coming from – is there a journal article that published these numbers? I would really like to identify the methodology and assumptions used in making these estimates.

+",1937,,1937,,8/10/2019 19:22,8/26/2020 17:45,Number of Qubits Required for Simulation of Caffeine and Penicillin Molecules,,2,3,,,,CC BY-SA 4.0 +6988,2,,6987,8/11/2019 0:01,,-1,,"

They are just estimates. But they are not arbitrary estimates, but are based on a reference algorithm.

+

For example, a simple algorithm for a particle: +Grover's algorithm is constructed with two qbits and can be used to find the correct answer to four quantum states of a particle, in a single step.

+

Eventually, a scientific publication would be more accurate in saying: "We have simulated a caffeine molecule using 90 qbits, by the Y-Topological Algorithm."

+",8256,,8256,,8/26/2020 16:31,8/26/2020 16:31,,,,2,,,,CC BY-SA 4.0 +6989,1,,,8/11/2019 6:15,,1,497,"

I am trying to run QSVM algorithm on the IBMQ backend devices using the API_TOKEN. Below is the snippet of the code that I am running. The code fails the validation test and throws an exception after it is submitted to the IBMQ backend.

+ + + +
import numpy as np
+import scipy
+from scipy.linalg import expm
+import matplotlib.pyplot as plt
+from mpl_toolkits.mplot3d import Axes3D
+from sklearn import datasets
+from sklearn.model_selection import train_test_split
+from sklearn.preprocessing import StandardScaler, MinMaxScaler
+from sklearn.decomposition import PCA
+from qiskit import BasicAer
+from qiskit.aqua.utils import split_dataset_to_data_and_labels, map_label_to_class_name
+from qiskit.aqua.input import ClassificationInput
+from qiskit.aqua import run_algorithm, QuantumInstance
+from qiskit.aqua.algorithms import QSVM
+from qiskit.aqua.components.feature_maps import SecondOrderExpansion
+from qiskit.aqua import set_qiskit_aqua_logging
+
+from qiskit import IBMQ
+IBMQ.save_account(API_TOKEN,overwrite=True)
+_ = IBMQ.load_account()
+provider = IBMQ.get_provider(hub='ibm-q', group='open', project='main')
+n = 24
+
+standardScalerObject = StandardScaler().fit(X_train)
+sample_train = standardScalerObject.transform(X_train)
+sample_test = standardScalerObject.transform(X_test)
+
+pca = PCA(n_components=n).fit(sample_train)
+sample_train = pca.transform(sample_train)
+sample_test = pca.transform(sample_test)
+
+# Scale to range -1 to 1
+samples = np.append(sample_train,sample_test,axis=0)
+minmax_scale = MinMaxScaler((-1,1)).fit(samples)
+sample_train = minmax_scale.transform(sample_train)
+sample_test = minmax_scale.transform(sample_test)
+class_labels = [1,0]
+label_train, label_test = y_train, y_test
+training_size = len(y_train)
+test_size = len(y_test)
+sample_train_positive = np.empty((len(finalDrugTargetPair_positive),24))
+sample_train_negative = np.empty((len(finalDrugTargetPair_negative),24))
+count_pos,count_neg = 0,0
+for i in range(len(y_train)):
+    if y_train[i] == 1:
+        sample_train_positive[count_pos] = sample_train[i]
+        count_pos += 1
+    else:
+        sample_train_negative[count_neg] = sample_train[i]
+        count_neg += 1
+sample_test_positive = np.empty((len(finalDrugTargetPair_positive),24))
+sample_test_negative = np.empty((len(finalDrugTargetPair_negative),24))
+count_pos,count_neg = 0,0
+for i in range(len(y_test)):
+    if y_test[i] == 1:
+        sample_test_positive[count_pos] = sample_train[i]
+        count_pos += 1
+    else:
+        sample_test_negative[count_neg] = sample_train[i]
+        count_neg += 1
+print(sample_train_positive.shape)
+print(sample_train_negative.shape)
+training_input = {1:sample_train_positive,0:sample_train_negative}
+test_input = {1:sample_test_positive,0:sample_test_negative}
+feature_map = SecondOrderExpansion(feature_dimension=24, depth=2, entanglement='linear')
+qsvm = QSVM(feature_map, training_input, test_input)
+backend = provider.get_backend('ibmq_qasm_simulator')
+quantum_instance = QuantumInstance(backend, shots=512)
+result = qsvm.run(quantum_instance)
+
+
+ +

The Exception Message

+ + + +
W0811 05:38:26.500134 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIIIZIIIZIIIIIIIIIIIII is skipped.
+W0811 05:38:26.501830 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIIZIIIIZIIIIIIIIIIIII is skipped.
+W0811 05:38:26.503939 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIZIIIIIZIIIIIIIIIIIII is skipped.
+W0811 05:38:26.505864 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIZIIIIIIZIIIIIIIIIIIII is skipped.
+W0811 05:38:26.507203 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIZIIIIIIIZIIIIIIIIIIIII is skipped.
+W0811 05:38:26.508888 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IZIIIIIIIIZIIIIIIIIIIIII is skipped.
+W0811 05:38:26.510094 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, ZIIIIIIIIIZIIIIIIIIIIIII is skipped.
+W0811 05:38:26.511391 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIIIIZIZIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.513397 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIIIZIIZIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.515936 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIIZIIIZIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.517422 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIZIIIIZIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.519120 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIZIIIIIZIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.521319 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIZIIIIIIZIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.522609 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IZIIIIIIIZIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.524315 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, ZIIIIIIIIZIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.525660 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIIIZIZIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.526803 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIIZIIZIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.528323 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIZIIIZIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.529316 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIZIIIIZIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.530683 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIZIIIIIZIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.532210 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IZIIIIIIZIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.533475 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, ZIIIIIIIZIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.535063 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIIZIZIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.536294 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIZIIZIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.538482 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIZIIIZIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.540581 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIZIIIIZIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.542438 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IZIIIIIZIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.544407 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, ZIIIIIIZIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.547164 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIIZIZIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.548890 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIZIIZIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.551091 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIZIIIZIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.552363 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IZIIIIZIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.554009 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, ZIIIIIZIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.555259 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIIZIZIIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.557298 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIZIIZIIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.558995 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IZIIIZIIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.560379 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, ZIIIIZIIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.561851 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IIZIZIIIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.563276 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IZIIZIIIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.566059 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, ZIIIZIIIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.568841 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, IZIZIIIIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.570071 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, ZIIZIIIIIIIIIIIIIIIIIIII is skipped.
+W0811 05:38:26.571298 140084711831424 pauli_expansion.py:136] Due to the limited entangler_map, ZIZIIIIIIIIIIIIIIIIIIIII is skipped.
+W0811 05:42:36.945176 140080057583360 connectionpool.py:662] Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /quantum-computing-user-jobs/qObject-5d4faacc698fad00199197ac.json?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=a0ee7e2f33ba42d08305f6d858999743%2F20190811%2Fus-east-standard%2Fs3%2Faws4_request&X-Amz-Date=20190811T054236Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=9ab8b3610eef7344e55d7a375bafdf44454eb4aff50746c9996cf2c8cc06abf1
+---------------------------------------------------------------------------
+JobError                                  Traceback (most recent call last)
+<ipython-input-13-265e7d718710> in <module>()
+     15 quantum_instance = QuantumInstance(backend, shots=512)
+     16 
+---> 17 result = qsvm.run(quantum_instance)
+     18 print(result)
+     19 # ran_job = backend.jobs(limit=1)
+
+7 frames
+/usr/local/lib/python3.6/site-packages/qiskit/aqua/algorithms/quantum_algorithm.py in run(self, quantum_instance, **kwargs)
+     62                 quantum_instance.set_config(**kwargs)
+     63             self._quantum_instance = quantum_instance
+---> 64         return self._run()
+     65 
+     66     @abstractmethod
+
+/usr/local/lib/python3.6/site-packages/qiskit/aqua/algorithms/many_sample/qsvm/qsvm.py in _run(self)
+    306 
+    307     def _run(self):
+--> 308         return self.instance.run()
+    309 
+    310     @property
+
+/usr/local/lib/python3.6/site-packages/qiskit/aqua/algorithms/many_sample/qsvm/_qsvm_binary.py in run(self)
+    127     def run(self):
+    128         """"""Put the train, test, predict together.""""""
+--> 129         self.train(self._qalgo.training_dataset[0], self._qalgo.training_dataset[1])
+    130         if self._qalgo.test_dataset is not None:
+    131             self.test(self._qalgo.test_dataset[0], self._qalgo.test_dataset[1])
+
+/usr/local/lib/python3.6/site-packages/qiskit/aqua/algorithms/many_sample/qsvm/_qsvm_binary.py in train(self, data, labels)
+     71         """"""
+     72         scaling = 1.0 if self._qalgo.quantum_instance.is_statevector else None
+---> 73         kernel_matrix = self._qalgo.construct_kernel_matrix(data)
+     74         labels = labels * 2 - 1  # map label from 0 --> -1 and 1 --> 1
+     75         labels = labels.astype(np.float)
+
+/usr/local/lib/python3.6/site-packages/qiskit/aqua/algorithms/many_sample/qsvm/qsvm.py in construct_kernel_matrix(self, x1_vec, x2_vec, quantum_instance)
+    243                                     num_processes=aqua_globals.num_processes)
+    244 
+--> 245             results = self.quantum_instance.execute(circuits)
+    246 
+    247             if logger.isEnabledFor(logging.DEBUG):
+
+/usr/local/lib/python3.6/site-packages/qiskit/aqua/quantum_instance.py in execute(self, circuits, **kwargs)
+    209 
+    210         result = run_qobjs(qobjs, self._backend, self._qjob_config, self._backend_options, self._noise_config,
+--> 211                            self._skip_qobj_validation)
+    212 
+    213         if self._measurement_error_mitigation_fitter is not None:
+
+/usr/local/lib/python3.6/site-packages/qiskit/aqua/utils/run_circuits.py in run_qobjs(qobjs, backend, qjob_config, backend_options, noise_config, skip_qobj_validation)
+    364         results = []
+    365         for job in jobs:
+--> 366             results.append(job.result(**qjob_config))
+    367 
+    368     result = _combine_result_objects(results) if len(results) != 0 else None
+
+/usr/local/lib/python3.6/site-packages/qiskit/providers/ibmq/job/ibmqjob.py in result(self, timeout, wait)
+    252         if status is not JobStatus.DONE:
+    253             raise JobError('Invalid job state. The job should be DONE but '
+--> 254                            'it is {}'.format(str(status)))
+    255 
+    256         if not self._result:
+
+JobError: 'Invalid job state. The job should be DONE but it is JobStatus.ERROR'
+
+ +

Also it would be a great help if someone can guide me so as to retrieve the accuracy and other statistics after the job is executed.

+",8258,,,,,8/11/2019 6:15,Job execution issue while using IBMQ Experience,,0,4,,,,CC BY-SA 4.0 +6990,2,,6940,8/11/2019 10:08,,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.

+",332,,9474,,5/9/2022 20:26,5/9/2022 20:26,,,,0,,,,CC BY-SA 4.0 +6991,2,,6978,8/12/2019 1:05,,1,,"

I found the answer in these notes:

+ +
+

For an ​NP​-complete problem like CircuitSAT, we can be pretty confident that the Grover speedup is real, because no one has found any classical algorithm that’s even slightly better than brute force. On the other hand, for more “structured” ​NP​-complete problems, we ​do​ know exponential-time algorithms that are faster than brute force: for example, 3SAT is solvable in about $O(1.3​^n​)$ time. So then the question becomes a subtle one, of whether Grover’s algorithm can be ​combined​ with the best classical tricks that we know, to achieve a polynomial speedup even compared to a classical computer that uses the same tricks. For many ​NP​-complete problems, the answer seems to be yes, but it need not be yes for all of them.

+
+",551,,,,,8/12/2019 1:05,,,,0,,,,CC BY-SA 4.0 +6992,1,,,8/12/2019 1:14,,5,387,"

I'm interested in deciding if an oracle is constant or not, but cannot guarantee that the non-constant oracles are balanced. The Deutsch-Jozsa seems like the obvious starting place, but handling the non-constant case deterministic(ie with probability 1) is evading me.

+ +

Just a clarification: I'm only interested in knowing if it is constant, not for what values it diverges. If there was some way of deciding whether the resulting superposition was in an eigenstate or not, that would suffice.

+ +

Any help would be appreciated.

+ +

Edit: Per my comments below, I don't see the reduce from general search to constancy checking. This is why I do not believe the optimality of Grover's search precludes a faster solution to my original problem. Perhaps such a floor would hold if the problem statement allowed oracles to refuse inputs, but I'm not interested in such a case.

+",8259,,8259,,8/15/2019 22:07,8/16/2019 7:58,Deutsch-Jozsa on non-balanced oracles,,1,0,,,,CC BY-SA 4.0 +6993,1,6994,,8/12/2019 6:28,,2,468,"

When setting up projects with Q# I used to start with the given Quick-Starting Guide. Following the tutorial I am able to setup the example problem and the program works well.

+ +

However, there seems to be some issues when trying to use the Q# Libraries, e.g., the Arithmetic libraries or Arrays. Consider the following minimal working example created from the tutorial:

+ +

Driver.cs + +using Microsoft.Quantum.Simulation.Core; +using Microsoft.Quantum.Simulation.Simulators; +using System.Diagnostics;

+ +

namespace Microsoft.Quantum.Numerics.Samples +{ + class Program + { + static void Main(string[] args) + { + using (var qsim = new QuantumSimulator()) + { + RunAll.Run(qsim).Wait(); + } + } + } +} +

+ +

Operation.qs + +namespace Bell +{ + open Microsoft.Quantum.Canon; + open Microsoft.Quantum.Intrinsic; + open Microsoft.Quantum.Arithmetic; // Added this line + operation HelloQ () : Unit { + Message(""Hello quantum world!""); + using ( (xQb, yQb) = (Qubit[5], Qubit[5]) ) // And this block + { + AddI(LittleEndian(xQb), LittleEndian(yQb)); + } + } +} +

+ +

Where only the line indicating the usage of the Microsoft.Quantum.Arithmetic library and the code block using the AddI($\cdot$) operation (or function?) have been added to the tutorial code. This results in an error :

+ +

error QS5022: No identifier with that name exists.

+ +

Whereas I am sure that this is not a Q# issue, I do wonder if anybody stumbled upon a similar problem, or know how to fix that?

+ +

Solution: Using any of the example code from GitHub, all functionalities that I was able to add work without any problems. Using such a sample project I can just delete all the code and rewrite it, which works well.

+ +

Question: While copy-paste-delete using sample projects is a viable approach to set up new projects, I do wonder what I am missing in the ""normal"" project setup?

+",7824,,2879,,8/12/2019 8:06,8/14/2019 10:26,"Q#: How to setup a project correctly (on Linux, command line)?",,2,0,,,,CC BY-SA 4.0 +6994,2,,6993,8/12/2019 8:05,,0,,"

(I tried the fix in Visual Studio, but I'm pretty sure that will work with command line as well)

+ +

You need to add Microsoft.Quantum.Numerics NuGet package reference to your project, as described here. That is the package in which AddI is defined, and by default a newly created Q# project doesn't include this reference.

+ +

If you copy an existing project from Numerics section of the samples, it will already include the reference to this package (see, for example, this .csproj file).

+",2879,,,,,8/12/2019 8:05,,,,3,,,,CC BY-SA 4.0 +6995,2,,6992,8/12/2019 8:12,,5,,"

This is not so straightforward, I suspect. The issue is being able to distinguish between the constant case (e.g. every input gives output 0) and the case where only one input returns 1, and all others return 0. To distinguish these cases is essentially a Grover Search (the return of 1 being essentially a marked item that you want to search for the existence of), which takes a lot longer.

+ +

So, my guess for how things would work is:

+ +
    +
  • run a standard Deutsch-Jozsa a few times. If the answer is not 'constant' every time, you know your function was not constant. If the answer is 'constant' every time, you can estimate how much imbalance the function has (since it will be almost constant)
  • +
  • run a Grover search for unknown numbers of marked items.
  • +
+ +
+ +

To be a bit more precise: You have an oracle the evaluates a function $f:\{0,1\}^n\mapsto\{0,1\}$. I'll denote the set of all possible functions of this form by $\Lambda$. You want to always determine if $f$ is constant or not. Hence, to be able to resolve this question, it is necessary to be also be able to resolve the question on any subset of possible functions $\lambda\subset\Lambda$. Clearly, if you know the set is $\lambda$ not $\Lambda$, you know more so it must be easier (or, at least, no more difficult).

+ +

So, I'm going to make a particular choice for $\lambda$: the constant function and any of the $2^n$ functions which have exactly 1 output of 1. Now we can consider the action of evaluating the oracle as 'marking' an item, and our question for deciding if $f\in\lambda$ is constant is the same as resolving whether the oracle marks 0 or 1 items (where the one marked item could be any). This is exactly the sort of decision problem that Grover's search is built to answer. I know it happens to tell you, as well, which item is marked, but that doesn't change things.

+ +

Indeed, perhaps a stronger way to think about this is, instead, to let $f(x)$ be the verifier for an NP-complete problem such as 3-SAT. There is then a decision problem to resolve if there exists an $x$ such that $f(x)=1$. Since this is NP-complete and we believe NP$\neq$ BQP, we believe, at the very least, that it will take super-polynomial time to resolve the question of whether $f$ is constant or not.

+",1837,,1837,,8/16/2019 7:58,8/16/2019 7:58,,,,6,,,,CC BY-SA 4.0 +6996,2,,6986,8/12/2019 8:24,,3,,"

In schemes like E91, the idea behind using an entangled state is that:

+ +
    +
  • in a particular measurement basis (for both parties), the measurement outcomes are perfectly correlated but completely random (50:50 outcomes).
  • +
  • you can perform a Bell test on the state to verify its nature.
  • +
+ +

Using a maximally entangled state gives you the property of the 50:50 outcomes (which you can see from the reduced density matrix having two eigenvalues of 1/2). You could use a non-maximally entangled state and still get perfectly correlated outcomes, just with an imbalance in the probabilities. You could compensate for this later (e.g. privacy amplification) but it reduces the length of the key you manage to produce, so best avoided if you have a choice.

+ +

Also, violating the bound on some Bell test is tricky. You want to give yourself the maximum chance of violating a Bell inequality. You can easily prove (Tsirelson's bound) that the maximally entangled state is the state that gives maximum violation of the CHSH inequality. This gives you the most overhead to work with given the potential presence of noise in the experiment. Again, provided your state does give violation of Bell inequality, it doesn't have to be maximal, but it will cost you in the rate of key generation.

+",1837,,,,,8/12/2019 8:24,,,,2,,,,CC BY-SA 4.0 +6997,2,,6982,8/12/2019 8:35,,3,,"

When I was doing some work on quantum cloning (so, slightly different applications to the channels you were asking about), I basically ended up setting up the Choi matrix as a description of the action that I'd like to achieve (perfect cloning), averaged over all possible inputs. In that case, the maximum eigenvalue tells you quite a lot - up to a scale factor of the size of the Hilbert space dimension of the input state, it gives you an upper bound on the fidelity that you can achieve that operation with. Moreover, if the maximal eigenvector is maximally entangled, that upper bound in the fidelity can be achieved (you can extend that condition to deal with degeneracy in the maximum eigenvalue).

+",1837,,,,,8/12/2019 8:35,,,,2,,,,CC BY-SA 4.0 +6998,1,7000,,8/12/2019 13:07,,5,185,"

This statement can be found in Vedral et al. 1997, eq. (1).

+ +

More precisely, given a bipartite state $\rho_{AB}$, they claim that any operation on $\rho_{AB}$ involving local operations plus classical communication can be written as +$$\sum_k (A_k\otimes B_k)\rho_{AB}(A_k^\dagger\otimes B_k^\dagger)\tag A$$ +for some operators $A_k, B_k$. This is a seminal result, used for example to prove the existence of bound entangled states.

+ +

I don't have any problem with the previous statement they make about general local operations being writable as $\Phi_{\mathrm{LGM}}(\rho)=\sum_{ij}(A_i\otimes B_j)\rho(A_i^\dagger \otimes B_j^\dagger)$, as any such $\Phi_{\mathrm{LGM}}$ should be by definition writable as composition/tensor product of two local operations: $\Phi_{\mathrm{LGM}}=\Phi_A\otimes\Phi_B$, and then if $A_i$ and $B_j$ are the Kraus operators of $\Phi_A$ and $\Phi_B$ we get the result.

+ +

However, when we allow classical communication it seems less obvious what a generic operation should look like. The Kraus decomposition of such a map $\Phi$ would a priori be written $\Phi(\rho_{AB})=\sum_k A_k \rho_{AB} A_k^\dagger$ where $A_k$ acts nonlocally on $AB$, but then I'm not sure how to translate the LOCC condition into a constraint for $\Phi$.

+",55,,55,,7/27/2020 12:31,7/27/2020 12:31,Why can any LOCC operation be written as $\sum_k (A_k\otimes B_k)\rho(A_k^\dagger\otimes B_k^\dagger)$?,,1,4,,,,CC BY-SA 4.0 +6999,2,,6993,8/13/2019 6:19,,1,,"

According to the [Microsoft website][1], basically you create a new C# project with language Q#. That should do the trick.

+ +
$ dotnet new console -lang Q# -o myApp
+$ cd MyApp
+$ dotnet run
+Update:
+To add dependencies, such as nuGet, go to your project folder, open the terminal, and run this:
+```
+$ dotnet add package Microsoft.Quantum.Numerics
+
+ +

+  [1]: https://docs.microsoft.com/en-us/quantum/install-guide/csharp?view=qsharp-preview
+
+",8263,,8263,,8/14/2019 10:26,8/14/2019 10:26,,,,2,,,,CC BY-SA 4.0 +7000,2,,6998,8/13/2019 11:11,,3,,"

The form (A) above is known as a separable superoperator. The effect of any LOCC protocol can be described as a separable superoperator, or as a separable POVM +with POVM elements $N_i = A_i\otimes B_i$.

+ +

This can be seen as follows (adapted from this answer - I will focus on the POVM case, the superoperator is obtained by ignoring the final outcome of the POVM):

+ +

Denote the parties by Alice and Bob. Without loss of generality, we can start with an action of Alice. Alice's first measurement has POVM elements $A_{i_1}\otimes I$. Alice then communicates her outcome $i_1$ to Bob. Bob's subsequent measurement has elements $I\otimes A^{i_1}_{i_2}$, where $i_2$ enumerates Bob's outcomes, and $A^{i_1}$ indicates that Bob's POVM can depend on Alice's outcome. The total POVM of both has then elements +$$ +N_{i_1,i_2}=A_{i_1}\otimes B^{i_1}_{i_2}\ , +$$ + which is a separable POVM $N_i=A_i\otimes B_i$ with double index $i\equiv{i_1,i_2}$.

+ +

Clearly, this can be iterated to an arbitrary number of rounds, and generalized to an arbitrary number of parties, and will always have POVM elements of the form $N_i=\otimes B_i\otimes \cdots$.

+ +

Conversely, not every separable POVM can be written as a LOCC POVM. A counterexample is given in Bennett et al., Quantum Nonlocality without Entanglement, Phys. Rev. A. 59, 1070 (1999).

+",491,,,,,8/13/2019 11:11,,,,2,,,,CC BY-SA 4.0 +7001,1,,,8/13/2019 17:15,,5,90,"

No cloning theorem states that if a counterfeiter is given a state $|\psi\big>$ picked from a bunch of non-orthogonal states, then he cannot clone the state perfectly.

+ +

But this seems far from useful for many applications. It doesn't rule out the chance that attacker is able to produce a state $|\phi\big>$ pretty close to $|\psi\big>^{\otimes 2}$.

+ +

We generally want to bound the fidelity (inner product) between attackers output state $|\phi\big>$ and clone of input state $|\psi\big>^{\otimes 2}$.

+ +

In general, consider a set S of states $\{|\psi_1\big>, |\psi_2\big>, |\psi_3\big>,\cdots |\psi_n\big>\}$. We pick a state $|\psi_i\big>$ with probability $p_i$ and give it to attacker. The attacker (a CPTP operator) produces a mixed state $|\rho_i\big>$. We want to have an upper bound on the expected fidelity $\sum_i p_i |\big<\psi_i^{\otimes 2}|\rho_i|\psi_i^{\otimes 2}\big>|$ in terms of the given states S and the probabilities $p_i$. Are there any works which do this?

+ +

Note: The best counterfeiter (CPTP operator) could actually depend on the list of states S and the probabilities $p_i$. We would like to bound the advantage of this best counterfeiter (not just generic counterfeiters).

+",8014,,8014,,8/14/2019 2:06,8/14/2019 7:50,Bounding advantage of a 'no cloning theorem' counterfeiter,,2,0,,,,CC BY-SA 4.0 +7002,2,,6964,8/13/2019 18:05,,2,,"

According to [1]:

+ +
+

Readout error is the error in measuring qubits.

+
+ +

You read the figure correctly (44 out of 1000 measurements fail on reading). Note there is yet another, though minor, error there: gate error. It is about errors in quantum gate operation, and is one 10th less than the error of measurement. So, actually there may occur more erroreus results than 44 in total due to the other type of error(s).

+ +

[1] https://medium.com/@jonathan_hui/qc-quantum-programming-implementation-issues-51e3a146645e

+",4280,,,,,8/13/2019 18:05,,,,0,,,,CC BY-SA 4.0 +7003,1,7009,,8/13/2019 19:19,,3,515,"

A qubit is given in the following form:

+ +

$\left|\psi\right\rangle = \cos\left(\dfrac{\theta}{2}\right)\left|0\right\rangle + + e^{i\phi}\sin\left(\dfrac{\theta}{2}\right)\left|1\right\rangle$.

+ +

Let's us start at $\left|0\right\rangle$ and rotate about the $x$-axis $180^{\circ}$ (we should end up at $\left|1\right\rangle$). Mathematically, it could be shown easily:

+ +

Let $\theta = 180^{\circ}$ and $\phi = 0^{\circ}$:

+ +

$\left|\psi\right\rangle = \cos\left(\dfrac{180}{2}\right)\left|0\right\rangle + + e^{i(0)}\sin\left(\dfrac{180}{2}\right)\left|1\right\rangle\\ +\left|\psi\right\rangle = \cos\left(90\right)\left|0\right\rangle + + \sin\left(90\right)\left|1\right\rangle\\ +\left|\psi\right\rangle = \left|1\right\rangle +$

+ +

Now, let's use the rotation matrix instead. The matrix is given as: +$R_x(\theta) \equiv e^{-i \theta \mathbb{X}/2} = \cos(\theta/2)\mathbb{I} -i\sin(\theta/2)\mathbb{X} = \begin{bmatrix} \cos(\theta/2) & -i\sin(\theta/2) \\ -i\sin(\theta/2) & \cos(\theta/2)\end{bmatrix}$, where $\mathbb{I} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}$ and $\mathbb{X} = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$.

+ +

Using $R_x(\theta)$, we get

+ +

$R_x(180) = \begin{bmatrix} \cos(180/2) & -i\sin(180/2) \\ -i\sin(180/2) & \cos(180/2)\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}\\ +R_x(180) = \begin{bmatrix}0 & -i\\ -i & 0\end{bmatrix}\begin{bmatrix}1\\0\end{bmatrix}\\ +R_x(180) = \begin{bmatrix}0\\-i\end{bmatrix}\\ +R_x(180) = -i\begin{bmatrix}0\\1\end{bmatrix}. +$

+ +

Of course, I feel that I am missing something. The vector obtained is correct but with a phase shift of $-i$.

+ +

Also, I am wondering why it is okay to let $\phi = 0$ (if it is not correct, then what should be the value?).

+ +

Lastly, I would like to know why the rotation matrix only have $\theta$ but not $\phi$.

+ +

Thank you in advance!

+",7528,,55,,6/6/2021 19:20,10/3/2021 17:08,What is the rotation matrix corresponding to a point on the Bloch sphere?,,1,1,,,,CC BY-SA 4.0 +7004,1,,,8/13/2019 22:43,,4,540,"

I'm a little confused about the terminology of measurement.

+ +

So say that we have the single qubit state $|\phi \rangle=c_0|0\rangle+c_1|1\rangle$.

+ +

If we perform the projective measurement $P_0=|0\rangle\langle 0|$. Then we say that the probability of obtaining the measurement result $|0\rangle$ is $\langle \phi|P_0|\phi \rangle$. So in this case we're talking about a possible state that can occur in the collapse of the wavefunction of $|\phi\rangle$.

+ +

In the context of P.O.V.M. measurement where we assume it's not a projective measurement, and we label the measurement operators $E_i$ then we say that if the result of the measurement is $E_i$ then we assume that the state sent by Alice was state-x. The probability of the measurement result $\langle\phi_j| E_i |\phi_j\rangle$.

+ +

So, in this case, it seems as though we're talking about the measurement of an operator instead , but if $E$ can be projective operator and in the case of a projective operator we're measuring the probability of the state collapsing into some state, then why does it seem like that's not what's happening in the more general case ?

+",6254,,55,,5/4/2021 23:56,5/4/2021 23:56,What is the relation between POVMs and projective measurements?,,2,0,,,,CC BY-SA 4.0 +7005,2,,7001,8/13/2019 23:14,,1,,"

""Optimal Cloning of Pure States"" by Werner, 1998

+ +

Although it really should be called ""optimal heralded cloning"", since it uses a post-selection step:

+ +

+ +

Basically it works by appending maximally mixed states and projecting the qubit+mixed system into the symmetric state.

+ +

Note how the state on the left (bloch sphere pointing down-and-left) is turned into two down-and-left-but-slightly-shorter states on the right. The amount of shortening is consistent across all single-qubit input states.

+",119,,,,,8/13/2019 23:14,,,,1,,,,CC BY-SA 4.0 +7006,2,,7004,8/14/2019 0:37,,3,,"

POVMs are more general than projective measurements. Thus, every projective measurement is also a POVM, by choosing $E_i=P_i$.

+",491,,,,,8/14/2019 0:37,,,,1,,,,CC BY-SA 4.0 +7007,1,,,8/14/2019 3:08,,1,782,"

I often see written ""and then we perform measurement in the standard computational basis"" but I'm a little fuzzy on what this means as it's never stated what type of measurement we're supposed to take.

+ +

Firstly I know what the standard computational basis is and secondly I know that (usually) measurement is take using projective operators.

+ +

What I mean is , say we're given some circuit with three qubits for instance and in the circuit at the end is written the measurement symbol on the first and second wire but not the last then how do we know what projective operators to use ( I'm assuming that we have to use a complete set of measurement operators to get a full measurement ). There is no one complete set of measurement operators it all depends on what type of measurement you want to perform so in this case should we perform projective measurement on the end state with all of :

+ +

$$P_0 \otimes P_0\otimes I\\ +\vdots\\ +P_1 \otimes P_1\otimes I$$

+ +

Or

+ +

$$P_0 \otimes P_0\otimes P_0\\ +\vdots\\ +P_1 \otimes P_1\otimes P_1$$

+ +

Because I would assume that we use the first given that the circuit requires measurement on just the first two but then what becomes of the third qubit if we don't project as we would in the second set I listed. Its wavefunction won't collapse if we don't measure it so do we just discard it if the measurement is not stated for it? Otherwise, what do we do?

+ +

P.S. A little bit of a side note but if we want to perform a measurement in say, for example, the bell basis, then do we just take the density operator of the 4 bell states and treat them as projection operators?

+",6254,,55,,8/14/2019 20:30,8/14/2019 20:30,Performing a measurement in the standard computational basis of a three qubit system on two qubits,,1,0,,,,CC BY-SA 4.0 +7008,2,,7007,8/14/2019 6:52,,2,,"

Your first set of projectors is correct. There's a general rule - if you're not supposed to do anything to a particular qubit, that's described by the identity matrix.

+ +

How you perform the projection is exactly what you would normally do. If $|\psi\rangle$ is a 3-qubit state, you calculate, for example, the probability of getting the 00 result: +$$ +p_{00}=\langle\psi|P_0\otimes P_0\otimes I|\psi\rangle, +$$ +and the state after measurement is +$$ +\frac{P_0\otimes P_0\otimes I|\psi\rangle}{\sqrt{p_{00}}}. +$$ +You do not discard the third qubit. It does collapse somewhat - for example, had your initial state been $(|000\rangle+|111\rangle)/\sqrt2$, you get the 00 answer with probability 1/2, and the final state is $|000\rangle$.

+ +

Note that there are other, equivalent, ways of performing the same calculation. These have been discussed previously, although I can't immediately lay my hands on a suitable answer that demonstrates them.

+",1837,,,,,8/14/2019 6:52,,,,2,,,,CC BY-SA 4.0 +7009,2,,7003,8/14/2019 7:01,,2,,"

Be careful with your choice of notation. You're using $(\theta,\phi)$ to describe the input state, and you're using $\theta$ as the angle of rotation. These two are different $\theta$s.

+

Now $\theta=\pi$ and $\phi=0$ simply because you chose your initial state to be $|0\rangle$. (Actually, $\phi$ could be arbitrary, so you pick it to be 0 for simplicity.)

+

It perhaps helps to think about a picture of the Bloch sphere. An arbitrary pure state (on the surface of the sphere) requires two parameters to describe it, $(\theta,\phi)$. An arbitrary rotation requires three parameters - an axis (which is two parameters, entirely equivalent to the $(\theta,\phi)$ of the pure state), and an angle of rotation about that axis. Now, in your example, you have selected a fixed axes, $X$, and the $\theta$ you're using describes the angle of rotation about that axis. See, it's really incomparable to the other $\theta$ you're using.

+

Finally, you are correct that the $R_x$ operation gives you the answer that you want only up to a global phase factor. But global phase factors make no difference, and can be neglected.

+

Also, the -i you see outside the state vector is part of global phase. Those are not considered phase shifts (only relative phase shifts are). And since $R_x$ does not introduce any phase shift, $\phi$ is not in its rotation matrix.

+

PS: As @DaftWullie pointed out, axis needs two parameters.

+",1837,,18230,,10/3/2021 17:08,10/3/2021 17:08,,,,1,,,,CC BY-SA 4.0 +7010,2,,7004,8/14/2019 7:25,,2,,"

In the case of projective measurements, we have a set of projectors $\{P_i\}$ satisfying the completeness relation +$$ +\sum_iP_i=I. +$$ +Note that this also means they satisfy $\sum_iP_i^\dagger P_i$, which I would argue is more relevant. If you have a state $|\phi\rangle$, then with probability $p_i=\langle\phi|P_i^\dagger P_i|\phi\rangle=\langle\phi|P_i|\phi\rangle$, you get outcome $i$. If you get outcome $i$, the state after measurement is $P_i|\phi\rangle/\sqrt{p_i}$.

+ +

For a general measurement, you have operators $\{M_i\}$ satisfying a completeness relation +$$ +\sum_iM_i^\dagger M_i=I +$$ +If you have a state $|\phi\rangle$, then with probability $p_i=\langle\phi|M_i^\dagger M_i|\phi\rangle$, you get outcome $i$. If you get outcome $i$, the state after measurement is $M_i|\phi\rangle/\sqrt{p_i}$. So you can see how projective measurements are a special case of general measurements.

+ +

POVMs use a slightly different formalism. They make the assumption that you are only interested in the probability of measurement outcomes, and not the state after measurement. So, they choose to set $E_i=M_i^\dagger M_i$, so they satisfy $\sum_iE_i=I$, and the probability of outcome $i$ is $p_i=\langle\phi|E_i|\phi\rangle$, but the formalism is deliberately chosen so you cannot answer the question of what the post-measurement state is.

+",1837,,,,,8/14/2019 7:25,,,,0,,,,CC BY-SA 4.0 +7011,2,,7001,8/14/2019 7:40,,2,,"

There is not, generally, a universal result for which you simply plug numbers into a formula. However, there is a good strategy that results in an upper bound for the achievable fidelity, with conditions on when that maximum fidelity can be achieved. I use it quite extensively in these two papers: paper1, paper2.

+ +

First, be aware that there are several different figures of merit that you could use. Your post seems to suggest that you're interested in the global fidelity, i.e. maximising the overlap of the output state $|\phi\rangle$ with the overall target state $|\psi\rangle|\psi\rangle$, if $|\psi\rangle$ was the state to be cloned. In that case, there is an optimal result, as stated by Craig Gidney in his answer (I think that result is only for ""universal"" cloning where the set of possible input states is any pure state of the correct dimension, with equal likelihood).

+ +

There is also the single-copy fidelity, where you want the density matrix of each individual qubit to have as large a fidelity as possible with a single copy of $|\psi\rangle$. From my awareness, this is the more commonly studied case, although that's probably just because the global fidelity case is entirely solved.

+ +

So, the strategy that I suggest is to calculate the matrix +$$ +R=\sum_ip_i|\psi_i\rangle\langle\psi_i|^T\otimes |\psi_i\rangle\langle\psi_i|\otimes |\psi_i\rangle\langle\psi_i|. +$$ +Let $\lambda$ be the maximum eigenvalue of $R$, and let $d$ be the dimension of the Hilbert space spanned by $S$. Then the achievable global fidelity is bounded by $F\leq d\lambda$.

+ +

If you want the single-copy fidelity, instead you'd use the matrix +$$ +R=\frac{1}{2}\sum_ip_i|\psi_i\rangle\langle\psi_i|^T\otimes\left( |\psi_i\rangle\langle\psi_i|\otimes I+I\otimes |\psi_i\rangle\langle\psi_i|\right). +$$

+ +

In either case, you can decide if the bound can be achieved by looking at the corresponding eigenvector. If the maximum eigenvalue is unique and the eigenvector is maximally entangled across the partition of the first system and the other two, you can achieve the maximum. In the case where there is degeneracy, it is sufficient to find a mixture of those eigenstates such that the reduced density matrix on the first system is maximally mixed.

+ +

What I don't know about is what you can do if it turns out that the upper bound is not saturated - in all the standard cases, there's sufficient symmetry in the set of input states that the upper bound can be achieved.

+",1837,,1837,,8/14/2019 7:50,8/14/2019 7:50,,,,0,,,,CC BY-SA 4.0 +7012,1,7017,,8/14/2019 8:17,,1,91,"

Question: how to dynamically assign qubits to variables?

+ +

e.g., say I want to represent a matrix of qubits:

+ +

$matrix := \{\vec{v_1}, \vec{v_2}, ..., \vec{v_r}\}$

+ +

where each vector consists of $dim$ many coefficients of each $bitlength$ many qubits.

+ +

(To the best of my knowledge) Q# only allows to initiate one-dimensional Qubit arrays:

+ +
using ( allQubits = Qubit[rank * dim * bitlength] ) {
+    // Some Code
+}
+
+ +

Which leaves us with the task to assign a partition of that qubit array to variables.

+ +

I see three ways of doing that, that first seems very messy, the other two I did not get to work:

+ +
    +
  1. Remembering indices in the qubit array (this will be messy)
  2. +
  3. Getting a representation of a three dimensional qubits array: $Qubit[rank][dim][bitlength]$
  4. +
  5. Getting a custom type of QubitVectors and getting an array of those.
  6. +
+ +

Any solution is welcome, does not have to follow any of these approaches.

+ +
+ +

Lets start with a $Qubit[rank][dim][bitl]$ array. Using the Partitioned function, one can split the allQubits array into smaller parts, e.g., the qubits that represent a single vector.

+ +
// Splits a given qubit array into chunks of length size
+operation splitQubitArray( allQubits : Qubit[], chunkSize : Int ) : Qubit[][]
+{   
+    Fact(Length(allQubits) % chunkSize == 0, ""Qubit array can not be splitted into equally sized chunks"");
+    Fact(Length(allQubits) / chunkSize > 0, ""Qubit array length is smaller than chunk size."");
+    let numChunks = Length(allQubits) / chunkSize;
+    mutable arraySplit = new Int[numChunks];
+    for (i in 0..(numChunks - 1))
+    {
+        set arraySplit w/= i <- chunkSize;
+    }
+    let res = Partitioned(arraySplit, allQubits);
+    Fact(Length(res[numChunks]) == 0, ""Qubit array not split equally."");
+    return res;
+}
+
+// Split AllQubits into rank many parts.
+// Each part contains dim * bitl many qubits.
+mutable allVecQubits = splitQubitArray( allQubits, dim * bitl );
+
+ +

Now we have a two dimensional array, where each entry of the first dimension represents a vector. One can split these further to get out a single vector variable, but I could not figure out how to put this into a iterable array...

+ +
mutable vec_1 = splitQubitArray(allVecQubits[0], rank);
+mutable vec_2 = splitQubitArray(allVecQubits[1], rank);
+...
+
+ +
+ +

Option 3, the type model: we define a type that contains a vector.

+ +
newtype customVec = (Data : Qubit[][]);
+
+ +

This leaves me with the problem that I am not able to initialize an array of that type...

+ +
mutable qbVectorArray = customVec[0]; // this does not work
+mutable qbVectorArray = new customVec[0]; // this does not work
+mutable qbVectorArray = customVec(new Qubit[][]); // this does not work
+
+ +
+ +

As a note on the side: +I tried to consule the documentation in copy-and-update expressions but could not figure out how to do this, if the custom type contains Qubits. Furthermore the webpage containing the ""update-and-reassign statements"" for Q# Arrays which is linked in the type model page seems to be unavailable. +An example or guide on how to deal with custom types with Qubits would be very much appreciated.

+",7824,,1978,,8/14/2019 17:13,8/14/2019 17:28,Q#: dynamically assigning (or updating) multidimensional Qubit arrays,,1,0,,,,CC BY-SA 4.0 +7013,1,7014,,8/14/2019 8:34,,5,590,"

I find in this link that

+ +
+

""A User has a maximum of 15 credits, and these credits are replenished upon the greater of 24 hours or when your execution has run off the queue.""

+
+ +

But what is credit? Is it necessary to deduct one credit when using IBMQ for one operation? Can I use for loop to run 100 times?

+ +

Thanks a lot.

+",8272,,27,,8/14/2019 17:13,8/14/2019 17:13,What is the IBM Q credits?,,1,0,,,,CC BY-SA 4.0 +7014,2,,7013,8/14/2019 9:12,,2,,"

Credits are a way of monitoring the queue, so that no one can add too many jobs to the queue at once, preventing other people from using the device. Depending on the length of your circuit, a variable number of credits will be used. For example, if you only have 10 gates in your circuit it may take 3 credits, but a circuit with 100 gates may take 4 or 5 credits.

+ +

As stated in the answer to this question the credits system is being deprecated, so it won't be a concern for much longer.

+",5955,,,,,8/14/2019 9:12,,,,0,,,,CC BY-SA 4.0 +7016,1,,,8/14/2019 17:19,,3,42,"

In the context of stabilizer codes my lecturer writes that $Z_1Z_2$ is spanned by $\{|000\rangle,|001\rangle,|110\rangle\, |111 \rangle \}$. But I don't see how this spans the matrix as it's given by

+ +

$Z_1\otimes Z_2 \otimes I= \begin {pmatrix} 1& 0&0&0&0&0&&0&0 \\0& 1&0&0&0&0&&0&0 \\0& 0&-1&0&0&0&&0&0 \\ 0& 0&0&-1&0&0&&0&0 \\ 0& 0&0&0&-1&0&&0&0 \\0& 0&0&0&0&-1&&0&0 \\ 0 & 0&0&0&0&0&&1 &0 \\ 0& 0&0&0&0&0&&0&1 \end {pmatrix}$

+ +

So I don't see how any linear combination of the given set can form all the elements of this matrix ?

+",6254,,,,,8/15/2019 10:29,Why is $Z_1Z_2$ spanned by this set ? Surely it's too small?,,1,2,,,,CC BY-SA 4.0 +7017,2,,7012,8/14/2019 17:28,,3,,"

One important thing to note is that arrays of Qubit aren't special in Q#, such that a solution that allows for splitting an array of type 'T[] into 'T[][][] will also work for arrays of qubits such as what you get from a using statement.

+ +

From that perspective, your solution is almost there already; you just need to generalize splitQubitArray into a function that takes 'T instead, then you can call that with 'T being Qubit[] instead of Qubit. +Turning your operation into a function and adding a type parameter, we get the following:

+ +
open Microsoft.Quantum.Arrays;
+open Microsoft.Quantum.Diagnostics;
+
+function Chunked<'T>(array : 'T[], chunkSize : Int) : 'T[][] {
+    Fact(Length(array) % chunkSize == 0, ""Array can not be splitted into equally sized chunks"");
+    Fact(Length(array) / chunkSize > 0, ""Array length is smaller than chunk size."");
+    let numChunks = Length(array) / chunkSize;
+    let res = Partitioned(ConstantArray(numChunks, chunkSize), array);
+    Fact(Length(res[numChunks]) == 0, ""Qubit array not split equally."");
+    // Note that since Parititoned always returns
+    // one more array than the length of the array
+    // of chunk sizes, chop off the last element of its result.
+    return Most(res);
+}
+
+ +

This can then be used twice to turn an array of type 'T[] into an array of type 'T[][][] for any element type 'T[]. For example, we can chunk an array of type Int[] into a rank-three array of integers:

+ +
open Microsoft.Quantum.Arrays;
+open Microsoft.Quantum.Convert;
+
+function Example() : Unit {
+    let rank3 = Chunked(Chunked(RangeAsIntArray(1.. 5 * 2 * 3), 2), 3);
+    Message($""Rank-3 array: {rank3}"");
+    Message($""Length(rank3) = {Length(rank3)}"");
+    Message($""Length(rank3[0]) = {Length(rank3[0])}"");
+    Message($""Length(rank3[0][0]) = {Length(rank3[0][0])}"");
+}
+
+ +

This gives us as our output:

+ +
Rank-3 array: [[[1,2],[3,4],[5,6]],[[7,8],[9,10],[11,12]],[[13,14],[15,16],[17,18]],[[19,20],[21,22],[23,24]],[[25,26],[27,28],[29,30]]]
+Length(rank3) = 5
+Length(rank3[0]) = 3
+Length(rank3[0][0]) = 2
+
+ +

In your example above, then, you could use this new function to make a rank-3 array of qubits:

+ +
let qubitsAsRank3Array = Chunked(Chunked(allVecQubits), dim), bitlength);
+let vec1 = qubitsAsRank3Array[0];
+let vec1 = qubitsAsRank3Array[1];
+// ...
+
+ +
+ +

This example can be run online at: https://mybinder.org/v2/gist/cgranade/e4a837dcb37a4e60f8e971cf1372a2ef/master

+",1978,,,,,8/14/2019 17:28,,,,0,,,,CC BY-SA 4.0 +7018,1,7026,,8/14/2019 20:51,,4,206,"

Consider the density matrix $\rho=|\psi\rangle\!\langle\psi|$ of a random pure state in an $N$-dimensional space (in other words, an $N$-dimensional qudit, $|\psi\rangle\in\mathbb C^N$), $\rho_{ij}=c_i \bar c_j$.

+ +

The average value of the diagonal elements of such density matrix, $|c_i|^2$, can be seen to be $\mathbb E[\rho_{ii}]=1/N$, when sampling the states according to the uniform Haar random distribution (that is, for example, taking the states as a column of a random unitary matrix of the appropriate dimensions).

+ +

It seems also natural that the average off-diagonal terms vanish: $\mathbb E[\rho_{ij}]=\mathbb E[c_i \bar c_j]=\mathbb E[c_i c_j]=0$ for $i<j$.

+ +

What about $\mathbb E[\lvert c_i \bar c_j\rvert]$? Can anything be said in this case?

+ +

A quick numerical experiment, plotting this average for different values of $N$ in loglog scale, gives the following

+ +

+ +

which looks very much like a $C/N$ behaviour for some constant $C$.

+ +
+ +

The above plot can be obtained with the following python code

+ +
import numpy as np
+import qutip
+import matplotlib.pyplot as plt
+N = 200
+state_sizes_list = [2, 5, 10, 20, 30, 50, 70, 100, 200, 300]
+averages = []
+for state_size in state_sizes_list:
+  cij_samples = np.zeros(shape=N)
+  for idx in range(N):
+    ket = qutip.rand_ket_haar(N=state_size).full()
+    cij_samples[idx] = np.abs(ket[0] * ket[1])
+  averages.append(cij_samples.mean())
+plt.loglog(state_sizes_list, averages, 'ro-')
+plt.xlabel('N');
+
+",55,,55,,8/16/2019 10:45,8/19/2019 15:44,What is the average value of $|c_i\bar c_j|$ for a random state $|\psi\rangle=\sum_i c_i|i\rangle$?,,1,7,,,,CC BY-SA 4.0 +7019,1,,,8/15/2019 2:03,,2,152,"

I have a question that's arose from reading ""Quantum computing explained"" by David McMahon. On page 212 there's an aspect of his description of the quantum Fourier transform which I don't understand .

+ +

He writes that after the Hadamard gate has been applied to the zero'th qubit and then we apply the control phase gate where the zero'th qubit is the target and the first is the control that the state becomes :

+ +

$I \otimes R_2|x_1>\otimes \tfrac{1}{\sqrt{2}}(|0\rangle +|1\rangle) = |x_1\rangle \otimes \tfrac{1}{\sqrt{2}}(|0\rangle +e^{2\pi i (0.j_0)}|1\rangle)$.

+ +

I have two questions regarding this :

+ +

1) The $R_2$ gate is a control gate which changes the phase of the second qubit if the if the first is 1 and does nothing if it's zero. However here he rights that the $|0\rangle $ qubit is never affected by the control gate regardless of the state of the control qubit ? How can this be ?

+ +

2) I was under the impression that all control gates were of the form $P_0\otimes I+ P_1 \otimes \hat{A}$ ( where $\hat{A}$ is an observable ) if the first qubit was the control and the second was the target and they were of the form $I\otimes P_0+ \hat{A} \otimes P_1$ , if the second was the control and the first was the target , yet here he writes $I \otimes R_2$ Which I thought simply meant do nothing to the first but act on the second without their being any controls involved ? What's going on here ?

+",6254,,1837,,8/15/2019 7:57,9/14/2019 8:00,The control phase gate in Quantum fourier transform and the question it brings up regarding control gates in general,,1,1,,,,CC BY-SA 4.0 +7020,1,,,8/15/2019 5:56,,3,188,"

I'm very confused about the tensor representation of Control gates. I had thought that all control gates were of the form $P_0 \otimes I+P_1\otimes \hat{A}$, where this does nothing to the first qubit and acts with the operator $A$ on the second, but that there was a conditional implication involved. And I thought that $I\otimes A$ just meant that you act on the second and not the first but there was no implication of of conditionality?

+ +

Could someone please clear this up for me?

+",6254,,55,,8/19/2019 11:13,8/19/2019 11:13,Understanding how control gates are written in tensor notation,,1,5,,,,CC BY-SA 4.0 +7021,2,,7019,8/15/2019 7:57,,1,,"

You are correct that a controlled-gate should be written in the form $P_0\otimes I+P_1\otimes U$ for a unitary $U$. It certainly should not be of the form $I\otimes U$. I don't have a copy of your textbook to hand, but could you perhaps have misread it? Perhaps the author meant $I\oplus U$, which is an alternative way of describing the matrix structure?

+ +

It is, however, true that if either of the qubits is in the $|0\rangle$ state, controlled-$R_2$ does nothing. For example, if the target qubit is in $|0\rangle$, then either (i) the control is in $|0\rangle$, and so $I$ was applied to the target. This leaves $|0\rangle$ as $|0\rangle$, or (ii) the control is in $|1\rangle$, so $R_2$ is applied to the target. But $R_2|0\rangle=|0\rangle$ so, again, nothing happens.

+",1837,,,,,8/15/2019 7:57,,,,0,,,,CC BY-SA 4.0 +7022,2,,7020,8/15/2019 8:57,,2,,"

The idea behind a controlled gate is that nothing (i.e. $I$) is performed on the control qubit, but the action on the target qubit depends on the state of the control qubit.

+ +

Therefore, you can't write the action on the target qubit as a unitary operation on only that qubit. That is to say, the controlled operation can not be of the form $I_{c} \otimes A_{t}$.

+ +

However, the different specific actions on the target qubit can be 'entangled' to the different states of the control qubit. This is exactly where your notation comes in. Consider the $CNOT$ operation: if the control qubit's state is $|0\rangle$, we perform $I$ on the target qubit, and if the state is $|1\rangle$, we perform $X$. This becomes: +\begin{equation} +CNOT = |0\rangle\langle0|\otimes I + |1\rangle\langle1|\otimes X, +\end{equation}

+ +

so in this case $P_{0} = |0\rangle\langle0|$ and $P_{1} = |1\rangle\langle1|$.

+ +

Note that we always have $\sum_{i} P_{i} = I$ if we sum over a whole basis. Therefore, the action on the control qubit, without any regard to the target qubit, is indeed always $I$, i.e. nothing.

+ +

Edit: as an added note, keep in mind that these projector operators $P_{i}$ can never correspond to unitary operations.

+",8141,,,,,8/15/2019 8:57,,,,0,,,,CC BY-SA 4.0 +7023,1,7073,,8/15/2019 9:10,,0,119,"

Assume we have a density operator (Hermitian, PSD, with trace 1, where PSD means positive semi-definite) called A for a particle. $v_i$ shows the i-th eigenvector of A and $\lambda_i$ shows the i-th eigenvalue. I assume that the elements of $|v_{i}|^2$ form a probability distribution of the particle being in the state $i$, and $\lambda_i$ shows the probability of happening the i-th state. Now if we omit the j-th row and column of A (called $A_{-j}$, is there any intuition behind the obtained matrix and its eigenvalues?

+",7897,,8325,,8/23/2019 20:41,8/23/2019 20:41,Is there any meaning for a density operator if we omit the j-th row and column in quantum mechanics?,,1,1,,,,CC BY-SA 4.0 +7024,1,,,8/15/2019 10:11,,4,56,"

I am researching how to speedup optimization problems using quantum algorithms. +Many such algoritms use the Euclidean norm of a vector. Hence, I tried to find a quantum algorithm that speedups the calculation of the Euclidean Norm, but with no success.

+ +

Are you aware of any quantum algorithms for calculating the norm of the vector? If so, can you please provide a reference (Scientific paper, book) for that algorithm?

+ +

Thank you in advance!

+",8281,,,,,8/15/2019 10:11,"Are there any quantum algorithms to compute the norm of a vector, better than the classical version (O(d), where d is dimension)",,0,2,,,,CC BY-SA 4.0 +7025,2,,7016,8/15/2019 10:29,,2,,"

This is basically what DaftWullie said in the comments, with a bit of elaboration —$\def\ket#1{\lvert #1 \rangle}\def\bra#1{\!\!\:\langle #1 \rvert}$

+ +

Notice that $Z_1 Z_2$ is an $8 \times 8$ operator when taken as an operation on 3 qubits, and $\{ \ket{000}, \ket{001}, \ket{110}, \ket{111} \}$ is a set of $8 \times 1$ column-vectors. There can't be any question of $Z_1 Z_2$ being spanned by the vectors, so the question you should ask in cases like this is what is actually meant. You seem to have interpreted this as a statement that $Z_1 Z_2$ is spanned by the projectors onto those states — that is, $\ket{000}\bra{000}$, $\ket{001}\bra{001}$, $\ket{110}\bra{110}$, and $\ket{111}\bra{111}$. This isn't a bad first guess, but as these are each rank-1 projectors and $Z_1 Z_2$ is a rank-8 operator, as you say there aren't enough for this to hold. (Any unitary operator on $n$ qubits cannot be expressed as fewer than $2^n$ rank-1 projectors.)

+ +

What your lecturer presumably meant is that the space which is stabilised by $Z_1 Z_2$, that is to say the +1 eigenspace of $Z_1 Z_2$, is spanned by the vectors $\{ \ket{000}, \ket{001}, \ket{110}, \ket{111} \}$. We can see this is true because $\ket{00}$ and $\ket{11}$ are the two-qubit it states which are stabilised by $Z_1 Z_2$, and in the set of states above we are just taking the tensor product with linearly independent states of the third qubit. For instance, it would be as valid to say that the space stabilised by $Z_1 Z_2$ is spanned by the vectors $\{ \ket{00+}, \ket{00-}, \ket{11+}, \ket{11-} \}$, or indeed by the vectors $\{ \ket{000}, \ket{00+}, \ket{111}, \ket{11-} \}$ (though it would be unusual to see a spanning set such as the last one here, as it is not orthogonal).

+",124,,,,,8/15/2019 10:29,,,,0,,,8/15/2019 12:20,CC BY-SA 4.0 +7026,2,,7018,8/15/2019 12:45,,5,,"

The constant is $C = \frac{\pi}{4}$.

+ +

The $2N$-dimensional vector composed of the real and imaginary parts of the coefficients of a normalized state vector is uniformly distributed on an $S^{2N-1}$. Thus the needed expectation value is:

+ +

$$\frac{C}{N} = \frac{\int_{S^{2N-1}}|(c_{1x} + i c_{1y}) (c_{2x} - i c_{2y})| d\mu(S^{2N-1})}{\mathrm{Vol}(S^{2N-1})}$$

+ +

Integrals of homogeneous functions over spheres can be traded by Gaussian integrals over the ambient Euclidean space the with proper normalizations; since the angular integrations are the same and we need only to normalize the different radial integrals. In our case we get:

+ +

$$\frac{C}{N} = \frac{\int_{\mathbb{C}^N}|(c_{1x} + i c_{1y}) (c_{2x} - i c_{2y})| e^{-\sum_j|c_j|^2}\prod_j d\mathrm{Re}(c_j)d\mathrm{Im}(c_j)}{\int_{\mathbb{C}^N}(\sum_j|c_j|^2e^{-\sum_j|c_j|^2}\prod_j d\mathrm{Re}(c_j)d\mathrm{Im}(c_j)}$$

+ +

The denominator is the unique symmetric polynomial of the same homogeneity degree as the numerator, thus gives rise to the same radial integration value.

+ +

The Gaussian integral in the numerator is decomposable to two types of integrals and in the one in the denominator denominator is a sum of N similar complex gaussian integrals, thus we get:

+ +

$$\frac{C}{N} =\frac{\left(\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} \sqrt{c_x^2 + c_y^2} e^{-c_x^2 - c_y^2}\right)^2 \left(\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} e^{-c_x^2 - c_y^2}\right)^{N-2}}{N \left(\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} (c_x^2 + c_y^2) e^{-c_x^2 - c_y^2}\right) \left(\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} e^{-c_x^2 - c_y^2}\right)^{N-1}}= \frac{\pi}{4N}$$

+ +

(In the above, the integrals can be solved in polar and cartesian coordinates yielding Gamma functions of intgral or half integral arumements)

+ +

Remark:

+ +

The equivalence of the integration formulas is based on the following Dirac delta function limit representation:

+ +

$$ \delta(y) = \lim_{\epsilon \rightarrow 0} \frac{1}{\sqrt{4\pi \epsilon}} e^{-\frac{-y^2}{4\epsilon}}$$

+ +

For a homogeneous function $f(x): \mathbb{R}^{2N} \rightarrow \mathbb{R}$:

+ +

$$f(ax) = a^{\alpha} f(x)$$

+ +

Denoting: $ r^2 = \sum_{j=1}^{2N} x_j^2$, the ratio of integrals:

+ +

$$\frac{\int_{\mathbb{R}^{2N}} f(x) \frac{e^{-\frac{r^2-1}{4\epsilon}}}{\sqrt{4\pi \epsilon}}d\mu_L(\mathbb{R}^{2N})}{\int_{\mathbb{R}^{2N}} r^{\alpha} \frac{e^{-\frac{r^2-1}{4\epsilon}}}{\sqrt{4\pi \epsilon}}d\mu_L(\mathbb{R}^{2N})}$$

+ +

is invariant under the scaling $x_j \rightarrow \sqrt{\frac{\epsilon}{\epsilon’}}x_j$, and the integral conserves its form with $\epsilon$ replaced by $\epsilon’$.

+ +

Therefore, the ratio of integrals is independent of $\epsilon$. By taking the limit $\epsilon = \frac{1}{4}$, we get our Gaussian integral. By taking the limit $\epsilon \rightarrow 0$, we get a delta function concentrating the measure to the spherical shell:

+ +

$$r^2=1$$

+ +

in the Euclidean space: $\mathbb{R}^{2N}$, which the integral over the $2N-1$ dimensional sphere.

+",4263,,55,,8/19/2019 15:44,8/19/2019 15:44,,,,11,,,,CC BY-SA 4.0 +7027,1,7059,,8/15/2019 13:10,,2,298,"

I would like to display two histograms next to each other, using something like matplotlib's subplot function. This doesn't seem to work because plot_histogram() closes the figure.

+ +

It is possible to show a figure that has been closed - see this post. I tried this approach but it doesn't work (see code below). Does anyone know how to do this?

+ +
figs = []
+for i in range(num):
+    counts = result.get_counts(circuits[i])
+    figs.append(plot_histogram(counts, title='here', bar_labels=True))
+    print(counts)
+plt.subplot(121)
+new_fig = plt.figure()
+new_mngr = new_fig.canvas.manager
+new_mngr.canvas.figure = figs[0]
+fig.set_canvas(new_mngr.canvas)
+plt.show(fig)
+
+plt.subplot(122)
+new_fig = plt.figure()
+new_mngr = new_fig.canvas.manager
+new_mngr.canvas.figure = figs[1]
+fig.set_canvas(new_mngr.canvas)
+plt.show(fig)
+
+",8282,,,,,8/19/2019 14:08,How to do subplots when plot_histogram etc. closes the figure,,1,3,,,,CC BY-SA 4.0 +7028,2,,6963,8/15/2019 17:55,,5,,"

Your question suggests you want to try an experiment that would only work if the no communication theorem wasn't a thing. So... just be aware of that.

+ +

In Quirk, the time-based gates are not continuously twisting the same qubit over time. Instead, every time a frame is drawn, the current time determines what the one thing the gate will do to the qubits is. When you see the state display to the right rotating, you are seeing a series of outputs that were operated on in slightly different ways (not one state being iteratively operated on and changed).

+ +

As such, the simplest way to emulate the time-based gates in Q# is to create an operation that include a time parameter, run simulations with a variety of time values, and look at the results.

+",119,,,,,8/15/2019 17:55,,,,0,,,,CC BY-SA 4.0 +7030,1,7034,,8/15/2019 20:43,,4,149,"

Classically, we have the Hamming Code, Turbo Code, Reed-Solomon Code, etc. +I am interested in knowing the classes of quantum error-correcting codes. They don't have to be analogous to classical codes, just the different classes and categories out there. Thanks!

+",7528,,55,,1/21/2021 11:04,1/21/2021 11:04,What are the Main Classes of Quantum Error-Correcting Codes?,,1,0,,,,CC BY-SA 4.0 +7032,2,,6868,8/16/2019 6:23,,1,,"

You will need to use some trickery.

+ +

SWAP gates are the conceptually easiest method. For example, let's use qubit 5 as $a_0$, and then 5, 6 and 9 as $a_1$, $a_2$ and $a_3$. Finally, let's use qubit 3 as $a_4$.

+ +

In this case, the only difficult cnot is cx(5,3), between $a_0$ and $a_4$, which cannot be implemented directly. So we could apply a SWAP gate between qubits 3 and 4, which swaps their states. Implementing cx(4,3), which is allowed by the device, then has much the same effect as cx(5,3) would have. To complete the effect, a final SWAP is applied.

+ +

Since a SWAP is implemented using three cnot gates, the above process requires 7 cnots to reproduce the effect of just one. It would therefore be good to find a more efficient option.

+ +

One possibility is the following

+ +
qc.cx(4,3)
+qc.cx(5,4)
+qc.cx(4,3)
+qc.cx(5,4)
+
+ +

The end effect of this is to perform qc.cx(5,3). It does this by making use of qubit 4. However, it does not matter what the state of qubit 4 was before the process is applied, and it leaves qubit 4 completely unchanged at the end.

+ +

A further option could be to encode the state of $a_0$ in many of the physical qubits on the device. For example, you could associate the $|0\rangle$/$|1\rangle$ state of $a_0$ with the $|000000\rangle$/$|111111\rangle$ states of qubits 1-6. Then a desired state $a |0\rangle+b|1\rangle$ would be encoded as $a |000000\rangle+b|111111\rangle$. A cnot can then be applied between this logical qubit and any of the 8 qubits it is connected to (0 and 7-13).

+",409,,,,,8/16/2019 6:23,,,,0,,,,CC BY-SA 4.0 +7033,2,,6839,8/16/2019 7:44,,2,,"

The short answer is: no.

+ +

The long answer is that only pure states can be encoded in Qiskit. However, there are ways around this. For example, by 'purifying' the state. For example, suppose you wanted the mixture

+ +

$$ +\rho = p_0 |0\rangle\langle0| + p_+ |+\rangle\langle+|. +$$

+ +

You could do this by creating the entangled state

+ +

$$ +\psi = \sqrt{p_0} |00\rangle \sqrt{p_+} |1+\rangle. +$$

+ +

In this, each term represents a term from the desired mixed state. The state of the rightmost qubit in each term corresponds to one from the desired mixture. Each term has a unique state from an orthonormal basis on the left most qubit. The amplitude for each term is the square root of the corresponding probability from the mixture.

+ +

Given these properties, the reduced density matrix for the rightmost qubit behaves exactly as the desired mixed state. We just need to leave the leftmost qubit out of any gates we perform, and not measure it at the end.

+",409,,409,,8/18/2019 11:21,8/18/2019 11:21,,,,0,,,,CC BY-SA 4.0 +7034,2,,7030,8/16/2019 8:04,,5,,"

I would say the most important classes are concatenated codes, topological codes and LDPC codes. But it depends on how one defines 'classes', as one could also talk of CSS vs non-CSS, stabilizer vs subsystem. In any case, I'll explain my three chosen 'classes'.

+ +

Concatenated codes are used in cases where we know a code that has a finite code distance (and hence finite suppression of errors), but we want arbitrarily good error suppression. For a code with one logical qubit made out of $n$ physical qubits, we can increase suppression by using $n^2$ physical qubits, then using $n$ independent instances of the code to make $n$ slightly improved logical qubits, and then using those to make another instance of the code. The end result is a single logical qubit, with better suppression than a single instance of the code could realize. This process can then be continued indefinitely.

+ +

One problem with concatenated codes is that, once you invoke many levels of concatenation, the number of qubits involved in each syndrome measurement can get very large. Topological codes are therefore seen as a great alternative, since these allow the distance to be increased arbitrarily while keeping a constant number of involved in qubits for each syndrome measurement. For example, the surface code is based on a planar lattice of qubits. Syndrome meaurements involve only closely located qubits on the lattice. The code distance is the width of the lattice, and so can be made as large as desired. Topological codes also often allow efficient and effective decoding algorithms.

+ +

For both concatenated and topological codes, you often have to pay a high price in terms of how many physical qubits make a logical qubit. The best hope for finding ways around this may come from LDPC codes. This is a large and diverse class. It includes the topological codes, but there are also codes that have very different structure. This means that finding ways to decode, and also ways to implement the logical operations required for quantum computing, can be challenging.

+",409,,409,,8/16/2019 8:08,8/16/2019 8:08,,,,3,,,,CC BY-SA 4.0 +7035,1,,,8/16/2019 8:22,,8,256,"

There is a famous paper by Childs, et al, in which it is shown that a quantum algorithm can find the name of the exit node for a certain graph in a way that is exponentially faster than any classical algorithm. This speedup assumes an oracle that tells you which nodes are connected to a given node, as well as a labelling of the nodes that prevents the exit name being deduced without navigating the graph.

+ +

In the paper, a random labelling of the nodes is used. However, this will presumably prevent the efficient implementation of an oracle.

+ +

Is there any cases for which an efficient oracle is known, that allows for the exponential speedup?

+",409,,,,,1/6/2021 1:27,Oracle for welded tree walk,,1,0,,,,CC BY-SA 4.0 +7037,1,7063,,8/16/2019 16:06,,9,1687,"

I am trying to understand Grover's algorithm. I read that this algorithm is able to find an entry in an unsorted list in just $\sqrt N$ steps, and needs only $\log N$ space.

+ +

I understand entanglement and superposition, and I also understand most parts of Shor's Algorithm. When it comes to Grover's algorithm, I often read that this algorithm uses an oracle. But as far as I understand, oracles do not really exist. They are used to describe hypothetical nondeterministic machines. But quantum computers do exist. The algorithm running on a real quantum computer will not really use a clairvoyant ghost who knows things nobody can know at this time.

+ +

So, how does it work?

+ +

I do not want to read scientific papers that deal with all the details. I just want a brief but correct overview.

+ +

Let's use an example: All 7 books about Harry Potter contain approximately 1 million words ($N = 1.000.000$). I want to know if the word ""teapot"" exists in one of the Harry Potter books, and if so, I want to get the position of at least one occurrence within the text.

+ +

If the word doesn't exist in the text, it will take me 1 million comparisons on a normal computer, i.e. 1 million steps. Grover will need only $\sqrt N = 1000$ steps to search through a list of $N = 1.000.000$ unsorted words. How?

+ +
+ +

Addendum

+ +

(reaction to comments)

+ +

I am not interested in an explanation about how the oracle works. I do not believe in fairies, elves or oracles. I believe in mathematics and physics. Oracles came into computer science when someone wanted to explain how nondeterministic machines like nondeterministic pushdown automatons will work. But nondeterministic machines do not exist in the real world. Even quantum computers aren't nondeterministic. So, there is no need to use fantasy beings with superpowers to explain quantum computers, since quantum computers do exist while wizards, magicians and oracles don't.

+ +

What I want is an explanation of grover's algorithm that uses only things that really exist in reality, i.e. quantum bits, superposition, entanglement, unitary operators etc. plus all the classic parts that still will be needed to sum up to the full algorithm.

+ +

And please use my Harry Potter example. If it's easier for you, let's assume that the word ""teapot"" exists exactly one times in the whole story, so that we know that there is exactly 1 needle in the haystack.

+ +

One thing that I do not understand, is this: How can the algorithm read all seven harry potter books (the complete haystack) and tell where exactly the word ""teapot"" is written using a number of steps that is proportional to the square root of the input length? How can the algorithm even read an input of $N$ items in a time proportional to $\sqrt N$?

+ +
+ +

Addendum II

+ +

I have learned form Norbert's Answer that Grover's Algorithm is unable to search for items in a database (like words in a list of words). So, what can it be used for? Norbert suggested, that Grover's Algorithm might give a square-root speed up for brute-force algorithms used to solve NP-Problems.

+ +

Traveling Salesmen is a problem in NP. How can you use Grover's Algorithm to find the shortest path?

+ +

If Traveling Salesman is not feasible, please use any other NP problem as an example, and please explain, how Grover's Algorithm can be used to solve it.

+ +

I still want to have a brief explanation of Grover's Algorithm (i.e. Grover's algorithm in a nutshell) but didn't get a sufficient answer yet.

+",8294,,8294,,8/18/2019 7:33,9/29/2019 4:08,Grover's algorithm in a nutshell,,3,14,,,,CC BY-SA 4.0 +7038,1,7039,,8/16/2019 22:29,,1,156,"

Wikipedia states that a controlled U gate maps the basis states to the following:

+ +

$$ + |00\rangle \mapsto |00\rangle\\ + |01\rangle \mapsto |01\rangle\\ + |10\rangle \mapsto |1 \rangle \otimes U |0 \rangle = |1 \rangle \otimes \left(u_{00}|0 \rangle + u_{10}|1 \rangle\right)\\ + |11\rangle \mapsto |1 \rangle \otimes U |1 \rangle = |1 \rangle \otimes \left(u_{01}|0 \rangle + x_{11} | 1 \rangle\right)$$

+ +

I am wondering how was this mapping derived?

+ +

I have looked at Nielsen and Chuang - Quantum Computation and Information 10$^{th}$; but I wasn't able to find the derivation process.

+ +

Thanks!

+",7528,,55,,8/18/2019 14:55,8/18/2019 14:55,How to derive the way a controlled $U$ gate acts on an input state?,,1,0,,,,CC BY-SA 4.0 +7039,2,,7038,8/16/2019 23:44,,4,,"

It is not a derived mapping, it's the mathematical version of the definition of how a controlled gate works: it does nothing to the second qubit if the first qubit is $|0\rangle$, and applies the unitary $U$ to the second qubit if the first qubit is $|1\rangle$.

+",2879,,,,,8/16/2019 23:44,,,,1,,,,CC BY-SA 4.0 +7040,1,,,8/17/2019 6:46,,3,261,"

As per IBM's documentation for quantum circuits, the general unitary operator is defined as:

+ +

$$\hat{U}=\begin{bmatrix}\cos(\frac{\theta}{2})&-e^{i\lambda}\sin(\frac{\theta}{2})\\e^{i\phi}\sin(\frac{\theta}{2})&e^{i\phi+i\lambda}\cos(\frac{\theta}{2})\end{bmatrix}$$

+ +

For a better understanding I was working out the algebra with the given constraints ($\hat{U}^{\dagger}\hat{U}$, $0\leq\theta\leq\pi$, and $0\leq\phi\leq2\pi$), but I didn't find any step that required a constraint on the sign of $a$ and $b$ (rows 1 and 2 of the second column, respectively) such that $a$ is negative and $b$ is positive. +That said, is it not true that the true general form is:

+ +

$$\hat{U}=\begin{bmatrix}\cos(\frac{\theta}{2})&\pm e^{i\lambda}\sin(\frac{\theta}{2})\\e^{i\phi}\sin(\frac{\theta}{2})&\mp e^{i\phi+i\lambda}\cos(\frac{\theta}{2})\end{bmatrix}$$

+ +

or am I missing some constraint?

+",8295,,55,,8/20/2019 10:21,8/20/2019 10:21,Does the general form of a unitary operator define strict signs for the second column?,,1,3,,,,CC BY-SA 4.0 +7041,1,,,8/17/2019 7:41,,5,2438,"

When I perform $2$ Hadamard $H$ gates on a single qubit, why is the probability of getting $0$ as the outcome 100%? Why is it not 50% 0 and 50% 1 + instead?

+ +

Why is the second $H$ gate not putting the input from the first $H$ gate into a superposition state?

+",8296,,55,,8/18/2019 17:04,8/19/2019 22:47,How do 2 Hadamard gates act on a single qubit?,,3,1,,,,CC BY-SA 4.0 +7042,2,,7041,8/17/2019 9:49,,-1,,"

An $H$ gate doesn't always create superposition. It just rotates all statevectors by 45°. So, when you have a state that is colinear to a component of the vector basis, and you measure it, this state vector always will collapse to the basis vector to which it is colinear, and so you will measure this state with a probability of 100%.

+ +

Then you rotate the vector by 45° (this is what the $H$ operator does). When you measure it now, it will collapse to both basis vectors with the same probability (i.e. 50%). So you will measure it as often as 0 as 1. This is what we call a superposition of both states. The qubit is not in one of both states, but exactly in between.

+ +

Then you rotate if again by 45°, which in sum gives 90°. If your original state was colinear to 1, then now it is colinear to 0 vice versa. When you measure it now, it can't do anything else but collapse to the basis vector to which it is colinear now. So, the probability to measure this new state (which is exactly the negation of the original state) is exactly 100%.

+",8294,,55,,8/19/2019 11:08,8/19/2019 11:08,,,,3,,,,CC BY-SA 4.0 +7043,1,7046,,8/17/2019 13:38,,7,337,"

The diamond norm distance between two operations is the maximum trace distance between their outputs for any input (including inputs entangled with qubits not being operated on).

+ +

Is it the case that the Diamond norm is subadditive under composition?

+ +

$$\text{Diamond}(U_1 U_2, V_1 V_2) \stackrel{?}{\leq} \text{Diamond}(U_1, V_1) + \text{Diamond}(U_2, V_2)$$

+",119,,124,,8/19/2019 16:10,8/19/2019 16:10,Is the diamond norm subadditive under composition?,,1,8,,,,CC BY-SA 4.0 +7045,2,,7037,8/17/2019 23:12,,4,,"

As this seems a recurring question, let me repeat my answer from Physics.SE:

+
+

This seems to be a common misunderstanding about Grover's algorithm. It is not about querying a magically encoded database. Rather, you have an efficiently computable function $f(x)\in\{0,1\}$ and you want to find some $x_0$ for which $f(x_0)=1$. Since you know how to realize $f(x)$ (i.e., you have a circuit), you can run $f$ on a quantum computer and use Grover to find such an $x_0$. This function can be seen as returning entries of a "database", which is encoded in a specific function, though I don't particularly like this picture.

+

The relevance is in the fact that a large number of interesting problems (namely, the class NP) are such that solutions might be hard to find, but they are easy to verify. Thus, Grover gives a square-root speed-up on any brute-force method to solve such a problem (i.e., any method which does not make use of any special structural property of $f$).

+
+

Differently speaking, Grover's algorithm is not, I repeat not, about searching Harry Potter books or the like. It is about speeding up finding solutions of unstructured NP problems (or problems where one does not know the structure), i.e. where the validity of a solution can be checked. This is often called a "search problem", but is has nothing to do with "databases" as we would usually think of them, and is thus not applicable to Harry Potter.

+",491,,-1,,6/18/2020 8:31,8/18/2019 0:18,,,,12,,,,CC BY-SA 4.0 +7046,2,,7043,8/18/2019 15:54,,6,,"

For arbitrary linear super-operators $U_j$ and $V_j\def\D{\mathrm{Diamond}} \def\Dn#1{\lVert #1 \rVert_\diamond}\def\le{\leqslant} $, we have +$$\def\D{\mathrm{Diamond}} \def\Dn#1{\lVert #1 \rVert_\diamond}\def\le{\leqslant} \begin{aligned} +\D(U_1 U_2, V_1 V_2) +&= \Dn{U_1 U_2 - V_1 V_2} +\\&\le \Dn{U_1 U_2 - V_1 U_2} + \Dn{V_1 U_2 - V_1 V_2} +\\&= \Dn{(U_1 - V_1) U_2} + \Dn{V_1(U_2-V_2)} +\\&\le \Dn{U_1 - V_1} \Dn{U_2} + \Dn{V_1} \Dn{U_2 - V_2}, +\end{aligned}$$ +writing compositions by juxtaposition for brevity. +In the case that $U_j$ and $V_j$ are CPTP maps, we have $\Dn{U_j} = \Dn{V_j} = 1$, so that +$$\begin{aligned} +\D(U_1 U_2, V_1 V_2) +&\le +\Dn{U_1 - V_1} \Dn{U_2} + \Dn{V_1} \Dn{U_2 - V_2} +\\&= \Dn{U_1 - V_1} + \Dn{U_2 - V_2} +\\&= +\D(U_1,V_1) + \D(U_2,V_2).\end{aligned}$$

+",124,,124,,8/18/2019 17:20,8/18/2019 17:20,,,,2,,,,CC BY-SA 4.0 +7047,2,,7040,8/18/2019 16:07,,2,,"

See this other answer of mine for a full derivation of the general form of a unitary $2\times2$ matrix.

+ +

As shown there, unitary matrices (notice I'm not imposing a constraint on the determinant here) can be written as +$$U=\begin{pmatrix}e^{i\alpha_{11}}\cos\theta& e^{i\alpha_{12}}\sin\theta\\ +e^{i\alpha_{21}}\sin\theta & e^{i\alpha_{22}}\cos\theta +\end{pmatrix},\tag A$$ +with the parameters $\alpha_{ij}$ satisfying the condition +$$\alpha_{11}-\alpha_{12}=\alpha_{21}-\alpha_{22}+\pi.\tag B$$

+ +

There are then many different ways to choose how to write these coefficients. This freedom mostly arises from the fact that a global phase change of the matrix doesn't change anything in the physics, and thus $U\simeq e^{i\phi}U$ for any $\phi\in\mathbb R$.

+ +

One relatively standard way to fix a notation is to fix the determinant. In the above notation, this determinant reads +$\det U=e^{i(\alpha_{11}+\alpha_{22})}$, +where I've used (B) and standard trigonometry to simplify the coefficients. +Imposing $\det U=1$ thus corresponds to the constraint $\alpha_{11}+\alpha_{22}=0$ (or $2k\pi$ for $k$ integer of course, but nothing changes if we pick $k>0$ here). Using this again in (B) then also implies $\alpha_{21}+\alpha_{12}=-\pi$.

+ +

With this added constraint, the $U$ now reads +$$U=\begin{pmatrix}e^{i\alpha_{11}}\cos\theta& e^{i\alpha_{12}}\sin\theta\\ +-e^{-i\alpha_{12}}\sin\theta & e^{-i\alpha_{11}}\cos\theta +\end{pmatrix}.$$ +Equivalently, I can say that a general SU(2) matrix has the form +$$U=\begin{pmatrix}x& y\\ -\bar y & \bar x\end{pmatrix},\tag C$$ +with $x,y\in\mathbb C$ satisfying $|x|^2+|y|^2=1$.

+ +

Now, if I want to describe a general unitary matrix, and not just one with unit determinant, I can simply write $U=e^{i\phi}(e^{-i\phi}U)$ where $\det U=e^{2i\phi}$ (remember that the determinant of a unitary matrix is always a phase). Then, $\tilde U\equiv e^{-i\phi}U$ has unit determinant (remember that $\det(\lambda U)=\lambda^2 \det U$), and can thus be written as per (C).

+ +

Putting the above results together, we conclude that a generic unitary matrix has the form +$$e^{i\varphi}\begin{pmatrix}x & y\\ -\bar y& \bar x\end{pmatrix},\tag D$$ +with the additional constraint $|x|^2+|y|^2=1$, and arbitrary phase $\varphi\in\mathbb R$.

+ +

What is nice about (D) is that it gives us a pretty straightforward recipe to figure out how the minuses and other phases should be placed: simply put out phases from the matrix in order to make it into a unit-determinant one, and then verify that what is left looks like (C).

+ +

Applying this to your example, we get +$$\begin{pmatrix}\cos(\frac{\theta}{2})&-e^{i\lambda}\sin(\frac{\theta}{2})\\e^{i\phi}\sin(\frac{\theta}{2})&e^{i\phi+i\lambda}\cos(\frac{\theta}{2})\end{pmatrix}= +e^{i(\phi+\lambda)/2} +\begin{pmatrix}e^{-i(\phi+\lambda)/2}\cos(\frac{\theta}{2})&-e^{i(-\phi+\lambda)/2}\sin(\frac{\theta}{2})\\e^{i(\phi-\lambda)/2}\sin(\frac{\theta}{2})&e^{i(\phi+\lambda)/2}\cos(\frac{\theta}{2})\end{pmatrix},$$ +which therefore looks like it should. +It is also worth noting here that this is not a general parametrisation of a $2\times 2$ unitary matrix. Global phase aside, a general parametrisation involves three parameters, not two. It is, however, a general parametrisation of unit determinant unitaries, identifying $U\sim e^{i\alpha}U$.

+",55,,,,,8/18/2019 16:07,,,,0,,,,CC BY-SA 4.0 +7048,2,,7041,8/18/2019 17:06,,4,,"

Most probably because your input state was $|0\rangle$.

+ +

The Hadamard gate has the property that $H^2=I$, thus acting on an arbitrary input $|\psi\rangle$ with the Hadamard gate twice in a row results in the output being identical to the input (that is, $|\psi\rangle$).

+",55,,55,,8/19/2019 11:09,8/19/2019 11:09,,,,0,,,,CC BY-SA 4.0 +7049,1,,,8/18/2019 18:29,,4,145,"

Scott Aaronson gives the outline of an algorithm to evaluate whether there exists a satisfying assignment for a given game tree. The idea is to use Grover's search recursively, for each level of the tree. He notes the following problem with this approach.

+ +
+

The problem is that, as the game tree gets deeper and deeper, the + advantage of Grover’s algorithm over classical search ​seems​ to get + weaker and weaker, for two reasons: first, the amplification that’s + needed at each layer to prevent error buildup, and second, the + constant factors, which multiply across the layers. Note that each + layer actually needs to run Grover’s algorithm on the layer below it + ​twice:​

+ +
    +
  • Once to do $ |​x\rangle​ \rightarrow |​x\rangle​ |​f(​x​​)\rangle $
  • +
  • And once to uncompute garbage.
  • +
+ +

For this reason, the constant factor $\frac{\pi}{4}$, in the + running time of Grover’s algorithm, actually becomes $\frac{\pi}{2}$, and $\frac{\pi}{2} > 1$.

+
+ +

I don't understand what garbage we are trying to uncompute here. Don't we need to perform some kind of a measurement after the first step which obviates the need to uncompute anything? Can someone explain this approach with a short example (perhaps a depth-2 or a depth-3 game tree)?

+",1351,,1351,,8/19/2019 3:02,8/19/2019 3:02,Grover's algorithm for game tree,,0,0,,,,CC BY-SA 4.0 +7050,1,,,8/18/2019 20:42,,2,149,"

From what I read classical computing evolved so quickly because of the funding-applications cycle. Even though the cost to make denser IC's was increasing rapidly, the applications were also getting better and wider so people put lot more money. Thus they were able to scale well with Moore's law. We need to build such a cycle for Quantum computing since it won't happen naturally as we can't expect quantum supremacy to be the first step that draws a ton of money.

+ +

So I was wondering how could I build applications for NISQ's or any basic few qubit systems practically implemented. For example what is the software that I can help build right now ? What kind of software are people looking for ? What has already been done and what can be done in next year or so ?

+",8306,,,,,9/17/2019 19:52,Software for Quantum Computing,,2,0,,,,CC BY-SA 4.0 +7051,2,,6958,8/19/2019 0:57,,0,,"
+

Superconducting qubits generally have frequencies within the range of 4 - 8 GHz. What design considerations give the upper and lower bounds for what is a feasible design. I.e., why can't they be higher or lower in frequency? [and from a comment]: ""... what about the lower bound?""

+
+ +

The size of the components, their spacing, and materials determine a reasonable operating frequency range, while the minimum wavelength is twice the lattice spacing.

+ +
+ +

From: ""Microwave photonics with superconducting quantum circuits"" (Nov 2017), by Xiu Gua, Anton Frisk Kockum, Adam Miranowicz, Yu-xi Liu, and Franco Nori:

+ +
+

""A basic requirement for the SQCs to function as artificial atoms is the anharmonicity of their energy-level spacing. Josephson junctions play an important role in SQCs because of the strong nonlinearity they provide, which is the key to making superconducting artificial atoms anharmonic.

+ +

...

+ +

A Josephson junction is made of two superconducting electrodes, separated by a thin insulating film (with typical thickness of 1–3 nm) in a sandwich structure, giving rise to an intrinsic capacitance. Cooper pairs, formed by two bound electrons, with opposite spins, in the superconducting electrodes, can tunnel coherently through the insulating barrier one by one.

+ +

...

+ +

In a given SQC, we can thus select the two lowest-energy levels from the non-equally spaced energy spectrum. These two levels form a quantum bit (qubit) for quantum-information processing.

+ +

When an ac voltage is applied to the two electrodes of the Josephson junction, the supercurrent $I$ is periodically modulated as $I=I_csin(ωt+ϕ)$ with the Josephson frequency $ν=ω∕(2π)=2eV∕h$. This is called the ac Josephson effect. The energy $hv$ equals the energy change of a Cooper pair transferred across the junction. The voltage applied to a Josephson junction is typically on the order of a few microvolts. Thus, SQCs are usually operating at frequencies in the microwave regime."".

+
+ +

From: ""Superconducting Qubits: Current State of Play"" (July 26 2019), by Morten Kjaergaard, Mollie E. Schwartz, Jochen Braumüller, Philip Krantz, Joel I-Jan Wang, Simon Gustavsson, and William D. Oliver, on page 5:

+ +
+

""... being only a few percent of the qubit level spacing

+ +

$$\omega_q/2\pi \equiv \omega_{01}/2\pi \sim 5 \text{GHz} +$$

+ +

For single-junction transmons (see Fig. 2(b)), this frequency is + set by the size of the shunt capacitor and the critical current $I_c$ of the Josephson junction, determined by design and fabrication parameters such as materials choice, junction area, and insulator thickness. Replacing the single Josephson junction by a superconducting loop with two junctions in parallel – a dc-SQUID – enables one to tune the effective critical current of the Josephson junction (and hence the qubit frequency) via a magnetic field applied to the dc-SQUID loop. The trade-off for this additional control knob is that the qubit becomes susceptible to magnetic flux noise. + Transmon qubits can be coupled capacitively – either directly or as mediated by a resonator “bus” – which, in the natural eigenbasis of the transmon qubits, lead to a two-qubit interaction term ..."".

+
+ +

Wikipedia: Harmonic oscillators lattice: phonons:

+ +
+

""The form of the quantization depends on the choice of boundary conditions; for simplicity, we impose periodic boundary conditions, defining the $(N + 1)th$ atom as equivalent to the first atom. Physically, this corresponds to joining the chain at its ends. The resulting quantization is

+ +

$$k=k_{n}={2n\pi \over Na}\quad {\hbox{for}}\ n=0,\pm 1,\pm 2,\ldots ,\pm {N \over 2}.$$

+ +

The upper bound to $n$ comes from the minimum wavelength, which is twice the lattice spacing $a$, as discussed above."".

+
+ +

Additional Information:

+ + +",278,,,,,8/19/2019 0:57,,,,3,,,,CC BY-SA 4.0 +7052,2,,7050,8/19/2019 1:13,,1,,"

You can participate in and contribute to open-source Qiskit.

+ +

You can write tools to work with Qiskit and/or other development kits, e.g., my qis_job which makes it easy to run a .qasm file right away.

+ +

You can write your own toys! See my quantum_yiqing.

+",7744,,7744,,8/19/2019 1:55,8/19/2019 1:55,,,,0,,,,CC BY-SA 4.0 +7054,1,10210,,8/19/2019 8:20,,5,197,"

Quantum depth-2 circuits can be efficiently simulated classically, as shown in Proposition 2 of this paper. The following is a quote of the proof.

+ +
+

After the first time step the quantum state of the circuit consists of + a set of 2-qubit entangled states and possibly some 1-qubit states and + thus the amplitudes of this state can be efficiently represented + classically. We may consider the second computing step and the final + measurement step as one single step in which a set of final + measurements are performed in arbitrary 2-qubit bases. We pick a first + measurement. It is simple to calculate the probabilities for the + various outcomes since they depend on the state of no more than four + qubits. We flip coins according to the outcome probabilities and fix + the outcome. We replace the 4-qubit state by the post-measurement + projected state consisting now of 2 qubits. We pick the next + measurement and proceed similarly etc. If only a subset of these + measured bits are required as output, the rest are simply discarded.

+
+ +

I don't understand the proof. I get how the first time step can be efficiently simulated as it only consists of disjoint one/two qubit gates.

+ +

But what about the second time-step? Why do the measurement outcomes depend on no more than four qubits? Why is it efficient to classically simulate measurement by an arbitrary two qubit basis? I'm not sure how we can simulate the conditional probabilities by putting in the projectors.

+ +

The authors also remark that adding another layer will break this simulation protocol. I’m not sure why that is the case.

+",1351,,9006,,3/17/2020 8:19,3/21/2020 16:47,Simulating depth-2 circuits,,2,1,,,,CC BY-SA 4.0 +7055,1,7058,,8/19/2019 9:23,,3,744,"

I'm trying to reproduce the results of this article https://arxiv.org/abs/1801.03897, using Qiskit and Xanadu PennyLane.

+ +

Particularly, this part with expected values of the Pauli operators: +

+ +

For Ansatz circuit from the mentioned article

+ +

+ +

I can get the same results for $\langle Z_0 \rangle$ and $\langle Z_1 \rangle$ but not for $\langle X_0X_1 \rangle$, $\langle Y_0Y_1 \rangle$. I calculate expected values in the following way:

+ +

$$\langle Z_0 \rangle = P(q_0=0)-P(q_0=1),$$ +$$\langle Z_1 \rangle = P(q_0=0)-P(q_0=1).$$

+ +

And for a product of the Pauli matrices: +$$\langle X_0X_1 \rangle = [P(q_0=0)-P(q_0=1)]*[P(q_1=0)-P(q_1=1)],$$ +$$\langle Y_0Y_1 \rangle = [P(q_0=0)-P(q_0=1)]*[P(q_1=0)-P(q_1=1)],$$

+ +

where $P(q_0=0)$ is probability of getting qubit 0 in state $|0\rangle$ and $P(q_0=1)$ is probability of getting qubit 0 in state $|1\rangle$.

+ +

In Qiskit for $\langle X_0X_1 \rangle$, $\langle Y_0Y_1 \rangle$ I use pre-measurement single-qubit rotations $H$ and $R_x(-\pi/2)$ respectively.

+ +

Help me understand, where I could make a mistake?

+",6071,,371,,8/18/2020 8:56,8/18/2020 8:56,Expected value of a product of the Pauli matrices in different bases,,1,0,,,,CC BY-SA 4.0 +7058,2,,7055,8/19/2019 12:57,,3,,"

Your expressions for $\langle X_0X_1 \rangle$ and $\langle Y_0Y_1 \rangle$ are correct under the assumption that the two qubits are independently random. In the case that they are correlated, these expressions will not yield the right answer.

+ +

This is because you have to think of $X_0X_1$, for example, as an operator in its own right, rather than just a combination of $X_0$ and $X_1$. This combined operator has eigenvalue $+1$ for any superposition of $|++\rangle$ and $|--\rangle$, and eigenvalue $-1$ for any superposition of $|+-\rangle$ and $|-+\rangle$. The expectation value is therefore

+ +

$$\langle X_0X_1 \rangle = P(q_0=0, q_1=0)+P(q_0=1, q_1=1)-P(q_0=0, q_1=1)-P(q_0=1, q_1=0).$$

+",409,,,,,8/19/2019 12:57,,,,0,,,,CC BY-SA 4.0 +7059,2,,7027,8/19/2019 14:08,,2,,"

~Moved from comment to answer~

+ +

If stopping plot_histogram() from closing the figure will fix this issue, then there is a way to do just that. If you go into the qiskit code to qiskit/visualization/counts_visualization.py you will find the plot_histrogram() method. Near the end of this method, you will see the conditional statement

+ +
if fig: 
+    plt.close(fig)
+
+ +

If you comment that out, it should stop automatically closing the figure when you call plot_histogram().

+",6180,,,,,8/19/2019 14:08,,,,0,,,,CC BY-SA 4.0 +7060,2,,7041,8/19/2019 16:07,,6,,"

If you apply the same gate twice on a state $|\psi\rangle$ you will get out the state $|\psi\rangle$ if the hermitian of the gate is the same as the gate. In your case, you applied the Hadamard gate, $H$, twice on (presumably) the $|0\rangle$ state, and so you got $|0\rangle$ as your result.

+ +

This happens because it is a requirement for quantum computing that gates be unitary. A unitary matrix $U$ is defined as a matrix where $$UU^\dagger = I$$ where $I$ is of course the identity matrix. Let's do $H^\dagger$ real quick: that requires doing the transpose of the matrix (i.e., flipping the elements across the diagonal), and then the complex conjugate of each of the elements. There's no complex numbers in the matrix, so we don't need to worry about that - and doing the transpose just means flipping $1$ and $1$. So $H^\dagger = H$.

+ +

So when you apply $H$ twice to your state, you are effectively doing $HH$ - and it is a requirement that this come out to $I$. $I$ is literally defined as a matrix where $$XI=X$$So here's what you are doing: $$HH|\psi\rangle $$ and we know that $HH = I$, so you are doing $$I|\psi\rangle $$ and we know that any thing multiplied by $I$ gives itself so you just get out $$|\psi\rangle$$

+ +

Hopefully this answers your question.

+",91,,91,,8/19/2019 22:47,8/19/2019 22:47,,,,3,,,,CC BY-SA 4.0 +7061,2,,4576,8/20/2019 11:08,,4,,"

I think that ahelwer's answer touches on some the ways that we think about the complexity of algorithms. However — given that we don't literally have "oracles" in the real world which we wish to query, you might wonder why we would worry about query complexity, or the idea of oracles at all. I will try to give some perspective on this, and in particular to describe how you might try to think of ways to construct a "Deutsch–Jozsa oracle" in a way that you don't feel as though you're cheating.

+

(As Norbert Schuch points out, for the Deutsch problem which is the elementary case of Deutsch–Jozsa, there's not much scope for insights, but I expect that your question about oracles applies more generally as well. That's what I'll speak to here.)

+

An intuition about oracles

+

The concept of an oracle is a way to allow ourselves to simplify how we talk about computational problems.

+

The original application of the concept of an oracle was to consider hypothetically what we could do if we could solve difficult problems, even impossible problems, without committing to how we could do it even in principle. But in computational complexity these days — particularly in quantum computation, e.g. in the cases of Deutsch–Jozsa, Bernstein–Vazirani, and other oracle problems — the situation is different: the oracle describes a function which is the basis of the problem. The fact that it is 'an oracle' is a way to structure how we describe the function which is at the centre of the problem: not that we must never contemplate how the function is computed, but that this information is simply not provided as part of the problem, and that we are not concerned with the time or other complexity associated with that function.

+

When we take this approach, we can actually obtain answers which are related to very difficult questions in computation. For instance, you may know that we do not know how to prove either P ≠ NP or P = NP, but that we can show that there are oracles A such that we can show that PA ≠ NPA. What the oracle A does here is not help a computer (more precisely, a deterministic Turing machine or a nondeterministic Turing machine) to solve a problem — it represents the problem which the computer must solve. The fact that we can show in some instances that PA ≠ NPA, doesn't mean that P is really different from NP: it just means that just using nondeterminism is really a significant resource for a model of computation to have — it allows you to solve some problems efficiently, and there is no way generically to simulate nondeterminism efficiently on a deterministic computer. So if you want to solve the problem related to what A computes, you absolutely would require some information about the structure of any function which could efficiently compute A.

+

This is one of the main things that oracles are about: they allow you to talk about ways that models of computation can or cannot solve problems, when you are provided with limited information about the problem.

+

Using oracle algorithms to solve non-oracle problems

+

The Deutsch–Jozsa algorithm, or the Bernstein–Vazirani algorithm, are in principles not algorithms which one performs for their own sake. (Well, not really — see the next Section.) They stand for ways that you can solve a problem. What problems do they solve? They allow you to discover certain features of a function you're interested in — whether it is constant/balanced, or what vector is associated in some scalar-valued linear function on vectors.

+

What functions do you perform them on? — You perform them on any function for which you are interested in the answer.

+

The description of these as oracle-based algorithms is beside the point. The oracle problems basically allow you to know that, with an ideal quantum computer, you can solve the problem even if you know extremely little about the function, provided that you can actually evaluate the function efficiently in practise. To actually evaluate such a function, of course you will need some description of how to do so, and so you have more information than in the oracle setting; but that doesn't prevent you from using the same algorithm.

+

What happens when you have more information than in the oracle setting, is that suddenly there are other ways that you might be able to solve the problem. Specifically, it might become possible to solve the problem efficiently classically. (This is the same observation as with PA ≠ NPA: it proves that there are problems which are in NP, which any efficient deterministic algorithm would at least require actual structural information to be able to solve — so that when you provide a description of an efficiently computable function rather than an 'oracle', it is possible that the problem will be in P.) It means that the quantum algorithm might not have the same advantage over classical algorithms at solving the particular problem you present — and in fact it may be that the classical approach is better (particularly with the devices we have at the moment).

+

In the end, just because you have a quantum algorithm to solve something, doesn't mean that it is necessarily the best way to solve something. This is certainly true of the Deutsch–Jozsa algorithm: even in the oracle setting, using randomness is nearly just as good, and it's much better given that we don't have large reliable quantum computers yet! But then again...

+

"Implementing" an oracle

+

The purpose of implementing the Deutsch–Jozsa algorithm is the same as implementing "Hello, World!" — not to solve a pressing unsolved problem, but to practise using a tool which you expect will be useful for doing other things.

+

To practise coding, you should feel absolutely relaxed and comfortable with the idea of implementing an oracle, and with the idea of the computer evaluating the oracle. In principle, this is the point of what you want to do. Even if you are using a classical emulator, in which the classical computer is actually evaluating all branches of the superposition and so explicitly finding the answer to a problem in order to pretend that it is a quantum computer acting in a slightly more roundabout way, so be it — you are practicing how to use a tool which may be useful for other things, and which one day won't be run on a classical computer.

+

So how should you go about implementing your oracle?

+

(i) If you are really committed to the idea that you are just getting practise, you don't have to pretend that you are doing anything magical. Come up with just any way to implement the oracle function, even if it is blatantly obvious to the casual observer whether the result is constant or balanced. You're just trying to practise realising an algorithm — don't worry that someone will accuse you of being an impostor, that you're pretending to cure cancer but are actually playing with Lego. You never were pretending to cure cancer, and you are playing with Lego by deliberate choice. Embrace that and just do it.

+

(ii) If you want to be sure that you aren't cheating somehow (nor the emulator, nor the eventual quantum computer), try to find a way to construct your oracle so that it is difficult to tell whether it is balanced or constant. This itself is not necessarily easy to do. It would be natural to try to do this by describing a function $f(x) = g(x,r)$ for some hidden parameter $r$, but coming up with a function $g(x,r)$ which is either constant or balanced for the evaluation of $x$, for any (or most?) values of $r$, and where it isn't obvious how to solve it classically, is non-trivial.

+
    +
  • For instance, you could let $g(x,r) = x \cdot r$ for $x,r \in \{0,1\}^n$, and consider a circuit which straightforwardly evaluates $g(x,r)$ on an auxiliary qubit. In this case, we would then know that $f(x)$ is either constant or balanced. However, the reason why we know this is because $f(x)$ is obviously balanced if and only if $r \ne 0$, and we could tell that easily from the circuit construction.

    +
  • +
  • It is conceivable that the above construction could be elaborated / obfuscated somewhat, to obtain a construction which is guaranteed to evaluate either a constant function or a balanced function, and where which of these two occurs is not obvious or even difficult — but I can't think of how, at the moment.

    +
  • +
+

Bear in mind that this actually be very difficult to do — but if you can see a way to do it, it could be very worthwhile: Bravyi, Gossett, and Koening did something like this for the Bernstein–Vazirani problem, and it allowed them to show a small but unconditional separation between quantum and classical complexity, which was one of the more interesting things to occur in quantum complexity in the past several years.

+

TL;DR

+
    +
  • Don't sweat over the fact that you're 'evaluating' an oracle.

    +
  • +
  • If you sweat over anything, only worry that an actual description of the function might make it possible to solve the same problem easily without a quantum computer.

    +
  • +
  • If your motivation is only to get practise with quantum programming, don't even worry about that. Save your worrying for worthier problems, like global warming. In the meantime enjoy playing with Legos while you build to something more.

    +
  • +
+",124,,2927,,6/18/2022 14:40,6/18/2022 14:40,,,,0,,,,CC BY-SA 4.0 +7062,1,7122,,8/20/2019 18:58,,8,620,"

In Quantum Machine Learning for data scientists, Page 34 gives an algorithm to calculate the distance between two classifical vectors. As mentioned in this question, it is not clear how the SwapTest is done and used to derive the distance. One answer from @cnada suggested that the swap is on the ancilla qubit only, per the original paper Quantum algorithms for supervised and unsupervised machine learning. However, the SwapTest was not designed on partial inputs.

+ +

I try to adapt SwapTest (on Page 33 of Quantum Machine Learning for data scientists) to derive as follows (by updating formula 131 with a minus sign, per the same answer from @cnada above), but cannot find the distance from the measurement at all.

+ +

First, initialize per DistCalc: +$$ |\psi\rangle = \frac{1}{\sqrt{2}} (|0,a\rangle + |1,b\rangle) $$ +$$ |\phi\rangle = \frac{1}{\sqrt{Z}} (|a||0\rangle - |b||1\rangle) $$ +Also let: +$$ |\psi'\rangle = \frac{1}{\sqrt{2}} (|a,0\rangle + |b,1\rangle) $$ +Note that $\psi'$ is a valid (normalized) qubit as it can be obtained by swapping qubits from $|\psi\rangle$.

+ +

Now, initialize per SwapTest: +$$ | 0, \psi, \phi \rangle = \frac{1}{\sqrt{2Z}} (|a|| 0,0,a,0\rangle - |b|| 0,0,a,1\rangle +|a|| 0,1,b,0\rangle - |b|| 0,1,b,1\rangle $$

+ +

Apply Hadamard gate on first qubit: +$$ | 0, \psi, \phi \rangle = \frac{1}{2\sqrt{Z}} (|a|| 0,0,a,0\rangle + |a|| 1,0,a,0\rangle - |b|| 0,0,a,1\rangle -|b|| 1,0,a,1\rangle$$ +$$+ |a|| 0,1,b,0\rangle+|a|| 1,1,b,0\rangle - |b|| 0,1,b,1\rangle - |b|| 1,1,b,1\rangle ) $$

+ +

Apply Swap gate on the ancilla qubit of $\psi$ (before $a$ or $b$) and the only qubit on $\phi$ (after $a$ or $b$): +$$ | 0, \psi, \phi \rangle = \frac{1}{2\sqrt{Z}} (|a|| 0,0,a,0\rangle + |a|| 1,0,a,0\rangle - |b|| 0,1,a,0\rangle -|b|| 1,1,a,0\rangle$$ +$$+ |a|| 0,0,b,1\rangle+|a|| 1,0,b,1\rangle - |b|| 0,1,b,1\rangle - |b|| 1,1,b,1\rangle ) $$ +$$= \frac{1}{\sqrt{2Z}} (|a|\frac{| 0 \rangle+| 1 \rangle}{\sqrt{2}}| 0 \rangle - +|b|\frac{| 0 \rangle+| 1 \rangle}{\sqrt{2}}| 1 \rangle)(| a,0 \rangle+| b,1 \rangle)$$

+ +

Apply Hadamard on first qubit: +$$ \frac{1}{\sqrt{2Z}} (|a|| 0,0 \rangle - +|b|| 0,1 \rangle)(| a,0 \rangle+| b,1 \rangle)$$

+ +

Measure on first qubit to get probability in getting first qubit in $| 0 \rangle$: +$$ \vert \frac{1}{\sqrt{2Z}} (|a|\langle 0| 0,0 \rangle - +|b|\langle 0| 0,1 \rangle)(| a,0 \rangle+| b,1 \rangle)]\vert^2$$ +$$=\frac{1}{2Z} \vert(|a||0 \rangle - +|b||1 \rangle)(| a,0 \rangle+| b,1 \rangle)\vert^2$$ +$$=\vert\frac{|a||0 \rangle - +|b||1 \rangle}{\sqrt{Z}}\vert^2 \vert\frac{| a,0 \rangle+| b,1 \rangle}{\sqrt{2}}\vert^2$$ +$$=||\phi\rangle|^2||\psi'\rangle|^2 = 1$$.

+ +

However, this is independent of the distance $|a - b|$=$||a||a\rangle - |b||b\rangle|$.

+ +

Another way to think about this is that in the SwapTest, both $|a\rangle$ and $|b\rangle$ are $|0\rangle$ if the swap is indeed done on the ancilla bit of $\psi$. Then $|\langle a| b\rangle|=1$.

+ +

Is there anything wrong in my derivation above?

+",8321,,16606,,5/23/2022 8:51,5/23/2022 8:51,Distance calculation between two vectors,,2,2,,,,CC BY-SA 4.0 +7063,2,,7037,8/20/2019 20:09,,5,,"

I will attempt here to address the question of how Grover's algorithm would work, for the specific task of searching a target entry (let's say a word) in a database of such entries (shall we call it a book?). +There have already been plenty of discussions about the general structure of the algorithm (e.g. Is there a layman's explanation for why Grover's algorithm works?, How does the Grover diffusion operator work and why is it optimal?, Why does Grover's search invert about the mean?), as well as how to use it to speed-up finding solutions to NP problems (e.g. here you can find an explicit circuit to apply Grover to a specific 3SAT problem, and here is a breakdown of the steps to apply Grover to a generic SAT problem, and here is a discussion on how to make a SAT problem into an oracle), so I won't focus on these points here.

+ +

The specific application of Grover to database searching has also been discussed e.g. in (Grover's algorithm: where is the list?), (How is the Grover-Algorithm applied to a database?), (Does the oracle in Grover's algorithm need to contain information about the entirety of the database?) and (Grover's algorithm: what to input to Oracle?). +This answer will thus inevitably overlap with bits and pieces scattered around between those various posts.

+ +
+ +

Setup: the classical problem

+ +

Consider the following classical problem. We have an indexed list of $N$ words. It is thus easy to retrieve a target word $w_x$ given its index $x=1,...,N$. We want to find the index $x_0$ such that $w_0\equiv w_{x_0}$ is some fixed target word. +Classically, being the database unsorted, there isn't much to do other than just try each $x$ until $w_x$ is found to be equal to $w_0$.

+ +

NOTE: Here, $x$ represents the index of an entry $w_x$. This means that what is usually denoted with $x$ when discussing Grover's algorithm, becomes here $w_x$ instead.

+ +

Querying the database

+ +

Going quantum, the first thing we need to do is figure out how to handle the database. +Grover's algorithm requires as input a superposition state of the form +$$|D\rangle=\frac{1}{\sqrt N}\sum_x |x,w_x\rangle\in\mathcal H_{\text{index}}\otimes \mathcal H_{\text{entry}},\tag A$$ +where $|x\rangle$ is the index of the corresponding ""word"" entry $|w_x\rangle$.

+ +

Note that generating (A) from a corresponding classical database is highly nontrivial, as it amounts to being able to query the (usually classical) database as if it was a quantum state. One possibility that has been put forward is to use a ""QRAM"" with input $|+\rangle\equiv\sum_x |x\rangle$ to ""load"" the database into a superposition (see e.g. this answer), but I don't think the actual feasibility of this is fully understood, as of yet.

+ +

Anyhow, for this answer, let's assume that this problem has somehow been solved. We can thus use a query operator $\mathcal Q$ which implements the evolution +$$\mathcal Q|x,0\rangle\mapsto|x,w_x\rangle,$$ +so that $\mathcal Q|+,0\rangle=|D\rangle$.

+ +

We can equivalently write $|D\rangle$ as +$$|D\rangle=\sin\alpha|x_0,w_0\rangle+\cos\alpha|X_\perp\rangle,$$ +for some $\alpha\in\mathbb R$ (where $\alpha\equiv\arcsin(1/\sqrt N)$), where $|x_0,w_0\rangle$ is the target index/word pair, and $|X_\perp\rangle$ is everything else. We don't need to worry about what $|X_\perp\rangle$ actually looks like, it is enough to know that it is orthogonal to $|x_0,w_0\rangle$.

+ +

Apply the oracle

+ +

The next step is to apply the oracle operation. In this case this is pretty straightforward: we want to implement the mapping $\mathrm{Orac}_{w_0}:|w\rangle\mapsto(-1)^{\delta_{w=w_0}}|w\rangle$ on the $\mathcal H_{\text{entry}}$ register. +We can obtain this operation, for example, by using a pair of additional ancilla registers, and implementing $\mathrm{Orac}_{w_0}$ as the reversible version of the classical circuit implementing the mapping +$$\mathrm{Orac}_{w_0}(|w\rangle\otimes|w_0\rangle\otimes |s\rangle) +\mapsto |w\rangle\otimes|w_0\rangle\otimes|s\oplus \delta_{w=w_0}\rangle.$$ +Then, using as input $|s\rangle=|-\rangle\equiv\frac{1}{\sqrt2}(|0\rangle-|1\rangle)$ gives +$$\mathrm{Orac}_{w_0}(|w\rangle\otimes|w_0\rangle\otimes |-\rangle) +=(-1)^{\delta_{w=w_0}} +(|w\rangle\otimes|w_0\rangle\otimes|-\rangle),$$ +so that we can just write $\mathrm{Orac}_{w_0}|w\rangle=(-1)^{\delta_{w=w_0}}|w\rangle$ without worrying about the extra registers. +Equivalently, we can write $\mathrm{Orac}_{w_0}=I-2\mathbb P(|w_0\rangle)$ (using the notation $\mathbb P(|\psi\rangle)\equiv|\psi\rangle\!\langle\psi\rvert$).

+ +

At this stage, the evolving state is thus +$|\Psi_1\rangle\equiv N^{-1/2}\sum_x(-1)^{\delta_{w_x,w_0}}|x,w_x\rangle,$ +or equivalently, +$$|\Psi_1\rangle=-\sin\alpha|x_0,w_0\rangle+\cos\alpha|X_\perp\rangle.$$ +Something that will be useful in the next step is that we can also write +$$|\Psi_1\rangle=\cos(2\alpha)|D\rangle+\sin(2\alpha)|D_\perp\rangle,$$ +where $|D_\perp\rangle\equiv -\cos(\alpha)|x_0,w_0\rangle + \sin(\alpha)|X_\perp\rangle$.

+ +

Diffusion step

+ +

The next step is to apply the ""diffusion operator"" $R_D\equiv 2|D\rangle\!\langle D|-I$ in the space $\mathcal H_{\text{index}}\otimes\mathcal H_{\text{entry}}$. +This operator is such that $R_D|D\rangle=|D\rangle$, but $R_D=-1$ on the rest of the space. Equivalently, $R_D|X\rangle=(-1)^{1-\delta_{X,D}}|X\rangle$.

+ +

Doing this is actually a bit tricky, as it requires knowledge of $|D\rangle$, and therefore of the database. +The only way I can think of to do it is using $\mathcal Q$ and $\mathcal Q^\dagger$. +More specifically, we need $R_D=\mathcal QH^{(1)}\mathcal C^{(2)} H^{(1)}\mathcal Q^\dagger$, where $H^{(1)}$ is the Hadamard on the index register, and $\mathcal C$ denotes the reversible version of a classical circuit mantaining the sign of $|\boldsymbol 0,\boldsymbol 0\rangle$ and changing the sign of the rest of the basis states. Indeed, consider the action of such $R_D$ on an input state:

+ +
    +
  1. If the input is $|D\rangle$, then we have $\mathcal C^{(2)} H^{(1)}\mathcal Q^\dagger|D\rangle=\mathcal C^{(2)} H^{(1)}|+,\boldsymbol 0\rangle=\mathcal C^{(2)} |\boldsymbol 0,\boldsymbol 0\rangle = |\boldsymbol 0,\boldsymbol 0\rangle$, and thus $R_D|D\rangle=|D\rangle$.
  2. +
  3. If instead the input is some $|X\rangle$ orthogonal to $|D\rangle$, then $R_D|X\rangle=\mathcal Q H^{(2)}\mathcal C^{(1)}\sum_{Y\neq(0,0)}|Y\rangle=-|X\rangle$.
  4. +
+ +

With this, we are pretty much done. +Applying $R_D$ to $|\Psi_1\rangle$ gives +$$|\Psi_2\rangle\equiv R_D|\Psi_1\rangle= +\cos(2\alpha)|D\rangle-\sin(2\alpha)|D_\perp\rangle +=\sin(3\alpha)|x_0,w_0\rangle+\cos(3\alpha)|X_\perp\rangle.$$

+ +

The rest of the algorithm then proceeds as usual: we go back and repeat oracle and diffusion steps $\mathcal O(\sqrt N)$ times before measuring. +For further details about how the combined action of oracle and diffusion steps results in an effective rotation of $2\alpha$ in state space you can have a look at this other answer of mine.

+",55,,55,,8/20/2019 20:15,8/20/2019 20:15,,,,0,,,,CC BY-SA 4.0 +7064,2,,7037,8/21/2019 4:29,,2,,"

From a software developer point of view, an Oracle is like a blackbox of function to be called. For the traveling salesman problem, if you have $n$ cities, there are up to $m=\frac{n^2-n}{2}$ direct routes between two cities, an Oracle can tell whether any subset of the $m$ routes is a valid path (visit each city exactly once) and the total path length is less than a given $x$. Even though classic method does call such naive Oracle directly, the best known algorithm requires $O(n^2 2^n)$ operations.

+ +

Now one can apply Grover‘s algorithm a few times. For the first time, classically find a path visiting each city at least once, let $x$ be the length of this path. If Grover‘s algorithm succeeds, use the length of the found path as $x$ for the next round. The total number of rounds shall be small (though I personally have not search diligently for a confirmation). Alternatively, one can at least use binary search of $x$. Since there are at most $m^n$ valid paths, we need at most $n\log{m}=O(n\log{n})$ rounds. Each round takes $O(2^\sqrt{n})$, hence total cost is $O(2^\sqrt{n} n\log{n})$, still much smaller than the classic one. Additional analysis probably will reduce the number of rounds.

+",8321,,8321,,9/29/2019 4:08,9/29/2019 4:08,,,,0,,,,CC BY-SA 4.0 +7065,2,,6681,8/21/2019 11:47,,5,,"

It seems to me that the diagonalisation arguments that can be used are only slightly different from a standard one, e.g. such as can be found in these lecture notes about the Baker–Gill–Solovay Theorem (i.e., that there are oracles $A$ for which $\mathsf P^A = \mathsf{NP}^A$ and also oracles $A$ for which $\mathsf P^A \ne \mathsf{NP}^A$). Basically, you have to describe how to 'engineer' an adversarial input a little differently.

+ +

Here's how we might use this approach to prove the existence of an oracle $A$ for which $\mathsf{NP}^A \not\subseteq \mathsf{BQP}^A$. For any oracle $A$, define a language +$$ L_A = \Bigl\{ 1^n \;\Big\vert\; \exists z \in \{0,1\}^n : A(z,0) = (z,1)\Bigr\} . $$ +It is clear that $L_A \in \mathsf{NP}^A$ for the simple reason that a nondeterministic Turing machine can examine whether the input is of the form $1^n$ for some $n$, and then guess a string $z \in \{0,1\}^n$ for which $A(z,0) = (z,1)$ if such $z$ exists. +The goal is to show that $L_A$ cannot be decided in polynomial time, with bounded error, by a uniform unitary circuit family, using the $O(2^{n/2})$ lower bound on the search problem.

+ +
    +
  1. Let $c,N > 0$ be such that the search problem on oracles with $n$-bit inputs requires at least $c 2^{n/2}$ oracle queries to decide correctly (with probability at least 2/3), for all $n > N$.

  2. +
  3. Let $\mathbf C^{(1)}\!$, $\mathbf C^{(2)}\!$, $\ldots$ be an enumeration of all unitary oracle circuit families $\mathbf C^{(k)} \!= \{ C^{(k)}_n \}_{n \geqslant 0 }$, such that the gate-sequence of the circuit $C^{(k)}_n\!$ acting on $n$-bit inputs can be produced in time strictly less than $c 2^{n/2}$. (This time bound relates to the 'uniformity' condition, where we will be interested in circuits can be computed by a deterministic Turing machine in polynomial time — a stronger condition than we impose here. The enumeration of these circuit families could be done, for instance, by representing them indirectly by the deterministic Turing machines $\mathbf T^{(k)}$ which produce their gate sequences, and enumerating those.) We enumerate the circuit families so that each circuit family occurs infinitely often in the enumeration.

    + +
      +
    • From the run-time bounds on the description of the gate sequence, it follows in particular that $C^{(k)}_n$ has fewer than $c 2^{n/2}$ gates for all $k$, and in particular makes fewer than $c 2^{n/2}$ queries to the oracle.

    • +
    • For any $n$, consider the circuit $C^{(n)}_n\!$. From the lower bound on the search problem, we know that for $n > N$ there are possible values of the oracle function $f: \{0,1\}^n \to \{0,1\}$ evaluated by the oracle, such that with probability 2/3, the output produced by $C^{(n)}_n\!$ on input $1^n$ is not the correct answer to whether $\exists z \!\in\! \{0,1\}^n\!:\! f(z) \!=\! 1$.

    • +
    • For each $n > N$, select such a function $f_n$ for which $C^{(n)}_n$ ""fails"" in this way.

    • +
  4. +
  5. Let $A$ be an oracle which, on inputs of size $n > N$, evaluates $f_{\!\!\:n\!\:}$.

  6. +
+ +

Having constructed $A$ in this way, each circuit family $\mathbf C^{(n)}$ fails to correctly decide $L_A$ with probability at least 2/3, for some $n > N$ (and infinitely many such $n$ in fact). +Then none of the circuit families $\mathbf C^{(k)}$ correctly decide $L_A$ with success probability bounded below by 2/3 on all inputs, so that $L_A$ cannot be solved with such bounds by any uniform unitary circuit family constructible in time $p(n)$.

+ +

Thus, $L_A \notin \mathsf{BQP}^A$, from which it follows that $\mathsf{NP}^A \not\subseteq \mathsf{BQP}^A$.

+",124,,124,,11/1/2019 4:49,11/1/2019 4:49,,,,0,,,,CC BY-SA 4.0 +7067,1,7069,,8/21/2019 18:07,,2,1279,"

I have created a 9 qubit register:

+ +
q = QuantumRegister(9)
+c = ClassicalRegister(9)
+qc = QuantumCircuit(q, c)
+
+ +

I want to measure only 1 of the register(let's suppose i want to measure the 5th register.) How do I implement the code?

+ +
qc.measure(q[register],c[register])
+job = execute(qc,simulator,shots = 1000)
+result = job.result()
+counts = result.get_counts(qc)
+print(""\nTotal count for 0 and 1 are:"",counts)
+
+ +

My code seems to measure all 9 registers.

+",8334,,1386,,8/22/2019 7:05,8/22/2019 7:05,qiskit - measure only 1 of the register out of n registers,,1,2,,,,CC BY-SA 4.0 +7069,2,,7067,8/21/2019 18:31,,1,,"

In qiskit, if there are classical bits that are not getting a value through a measurement gate, they will default to '0'. Since you set your circuit up to have 9 classical bits, the counts will always be bit strings of length 9, even though you are only measuring 1 qubit.

+ +

To only measure one qubit, and have that be the only value in the resulting bit string, you need to only have one classical bit in your circuit.

+ +
q = QuantumRegister(9)
+c = ClassicalRegister(1) # Changed from 9 to 1
+qc = QuantumCircuit(q, c)
+qc.measure(q[register],c)
+job = execute(qc,simulator,shots = 1000)
+result = job.result()
+counts = result.get_counts(qc)
+print(""\nTotal count for 0 and 1 are:"",counts)
+
+",6180,,,,,8/21/2019 18:31,,,,0,,,,CC BY-SA 4.0 +7071,1,,,8/22/2019 3:36,,10,83,"

(Edited to make the argument and the question more precise)

+ +

An argument for quantum computational ""supremacy"" (specifically in Bremner et al. and the Google paper) assumes that there exists a classical sampler that outputs a probability $q_x$, $x \in \{0,1\}^{2^n}$ that approximates an output probability $p_x$ of a quantum device up to an additive error +$$|p_z - q_z| \le \epsilon,$$ +then uses Stockmeyer's counting to improve $q_x$ to a multiplicative approximate $\tilde{q}_x$ +$$|p_z - \tilde{q}_z| \le \frac{p_z}{\mathrm{poly}(n)}$$ +using a $\mathrm{BPP^{NP}}$ machine. This last step works only on a constant fraction of circuits i.e. on average, and relies on ""anti-concentration"", a separate property of the probabilities $p_z$.

+ +

If multiplicatively approximate $p_x$ is #P-hard on average, then the polynomial hierarchy collapses to the third level (known to contain $\mathrm{BPP^{NP}}$) by the fact that $\mathrm{PH \subset P^{\#P}}$. Thus, we conclude that no such classical sampler exists because we don't believe in PH collapse.

+ +

My question is the following: we know that there exists a quantum circuit whose single output probability $p_0$ is #P-complete to compute exactly (""strongly simulate"") yet the probabilities can be sampled efficiently (""weakly simulate"") on a classical computer. (In fact, this kind of quantum circuits are no more powerful than a BPP machine.) Is there anything close to a ""quantum supremacy"" argument (albeit there is nothing quantum here) that would apply to a worst-case hard problem that is nevertheless easy to approximate like this? My guess is that there can be none. But what exactly prevents this kind of argument? Is it the lack of anti-concentration, or worst-to-average case reduction, or something more general?

+",343,,343,,8/25/2019 12:00,8/25/2019 12:00,Strong vs weak simulations and the polynomial hierarchy collapse,,0,2,,,,CC BY-SA 4.0 +7072,1,,,8/22/2019 13:10,,2,145,"

I want to use Blender and Blender Python Scripts working with Qiskit. +(want to make 3D creations) (www.blender.org)

+ +

How can I do this ? +(because when I try to install Qiskit inside Blender Python, it doesn't work )

+ +

How to make communication between Blender and Qiskit installed with Anaconda Python ?

+ +

Thanks

+ +

Alain

+",8340,,,,,8/26/2019 18:27,Using Qiskit with Blender,,2,0,,,,CC BY-SA 4.0 +7073,2,,7023,8/22/2019 19:02,,2,,"

When you remove a column and corresponding row from a matrix, the eigenvalues and eigenvectors change according to this: https://mathoverflow.net/questions/43514/how-do-eigenvectors-and-eigenvalues-change-when-we-remove-a-row-column-pair-of-a

+ +

The only additional thing I will say here is what the consequences would be in quantum mechanics (because the link I gave you is only for general Maths). The consequence would be that what you have may no longer be a density matrix, unless you adjust the rest of the row and columns to compensate for the elements that were taken out (because the sum of the diagonals has to equal 1, so unless the diagonal element deleted was a 0, then you will be affecting the sum of the diagonals when removing that element). If the matrix is no longer a density matrix, then it is no longer a quantum state, so you have to be careful.

+",8325,,,,,8/22/2019 19:02,,,,1,,,,CC BY-SA 4.0 +7074,2,,6803,8/22/2019 20:21,,1,,"

You can do this with two ancillae and $O(n \lg n)$ operations by using the comparator from https://arxiv.org/abs/1706.07884.

+ +

The constant comparator uses two constant adders:

+ +

+ +

The constant adders are a recursive construction from https://arxiv.org/abs/1611.07995 which uses an incrementer and a carry signal propagator:

+ +

+ +

The incrementer uses a normal adder with same-sized input and target registers:

+ +

+ +

The same-sized input/target adder can be done with no ancillae:

+ +

+ +

And the carry propagation uses linear dirty ancillae:

+ +

+ +

If you're feeling really ambitious, you can remove at least one of the ancillae by using phasing operations in this way:

+ +

+",119,,,,,8/22/2019 20:21,,,,3,,,,CC BY-SA 4.0 +7076,1,7089,,8/22/2019 22:18,,3,133,"

I have a state $|p\rangle$ that has an extractable Bell state and I want to write it as a Bell state, $|b\rangle$, with a local unitary acting on one side. Basically I am trying to find a local unitary $U$ that satisfies:

+ +

$$ + |p\rangle = (U \otimes 1)|b\rangle +$$

+ +

$|b\rangle$ is a Bell state +$|p\rangle$ is a known state with an extractable Bell state

+ +

Does anyone know how to do this?

+ +

My initial guess was $U \otimes 1 = |p \rangle \langle b|$ but this isn't a unitary operator.

+ +

The known state $|p\rangle$ is in state vector form. I am using Python an NumPy for reference.

+",7734,,55,,1/21/2021 11:04,1/21/2021 11:04,Find the local unitary that takes the bell state to a state phi that has an extractable bell state,,1,0,,,,CC BY-SA 4.0 +7077,1,7085,,8/22/2019 22:36,,1,1295,"

How are 2 qubit Controlled Z gates (1 control / 1 target) typically implemented? Do we seek physical realizations of this gate, or have an alternate decomposition?

+",8343,,8343,,8/22/2019 23:01,8/23/2019 17:43,How is the Controlled Z Gate implemented?,,1,2,,,,CC BY-SA 4.0 +7078,1,,,8/23/2019 0:54,,3,146,"

You are given a source of an unknown qubit state. You make measurements in the computational basis, that is, your measurement is $\{|0\rangle \langle0|,|1\rangle \langle 1|\}$. You observe that you see the outcome zero $30$ times and the outcome one $70$ times out of a hundred measurements. What is your estimate of the absolute value of the probability amplitude of $|0\rangle$ in the superposition?

+ +

Any help would be appreciated. +Thanks

+",8344,,55,,6/13/2020 18:07,6/13/2020 18:07,Estimate of the absolute value of the probability amplitude of |0⟩ in the superposition,,1,11,,,,CC BY-SA 4.0 +7079,1,7080,,8/23/2019 7:28,,1,94,"

I have a state +$${|\psi\rangle} = s {\Bigl(|1\rangle_1|1\rangle_2-|0\rangle_1|0\rangle_2\Bigr)}\otimes{\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)}\otimes{\Bigl(|0\rangle_5|1\rangle_6-|1\rangle_5|0\rangle_6\Bigr)},$$ +with the subindexes meaing the particle number (for some normalising factor $s$). How do we represent a measurement of qubit 1 and 5 in the Bell basis, given that these two qubits are not adjacent?

+",6070,,124,,8/23/2019 10:08,8/23/2019 10:58,Representing a Bell measurement on non adjacent qubits,,1,2,,,,CC BY-SA 4.0 +7080,2,,7079,8/23/2019 10:25,,3,,"

The most direct way to do this using normal notation is to simply write the Bell projections using the same convention for subscripts:$\def\ket#1{\lvert#1\rangle}\def\bra#1{\langle#1\rvert}\def\idop{\mathbf 1}$ +$$\begin{aligned} + \bra{\Phi^+}_{1,5} \;&=\; \tfrac{1}{\sqrt 2}\Bigl(\,\bra{0}_1\bra{0}_5 \,+\, \bra{1}_1 \bra{1}_5\,\Bigr), +\\ + \bra{\Phi^-}_{1,5} \;&=\; \tfrac{1}{\sqrt 2}\Bigl(\,\bra{0}_1\bra{0}_5 \,-\, \bra{1}_1 \bra{1}_5\,\Bigr), +\\ + \bra{\Psi^+}_{1,5} \;&=\; \tfrac{1}{\sqrt 2}\Bigl(\,\bra{0}_1\bra{1}_5 \,+\, \bra{1}_1 \bra{0}_5\,\Bigr), +\\ + \bra{\Psi^-}_{1,5} \;&=\; \tfrac{1}{\sqrt 2}\Bigl(\,\bra{0}_1\bra{1}_5 \,-\, \bra{1}_1 \bra{0}_5\,\Bigr). +\end{aligned}$$ +It might not be immediately obvious why it makes sense to just 'decorate a bra with subscripts'. The idea is that for any qubit which is not indicated in the subscripts, what we have in mind is that we take the tensor product with the identity. So, for example, we have +$$\begin{alignat}{2} + \bra{0}_1\bra{0}_5 \;&:=\; &&\bra{0} \otimes \idop \otimes \idop \otimes \idop \otimes \bra{0} \otimes \idop, +\\[1ex] + \bra{1}_1\bra{1}_5 \;&:=\; &&\bra{1} \otimes \idop \otimes \idop \otimes \idop \otimes \bra{1} \otimes \idop, +\\[1ex] + \bra{\Phi^+}_{1,5} \;&:=\; \tfrac{1}{\sqrt 2}\Bigl(\,&&\bra{0} \otimes \idop \otimes \idop \otimes \idop \otimes \bra{0} \otimes \idop +\\[-1.5ex]&&&+ \bra{1} \otimes \idop \otimes \idop \otimes \idop \otimes \bra{1} \otimes \idop\,\Bigr), +\end{alignat}$$ +and so on. The advantage of writing things this way with the subscripts is that if you decompose an operator such as $\bra{\Phi^+}$, $\bra{\Psi^-}$, and so forth as a sum of tensor products, you can then compose it with other operators without having to write all of the identity tensor factors, so long as you only compose together operators acting on the same tensor factor. For instance: +$$\begin{aligned} +\bra{\Phi^+}_{1,5} \ket{\psi}& +\\[1ex] += \tfrac{1}{\sqrt2}\Bigl[& +\bra{0}_1\bra{0}_5\ket{\psi} + \bra{1}_1 \bra{1}_5 \ket{\psi} \Bigr] +\\[2ex] += \tfrac{\textstyle s}{\sqrt2}\Bigl[& +\bra{0}_1\bra{0}_5 {\Bigl(|1\rangle_1|1\rangle_2-|0\rangle_1|0\rangle_2\Bigr)\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)\Bigl(|0\rangle_5|1\rangle_6-|1\rangle_5|0\rangle_6\Bigr)} +\\&+\bra{1}_1\bra{1}_5 {\Bigl(|1\rangle_1|1\rangle_2-|0\rangle_1|0\rangle_2\Bigr)\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)\Bigl(|0\rangle_5|1\rangle_6-|1\rangle_5|0\rangle_6\Bigr)}\Bigr] +\\[1ex] += \tfrac{\textstyle s}{\sqrt2}\Bigl[& + {\Bigl(\langle0|1\rangle_1|1\rangle_2-\langle0|0\rangle_1|0\rangle_2\Bigr)\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)\Bigl(\langle0|0\rangle_5|1\rangle_6-\langle0|1\rangle_5|0\rangle_6\Bigr)} +\\&+ {\Bigl(\langle1|1\rangle_1|1\rangle_2-\langle1|0\rangle_1|0\rangle_2\Bigr)\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)\Bigl(\langle1|0\rangle_5|1\rangle_6-\langle1|1\rangle_5|0\rangle_6\Bigr)}\Bigr] +\\[1ex] += \tfrac{\textstyle s}{\sqrt2}\Bigl[& + {-|0\rangle_2\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)|1\rangle_6} + - {|1\rangle_2\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)|0\rangle_6}\Bigr] +\\[2ex] += -\tfrac{\textstyle s}{\sqrt2}\Bigl(& + {|0\rangle_2|1\rangle_6 + |1\rangle_2|0\rangle_6\Bigr) +\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4}\Bigr). +\end{aligned}$$ +Three things about this answer:

+ +
    +
  • This calculation has effectively removed qubits 1 and 5 from the state — we're basically describing a destructive measurement. If we wanted to describe a projective measurement which doesn't destroy the qubits involved, we'd have to take a tensor product with the state $\ket{\Phi^+}_{1,5}$. We can certainly write out what that superposition would look like, simply by expanding $\ket{\Phi^+}_{1,5} = \tfrac{1}{\sqrt 2}\bigl[ \ket{0}_1 \ket{0}_5 + \ket{1}_1 \ket{1}_5 \bigr]$, and including this in the description of the post-measurement state.

  • +
  • I've moved the tensor factors of qubits 2 and 6 so that they are adjacent. It's not difficult to see that they are in a tensor product with qubits 3 and 4, in any case, and it doesn't matter if we change the order given that we're using the subscripts to keep track of which qubit is which — just like listing some variables in different orders doesn't change what values those variables have. This allows us to see that after the measurement, the states of qubits 2 and 6 are in the state $\ket{\Psi^+}$ is the measurement result on qubits 1 and 5 was $\ket{\Phi^+}$ (and similar things will happen for the other possible outcomes of the measurement).

  • +
  • Notice that the normalisation is affected. We would normally chose $s$ so that the original vector had a norm of $1$, so for example $s = 1/2\sqrt{2}$. This new state has a leading factor of $s/\sqrt{2} = 1/4$, so it is not difficult to see that it is sub-normalised. Specifically, the vector here has norm $1/2$, which corresponds to the fact that a Bell measurement on qubits 1 and 5 will produce the state $\ket{\Phi^+}$ with probability $1/4 = (1/2)^2$.

  • +
+",124,,124,,8/23/2019 10:58,8/23/2019 10:58,,,,7,,,,CC BY-SA 4.0 +7081,1,7086,,8/23/2019 13:34,,7,212,"

I'm actually searching two types of documents (could be the same):

+ +

1) A synthesis about all the main gap/problems that make the physical realisation of a quantum computer actually infeasible.

+ +

2) Something more polemical that criticizes the point of view ""quantum computers arrive soon! They will break the actual instantiation of RSA"", and +consider that there is no good reason to think there will be a quantum computer functional for cryptanalysis during this century.

+ +

I'm not sure of the existence of 2), but I met so many physicists who are skeptical about the optimistic projection (4000 qubits in one decade). +Maybe people here have heard about a such document?

+",8348,,55,,8/27/2019 7:28,8/27/2019 7:28,Looking for papers that are pessimistic about the feasibility of a quantum computer,,1,0,,,,CC BY-SA 4.0 +7082,1,6951,,8/23/2019 14:38,,9,1810,"

This question refers to Nielsen and Chuang's Exercise 4.22:

+ +

Prove that a $C^2(U)$ gate (for any single-qubit unitary U) can be +constructed using at most eight one-qubit gates, and six controlled-not gates.

+ +

+ +

To prove this, I decomposed all $C(V)$ operations into $AXBXC$ form and ended up with 9 single-qubit gates and 8 C-NOT gates. So I need to now get rid of one single-qubit gate and 2 C-NOT gates. To do the former, I changed the order of $V's$ and got rid of 2 single-qubit gates with combining 2 pairs of single-qubit gates.

+ +

For example: as $C=R_z((\delta - \beta)/2)$ and $A=R_z(\beta)R_y(\gamma/2)$ +became + $CA=R_z((\delta - \beta)/2)R_z(\beta)R_y(\gamma/2)$ +

+ +

For the CNOT gates, I can't touch the 2 C-NOT operations on qubits 0 and qubit 1 because they are important for the functioning of $V^\dagger$. The only way then is to reduce the 4 CNOT gates that compose the 2 $C(V)$ gates. I am encountering some difficulty here. Any help/hint will be appreciated.

+ +

*This is not a homework question. I am self-studying from Nielsen and Chuang for an independent project.

+",7943,,7372,,8/28/2019 11:12,8/28/2019 11:12,How to reduce circuit elements of a decomposed $C^2(U)$ operation?,,1,5,,,,CC BY-SA 4.0 +7084,1,,,8/23/2019 16:41,,3,443,"

These two kinds of qubits are both classified under ""charge qubits"", looking for them, I always find the same circuit representation.

+ +

+ +

Occasionally, I find one where there's a SQUID instead of the Josephson junction, but I don't think this is the difference.

+ +

What is the difference?

+",5125,,,,,8/23/2019 16:41,What is the difference between a cooper pair box and a transmon qubit?,,0,1,,,,CC BY-SA 4.0 +7085,2,,7077,8/23/2019 17:43,,1,,"

On IBM QX architectures, the only entangling gate is the controlled not (CX), so controlled Z gates with control qubit $n$ and target qubit $m$ are decomposed into $CZ^n_m = H_m CX^n_m H_m$.

+ +

Although this is QX-specific, it demonstrates a principle that will likely hold on any architecture -- That the general method is to use a similarity transform to rotate Z onto the most conducive rotation axis for the hardware, perform that rotation, and rotate Z back into place.

+",8349,,,,,8/23/2019 17:43,,,,0,,,,CC BY-SA 4.0 +7086,2,,7081,8/23/2019 17:45,,4,,"

You can look up work by Gil Kalai, who is a longstanding and outspoken critic of quantum computing (his most recent essay: Kalai, 2019). He often bases his view on assumptions that I entirely disagree with, but its a refreshing reminder that certain ideas are taken for granted in the industry, namely that NISQ computers will yield practical applications. Kalai's analyses and views aren't necessarily mainstream.

+ +

I don't know of any comprehensive papers that address (2) but some example analyses looks into how quantum computers might impact Bitcoin and find that any impact is unlikely (Aggarwal, 2017, Tessler).

+ +

With respect to cryptography, NIST is currently sponsoring the development of post-quantum cryptography standards that would possibly be secure against quantum attacks even if a large quantum computer were made available in the near term. Google has even begun implementing a variation of one of these protocols (HRSS) for key exchange. However, claims that a protocol is ""post-quantum"" should generally be taken with a grain of salt since its entirely unknown whether a method to break these protocols (classical or quantum) exists.

+",1939,,,,,8/23/2019 17:45,,,,5,,,,CC BY-SA 4.0 +7087,2,,7072,8/23/2019 18:08,,1,,"

Are you using Qiskit from within a conda virtual environment? If Blender isn't launched from within the same venv they may not be able to communicate (or share libraries).

+",8350,,,,,8/23/2019 18:08,,,,0,,,,CC BY-SA 4.0 +7088,1,,,8/23/2019 18:38,,2,172,"

I'm trying to implement an algorithm (https://dl.acm.org/citation.cfm?id=1128034, basically a simple Grover Algorithm in which the oracle is made of a Fitness operator- some CNOT gates- and 2 adders) and when I try to simulate it on ibm_qasm_simulator I get the error: +""Job resulted in the following QASM status(es): ERROR."". If I export the qasm code and simulate it online, I got the following error: ERROR_TRANSPILING_JOB but the original and transpiled code look identical.

+ +

I'm using qiskit 0.8.2:

+ +
'qiskit': '0.11.1', 
+'qiskit-terra': '0.8.2', 
+'qiskit-ignis': '0.1.1', 
+'qiskit-aer': '0.2.3', 
+'qiskit-ibmq-provider': '0.3.1', 
+'qiskit-aqua': '0.5.3'
+
+ +

The QASM code, as generated by qiskit and modified a little bit to include the subcircuits is:

+ +
OPENQASM 2.0;
+include ""qelib1.inc"";
+gate majority a,b,c
+{
+  cx c,b;
+  cx c,a;
+  ccx a,b,c;
+}
+gate unmaj a,b,c
+{
+  ccx a,b,c;
+  cx c,a;
+  cx a,b;
+}
+gate add4 a0,a1,a2,a3,b0,b1,b2,b3,cin,cout
+{
+  majority cin,b0,a0;
+  majority a0,b1,a1;
+  majority a1,b2,a2;
+  majority a2,b3,a3;
+  cx a3,cout;
+  unmaj a2,b3,a3;
+  unmaj a1,b2,a2;
+  unmaj a0,b1,a1;
+  unmaj cin,b0,a0;
+}
+gate adder8 aop0,aop1,aop2,aop3,aop4,aop5,aop6,aop7,bop0,bop1,bop2,bop3,bop4,bop5,bop6,bop7,carry0,carry1
+{
+    add4 aop0,aop1,aop2,aop3,bop0,bop1,bop2,bop3,carry0,carry1;
+    add4 aop4,aop5,aop6,aop7,bop4,bop5,bop6,bop7,carry1,carry0;
+}
+
+gate tof ctrl0,ctrl1,ctrl2,ctrl3,ctrl4,ctrl5,ctrl6,ctrl7,anc0,anc1,anc2,anc3,anc4,anc5,anc6,tgt
+{
+    ccx ctrl0,ctrl1,anc0;
+    ccx ctrl2,anc0,anc1;
+    ccx ctrl3,anc1,anc2;
+    ccx ctrl4,anc2,anc3;
+    ccx ctrl5,anc3,anc4;
+    ccx ctrl6,anc4,anc5;
+    ccx ctrl7,anc5,anc6;
+    cx anc6,tgt;
+    ccx ctrl7,anc5,anc6;
+    ccx ctrl6,anc4,anc5;
+    ccx ctrl5,anc3,anc4;
+    ccx ctrl4,anc2,anc3;
+    ccx ctrl3,anc1,anc2;
+    ccx ctrl2,anc0,anc1;
+    ccx ctrl0,ctrl1,anc0;
+}
+
+qreg ireg[4];
+qreg freg[9];
+qreg mreg[8];
+qreg carryreg[2];
+qreg oreg[1];
+qreg ancilla[3];
+creg reg[9];
+h ireg[0];
+h ireg[1];
+h ireg[2];
+h ireg[3];
+x mreg[1];
+x mreg[2];
+x mreg[4];
+x mreg[5];
+x mreg[6];
+x mreg[7];
+barrier ireg[0],ireg[1],ireg[2],ireg[3],freg[0],freg[1],freg[2],freg[3],freg[4],freg[5],freg[6],freg[7],freg[8],mreg[0],mreg[1],mreg[2],mreg[3],mreg[4],mreg[5],mreg[6],mreg[7],carryreg[0],carryreg[1],oreg[0],ancilla[0],ancilla[1],ancilla[2];
+adder8 mreg[0],mreg[1],mreg[2],mreg[3],mreg[4],mreg[5],mreg[6],mreg[7],freg[0],freg[1],freg[2],freg[3],freg[4],freg[5],freg[6],freg[7],carryreg[0],carryreg[1];
+barrier ireg[0],ireg[1],ireg[2],ireg[3],freg[0],freg[1],freg[2],freg[3],freg[4],freg[5],freg[6],freg[7],freg[8],mreg[0],mreg[1],mreg[2],mreg[3],mreg[4],mreg[5],mreg[6],mreg[7],carryreg[0],carryreg[1],oreg[0],ancilla[0],ancilla[1],ancilla[2];
+x freg[7];
+cx freg[7],oreg[0];
+x freg[7];
+barrier ireg[0],ireg[1],ireg[2],ireg[3],freg[0],freg[1],freg[2],freg[3],freg[4],freg[5],freg[6],freg[7],freg[8],mreg[0],mreg[1],mreg[2],mreg[3],mreg[4],mreg[5],mreg[6],mreg[7],carryreg[0],carryreg[1],oreg[0],ancilla[0],ancilla[1],ancilla[2];
+reset mreg[0];
+reset mreg[1];
+x mreg[1];
+reset mreg[2];
+reset mreg[3];
+x mreg[3];
+reset mreg[4];
+reset mreg[5];
+reset mreg[6];
+reset mreg[7];
+barrier ireg[0],ireg[1],ireg[2],ireg[3],freg[0],freg[1],freg[2],freg[3],freg[4],freg[5],freg[6],freg[7],freg[8],mreg[0],mreg[1],mreg[2],mreg[3],mreg[4],mreg[5],mreg[6],mreg[7],carryreg[0],carryreg[1],oreg[0],ancilla[0],ancilla[1],ancilla[2];
+adder8 mreg[0],mreg[1],mreg[2],mreg[3],mreg[4],mreg[5],mreg[6],mreg[7],freg[0],freg[1],freg[2],freg[3],freg[4],freg[5],freg[6],freg[7],carryreg[0],carryreg[1];
+reset mreg[0];
+reset mreg[1];
+reset mreg[2];
+reset mreg[3];
+reset mreg[4];
+reset mreg[5];
+reset mreg[6];
+reset mreg[7];
+barrier ireg[0],ireg[1],ireg[2],ireg[3],freg[0],freg[1],freg[2],freg[3],freg[4],freg[5],freg[6],freg[7],freg[8],mreg[0],mreg[1],mreg[2],mreg[3],mreg[4],mreg[5],mreg[6],mreg[7],carryreg[0],carryreg[1],oreg[0],ancilla[0],ancilla[1],ancilla[2];
+h freg[0];
+x freg[0];
+h freg[1];
+x freg[1];
+h freg[2];
+x freg[2];
+h freg[3];
+x freg[3];
+h freg[4];
+x freg[4];
+h freg[5];
+x freg[5];
+h freg[6];
+x freg[6];
+h freg[7];
+x freg[7];
+h freg[8];
+x freg[8];
+h freg[8];
+tof freg[0],freg[1],freg[2],freg[3],freg[4],freg[5],freg[6],freg[7],mreg[0],mreg[1],mreg[2],mreg[3],mreg[4],mreg[5],mreg[6],freg[8];
+x freg[0];
+h freg[0];
+x freg[1];
+h freg[1];
+x freg[2];
+h freg[2];
+x freg[3];
+h freg[3];
+x freg[4];
+h freg[4];
+x freg[5];
+h freg[5];
+x freg[6];
+h freg[6];
+x freg[7];
+h freg[7];
+h freg[8];
+x freg[8];
+h freg[8];
+measure freg[0] -> reg[0];
+measure freg[1] -> reg[1];
+measure freg[2] -> reg[2];
+measure freg[3] -> reg[3];
+measure freg[4] -> reg[4];
+measure freg[5] -> reg[5];
+measure freg[6] -> reg[6];
+measure freg[7] -> reg[7];
+measure freg[8] -> reg[8];
+
+
+",2759,,,,,8/23/2019 18:38,Error ERROR_TRANSPILING_JOB when trying to simulate the circuit,,0,3,,,,CC BY-SA 4.0 +7089,2,,7076,8/23/2019 23:58,,2,,"

$$ +|p \rangle = ((aI + bZ + cX + dZX) \otimes 1) | \Phi^+ \rangle = a | \Phi^+ \rangle + b | \Phi^- \rangle + c | \Psi^+\rangle + d | \Psi^- \rangle\\ +(aI+bZ+cX+dZX)(\bar{a}I+\bar{b}Z+\bar{c}X+\bar{d}XZ) = 1\\ +a = \langle \Phi^+ | p \rangle\\ +b = \langle \Phi^- | p \rangle\\ +c = \langle \Psi^+ | p \rangle\\ +d = \langle \Psi^- | p \rangle\\ +$$

+ +

I'll leave the rest to you.

+",434,,,,,8/23/2019 23:58,,,,0,,,,CC BY-SA 4.0 +7090,1,7092,,8/24/2019 11:13,,3,204,"

If we have a physical qubit with energy eigenstates $|0\rangle$ and $|1\rangle$ with energy separation $\Delta E$ its Hamiltonian in the absence of any interaction is

+ +

$$H=\hbar\frac{\Delta E}{2}\sigma_z $$

+ +

the time evolution operator is $U=e^{-iHt/\hbar}$, so why doesn't a qubit left to itself not just continuously rotate in the $z$ direction? And if it does, how is this not a problem? It seems to me that after some time $t$, a $\sigma_z$ gate will be applied whether we want it or not!

+",5125,,5125,,8/24/2019 11:20,8/25/2019 13:20,Why don't qubits continuously rotate in the $z$ direction due to free time evolution?,,2,0,,,,CC BY-SA 4.0 +7092,2,,7090,8/24/2019 11:47,,3,,"

It does, unless you have a way to tune your Hamiltonian such that $\Delta$ becomes zero. Since a tunable Hamiltonian is something you usually want in a quantum computer implementation, this should not be a problem.

+ +

If this term is non-switchable, it just means that the basis in which you are working is continuously rotating, and you have to keep track of that and implement your ""active"" gates in a correspondingly rotated basis, or exactly at the time when the evolution due to your Hamiltonian has cancelled out. (Essentially, this is like working in the interaction picture.)

+ +

(By the way, it is debatable if you should call this ""in the absence of any interaction"", since this level splitting can very well seen as some type of interaction, and will in many cases depend on some external parameter.)

+",491,,,,,8/24/2019 11:47,,,,0,,,,CC BY-SA 4.0 +7093,2,,6860,8/24/2019 18:16,,3,,"

The word superposition had many meanings long before the phrase quantum superposition became popular.

+ +

A linear super-position of A and B is just ""A + cB"" where c is a constant.

+ +

So you have your binary optimization problem that has to be solved, for example:

+ +

H_problem = b1*b2 - b1*b3 + 2*b2*b4.

+ +

Then you have a constraint such as ""b1*b2 = 1"" which can be converted into a binary optimization problem because minimizing:

+ +

H_constraint = (b1*b2 - 1)^2

+ +

is the same as satisfying the constraint ""b1*b2 = 1"".

+ +

So the final Hamiltonian will be a linear superposition:

+ +

H = H_problem + c*H_constraint, where c > 0.

+ +

The goal is for the minimum of H to be the minimum of H_problem, and to also satisfy the constraint. Now notice that if the constraint is not satisfied, we don't have a minimum, because we will be adding a positive number, making the energy higher. If H_problem is not minimized, then clearly H is not minimized because one of the terms in H can be made lower by minimizing H_problem. So overall, H will only be minimized if both:

+ +
    +
  • H_problem is minimized, and
  • +
  • H_constraint is minimized (i.e. the constraint is satisfied).
  • +
+ +

You can now convert this into Ising model by turning all binary variables from b={0,1} to sigma_z={-1,1}.

+ +

Hope this helps. +It seems you've been thinking about quantum information for too long now, and now when you see ""superposition"" you immediately think (|0> + |1>)/sqrt(2). But superposition had another meaning long before quantum information became popular.

+",8325,,,,,8/24/2019 18:16,,,,1,,,,CC BY-SA 4.0 +7094,2,,1620,8/25/2019 5:24,,7,,"

Let me first answer the general question how to get a reasonably tight Lieb-Robinson (LR) speed when you are facing a generic locally interacting lattice model, and then I'll come back to the 1D XY model in your question, which is very special to be exactly solvable.

+ +
+ +

General Method

+ +

The method to obtain the tightest bound to date (for a generic short-range interacting model) is introduced in Ref1=arXiv:1908.03997. The basic idea is that the norm of the unequal time commutator $\|[A_X(t),B_Y(0)]\|$ between arbitrary local operators can be upper bounded by the solution to a set of first order linear differential equations living on the commutativity graph of the model. The commutativity graph, as introduced in Sec.II A of Ref1, can be easily drawn from the model Hamiltonian $\hat{H}$, and is designed to reflect the commutation relations between different local operators presented in $\hat{H}$. In translation invariant systems, this set of differential equations can be easily solved by a Fourier transform, and an upper bound of the LR speed can be calculated from the largest eigenfrequency $\omega_{\max}(i\vec{\kappa})$ using Eq.(31) of Ref1. In the following I'll apply this method to the 1D XY model as a pedagogical example. For simplicity, I'll focus on the time-independent and translation invariant case $|B_n|=B>0$, $|J_n|=J>0$ (the resulting bound doesn't depend on signs of $B_n,J_n$). For the translation non-invariant, time-dependent case, you can either solve the differential equation numerically (which is an easy computational task for systems of thousands of sites), or you can use an overall upper bound $|J_n(t)|\leq J,~|B_n(t)|\leq B$ and proceed to use the method below (but this slightly compromises tightness compared to the numerical method).

+ +
    +
  1. First we draw the commutativity graph, as below. Each operator in the Hamiltonian~($X_{n}X_{n+1}$, $Y_nY_{n+1}$, $Z_n$) is represented by a vertex, and we link two vertices if and only if the corresponding operators don't commute (or, in the current case, anti-commute). +

  2. +
  3. Then write down the differential equations Eq.(10) of Ref1: +\begin{eqnarray} + \dot{\bar{\gamma}}_{\alpha,n}&=&J[\bar{\gamma}_{\alpha,n-1}(t)+\bar{\gamma}_{\alpha,n+1}(t)]+B[\bar{\gamma}_{3,n}(t)+\bar{\gamma}_{3,n+1}(t)],~~\alpha=1,2,\nonumber\\ + \dot{\bar{\gamma}}_{3,n}&=&J\sum_{\alpha=1,2}[\bar{\gamma}_{\alpha,n-1}(t)+\bar{\gamma}_{\alpha,n}(t)]. + \end{eqnarray}

  4. +
  5. Fourier transforming the above equation, we have +\begin{equation} + \frac{d}{dt}\begin{pmatrix} + \bar{\gamma}_{1,k}\\ + \bar{\gamma}_{2,k}\\ + \bar{\gamma}_{3,k} + \end{pmatrix}=\begin{pmatrix} + 2J\cos k & 0 & B(1+e^{ik})\\ + 0 & 2J\cos k & B(1+e^{ik})\\ + J(1+e^{-ik}) & J(1+e^{-ik}) & 0\\ + \end{pmatrix}\begin{pmatrix} + \bar{\gamma}_{1,k}\\ + \bar{\gamma}_{2,k}\\ + \bar{\gamma}_{3,k} + \end{pmatrix}. + \end{equation} +The eigenfrequencies are $2J\cos k,J\cos k\pm \sqrt{(J\cos k)^2+2BJ(1+\cos k)}$. The LR speed is given by Eq.(31) of Ref1: +$$v_{\text{LR}}\leq \min_{\kappa>0}\frac{\omega_{\max}(i\kappa)}{\kappa} =\mathcal{Z}_{\frac{B}{2J}}J,$$ +where +\begin{equation}\label{eq:vLRFHWy} +\mathcal{Z}_y\equiv \min_{\kappa>0}\frac{\cosh\kappa+\sqrt{\cosh^2\kappa+4y(1+\cosh\kappa)}}{\kappa}. + \end{equation}

  6. +
+ +

Note: This bound diverges when $B/J\to \infty$, while the physical information propagation speed stays finite. We can get rid of this problem by using the method in Sec. VI of Ref1. The result is $v_{\text{LR}}\leq 4\mathcal{X}_0 J$ in this limit, where $\mathcal{X}_y$ is defined as the solution to the equation $x\mathrm{arcsinh}(x)=\sqrt{x^2+1}+y$.

+ +
+ +

Velocity bounds for some classic models

+ +

The above method is completely general. In case you are interested in more, I listed the velocity bounds for some classic models in the following table, obtained in a similar way. Notice that the LR velocity $v_{\text{LR}}$ is upper bounded by the smallest of the all the expressions listed (so in different parameter regions different expressions should be used). The function $F(J_x,J_y,J_z)$ is defined as the largest root of $x^3-(J_xJ_y+J_xJ_z+J_yJ_z)x-2J_xJ_yJ_z=0.$ All parameters are assumed positive (just take absolute value for the negative cases).

+ +

$$\begin{array}{|c|l|} + \hline +\text{Model} & v_{\text{LR}} \\ \hline + d\text{-dimensional TFIM} & 2\mathcal{X}_0\sqrt{dJh}= 3.02\sqrt{dJh} \\ + \hat{H}= J\sum_{\langle mn\rangle} X_m X_{n}+h\sum_n Z_n & 4\mathcal{X}_{\frac{d-1}{d}}dJ \leq 8.93 d J \\ + & 4\mathcal{X}_0dh = 6.04 d h \\ \hline + d\text{-dimensional Fermi-Hubbard} & 2 \mathcal{X}_{\frac{3U}{4dJ}}dJ \\ + \hat{H}=J\sum_{\langle mn\rangle, s=\uparrow,\downarrow} (a^\dagger_{m,s}a_{n,s}+\mathrm{H.c.}) & 8\mathcal{X}_{\frac{d-1}{d}}dJ\leq 17.9 d J \\ + ~~+U \sum_n a^\dagger_{n\uparrow}a_{n\uparrow}a^\dagger_{n\downarrow}a_{n\downarrow} & \mathcal{Z}_{U/J}J~(d=1) \\ \hline +\text{1D Heisenberg XYZ} & 4\mathcal{X}_0 F(J_x,J_y,J_z) \\ +\hat{H}=\sum_n (J_x X_n X_{n+1}+J_y Y_n Y_{n+1}+J_z Z_n Z_{n+1}) & 34.6 \max\{J_x,J_y\}\\ \hline +\end{array}$$

+ +

As for how good these bounds are, I haven't investigated in general, but for the 1D TFIM at critical point $J=h$, exact solution gives $v_{\text{LR}}=2J$, while the above bound gives $2\mathcal{X}_0J\approx 3.02 J$. Similarly, at the $U=0$ point of FH and the $J_x=J_y,J_z=0$ point of Heisenberg XYZ, the above bound are all larger than exact solution by a factor of $\mathcal{X}_0\approx 1.50888$. [Actually at these special points the latter two are equivalent to decoupled chains of TFIM, as can be directly judged from their commutativity graph.]

+ +
+ +

Tighter bound for 1D XY by mapping to free fermions

+ +

Now let's talk more about the 1D XY model. As you noticed, it's exactly solvable by mapping to free fermions: +$$\hat{H}=\sum_nB_n(a_n^\dagger a_n-1/2)+\sum_n J_n(a_n^\dagger a_{n+1}+\mathrm{H.c.}). $$ +For general $B_n(t),J_n(t)$ you need to solve the free-fermion problem numerically, but let me mention two special cases that are analytically tractable.

+ +
    +
  1. $B_n(t)=B,J_n(t)=J$ are fixed and translation invariant. Then the exact solution is +\begin{eqnarray}\label{eq:aisigmat} + a_{n}(t)&=&\frac{1}{\sqrt{2\pi}}\int_{-\pi}^\pi \tilde{a}_{k}e^{-i2Jt\cos k }e^{ikx}d k\nonumber\\ + &=&\sum_{m}\mathcal{J}_{|n-m|}(2Jt) a_{m}(0), + \end{eqnarray} +where $\mathcal{J}_{|n-m|}(2Jt)$ is the Bessel function of order $|n-m|$. So the LR speed is $\color{red}{v^{\text{XY}}_{\text{LR}}=2J}$.

  2. +
  3. $B_n,J_n$ are fixed in time but are completely random (quenched disorder). Then due to many-body localization (or Anderson localization in the fermion picture), information don't propagate in this system, so $v_{\text{LR}}=0$. More rigorously, in arXiv:quant-ph/0703209, the following bound is proved for disordered case: +$$[A_X(t),B_Y(0)]\leq \mathrm{const.}~ t ~e^{-d_{XY}/\xi},$$ +with a decelerating, logarithmic light cone $d_{XY}=\xi \ln t$.

  4. +
+",8352,,,,,8/25/2019 5:24,,,,4,,,,CC BY-SA 4.0 +7095,2,,7090,8/25/2019 13:20,,2,,"

They are always rotating in the lab reference frame, but most quantum algorithms take a rotating reference frame to simply things, so that a z rotation only happens when you want it to.

+ +

The rotating reference frame spins along with the natural spinning rate of each qubit, so in general in can spin at different rates for different qubits.

+",1867,,,,,8/25/2019 13:20,,,,0,,,,CC BY-SA 4.0 +7096,1,,,8/26/2019 11:55,,-2,107,"

I have a matrix $M= \begin{pmatrix} a - ib & 0 \\ 0 & a + ib \end{pmatrix}$, where $a$ and $b$ are real numbers and $i = \sqrt{-1}$. I need to represent this matrix in terms of the quantum logic gates. Is the following representation valid +\begin{equation} M = a \mathbb{I} - ib \sigma_Z, \end{equation}

+ +

where $ \mathbb{I} $ and $\sigma_Z$ are the identity matrix and Pauli-z gate, respectively. Can this be implemented in a lab?

+",8290,,55,,8/27/2019 7:14,8/28/2019 9:15,Is $M = a \mathbb{I} - ib \sigma_Z$ a valid representation in terms of logic gates?,,2,3,,,,CC BY-SA 4.0 +7097,2,,7072,8/26/2019 18:27,,2,,"
import sys
+sys.exec_prefix
+
+ +

will show the path of python used by blender. Rename this python folder to something else. Now blender will automatically use the python version in windows path. Make sure that your Python runs in command prompt when you type python. If it doesn't, type environment variables in search and add python.exe to the path variable. Restart command prompt if python opens up python interpreter, blender will too.

+",7467,,,,,8/26/2019 18:27,,,,0,,,,CC BY-SA 4.0 +7098,1,,,8/26/2019 19:58,,2,2705,"

I successfully installed qiskit, +yet am unable to load my account in the Jupyter notebook.

+ +

Each time I load my account in Jupyter notebook here is the response I get

+ +
+

RequestsApiError: 401 Client Error: Unauthorized for url: + https://auth.quantum-computing.ibm.com/api/users/loginWithToken. + LOGIN_FAILED, Error code: LOGIN_FAILED.

+
+ +

What causes this?

+",8369,,55,,5/21/2021 9:22,5/21/2021 9:22,Loading Qiskit account in the Jupyter notebook gives RequestsApiError error,,3,0,,,,CC BY-SA 4.0 +7099,1,,,8/26/2019 21:45,,5,1065,"

I have the state vector $|p\rangle$ made up of 4 qubits. Say system A is made up of the first and second qubits while system B is made up of qubits 3 and 4. I want to find the reduced density matrix of system A.

+ +

I know I could separately extract qubits 1,2 and 3,4 into their own state vectors then find their density matrices and compute the reduced density matrix for system A.

+ +

I want to figure out how to do this without having to extract and separate the systems. First I would find the density matrix of $|p\rangle$ and then do a partial trace with respect to system B. I am not sure how to do the partial trace of system B since the system contains 2 qubits.

+ +

Can anyone help me figure this out? I am using Python and NumPy for reference.

+",7734,,55,,2/5/2021 20:12,5/17/2021 6:47,How to find the reduced density matrix of a four-qubit system?,,2,2,,,,CC BY-SA 4.0 +7101,2,,7099,8/27/2019 0:19,,1,,"

Wikipedia entry has a nice description of the partial trace and how to compute it.

+ +

In your case the partial trace of $M=|p\rangle\langle p|$ over $B$ can be computed as +$$ +\text{Tr}_B(M) = \text{Tr}_B\bigg(\sum_{k,l} M_{k,l} \otimes |k\rangle\langle l| \bigg) = \sum_{k} M_{k,k} +$$
+where $k,l \in \{00,01,10,11\}$.

+ +

Those $M_{k,l}$ are $4 \times 4$ submatrices of the $16 \times 16$ matrix $M$. What kind of submatrices depends on the actual encoding. In the big-endian encoding – where the matrix row order corresponds to $|0000\rangle, |0001\rangle, ... , |1111\rangle$ – matrix $M_{k,l}$ has element in the position $(i,j)$ that equals to an element in the position $(k,l)$ of the $(i,j)$-th block of the big matrix $M$. So the resulting sum is actually equivalent to a matrix whose elements are traces of $4 \times 4$ blocks of the matrix $M$.

+ +

Partial trace over the first subsystem A in the big-endian encoding is easier – it's just the sum of 4 blocks from the diagonal.

+",5870,,,,,8/27/2019 0:19,,,,0,,,,CC BY-SA 4.0 +7102,2,,7098,8/27/2019 8:57,,2,,"

This is normally caused by incorrect credentials being used. To fix this you can generate a new API key and update your saved credentials to use this instead.

+ +

You can do this by navigating to https://quantum-computing.ibm.com and getting your API key from the My Account section. In a notebook then run IBMQ.save_account('YOUR API KEY', overwrite=True). This will remove any incorrect credentials from your system and then the login should work.

+",5955,,,,,8/27/2019 8:57,,,,0,,,,CC BY-SA 4.0 +7103,2,,6935,8/27/2019 8:57,,6,,"

Let me begin by reformulating the Knill-Laflamme Theorem, looking at it from a different angle might help in making the matter a little less abstract.

+ +

The Knill-Laflamme Theorem for the conditions of quantum error correction can be stated as follows:

+ +

Let $C$ be a quantum error correcting code defined as a subspace of the n-dimensional Hilbert space, $\mathcal{H}_2^{\otimes n}$, and let $\mathcal{E} \subset \mathbb{C}^{2^n\times2^n}$ be a set of errors. Then $\mathcal{C}$ can correct +$\mathcal{E}$ if and only if $$\langle\psi_i|E_a^\dagger E_b|\psi_j\rangle = c_{ab}\delta_{ij} ,$$ +where {$|\psi_i\rangle$} is a base of the subspace that defines the code $\mathcal{C} \subset \mathcal{H}_2^{\otimes n}$ and $E_a$, $E_b$ $\in \mathcal{E}$.

+ +

By itself, the above statement provides information about the degeneracy of the code. By computing all the possible outputs of parameter $c_{ab}$ (this can be done by randomly selecting a basis vector of $C$, $|\psi_i\rangle$, and setting $i=j$.), placing them in a matrix $C_{ab}$, and then computing its rank, we can determine if $C$ is degenerate or non-degenerate. If $\mathrm{rank}(C_{ab}) < max$, the quantum code is degenerate, which means different errors from an error set $\mathcal{E}$ map to the same syndrome and cause the same error effect on the codeword, thus, being reversible via the same recovery operation. If $C_{ab}$ is full rank, each error $E_i$ in the error set $\mathcal{E}$ maps to a unique error syndrome.

+ +

Placing the matter of degeneracy aside, the following corollary of the Theorem might help in understanding the meaning of the Theorem itself.

+ +

For any code $C$ defined as a subspace of $\mathcal{H}_2^{\otimes n}$, if $C$ is capable of correcting all the errors in a set $\mathcal{E} \subset \mathcal{C}^{2^n\times2^n}$, then $C$ will be able to correct all the errors within the linear span of $\mathcal{E}$.

+ +

Essentially what this corollary tells us is that if a quantum error correcting code can correct all the errors in the set $\mathcal{E}$, it will also be able to correct all the possible linear combinations of the elements within that set. If we now consider that the Pauli matrices define a basis for the $\mathbb{C}^{2\times2}$ space, then the $n$-fold Pauli group will form a base for the n-dimensional subspace $(\mathbb{C}^{2\times2})^{\otimes n} = \mathbb{C}^{2^n\times2^n}$. This last statement, means that all the matrices in $\mathbb{C}^{2^n\times2^n}$ can be expressed as linear combinations of the elements of the $n$-fold Pauli group, which by the above corollary gives us the groundbreaking condition that to design good quantum error correcting codes we must needs only consider errors that are elements of the $n$-fold Pauli group.

+ +

Hopefully this approach to the Theorem aids in understanding its utility and importance.

+",7855,,26,,11/29/2019 17:29,11/29/2019 17:29,,,,2,,,,CC BY-SA 4.0 +7104,2,,7096,8/27/2019 13:54,,1,,"

For this matrix to be a unitary, you need, as Neil mentioned, that $a^{2} + b^{2} = 1$. If that is the case, then the matrix $M$ is a rotational matrix along the $z$-axis. In other words (and how it shows on the wikipedia page you linked), it is a phase gate $R_{\phi}$, or also known as $R_{z}(\theta)$.

+ +

Since a global phase can always be omitted, we can write: +\begin{equation} +M = \begin{bmatrix}a - ib & 0 \\ 0 & a + ib\end{bmatrix} = (a - ib)\begin{bmatrix}1 & 0 \\ 0 & \frac{a + ib}{a - ib}\end{bmatrix} = (a - ib)\begin{bmatrix}1 & 0 \\ 0 & \frac{a^{2} - b^{2} - 2iab}{a^{2} + b^{2}}\end{bmatrix} \hat{=} \begin{bmatrix}1 & 0 \\ 0 & a^{2} - b^{2} - 2iab\end{bmatrix}, +\end{equation} +where $\hat{=}$ indicates that it has the same action on a qubit (this is the global phase, practically). So from that you can easily compute the $\phi$ as $2\tan(\frac{b}{a})$.

+",8141,,434,,8/27/2019 21:03,8/27/2019 21:03,,,,1,,,,CC BY-SA 4.0 +7106,1,,,8/27/2019 18:50,,3,102,"

I earlier posted I question Representing a Bell measurement on non adjacent qubits for which I got an excellent answer. Now I want to build upon that and do further analysis which is where I am stuck. So here it goes. Consider the original state as $${|\psi\rangle} = s {\Bigl(|0\rangle_1|1\rangle_2-|1\rangle_1|0\rangle_2\Bigr)}\otimes{\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)}\otimes{\Bigl(|0\rangle_5|1\rangle_6-|1\rangle_5|0\rangle_6\Bigr)},$$ which is being shared by 3 parties where Alice get particle $1$ and $6$, Bob gets $2$ and $3$, Charlies gets $4$ and $5$. Now the sharing protocol is as follows:

+ +
    +
  1. First, Alice performs a local unitary operation randomly +on one of her two qubits 1 and 6, say, on qubit $1$.

  2. +
  3. Then she performs a Bell-state measurement on +qubits $1$ and $6$ and announces publicly her measurement outcome. +After this, Bob and Charlie perform Bell-state measurements +on their qubits, respectively, and record the +measurement outcomes.

  4. +
  5. If Bob and Charlie collaborate, +according to their Bell-state measurement outcomes and Alice’s +public announcement of the Bell-state measurement on +qubits $1$ and $6$, they can deduce the exact local unitary operation +that Alice performed on qubit $1$.

  6. +
  7. For example, if Bob’s and +Charlie’s outcomes are respectively $|\psi^{-}\rangle_{23}$ +and $|\phi^{+}\rangle_{45}$, since +the state Alice prepared initially in qubits $3$ and $4$ is $|\psi^{-}\rangle_{34}$, +then from Eq.7, they can know that qubits $2$ and $5$ have +projected to $|\phi^{+}\rangle_{25}$ +after Alice’s Bell-state measurement on +qubits $1$ and $6$. Since both the initial states of the qubit pair +$(1,2)$ and the initial states of the qubit pair $(5,6)$ are $|\psi^{-}\rangle$, respectively, and Bob and Charlie know Alice’s Bell-state +measurement outcome on qubits $1$ and $6$, $|\phi^{+}\rangle_{16}$ and +they have already deduced the state $|\phi^{+}\rangle_{25}$ of qubits $2$ and $5$, +then from Eq. $8$ they can determine that the local unitary +the operation performed by Alice is $u_4$, that is, the secret message is the two classical bits “11.” +What I have understood is, let's say the original state is $|\Psi\rangle$

  8. +
  9. $${|\psi\rangle} = s {\Bigl(|0\rangle_1|1\rangle_2-|1\rangle_1|0\rangle_2\Bigr)}\otimes{\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)}\otimes{\Bigl(|0\rangle_5|1\rangle_6-|1\rangle_5|0\rangle_6\Bigr)},$$

  10. +
  11. Now alice performs say $X$ gate on his qubit $1$, so the new state is +${|\psi\rangle} = s {\Bigl(|1\rangle_1|1\rangle_2-|0\rangle_1|0\rangle_2\Bigr)}\otimes{\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)}\otimes{\Bigl(|0\rangle_5|1\rangle_6-|1\rangle_5|0\rangle_6\Bigr)},$$

  12. +
  13. Alice measures say the state $ |\psi^+\rangle_{16}$ , and tells both Bob Charlie. Now after his measurement Bob and Charlie receive the reduced state +$${|\psi\rangle} = s {}{\Bigl(|0\rangle_3|1\rangle_4-|1\rangle_3|0\rangle_4\Bigr)}\otimes{\Bigl(|0\rangle_2|0\rangle_5+|1\rangle_2|1\rangle_5\Bigr)},$$

  14. +
  15. Now, here things becoming complicated for me while reading, what happens when Bob measures $|\Psi^-\rangle_{34}$ and Charlie measures $|\Phi^+\rangle_{25}$. I am not able to understand the language the point $4$.

  16. +
+ +

$u_3(|\Psi^-\rangle_{ab}) \otimes |\Psi^-\rangle_{cd}$= $ |\Phi^+\rangle_{ab} \otimes |\Psi^-\rangle_{cd} = |\Phi^-\rangle_{ac}|\Psi^+\rangle_{bd} - |\Psi^+\rangle_{ac}|\Phi^-\rangle_{bd}- |\Psi^-\rangle_{ac}|\Phi^+\rangle_{bd} + |\Phi^+\rangle_{ac}|\Psi^-\rangle_{bd}$ where $u_3=|1\rangle\langle 0|+ |0\rangle\langle 1|$. I understand all the operators except this equation and the theoretical explaination. Can somebody explain it in a simple manner?

+",6070,,55,,1/7/2021 10:59,1/7/2021 11:56,Determining the quantum secret,,1,0,,,,CC BY-SA 4.0 +7108,2,,2536,8/28/2019 5:31,,1,,"
+

How is D-Wave's Pegasus architecture different from the Chimera architecture?

+
+ +

See: ""Pegasus: The second connectivity graph for large-scale quantum annealing hardware"" (Jan 22 2019), by Nike Dattani (Harvard), Szilard Szalay (Wigner Research Centre), and Nick Chancellor (Durham). Figures were made with their open source software PegasusDraw.

+ +
+

""The 128 qubits of the first commercial quantum annealer (D-Wave One, released in 2011) were connected[by a graph called Chimera (first defined publicly in 2009 [1]), which is rather easy to describe: A 2D array of $K_{4,4}$ graphs, with one ‘side’ of each $K_{4,4}$ being connected to the same corresponding side on the $K_{4,4}$ cells directly above and below it, and the other side being connected to the same corresponding side on the $K_{4,4}$ cells to the right and left of it (see Figure 1). The qubits can couple to up to 6 other qubits, since each qubit couples to 4 qubits within its $K_{4,4}$ unit cell, and to 2 qubits in the $K_{4,4}$ cells above and below it, or to the left and right of it. All commercial quantum annealers built to date follow this graph connectivity, with just larger and larger numbers of $K_{4,4}$ cells (see Table 1). + $$\begin{array}{lc} +&\text{Array of }K_{4,4}\text{ cells} & \text{Total # of qubits} \\ +\text{D-Wave One} & 4 \times 4 & 128 \\ +\text{D-Wave Two} & 8 \times 8 & 512 \\ +\text{D-Wave 2X} & 12 \times 12 & 1152 \\ +\text{D-Wave 2000Q} & 16 \times 16 & 2048 +\end{array} +$$ + $$\text{Table I: Chimera graphs in all commercial quantum +annealers to date.}$$

+ +

In 2018, D-Wave announced the construction of a (not yet commercial) quantum annealer with a greater connectivity than Chimera offers, and a program (NetworkX) which allows users to generate certain Pegasus graphs. However, no explicit description of the graph connectivity in Pegasus has been published yet, so we have had to apply the process of reverse engineering to determine it, and the following section describes the algorithm we have established for generating Pegasus.

+ +

[1] H. Neven, V. S. Denchev, M. Drew-Brook, J. Zhang, W. G. Macready, and G. Rose, NIPS 2009 Demonstration: Binary Classification using Hardware Implementation of Quantum Annealing, Tech. Rep. (2009).

+
+ +

+ +

There are a few dozen illustrations in that paper, verified by Kelly Boothby of D-Wave, I don't want to overquote; I believe I've covered the gist of it.

+ +

A few points:

+ +
    +
  • Every qubit is associated with 6 indices: (x, y, z, i, j, k).

  • +
  • The degree of the vertices (which is 15) has increased by a factor of 2.5 when compared to the degree of Chimera (which is 6), except the cells at the boundary.

  • +
  • Pegasus' non-planarity expands on the number of binary optimization problems that cannot yet be solved in polynomially time on a D-Wave.

  • +
  • All quadratization gadgets for single cubic terms which require one auxiliary qubit, can be embedded onto Pegasus with no further auxiliary qubits because Pegasus contains $K_4$, which means that all three logical qubits and the auxiliary qubit can be connected in +any way, without any minor-embedding.

  • +
+ +

See also: ""Quadratization in discrete optimization and quantum mechanics"", (Jan 14 2019), by Nike Dattani. GitHub source code.

+",278,,,,,8/28/2019 5:31,,,,0,,,,CC BY-SA 4.0 +7110,2,,7096,8/28/2019 8:57,,1,,"

If $A$ is an operator, and $A^2=\mathbb{I}$, then you can show that

+ +

$$e^{-ixA}=\cos(x)\mathbb{I}-i\sin(x)A $$

+ +

Just write down $e^{-ixA}$ as a series and separate the even and odd indices. Since $\sigma_z^2=\mathbb{I}$, provided that $a^2+b^2=1$ (hence this transformation is a valid quantum gate) then you can write in polar coordinates $a=\cos(\theta)$, $b=\sin(\theta)$, and your gate is

+ +

$$e^{-i\theta\sigma_x} $$

+ +

which is clearly a rotation around the $z$ axis in the Bloch sphere. As others have mentioned is $a^2+b^2\neq 1$ then this isn't a quantum gate, as it is not unitary.

+",5125,,5125,,8/28/2019 9:15,8/28/2019 9:15,,,,0,,,,CC BY-SA 4.0 +7111,1,,,8/28/2019 11:12,,1,140,"

I want to know whether I can have a operator $A$ which commutes with four other operators $M_1$, $M_2$, $M_3$, and $M_4$ (for instance, drawing the operators $M_j$ from $\{H,I,X,Y\}$).

+ +

When can we tell that such an operator $A$ exists?

+",4575,,55,,7/26/2020 18:09,7/26/2020 18:09,Can one operator commute with four other operators?,,2,3,,,,CC BY-SA 4.0 +7112,1,7113,,8/28/2019 11:36,,3,251,"

I am stuck with this exercice of Nielsen and Chuang:

+ +
+

Let $S = \langle g1,... ,gl \rangle $.Show that $−I$ is not an element of S if and only if $g^2_j = I$ for all $j$,and $g_j \neq − I$ for all $j$.

+
+ +

$S$ is a subgroup of $G_n$ the set of $n$ Pauli matrices.

+ +

What I don't understand is that if I consider:

+ +

$$S=\langle X, -X \rangle$$

+ +

I have the two properties: $g^2_j = I$ for all $j$,and $g_j \neq − I$ for all $j$

+ +

However, $X*(-X)=-X^2=-I$

+ +

Thus it is a counter example of the property I should show. So I guess there is something I miss here but I don't get what...

+",5008,,26,,10/14/2019 16:19,10/14/2019 16:19,Exercise 10.34 of Nielsen and Chuang : $-I$ not element of stabilizer group iff $g_j^2=I$ and $g_j \neq I$ where $g_j$ generators,,1,2,,,,CC BY-SA 4.0 +7113,2,,7112,8/28/2019 14:13,,5,,"

Consulting my local copy of Nielsen & Chuang (10th anniversary edition, p. 457), the complete statement of the exercise is pretty much exactly as you have given it:

+ +
+

Exercise 10.34. Let $\langle g_1, \ldots, g_l \rangle$. Show that $-I$ is not an element of $S$ if and only if $g_j^2 = I$ for all $j$, and $g_j \ne - I$ for all $j$.

+
+ +

Reading the text as though I were learning the material for the first time, the context does not seem to impose many further restrictions. It is clear from context that each $g_j$ is meant to be a Pauli operator (an element of $G_n$ in the notation of Chapter 10) — and, just plausibly (but not very explicitly), we could suppose that the operators $g_j$ are meant to commute with one another. But:

+ +
    +
  • Without the explicit constraint that the operators commute, we could reasonably consider $\langle X, Z \rangle$ to be another counterexample, which contains the element $-I = ZXZX$.

  • +
  • Even supposing that we restrict ourselves to abelian subgroups of $G_n$, the preceding text does not require that the generators $g_j$ be linearly independent operators, i.e. in this case that $g_j \ne - g_k$ for all $j,k$. This allows you to obtain the counterexample $\langle X, -X \rangle$ as you have done.

  • +
  • Worse, it is not enough to simply check pairs of generators to see whether they are proportional to one another: the group $\langle X\!\otimes\!X, Y\!\otimes\!Y, Z\!\otimes\!Z \rangle$ has independent generators and linearly independent generators, but still include $-I = (X\!\otimes\!X)(Y\!\otimes\!Y)(Z\!\otimes\!Z)$.

  • +
+ +

I would propose that the exercise should be re-worded as follows:

+ +
+

Exercise 10.34  ( revised ). Let $\langle g_1, \ldots, g_l \rangle$ be a commutative subgroup of $G_n$. Show that $-I$ is not an element of $S$ if and only if $g_j^2 = I$ for all $j$, and no product of any subset of $\{g_1, \ldots, g_l\}$ is equal to $-I$.

+
+ +

It might seem as though the final condition (on subsets of the generators) rather gives the game away. However, from the fact that we are requiring that $g_j^2 = I$, we are essentially considering the Pauli group as a non-abelian group which contains elements of order $2$ and order $4$: from the very elementary starting point taken by Nielsen and Chuang, it is perhaps a useful exercise to take the time to show that in an abelian group whose generators all have order $2$, then every element $g$ is characterised by a subset of generators which you use exactly once in a product to obtain $g$. To people familiar with group theory (or whose prejudices are sufficiently steeped in computer science that they quickly leap to thinking about bit-vectors anyway), it is clear that the second condition amounts to saying the $-I$ is not generated by any product of generators — but we should recall that the target audience also includes physicists who might not see these things as quickly, as they have likely been pre-occupied mostly with solving differential equations or coding up numerical simulations before encountering Nielsen and Chuang.

+ +

This revised version of Exercise 10.34 is thus a relatively elementary exercise which gets you to think of subgroups of the Pauli group in which every element has order 2, getting you ready to think about them in terms of bit-vectors. It could be that this is actually be what Nielsen and Chuang originally intended. Whether or not this is the case, however, it is also the smallest modification of the exercise that I can think of which makes it correct.

+",124,,,,,8/28/2019 14:13,,,,0,,,,CC BY-SA 4.0 +7116,2,,7111,8/29/2019 7:09,,2,,"

If an operator $A$ commutes with $X$ and $Y$ it already must be trivial ($A = c I, c\in \mathbb{C}$). One way to prove this is to note that $A$ also commutes with $Z$ since $Z = \frac{1}{2}i(YX - XY)$, and $A$ trivially commutes with $I$. Since $A$ commutes with $I, X, Y, Z$, which is Pauli basis of all operators, then $A$ commutes with any other operator, hence it must be trivial.

+ +

In general case you can have any number of commuting operators since all diagonal operators commute, as was pointed out by Norbert Schuch.

+",5870,,5870,,8/29/2019 7:29,8/29/2019 7:29,,,,0,,,,CC BY-SA 4.0 +7117,1,,,8/29/2019 7:41,,8,2329,"

I have ran an experiment in one of the IBM processors and the work has finished. However, I can not obtain the data as histograms or counts in the qiskit notebook because the experiment was concluded while I was logged off and therefore now I would need to run the full script again. That is, I would need to run the experiment again. My question is if there is some way to access the results in the notebook without this requirement. I know that the histograms are stored in the section ""results"" but I specifically want to work with them in the notebook. Thank you.

+",8388,,26,,11/24/2019 14:16,3/16/2022 5:44,Access results from an experiment without having to run the script again,,3,1,,,,CC BY-SA 4.0 +7118,2,,7117,8/29/2019 7:58,,4,,"

First, set up your provider

+ +
provider = IBMQ.load_account()
+
+ +

From this you can access a list of all your jobs with

+ +
provider.circuits.client.get_status_jobs()
+
+ +

Each job is recorded as a dictionary. One of the keys is 'id', which is the job id. To extract this for the first job on the list, for example, use

+ +
job_id = provider.circuits.client.get_status_jobs()[0]['id']
+
+ +

You can then use

+ +
job_info = provider.circuits.client.get_job(job_id)
+
+ +

To get a JSON which contains all the information about the job, including the results. The counts data for the first circuit in the job, for example, can be found at

+ +
job_info['qObjectResult']['results'][0]['data']['counts']
+
+ +

Though note that the strings will be hex strings rather than bit strings, and so will need conversion.

+",409,,409,,9/2/2019 11:05,9/2/2019 11:05,,,,4,,,,CC BY-SA 4.0 +7119,2,,6935,8/29/2019 11:28,,15,,"

We can try to geometrically interpret the Knill–Laflamme conditions on a code-space $\mathcal C$, as follows.$\def\ket#1{\lvert#1\rangle}\def\bra#1{\langle#1\rvert}$

+ +

Images of the code-space under an error operation

+ +

First, consider any individual error operator $E_j$: this is a Kraus operator of some transformation of the system, and so is not necessarily even unitary.

+ +

For any input pure state $\ket\psi \in C$ and for an arbitrary operator $E_j$, the vector $E_j \ket{\psi}$ will represent some distorted image of the input state. You might wonder whether different states $\ket\psi \in \mathcal C$ could be affected in different ways: specifically, whether some vectors $E_j \ket\psi$ will have different norms for various states $\ket\psi$. The Knill–Laflamme condition indicates that this isn't possible: as $P_{\mathcal C} E_{\!\!\:j}^\dagger E_{\!\!\:j}^{\phantom\dagger} \!P_{\mathcal C} = \alpha_{\!\!\:j,j} P_{\mathcal C}$ for some scalar $\alpha_{\!\!\:j,j}$ (which we can show is a non-negative real), it follows that $\lVert E_j \ket\psi \rVert^2 = \alpha_{\!\!\:j,j}$ for all $\ket\psi \in \mathcal C$.

+ +

So: for any set of errors $\{E_j\}_j$ satisfying the Knill–Laflamme conditions, each error $E_j$ produces some faithful image of the original code-space $\mathcal C$i.e., proportional to a unitary transformation on $\mathcal C$, even if $E_j$ is not itself proportional to a unitary.

+ +

Images of the code-space under different error operations

+ +

Next, consider how these images of the code-space compare for two different error operators $E_j$ and $E_k$, and under what conditions we can hope to recover a state which have been affected by one of the errors.

+ +
    +
  • In some cases — as with distinct single-qubit Pauli operators on a code with distance 3 or greater — the subspace $E_{\!\!\:j}\!\: \mathcal C$ and $E_k \mathcal C$ will be orthogonal to one another, and therefore perfectly distinguishable. In particular, we would then have $E_j\ket\psi \perp E_k\ket\varphi$ for any $\ket\psi,\ket\varphi \in \mathcal C$, so that $P_{\mathcal C} E_{\!\!\:j}^\dagger E_{\!\!\:k}^{\phantom\dagger}\!\!\: P_{\mathcal C} = 0$. If all of the error operators $\{E_j\}_{j}$ are 'orthogonal' in this sense, there would then be no problem to correct the errors: we could simply perform a measurement of which of the subspaces $E_r \!\: \mathcal C$ we were in, and then perform a unitary transformation which maps $E_r \!\:\mathcal C \mapsto \mathcal C$. This corresponds to the case where $\alpha_{j,k} = 0$ for any $j \ne k$.

  • +
  • However, it is also possible (for instance, in a degenerate code as Patrick Fuentes indicates in his answer) to have errors $E_j$ and $E_k$ in which $E_{\!\!\:j}\!\: \mathcal C$ and $E_k \mathcal C$ are not orthogonal: the unit vectors in those subspaces may have non-zero overlap, or the two subspaces may even be the same. In this case, the only hope for us to be able to correct the error is +that — to the extent that the effect of $E_j$ and $E_k$ on the +code-space cannot be distinguished — the two images in a sense agree.

    + +

    What I mean by this is: suppose that you had a state $\ket\psi \in \mathcal C$ which (unbeknownst to you) was affected by the error $E_j$, yielding the state $\ket{\psi'} = E_j \ket{\psi}$. Suppose that you then tried to determine whether it was affected instead by the error $E_k$, by measuring whether the state was in the space $E_k \mathcal C$. In general, this would disturb the state $\ket{\psi'}$. However, if $\ket{\psi'}$ collapsed to the state $\ket{\psi''} = E_k \ket{\psi}$, there would be no problem: you could simply correct the state as though $E_k$ had happened, and thereby recover $\ket{\psi}$.

    + +

    This is what is guaranteed by the Knill–Laflamme conditions: that for any state $\ket{\psi} \in \mathcal C$, the projection of $E_{\!\!\:j}\!\: \ket{\psi}$ onto $E_k \mathcal C$ will be proportional to $E_k \ket{\psi}$. Furthermore, that the constant of proportionality $\alpha_{j,k}$ involved is the same for all $\ket{\psi} \in \mathcal C$.

  • +
+ +

Thus, the Knill–Laflamme conditions imply that, to the extent that we cannot perfectly distinguish the effects of $E_j$ and $E_k$ on the entire subspace $\mathcal C$, the effects of $E_j$ and $E_k$ on individual states in $\mathcal C$ are also indistinguishable, so that we cannot confuse one error $E_j$ for another error $E_k$ plus some transformation on the original encoded state.

+ +

In summary

+ +

The Knill–Laflamme conditions on a set of error operators $\{E_j\}_j$ on a code-space $\mathcal C$ indicate that the effect of any one error $E_j$ affects the entire space a uniform way (rescaling it uniformly and transforming it unitarily otherwise); and that to the extent that the effects of two errors $E_j$ and $E_k$ cannot be operationally distinguished from one another, their effect on the code-space is the same as one another, so that you can measure which error occurred and then correct the state as though that error actually is the one that did occur.

+",124,,124,,8/29/2019 13:39,8/29/2019 13:39,,,,10,,,,CC BY-SA 4.0 +7120,1,7158,,8/29/2019 13:04,,7,132,"

I am trying to understand ""Stabilizer codes construction"" in Nielsen & Chuang (page 465). Below, we're working in a Hilbert space of dimension $2^n$, and $G_n$ is the $n$-qubit Pauli group.

+ +

A stabilizer group $S=\langle g_1,...,g_{n-k} \rangle \subseteq G_n$ is a commuting subgroup of Pauli operators such that $-I \notin S$. Below, we suppose that the operators $g_j$ are independent, in which case the stabilised space $V_S$ has dimension $2^k$.

+ +

Given $n-k$ generators, from their representation in terms of bit-vectors, it is easy to see that we can always find some $k$ additional independent generators. However, how can we be sure that we can always find $k$ additional commuting generators?

+",5008,,124,,8/29/2019 14:46,9/2/2019 9:47,"Given $n-k$ stabiliser generators, how can we find an additional $k$ commuting generators?",,1,4,,,,CC BY-SA 4.0 +7121,1,7132,,8/29/2019 21:06,,3,56,"

All the entanglement I've see is between 2 parties that have the same number of qubits. Is it possible to have entanglement where each party has a different number of qubits? Is it possible to have entanglement between 3 parties?

+",7734,,55,,1/7/2021 10:59,1/7/2021 10:59,Is it possible to have entanglement with different sized parties or with more than 2 parties?,,1,0,,,,CC BY-SA 4.0 +7122,2,,7062,8/30/2019 0:26,,4,,"

The problem is that you applied a Swap gate when you should have applied a CSWAP, and so you never entangled the readout qubit with your query states (as a result the readout qubit will always return a ""0"", which makes sense because the net effect of $HH|0\rangle$ is $I|0\rangle$).

+ +

Continuing your derivation starting from just after the first Hadamard, we apply a CSWAP gate on the ancilla qubit of $\psi$ (before $a$ or $b$) and the only qubit on $\phi$ (after $a$ or $b$):

+ +

$$ \rightarrow \frac{1}{2\sqrt{Z}} (|a|| 0,0,a,0\rangle + |a|| 1,0,a,0\rangle - |b|| 0,0,a,1\rangle -|b|| 1,1,a,0\rangle$$ +$$+ |a|| 0,1,b,0\rangle+|a|| 1,0,b,1\rangle - |b|| 0,1,b,1\rangle - |b|| 1,1,b,1\rangle ) $$

+ +

Rearranging before applying the Hadamard: +$$ \rightarrow \frac{1}{2\sqrt{Z}} (|a|(|0\rangle + |1\rangle) |0,a,0\rangle - |b|(|0\rangle + |1\rangle) |1,b,1\rangle$$ +$$ + (|a|| 0,1,b,0\rangle +|a|| 1,0,b,1\rangle - |b|| 0,0,a,1\rangle -|b|| 1,1,a,0\rangle) +$$

+ +

Now apply a Hadamard to the first qubit and group by the state of the first qubit (you only need to work out the amplitude for the first qubit being in ""$|0\rangle$"", and normalization will tell us the amplitude for being in ""$|1\rangle$""): +$$ \rightarrow \frac{1}{\sqrt{2Z}} |0\rangle \lbrack 2 |a| |0,a,0\rangle - |b| |0,a,1\rangle + |a| |1,b,0\rangle - 2|b| |1,b,1\rangle + |a||0,b,1\rangle -|b||1,a,0\rangle\rbrack + \cdots$$

+ +

$$=\frac{1}{\sqrt{2Z}} |0\rangle \lbrack (|0,a\rangle + |1,b\rangle ) (|a| |0\rangle - |b| |1\rangle ) + (|a| |0\rangle - |b| |1\rangle )(|a,0\rangle + |b,1\rangle ) \rbrack + \cdots +$$

+ +

You can check that this is on the correct track because it has the form of the ""symmetric"" combination of swapped states that provides the amplitude for a ""0"" readout in the SWAP test (equation 127 from your first ref): +$$ +\frac{1}{2}|0\rangle (|\psi\rangle|\phi\rangle + |\phi\rangle|\psi\rangle) + \cdots +$$

+ +

Though in this case you need to account for the fact that you only partially swapped the registers of $|\psi\rangle$ and $|\phi\rangle$, which is why the $a$ and $b$ states remain in the third slot for both parts of the superposition. Then from this simpler expression you can continue with the derivation of the ordinary SWAP test to find that the readout probability for ""0"" is directly related to Euclidean distance.

+",1939,,,,,8/30/2019 0:26,,,,1,,,,CC BY-SA 4.0 +7124,1,,,8/30/2019 9:28,,2,325,"

I have a 2 qubits system, maximally entangled, and I performed measurement on one of the qubit.

+
q = QuantumRegister(2)
+c = ClassicalRegister(1)
+qc = QuantumCircuit(q, c)
+###create Bell State Qubit########
+qc.h(q[1])
+qc.cx(q[1],q[0])
+### Perform Measurement ##########
+qc.measure(q[0],c)
+job = execute(qc,simulator,shots = 1000)
+result = job.result()
+counts = result.get_counts(qc)
+print("\nTotal count for 0 and 1 are:",counts)
+
+

Before measurement, the state of the 2 qubit is $|00\rangle+|11\rangle/\sqrt{2}$. After obtaining the measurement result, I measured another qubit. I expected the 2nd qubit to collapse to either 1 of the 2 states($|0\rangle$ or $|1\rangle$) after measurement, but the result shows it is still in the superposition state. How do I renormalise the qubit state after measurement?

+
qc.measure(q[1],c)
+job = execute(qc,simulator,shots=1000)
+result = job.result()
+counts = result.get_counts(qc)
+print("\n Total count for 0 and 1 are:,counts")
+
+",8334,,16092,,6/21/2021 15:50,11/13/2022 18:07,Qiskit - Renormalize the qubit after measurement,,1,2,,,,CC BY-SA 4.0 +7125,1,7126,,8/30/2019 11:34,,2,314,"

Below I created a circuit and applied several gates to it:

+ +
n = 4
+
+qubits = QuantumRegister(n, name='q')
+ansilla = QuantumRegister(n - 1, name='ans')
+
+circuit = QuantumCircuit(qubits, ansilla)
+
+# I step
+circuit.ccx(qubits[0], qubits[1], ansilla[0])
+
+# II step
+for i in range(2, n - 1):
+    circuit.ccx(qubits[i], ansilla[i-2], ansilla[i-1])
+
+
+# III step
+circuit.cx(ansilla[-1], qubits[-1])
+
+ +

When I draw a visualization with circuit.draw() I got the following diagram:

+ +

+ +

It draws III step before II step.

+ +

Is it a bug or how can I overcome this problem?

+ +

I use qiskit version=0.8.2

+",6134,,,,,9/5/2019 10:36,Why qiskit changed the order of gated applied to a circuit,,2,0,,,,CC BY-SA 4.0 +7126,2,,7125,8/30/2019 11:42,,1,,"

Why does it do it? I don't know.

+ +

What I do know is that it isn't a problem when the circuit is run. Step II and step III are applied to completely different sets of qubits. As such, it does not matter which is done first.

+ +

If you nevertheless want to stop it happening, circuit.draw(justify='none'). If that ever doesn't work for any reason, you can put a circuit.barrier() operation between the steps. This will stop the compiler doing whatever it is doing.

+ +

Since this behaviour is obvious not intended, please consider filing an issue so that it can be fixed.

+",409,,409,,9/5/2019 10:36,9/5/2019 10:36,,,,2,,,,CC BY-SA 4.0 +7127,1,,,8/30/2019 11:52,,4,104,"

It is a proven and well-known fact that length-4 cycles are detrimental to the performance of classical LDPC codes. This is due to the fact that such short cycles impair the decoding algorithm (Sum Product or Belief Propagation over the code Tanner Graph), reducing its convergence threshold and negatively impacting its performance. For this reason, numerous algorithms and LDPC code construction techniques that minimize the presence of these short cycles (i.e maximize the code girth) have been devised.

+ +

In the Quantum realm, Quantum LDPC codes are designed based on the Stabilizer formalism, which allows us to construct QLDPC codes by making use of existing classical LDPC codes, albeit following specific criteria to select the aforementioned existing classical codes. They are also decoded based on implementations of the SPA or BPA over the associated Tanner graphs. Therefore, it is intuitive to assume, without considering the specifics of a quantum framework, that length-4 cycles will also have a negative impact on the performance of QLDPC codes based solely on what is known from classical communications.

+ +

Let us now consider how QLDPC codes, or their quantum parity check matrices more precisely, are constructed (I will employ the CSS construction method as it is the most common): $$ H_Q = (H_z|H_x) = +\begin{pmatrix} H_z^{'} &0 \\ + 0 &H_x^{'} \end{pmatrix}, $$ where $ H_z = \begin{pmatrix} H_z^{'} \\ 0 \end{pmatrix}$ and $ H_x = \begin{pmatrix} 0 \\ H_x^{'} \end{pmatrix}$. In the construction shown above, $H_z'$ and $H_x'$ are the parity check matrices of two classical LDPC codes $C_1$ and $C_2$, chosen so that $C_1^\perp \in C_2$ is fulfilled, where $C_1^\perp$ is the dual of the classical LDPC code $C_1$.

+ +

In essence, the Quantum PCM of a QLDPC code is constructed based on the classical PCMs of two classical LDPC codes. Thus, we are faced with a ""double whammy""-like scenario:

+ +
    +
  • On the one hand, the QPCM is built from two different parity check matrices that will inevitably have some length-4 cycles.

  • +
  • In addition, the symplectic representation employed in Quantum error correction automatically induces more length-4 cycles. This stems from the fact that the generators of the code must commute in order to satisfy the symplectic criterion, which ensures the resulting code is applicable in a quantum environment.

  • +
+ +

Based on what I have mentioned up to this point, it would seem reasonable to assume that minimizing or even eliminating all the length-4 cycles from the PCM of a QLDPC code would undoubtedly improve performance. However, based on the work I am conducting on QLDPC codes and results I have garnered, it appears as if less length-4 cycles is not always better. In other words, there seems to be a ""sweet spot"" value of length-4 cyles at which performance of QLDPC codes peaks and increasing or decreasing the amount of cycles at that point worsens said performance. I am not entirely certain as to why this happens, but I believe an argument could be made for the presence of at least a minimum number of short cycles in the QPCM of a QLDPC code (they might aid in spreading information over the entire decoding graph which could then be exploited by the decoding algorithm due to its iterative nature).

+ +

I am trying to ascertain if pursuing methods to determine or establish a threshold of length-4 cycles that optimizes code performance is a worth-while research endeavour. I would be greatful for insights, opinions or experiences others may have had in this field. I would also be thankful if I could be directed towads publications that may discuss this topic (I recall reading a paper that mentioned the importance of having length-4 cycles in decoding graphs by I have not been able to find it).

+",7855,,55,,1/5/2021 11:37,1/5/2021 11:37,The importance of length-4 cycles in Quantum LDPC codes,,0,0,,,,CC BY-SA 4.0 +7128,2,,7124,8/30/2019 13:52,,0,,"

It looks like you are using the simulator, so adding a reset on the qubit you want to renormalize would work. The reset operation sets a qubit back to the ground state, $|0\rangle$. You would call this like any other operation: circuit.reset(<qubits>). Note: This will not work on the real devices.

+ +

If you think it is still in superposition after the measurement, applying another H-Gate would fix that as well.

+ +

However, if you plan to continue using the simulator, applying the reset might be the better option as you will always be sure, no matter what, that that qubit is back in the $|0\rangle$ state.

+",6180,,,,,8/30/2019 13:52,,,,1,,,,CC BY-SA 4.0 +7129,1,7131,,8/30/2019 14:15,,1,1340,"

For example, I have some circuit

+ +
circuit = QuantumCircuit(2)
+
+ +

After operations:

+ +
circuit.h(0)
+circuit.cx(0, 1)
+
+ +

probability amplitudes of the qubits will change.

+ +

I know that I can estimate them by measuring qubits a bunch of times and normalizing the counts:

+ +
result = execute(circuit, backend, shots=1000).result()
+counts  = result.get_counts(circuit)
+
+ +

But is there a way to directly obtain true amplitudes? Yeah, it's impossible in real life, but I hope the information is contained under the hood of qiskit for education purposes.

+",6134,,6134,,8/30/2019 14:58,8/30/2019 17:25,How to obtain qubit's amplitude in qiskit,,1,2,,,,CC BY-SA 4.0 +7130,2,,7125,8/30/2019 16:55,,1,,"

The reason this happens is that the sort order is not guaranteed for the diagram.

+ +

It's a matter of network theory. networkx is the toolkit used for the DAG (Distributed Acyclic Graph) into which circuits are decomposed.

+ +

In your example, it doesn't matter to the computation which operation occurs first.

+ +

If it matters, the order displayed is guaranteed correct.

+",7744,,,,,8/30/2019 16:55,,,,0,,,,CC BY-SA 4.0 +7131,2,,7129,8/30/2019 17:25,,5,,"

You can get these ""true amplitudes"" through the use of the statevector_simulator within Aer. If you execute the circuit on the statevector_simulator backend, it will return a statevector for the circuit. This statevector, when normalized, will return the theoretical probabilities of each state.

+ +

Let's take the circuit you posted as an example:

+ +
circuit = QuantumCircuit(2)
+circuit.h(0)
+circuit.cx(0, 1)
+
+# Retrieve the statevector_simulator backend
+backend = Aer.get_backend('statevector_simulator')
+
+result = execute(circuit, backend, shots=1000).result()
+
+# Get the statevector from result().
+statevector = result.get_statevector(circuit)
+
+# Normalize statevector to receive the true probabilities.
+
+ +

The statevector will be in the form of a list, with each entry representing a possible state. In this example, the statevector would be returned as [0.70710678+0.j 0. +0.j 0. +0.j 0.70710678+0.j]. This can be read as:

+ +
    +
  • State 00 probability = 0.70710678+0.j (which is $\frac{1}{\sqrt2}$)
  • +
  • State 01 probability = 0
  • +
  • State 10 probability = 0
  • +
  • State 11 probability = 0.70710678+0.j (which is $\frac{1}{\sqrt2}$)
  • +
+ +

Which, when normalized would give you a 50% probability of the state 00 and a 50% probability of the state 11.

+",6180,,,,,8/30/2019 17:25,,,,0,,,,CC BY-SA 4.0 +7132,2,,7121,8/30/2019 20:31,,3,,"

Sure! Look up multipartite entanglement.

+ +

An example of an entangled system among $n$ $d$-dimensional qudits is a GHZ state: +$$|\mathrm{GHZ}\rangle\equiv\frac{1}{\sqrt d}\sum_{k=1}^d \lvert \underbrace{k,k,...,k}_n\rangle +\equiv \frac{1}{\sqrt d}\sum_{k=1}^d \bigotimes_{j=1}^n \lvert k\rangle.$$ +You can think of this as a generalisation of a Bell state, which you might have heard of.

+ +

Another notorious genuinely multipartite entangled state is a $W$ state. In the simplest case of three qubits this is +$$|W\rangle=\frac{1}{\sqrt 3}(|001\rangle+|010\rangle+|100\rangle).$$

+ +

Entanglement between systems of different dimensions is also possible. For example, if you have a qubit and a qutrit, you can consider a state such as +$$\frac{1}{\sqrt2}\left[|0\rangle\otimes\frac{1}{\sqrt3}\left(|0\rangle+|1\rangle+|2\rangle\right) ++ |1\rangle\otimes\frac{1}{\sqrt2}(|0\rangle-|1\rangle)\right].$$ +A context in which you commonly encounter states with entanglement/correlation between a low-dimensional and a high-dimensional degree of freedom is for example a quantum walk (though one doesn't usually study the entanglement properties of the produced states when dealing with these).

+",55,,,,,8/30/2019 20:31,,,,0,,,,CC BY-SA 4.0 +7133,1,7135,,8/30/2019 23:47,,1,655,"

I am trying to figure out the intuitive meaning behind the eigenvalues and eigenvectors of a reduced density matrix. I understand that of a density matrix- the eigenvalues are the probability the state will be measured in the corresponding pure state eigenvector. What about a reduced density matrix?

+ +

I am trying to figure out why all eigenvalues of a reduced density matrix having two-fold degeneracy is a sufficient condition for entanglement. Any insight here would be appreciated.

+",7734,,55,,8/20/2020 8:04,8/20/2020 8:04,Intuitive meaning of the eigenvalues and eigenvectors of a reduced density matrix,,1,0,,,,CC BY-SA 4.0 +7134,1,,,8/31/2019 15:09,,2,169,"

I am learning the stabilizer code through Nielsen & Chuang which give the following hypothesis to have correctable error for stabilizer codes:

+ +
+

Let S be the stabilizer for a stabilizer code C(S). Suppose ${E_j}$ is a + set of operators in $G_n$ such that $\forall (j,k) E^{\dagger}_j E_k \notin N(S) - S$. Then, $\{E_i\}$ is a correctable set of errors for $C(S)$.

+
+ +

Where $N(S)$ is the normalizer of $S$ which is also equal to the centralizer $Z(S)$.

+ +

I agree with this statement after having gone through the proof but the initial condition is a little abstract for me. I would like to have intuition of what it means.

+ +

This is why I looked at https://en.wikipedia.org/wiki/Stabilizer_code#Stabilizer_error-correction_conditions which seems to give a nice way to interpret it.

+ +

In summary, they say that the condition as given in Nielsen & Chuang, are equivalent to say:

+ +

An error $E \in \{E_j\} \subset G_n$ (the n-Pauli group) is :

+ +
    +
  • correctable if it anti-commutes with at least one of the generators
  • +
  • correctable and commutes with all the generator $\Leftrightarrow$ $E \in S$
  • +
+ +

Which means that an error is correctable if it is NOT in $Z(S)-S$.

+ +

However I do not understand why the two proposition are equivalent.

+ +

In conclusion, my questions:

+ +

What is the physical intuition behind the abstract condition $\forall (j,k), E^{\dagger}_j E_k \notin N(S) - S$ ?

+ +

If it is the one given by the wikipedia page, then why is the wikipedia definition equivalent to the one in N&Chuang ?

+",5008,,5008,,8/31/2019 16:16,8/31/2019 16:16,Stabilizer error correction condition,,0,11,,,,CC BY-SA 4.0 +7135,2,,7133,8/31/2019 16:21,,6,,"

The interesting quantity of a density matrix (reduced or not) is its rank, that is, the number of non-zero eigenvalues it has. Rank 1 means the state is pure which can also be seen from the density matrix that takes the form of a projection on a single state +$$\rho=|\psi\rangle\langle\psi|.$$
+Higher rank density matrix implies the state is mixed. The eigenvectors associated with the different eigenvalues $p_1,p_2,...$ are the pure states in this mixture +$$\rho=p_1|\psi_1\rangle\langle\psi_1|+p_2|\psi_2\rangle\langle\psi_2|+\ldots$$
+(When some of the eigenvalues are degenerate the eigenvectors are somewhat arbitrary but the statement is essentially the same.)

+ +

Why multiple non-zero eigenvalues (they don't have to be degenerate) in the reduced state imply entanglement? Because this implies that the reduced state is mixed and (assuming the unreduced state was pure) this can only happen if the unreduced state was entangled. +If it is not clear why it is the case, I encourage you to learn about the Schmidt decomposition.

+",8288,,23,,8/31/2019 21:58,8/31/2019 21:58,,,,0,,,,CC BY-SA 4.0 +7136,2,,7111,8/31/2019 16:54,,2,,"

In general, the answer is that you need to find the irreducible representation (irrep) structure of the algebra generated by $\{M_1,M_2,...\}$. This will tell you what the commutant of the algebra looks like (commutant = {all operators that commute with all operators of the algebra}) . Then you can pick $A$ from the commutant.

+ +

In many cases the irrep of the algebra is trivial, like when the generators act irreducibly on the whole space (example: $\{X,Y\}$ acting on the space of a qubit) . Then the commutan is just the operators proportional to the identity. Another simple case is when all $\{M_1,M_2,...\}$ commute with each other. Then you just need to simultaneously diagonalize them and the commutant is all operators that act arbitrarily on the degenerate sectors.

+ +

For the general case the irrep structure is hard to find. There are numerical algorithms out there that can do the job.

+ +

I am working on an algorithm that can find the irrep structure without numerics (if the irreps are not too complicated that is, but one can also run it numerically).

+",8288,,,,,8/31/2019 16:54,,,,0,,,,CC BY-SA 4.0 +7137,1,,,8/31/2019 23:21,,0,835,"

I'm trying to plot a histogram of my code but when I run

+
plot_histogram(results.get_counts(circuit))
+
+

it gives me a traceback error.

+

This is what I had before calling the histogram function:

+
-result = execute(circuit, backend = simulator).result()
+
+

and thereafter when I try to plot it by typing

+
-plot_histogram(results.get_counts(circuit))
+
+

it doesn't work.

+",8404,,45,,9/29/2020 7:19,9/29/2020 7:19,Qiskit plot_histogram and count not working,,1,1,,9/29/2020 9:06,,CC BY-SA 4.0 +7138,1,7143,,9/1/2019 2:55,,4,479,"

From my understanding, the oracle function in Grover's algorithm is used as a way to check for the desired outcome.

+ +

I have looked at this example which implements the Exactly-1 3-SAT problem and the oracle function follows some rules which only returns True for the correct solution. I have also looked at this which looks for two marked states.

+ +

In the second example it looks like the exact solution is given to the oracle which I don't understand as I thought we are supposed to be searching for the solution.

+ +

I was wondering if I am misinterpreting this and also how an oracle function can be created if we don't know the rules (like a maze)?

+",8405,,26,,9/29/2019 9:32,9/29/2019 9:32,"In Grover's Algorithm, does the exact solution need to be given to the oracle?",,2,2,,,,CC BY-SA 4.0 +7139,1,,,9/1/2019 4:00,,3,96,"

I am trying to prove the following relation related to the Quantum Fourier Transform:

+ +

$$\sum_{y=0}^{N-1}e^{2\pi i\frac{x}{N}y} = \begin{cases}0 & \text{if } x\neq 0\mod N \\ N & \text{if } x=0\mod N\end{cases}.$$

+ +

I could not find the proof anywhere. What are the possible ways to proceed?

+",8249,,55,,9/5/2019 9:12,9/5/2019 9:12,"How do I prove that $\sum_{y=0}^{N-1}e^{2\pi i xy/N}=N\delta_{x,0}$?",,2,1,,,,CC BY-SA 4.0 +7140,1,,,9/1/2019 6:55,,1,63,"

Consider the state +$$\frac{1}{\sqrt{N}}\sum_{j=0}^{N-1}e^{2\pi i\frac{x_1}{N}j}\left|j\right>_h\left|j\right>_t.$$

+ +

In the above entangled state, what is the probability of getting $|j\rangle_t$ where $j$ belongs to $\left\lbrace 0, 1, 2, \ldots, N-1\right\rbrace$? The 1st $m$ qubits are $|j\rangle_h$ and 2nd m qubits $|j\rangle_t$. We are measuring 2nd $m$ qubits here.

+",8249,,55,,9/11/2019 21:44,9/11/2019 21:44,"What is the probability of measuring $|j\rangle$ with $j\in\{0, 1, 2, ... N-1\}$?",,1,5,,,,CC BY-SA 4.0 +7141,1,,,9/1/2019 7:55,,2,183,"

consider a 2 qubit entangled state ($\sqrt 3/2)\left|00\right> + (1/2)\left|11\right>$

+ +

Q1) Is the above entangled state a valid one? +q2) If valid then What is the probability of measuring the second qubit as $\left|0\right>$?

+",8249,,8249,,9/1/2019 8:22,9/3/2019 4:20,Measuring a single qubit in 2 bit entangled state,,2,2,,,,CC BY-SA 4.0 +7142,1,,,9/1/2019 8:17,,2,395,"

I try to follow the calculation from IBMQ experience regrading of Entanglement and Bell test which they derive the value of question as +\begin{equation} +C=\langle A B\rangle-\left\langle A B^{\prime}\right\rangle+\left\langle A^{\prime} B\right\rangle+\left\langle A^{\prime} B^{\prime}\right\rangle +\end{equation} + where ; $\langle A B\rangle= p_{++}+p_{--}-p_{+-}-p_{-+}$ and $A , A'$ is Alice's basis, $B, B'$ is Bob's basis of measurement

+ +

the choice of the basis they chose is following this $A = Z, A' = X$ and $B = W, B' = V$ where + +

+ +

then they have +\begin{equation} +\langle Z W\rangle=\langle Z V\rangle=\langle X W\rangle=\frac{1}{\sqrt{2}},\langle X V\rangle=-\frac{1}{\sqrt{2}} +\end{equation} +so that $|C| = 2\sqrt{2}$ which greater than $2$

+ +

Now, they do this experiment on the real device and obtain the following value

+ +

+ +

The question is if following their choice of basis then $\langle AB' \rangle$ = $\langle ZV' \rangle$ but from their calculation, it can be seen that $\langle AB' \rangle$ = $\langle XV' \rangle$ which seem to agree with above value.

+ +

So what is supposed to be right and wrong in this calculation and how can I know theoretically which basis is supposed to have a minus sign from this choice of basis.

+ +

Note : the link to reference will redirect to another page +https://quantum-computing.ibm.com/support/guides/introduction-to-quantum-circuits?page=5cae705d35dafb4c01214bc5 +from that page --> Introduction to Quantum Circuits --> Entanglement and Bell Tests +Sorry for the inconvenience.

+",4729,,55,,9/2/2019 18:15,9/2/2019 18:15,"In the CHSH inequality, how can I know which term is supposed to have the minus sign?",,1,0,,,,CC BY-SA 4.0 +7143,2,,7138,9/1/2019 8:18,,5,,"

The first example you're looking at is closer to the process of building an oracle for practical applications than the second one. The oracle circuit has to encode the Boolean formula for a specific instance of the problem you're trying to solve, and not the known solutions themselves. When you encode the oracle, you don't know the answer to the problem, but you do know the formula that describes the problem instance and create an oracle based on this knowledge.

+ +

The tag grovers-algorithm has a lot of discussions on oracle implementations, since this is probably one of the most confusing topics about the Grover's algorithm - you might want to check them out.

+ +

If you're looking for more examples of building oracles for SAT problems given only the SAT formula, you can find them in my tutorial (for a different flavor of SAT problem, but the logic of the steps that have to be done to convert a formula into an oracle is more or less the same for all problems).

+",2879,,,,,9/1/2019 8:18,,,,0,,,,CC BY-SA 4.0 +7144,1,,,9/1/2019 15:15,,3,149,"

I am confused by a property.

+ +

In the N&Chuang it is said that an $[n,k,2t+1]$ stabilizer code is able to correct up to $t$ errors. But for me if the code has distance $d$ it should be able to correct up to $d-1$ error.

+ +

Indeed, the distance of a quantum code is defined as the minimal weight of an element in $Z(S)-S$ (uncorrectable errors).

+ +

But then, if my error has a weight $d-1$, it is not in $Z(S)-S$ and I will be able to correct it ? +Thus an $[n,k,d]$ code is able to correct up to $d-1$ error.

+ +

Where is my mistake ?

+",5008,,,,,9/3/2019 7:54,Link between distance of a stabilizer code and number of errors it is able to correct,,2,0,,,,CC BY-SA 4.0 +7145,1,,,9/1/2019 16:31,,6,193,"

My question simply is the following: is there any interests in building arithmetic circuits such as adders or multiplier on a quantum computer?

+ +

I'm asking this because it seems that classical computers are way better at doing arithmetic operations, so even if a quantum algorithm needs to do some arithmetics, wouldn't it be better to let a classical computer handle this part and then return the results to the quantum computer so it can then continue to run the algorithm?

+",8115,,55,,9/5/2019 10:41,9/5/2019 10:41,What is the point of building arithmetic circuits in a quantum computer?,,2,0,,,,CC BY-SA 4.0 +7146,1,7159,,9/1/2019 16:45,,2,630,"

For computation, I use N working qubits and M ancilla qubits.

+ +
qubits = QuantumRegister(N, name='q')
+ancilla = QuantumRegister(M, name='anc')
+circuit = QuantumCircuit(qubits, ancilla)
+
+ +

Then at the end of a program to get state vector I do:

+ +
result = execute(circuit, Aer.backend, shots=shots).result()
+return result.get_statevector(circuit)
+
+ +

Because of ancilla qubits are usually used for computation/uncomputation steps it means that the end states of them are $|0..0 \rangle$ (at least in some cases) and I am not interested in them due to unnessasary information about M ancilla qubits contained in get_statevector(circuit).

+ +

Is it possible to get state vector so it will show amplitudes only for N working qubit?

+ +

I have an idea to solve this equation to find $S_N$ (state vector of N working qubits): +$$ S_N \otimes I_M = S_{M+N}$$ +but probably qiskit can do it internally.

+",6134,,6134,,9/1/2019 20:42,9/13/2019 14:23,How to get amplitudes only for chosen qubits?,,2,0,,,,CC BY-SA 4.0 +7147,1,,,9/1/2019 17:28,,7,1981,"

I was wondering why IBM's computer were using U1 and U2 gates as part of there basis gates since as I understood, they are particular cases of the U3 gate. Why not just use U3 gate instead ?

+ +

Thanks in advance

+",8115,,,,,9/2/2019 22:17,Why use U2 and U1 gate in IBM quantum computers?,,1,0,,,,CC BY-SA 4.0 +7149,2,,7062,9/1/2019 22:58,,5,,"

Thanks for the answers from @forky40. I accept it as the right answer, but do want to provide a complete derivation as follows.

+ +

(Same as in the original question) First, initialize per DistCalc: +$$ |\psi\rangle = \frac{1}{\sqrt{2}} (|0,a\rangle + |1,b\rangle) $$ +$$ |\phi\rangle = \frac{1}{\sqrt{Z}} (|a||0\rangle - |b||1\rangle) $$ +Also let: +$$ |\psi'\rangle = \frac{1}{\sqrt{2}} (|a,0\rangle + |b,1\rangle) $$ +Note that $\psi'$ is a valid (normalized) qubit as it can be obtained by swapping qubits from $|\psi\rangle$.

+ +

(Same as in the original question) Now, initialize per SwapTest: +$$ | 0, \psi, \phi \rangle = \frac{1}{\sqrt{2Z}} (|a|| 0,0,a,0\rangle - |b|| 0,0,a,1\rangle +|a|| 0,1,b,0\rangle - |b|| 0,1,b,1\rangle $$

+ +

(Same as in the original question) Apply Hadamard gate on first qubit: +$$ \frac{1}{2\sqrt{Z}} (|a|| 0,0,a,0\rangle + |a|| 1,0,a,0\rangle - |b|| 0,0,a,1\rangle -|b|| 1,0,a,1\rangle$$ +$$+ |a|| 0,1,b,0\rangle+|a|| 1,1,b,0\rangle - |b|| 0,1,b,1\rangle - |b|| 1,1,b,1\rangle ) $$

+ +

(Updated as suggested by @forky40) Apply Control-Swap gate on the ancilla qubit of $\psi$ (before $a$ or $b$) and the only qubit on $\phi$ (after $a$ or $b$) with the first qubit as the control bit: +$$ \frac{1}{2\sqrt{Z}} (|a|| 0,0,a,0\rangle + |a|| 1,0,a,0\rangle - |b|| 0,0,a,1\rangle -|b|| 1,1,a,0\rangle$$ +$$+ |a|| 0,1,b,0\rangle+|a|| 1,0,b,1\rangle - |b|| 0,1,b,1\rangle - |b|| 1,1,b,1\rangle ) $$ +$$= \frac{1}{\sqrt{2Z}} (|a|\frac{| 0 \rangle+| 1 \rangle}{\sqrt{2}}| 0,a,0 \rangle - +|b|\frac{| 0 \rangle+| 1 \rangle}{\sqrt{2}}| 1,b,1 \rangle)$$ +$$+\frac{1}{2\sqrt{Z}} ( - |b|| 0,0,a,1\rangle -|b|| 1,1,a,0\rangle+ |a|| 0,1,b,0\rangle+|a|| 1,0,b,1\rangle ) $$

+ +

Apply Hadamard on first qubit: +$$ \frac{1}{\sqrt{2Z}} (|a|| 0,0,a,0 \rangle -|b|| 0,1,b,1 \rangle)$$ +$$+\frac{1}{2\sqrt{2Z}} ( - |b|| 0,0,a,1\rangle - |b|| 1,0,a,1\rangle -|b|| 0,1,a,0\rangle+|b|| 1,1,a,0\rangle$$ +$$+ |a|| 0,1,b,0\rangle+ |a|| 1,1,b,0\rangle+|a|| 0,0,b,1\rangle -|a|| 1,0,b,1\rangle ) $$

+ +

Measure on first qubit to get probability in getting first qubit in $| 0 \rangle$: +$$ \vert \frac{1}{\sqrt{2Z}} (|a|| 0,a,0 \rangle - +|b|| 1,b,1 \rangle) +\frac{1}{2\sqrt{2Z}} ( - |b|| 0,a,1\rangle -|b|| 1,a,0\rangle ++ |a|| 1,b,0\rangle+ |a|| 0,b,1\rangle ) \vert^2$$ +$$=\frac{1}{8Z} \vert(|a|(2|0,a,0 \rangle + +|1,b,0 \rangle+|0,b,1\rangle)-|b|(2| 1,b,1 \rangle+| 0,a,1 \rangle+|1,a,0\rangle)\vert^2$$

+ +

Now consider qubits before and after $a$ and $b$, there are four combinations. Hence the probability is +$$\frac{1}{8Z}(|a|^2(2^2+1+1) + |b|^2 (2^2+1+1) $$ +$$ -|a||b|(\langle 0,b,1|0,a,1\rangle+\langle 0,a,1|0,b,1\rangle) + -|a||b| (\langle 1,b,0|1,a,0\rangle+\langle 1,a,0|1,b,0\rangle)$$ +$$=\frac{1}{8Z}(6(|a|^2+|b|^2)-2|a||b|\langle a|b \rangle -2|a||b|\langle b|a \rangle) = \frac{1}{8Z}(6Z-4|a||b|\langle a|b \rangle)$$ +$$=\frac{3}{4} - \frac{|a||b|}{2Z}\langle a|b \rangle$$

+ +

Alternatively, the probability can be rewritten to +$$\frac{1}{4Z} \vert(|a|(|0,\psi' \rangle + |\psi,0\rangle) +-|b|(| 1,\psi' \rangle+| \psi,1\rangle)\vert^2$$ +$$=\frac{1}{4} \vert(|\phi,\psi' \rangle + |\psi,\phi\rangle)\vert^2$$ +$$=\frac{1}{4} (\langle \phi,\psi'|\phi,\psi' \rangle + \langle \psi,\phi |\psi,\phi\rangle + +\langle \phi,\psi'|\psi,\phi \rangle + \langle \psi,\phi |\phi,\psi'\rangle) $$

+ +

Note that +$$|\psi,\phi\rangle = \frac{1}{\sqrt{2Z}}(|a|(|0,a,0\rangle+|1,b,0\rangle)-|b|(|0,a,1\rangle+|1,b,1\rangle)$$ +$$|\phi,\psi'\rangle = \frac{1}{\sqrt{2Z}}(|a|(|0,a,0\rangle+|0,b,1\rangle)-|b|(|1,a,0\rangle+|1,b,1\rangle)$$ +$$\langle \phi,\psi'|\psi,\phi\rangle = \langle \psi,\phi|\phi,\psi'\rangle = \frac{1}{2Z}(|a|^2+|b|^2-2|a|b|\langle a|b \rangle)=\frac{1}{2}-\frac{1}{Z}|a|b|\langle a|b \rangle$$ +Hence the probability is +$$\frac{1}{4}(1+1+2(\frac{1}{2}-\frac{1}{Z}|a|b|\langle a|b \rangle)=\frac{3}{4} - \frac{|a||b|}{2Z}\langle a|b \rangle$$

+ +

Finally +$$\frac{3}{4} - \frac{|a||b|}{2Z}\langle a|b \rangle=\frac{1}{2}+\frac{Z-2|a||b|\langle a|b \rangle}{4Z}$$ +$$=\frac{1}{2}+\frac{|a|^2 \langle a|a \rangle + |b|^2 \langle b|b \rangle -2|a||b|\langle a|b \rangle}{4Z}$$ +$$=\frac{1}{2}+\frac{||a||a \rangle - |b||b \rangle|^2}{4Z}=\frac{1}{2}+\frac{|a-b|^2}{4Z}$$

+",8321,,,,,9/1/2019 22:58,,,,0,,,,CC BY-SA 4.0 +7150,2,,7145,9/1/2019 23:03,,1,,"

Quantum arithmetic circuits are useful in implementing ""oracles"" in various general quantum algorithms. For example, if we want to apply Grover's algorithm to solve a real Traveler's salesman problem, we need to implement the ""oracle"" inside the quantum circuit. Of course, in this case, we still need the conventional computer to prepare the quantum circuits according to the specific Traveler's salesman problem, including how cities are connected and weights are assigned to roads.

+",8321,,,,,9/1/2019 23:03,,,,0,,,,CC BY-SA 4.0 +7151,2,,7139,9/1/2019 23:14,,1,,"

Let $f(y)=e^{2\pi i \frac{x}{N}y}, Y=\sum_{y=0}^{N-1}f(y)$. Clearly $f(0)=f(N)=1$.

+ +

If $x = 0\mod N$, then $f(y)=1$, hence $Y=N$.

+ +

If $x\not= 0 \mod N$, then $f(1)\not=1$. +Now $f(1)Y=\sum_{y=1}^{N}f(x) = Y - f(0) + f(N) = Y$, so $Y(f(1)-1)=0$. Since $f(1)\not=1$, then $Y=0$.

+",8321,,,,,9/1/2019 23:14,,,,0,,,,CC BY-SA 4.0 +7152,2,,7141,9/1/2019 23:20,,2,,"

It is valid, as $|00\rangle$ and $|11\rangle$ are the two computational basis states and the amplitudes are normalized $(\frac{\sqrt{3}}{2})^2+(\frac{1}{2})^2=1$.

+ +

The probability of measuring the second qubit as $|0\rangle$ is $\frac{3}{4}$. BTW, as the result of the measurement, the first qubit will be also in $|0\rangle$ due to the entanglement.

+",8321,,,,,9/1/2019 23:20,,,,0,,,,CC BY-SA 4.0 +7153,2,,7138,9/1/2019 23:32,,2,,"

Nielsen and Chuang's book made a very good point about the problem to solve using Grover's algorithm: it is easy to recognize a solution but difficult to find one. As a practical example, it is much easier to determine whether a very large number between $10^{10^{10}}$ and $10^{10^{11}}$ is prime or not, than to find a prime number in this range (FYI, the largest known prime has $24,862,048$ digits).

+",8321,,8321,,9/2/2019 15:07,9/2/2019 15:07,,,,0,,,,CC BY-SA 4.0 +7154,2,,7144,9/2/2019 6:26,,3,,"

This question applies equally to classical codes, and is perhaps easier to understand in that context. Consider, for example, the 5-bit repetition code. The code words are +$$ +00000\qquad 11111 +$$ +Clearly, the distance $d=5$ because it takes 5 bit flips to convert from one code word to the other. Now, let's imagine some errors have happened. We look at our bits and read +$$ +11101 +$$ +What has happened? It's actually ambiguous. Either our codeword was 00000 and errors have happened on bits 1,2,3,5 or the codeword was 11111 and there was a single error on bit 4. With the underlying assumption that errors are unlikely, we will always resolve the ambiguity by assuming it was the most likely error sequence, i.e. the one consisting of fewest errors. So, even if it were the case that 4 errors had happened, we have no way of knowing that. We'd perform the wrong correction. So, when is correction successful? If the number of errors leaves us closer to our original codeword than the other codeword. In other words, if $d=2t+1$, then we can correct for $t$ errors. In this specific case, $t=2$.

+",1837,,,,,9/2/2019 6:26,,,,2,,,,CC BY-SA 4.0 +7155,2,,7139,9/2/2019 6:34,,2,,"

The case of $x=0\text{ mod }N$ is straightforward - each term in the sum is $e^0=1$ and there are $N$ terms in the sum.

+ +

For $x\neq 0$, there are a number of ways you could do this. I tend to use the sum of a geometric progression: +$$ +\sum_{r=0}^{N-1}a^r=\frac{a^N-1}{a-1}, +$$ +assuming $a\neq 1$. Hence, if we let $a=e^{2\pi ix/N}$, the sum is +$$ +\frac{e^{2\pi ix}-1}{e^{2\pi ix/N}-1}=0. +$$

+",1837,,,,,9/2/2019 6:34,,,,0,,,,CC BY-SA 4.0 +7156,2,,7145,9/2/2019 6:41,,2,,"

Remember that quantum computers contain, as a subset, the classical logic gates. So your assertion that ""classical computer are way better at doing arithmetic operations"" is not entirely clear. Unless you mean that the current state of the art quantum computers are not as good as classical computers.

+ +

That said, I can think of two reasons why we might want to implement simple arithmetic on a quantum computer:

+ +
    +
  • it might be that the algorithms are more efficient. As I said, classical computation is a subset. So, we have something else as well, and if we're smart, perhaps we can improve the algorithms using that something extra.

  • +
  • if you want to use the result of the calculation within part of a larger computation. You cannot just farm this out to a classical computer due to linearity. Fine, if the QC is guaranteed to be in a basis state $|a\rangle|b\rangle|0\rangle$ then you might think you could prepare $|a\rangle|b\rangle|a\oplus b\rangle$ by computing $a\oplus b$ and just making the state. But if any of the registers are in a superposition, you would be unable to read all the values, and unable to prepare a suitable superposition. The calculation has to be done within the quantum computer to preserve the linearity of the operation. It might be defined on computational basis states, but must work just as well for superpositions.

  • +
+",1837,,,,,9/2/2019 6:41,,,,0,,,,CC BY-SA 4.0 +7157,2,,7142,9/2/2019 6:51,,3,,"

The fact is that it doesn't matter. So long as one of the four terms has the minus sign on it, you'll get a suitable test. Yes, there seems to be some inconsistency with labelling the different cases, but it's not a big deal - nothing physically changes if you swap which measurement basis you call $A$ and which you call $A'$ for example; you're still doing the same experiment. Obviously in this case you want to calculate +$$ +\langle ZW\rangle+\langle ZV\rangle+\langle XW\rangle-\langle XV\rangle. +$$

+",1837,,,,,9/2/2019 6:51,,,,0,,,,CC BY-SA 4.0 +7158,2,,7120,9/2/2019 7:02,,4,,"

The way that I tend to think about it is to write out the $(n-k)\times 2n$ binary matrices specifying the generators. The first $n$ bits of each row are the locations of Pauli $X$ matrices, while the second $n$ are the locations of the Pauli $Z$ matrices. +$$ +G=\left(\begin{array}{c|c} G_x & G_z \end{array}\right) +$$

+ +

Now, imagine we introduce a new stabilizer $g=(x|z)$. It is linearly independent if $G\cdot G^t\equiv 0\text{ mod }2$. Also, it commutes if $G\cdot (z|x)^T\equiv 0\text{ mod }2$. In other words, we're looking for a vector that satisfies +$$ +\left(\begin{array}{c|c} G_x & G_z \\ G_z & G_x \end{array}\right)\cdot g\equiv 0\text{ mod }2. +$$ +Hence, we simply seek a member of the Null Space, modulo 2, of the big matrix.

+ +

Example: Think of the 3-bit majority vote. It has stabilizers $Z_1Z_2$ and $Z_2Z_3$. We can perform the necessary computation with Mathematica:

+ +
+

NullSpace[{{1, 1, 0, 0, 0, 0}, {0, 1, 1, 0, 0, 0}, {0, 0, 0, 1, 1, 0}, {0, 0, 0, 0, 1, 1}}, Modulus -> 2]

+
+ +

We get two possible answers (note, however, that these do not mutually commute): $Z_1Z_2Z_3$ and $X_1X_2X_3$. Note, of course, that we can reduce the $Z$ terms by removing products of stabilizers, returning something like $Z_1$.

+",1837,,1837,,9/2/2019 9:47,9/2/2019 9:47,,,,2,,,,CC BY-SA 4.0 +7159,2,,7146,9/2/2019 9:19,,3,,"

I think that the statevector_simulator will always return the statevector for all the qubits in the circuit. You can however add snapshots over a subset of qubits, so you could add this right at the end of your circuit and use the information you get from that instead.

+ + + +
from qiskit.extensions.simulator import snapshot
+qc.snapshot(""one_qubit"", qubits=[0])
+qc.snapshot(""many_qubits"", qubits=[0,2])
+
+backend = Aer.get_backend('statevector_simulator')
+result = execute(qc, backend).result()
+
+snapshots = result.data()['snapshots']['statevector'].items()
+
+",5955,,,,,9/2/2019 9:19,,,,7,,,,CC BY-SA 4.0 +7160,2,,7146,9/2/2019 9:41,,1,,"

If I can be sure that all ancilla qubits are in $ | 0...0 \rangle$ then that their state vector is: +\begin{bmatrix} +1 \\ +0 \\ +... \\ +0 +\end{bmatrix}

+ +

with $2^M\times 1$ dimension.

+ +

So I can take the first $2^N $ elements out of result.get_statevector(circuit) to find the state vector of working qubits.

+ +

But it's just a partial solution.

+",6134,,6134,,9/13/2019 14:23,9/13/2019 14:23,,,,0,,,,CC BY-SA 4.0 +7161,1,7163,,9/2/2019 15:04,,4,870,"

I'm having trouble understanding how the measurement on $z$ and $x$ axes can be interpreted in terms of the Bloch sphere representation.

+ +

.

+ +

I know that the state can be written as +$$∣𝜓⟩=\cos(𝜃/2)|0⟩+\exp(i𝜙)\sin(𝜃/2)|1⟩,$$ +and that to make a measurement we use the squared modulus of the inner product of the basis vector and the state vector. +For example, we have +$|⟨0|𝜓⟩|^2$ +for a $z$ measurement.

+ +

Thinking in terms of the Bloch sphere, it is clear that a rotation by an angle $𝜙$ would not affect a $z$ measurement, and this is easy to prove mathematically. +But this should also be the case for a $𝜃$ rotation on a $x$ measurement, right?

+ +

But when I try to prove it mathematically, I get

+ +

$$|⟨+|𝜓⟩|^2 = \frac{1}{\sqrt2}|(\cos(𝜃/2)+\exp(i𝜙)\sin(𝜃/2)|^2 +\\= \frac{1}{\sqrt2}|(\cos(𝜃/2)+\cos(𝜙)\sin(𝜃/2)+i \sin(𝜙)\sin(𝜃/2)|^2,$$

+ +

which then can be written in the form of $a^2 + b^2$ where +$a=\cos(𝜃/2)+\cos(𝜙)\sin(𝜃/2)$ and $b = \sin(𝜙)\sin(𝜃/2)$.

+ +

This means that $𝜃$ affects the probability of a $x$ measurement. I know I must be doing something wrong but what is it?

+ +

I also don't understand why x gate is a rotation around the x axis and not the y axis ?

+ +

Thanks in advance for your answer.

+",8115,,55,,9/2/2019 18:02,9/2/2019 18:02,How are measurements on $Z$ and $X$ axes interpreted in the Bloch sphere?,,1,0,,,,CC BY-SA 4.0 +7162,1,7169,,9/2/2019 16:36,,3,333,"

First of all, let me come out and say that I know very little about Quantum Computing (QC), even though it's a subject which fascinates me. I'd say I'm generally aware of the basic principles (with a lot of misconceptions thrown in, quite probably), but not naive enough to think I have a firm grasp of them, so please go easy on me.

+ +

I also know little about the Lattice-Boltzmann Method as my day to day at work involves using Navier-Stokes based commercial solvers for our commercial Computational Fluid Dynamics (CFD) work, and that's what I was taught in my integrated Masters. I've only briefly checked out a couple of open-source LBM codes while at work.

+ +

So, from what little understanding I have of both these topics, and from the following explanation of the LBM method - Everything you need to know about the Lattice Boltzmann Method - is it plausible to assume that this method would be inherently more suitable to implement in a QC CFD code, or am I just erroneously conflating the role that probability plays in both these topics?

+ +

Best regards,

+",8342,,,,,9/3/2019 8:46,Would the Lattice Boltzmann Method be more suitable for QC CFD than Navier-Stokes?,,1,0,,,,CC BY-SA 4.0 +7163,2,,7161,9/2/2019 17:53,,5,,"

The $\theta$ and the $\phi$ angles are not equivalent in the Bloch sphere. First, they have different ranges -- one is $\pi$ and the other is $2\pi$. More importantly, $\phi$ is a rotation around a fixed axis, $z$, while $\theta$ is a rotation around a non-fixed axis that is moving with $\phi$. For $\phi=0$ this axis is $y$, for $\phi=\pi/2$ it is $x$, and for every other $\phi$ it is everything in between in the $x-y$ plane.

+ +

If pictorially we associate the probability of outcome to depend on the angle of the state's vector with the axis of measurement (the $z$ axis is the 0,1 measurement for example), then rotations around the $z$ axis should not affect the probabilities of 0,1 outcomes, and that's why the $\phi$ angle does not change this measurement. +We cannot say the same about rotations by $\theta$ since it depends on the axis of rotation. In special cases though, for example if you set $\phi=\pi/2$, then the axis of $\theta$ rotation is $x$, then you should expect the +,- measurements along the $x$ axis not to depend on the $\theta$ (set $\phi=\pi/2$ and with basic trigo your equations should be telling you that).

+",8288,,,,,9/2/2019 17:53,,,,1,,,,CC BY-SA 4.0 +7165,2,,7137,9/2/2019 20:10,,1,,"

Looking at the code without the example it looks like you missed an ""s"" on the result variable. plot_histogram(results.get_counts(circuit)) should work.

+",302,,,,,9/2/2019 20:10,,,,0,,,,CC BY-SA 4.0 +7166,2,,7147,9/2/2019 20:34,,16,,"

There is not anything that you cant do with U3 so ideally there is no reason for U1 and U2. Eventually, as the transpilers gets better we may remove them and just have U3 and CNOT. So why did we make U1 and U2? It is because of the hardware. The U1 is done using a frame change (see https://arxiv.org/abs/1612.00858) which means they are done in software (gate time is zero). U2 is a single $\pi/2$ gate with a pre and post frame change (gate time is one unit of single-qubit gates). The one we calibrate is a $\pi/2$ rotation around the x-axis and choose the pre and post to get the definition of U2. The U3 is three frame changes and two-single qubit gates.

+ +

The reason why you would use them is the error rate. For the U1 the erorr rate is not measurable (so let us say it is zero). The error for the U3 is twice that of the U2. So if you want a better fidelity (ignoring spectator qubit errors - these are errors from parallel operations or spectator qubits being in a state that is not zero) you want to minimize the number of gates with errors so a circuit of just U1 will be better than one using U3.

+",302,,302,,9/2/2019 22:17,9/2/2019 22:17,,,,0,,,,CC BY-SA 4.0 +7167,2,,7141,9/3/2019 4:20,,2,,"

Regarding Q2, lets take the case of making a measurement on first qubit, then the probability of finding first qubit is 0.75 in |0> and 0.25 in |1> (explanation given in answer @czwang). Now say, the first qubit is found to be in |0> post measurement then the probability of second qubit to be in |0> is ONE and if the first qubit is found in |1> post measurement, then the probability of the second qubit to be in |0> is ZERO.

+ +

However, if you first perform the measurement on second qubit then the probability of second qubit to be in |0> is 0.75.

+",8120,,,,,9/3/2019 4:20,,,,0,,,,CC BY-SA 4.0 +7168,2,,7144,9/3/2019 7:54,,1,,"

From my understanding of the concept, the weight of an error $E \in G_n$, where $G_n$ represents the n-fold Pauli group, is defined as the number of terms in the tensor product that are not equal to $I$ (the identity operator). Therefore, according to this definition, error sequences of weight $t$ correspond to sequences that have errors in $t$ qubits.

+ +

The distance $d$ of a stabilizer code is defined as the minimum weight of an element that belongs to the set defined as the centralizer minus the stabilizer: $Z(S) - S$. This set contains all the elements that commute with $S$ but don't actually belong to $S$. The Pauli operators that belong to $Z(S) - S$ are such that $<\psi_i|E_a|\psi_j>\neq c_{a}\delta_{ij}$, where $E_a \in [Z(s) - S]$.

+ +

Therefore, based on our definition of distance, a stabilizer code will be able to correct $t$ errors if the error set $\mathbb{E}$ used for recovery includes all Pauli operators of weights $t$ or less. The definition given for distance implies that the criterion for error correction $<\psi_i|E_a^{\dagger}E_b|\psi_j> =c_{ab}\delta{ij}$ will be fulfilled by Pauli operators of weight $t$ or less, provided that $d \geq 2t + 1$. Thus if $d=2t+1$, the stabilizer code will be able to correct $t$ errors.

+",7855,,,,,9/3/2019 7:54,,,,0,,,,CC BY-SA 4.0 +7169,2,,7162,9/3/2019 8:46,,2,,"

If I understand correctly, the Lattice Boltzmann Method computes the probability density on a lattice. It doesn't consider sampling from that probability distribution. So, from a very remote perspective, both methods are computing some quantity over a lattice using some finite-difference approximations of differential operators. From this perspective, LBM doesn't involve more or less probability. Therefore, both equations should be equally suitable for implementing on a quantum computer.

+ +

They may have different challenges, though, because of the different operators they involve (I can't comment on that, as I haven't read in-depth any works that proposed quantum CFD).

+ +

Quantum computers would have an edge in problems where it is hard to sample such a probability distribution. For example, the evolution of a quantum Hamiltonian can lead to a probability distribution that is (believed to be) hard to sample from using a classical computer but easily implemented with a quantum one (e.g. see this article; it is very technical but the introduction seems accessible to non-experts).

+",5103,,,,,9/3/2019 8:46,,,,0,,,,CC BY-SA 4.0 +7170,1,,,9/3/2019 10:19,,0,135,"

$$\frac{1}{\sqrt{N}}\sum_{j=0}^{N-1}e^{2\pi i x j \left/ {\phantom\vert\!\!} N \right.}\,\left|j\right\rangle_h\left|j\right\rangle_t$$

+ +

For a valid state we should have sum of probabilities = 1. However, when I compute the sum of the squares of the amplitudes of this state, I get zero. Am I making a mistake?

+",8249,,124,,9/5/2019 14:29,9/5/2019 14:29,Is $\frac{1}{\sqrt{N}}\sum_{j=0}^{N-1}e^{2\pi ixj \left/\phantom\vert\!{N} \right.}|j\rangle |j\rangle$ a valid entangled quantum state?,,2,1,,,,CC BY-SA 4.0 +7171,1,7174,,9/3/2019 19:36,,0,248,"

It is possible to use cirq.simulate and then the final_state keyword to get the final wavefunction of the circuit, however, the circuit that I am trying to simulate is very large, and the simulation seems to take a long time. Thus, I was wondering if there was a function that would allow me to find the probability of measuring the specific state that I'm interested in, rather than calculating the entire wavefunction (in turn hopefully helping to speed up the program).

+",4907,,,,,9/4/2019 0:28,Is there a function that returns the probability of measuring a particular state in Cirq?,,1,0,,,,CC BY-SA 4.0 +7173,2,,7170,9/4/2019 0:15,,6,,"

For $\left|\psi\right> = \frac{1}{\sqrt{N}}\sum_{j=0}^{N-1}e^{2\pi +i\frac{x_1}{N}j}\left|j\right>_h\left|j\right>_t$ to be normalized. It must satisfy $\left<\psi|\psi\right> = 1$. Let's check, $\left<\psi|\psi\right> = \frac{1}{N}\sum_{j=0}^{N-1}e^{-2\pi +i\frac{x_1}{N}j}\left<j\right|_h\left<j\right|_t\sum_{j=0}^{N-1}e^{2\pi +i\frac{x_1}{N}j}\left|j\right>_h\left|j\right>_t$. Assuming the $\left|j\right>_i$ states are orthonormal, then $\left<\psi|\psi\right> = \frac{1}{N}N = 1$

+",8420,,,,,9/4/2019 0:15,,,,0,,,,CC BY-SA 4.0 +7174,2,,7171,9/4/2019 0:28,,1,,"

Cirq's simulator is a state vector simulator, which cannot be told to focus on the amplitude of a specific output state or combination of output states.

+ +

Some tensor network based simulators can get benefit from focusing on a specific output state, but there isn't such a simulator in Cirq.

+",119,,,,,9/4/2019 0:28,,,,1,,,,CC BY-SA 4.0 +7175,1,7179,,9/4/2019 1:15,,0,109,"

Say I want to measure a photon in state $\dfrac{\sqrt 2}{2}|0\rangle-\dfrac{\sqrt 2}{2}|1\rangle$ in the measurement basis $[|i\rangle,|-i\rangle]$.

+",8421,,55,,9/5/2019 10:59,9/5/2019 10:59,Is measuring real qubit states in a complex basis such as $|0\rangle\pm i|1\rangle$ possible?,,1,2,,,,CC BY-SA 4.0 +7176,1,,,9/4/2019 3:17,,-2,45,"

Suppose Alice has 2 qubit entangled state and wants to send 1st qubit to Bob.

+ +

q1) Now what is left with Alice? Both 1st and 2nd qubits or only 2nd qubit? +q2) Does the overall composite quantum system be in the same entangled state as with Alice initially?

+",8249,,,,,9/4/2019 13:53,What is the state after entangled qubit transfer?,,1,0,,,,CC BY-SA 4.0 +7177,2,,7170,9/4/2019 3:45,,2,,"

Another approach is $\exp(ix) = \cos x + i\sin x$, so $\left|\cos x + i\sin x\right| = \sqrt{\left(\cos x + i\sin x\right)\left(\cos x - i\sin x\right)} = \sqrt{\cos^2x + \sin^2x} = 1$. so each term in $|ψ⟩$ has coefficient amplitude $1/√N$, so sum of square of all the terms $N\times(1/√N)^2 =1$.

+",8120,,23,,9/4/2019 20:54,9/4/2019 20:54,,,,0,,,,CC BY-SA 4.0 +7178,1,,,9/4/2019 4:17,,-1,71,"

Suppose Alice has the following state +$|\Psi\rangle = \frac{1}{\sqrt2} (|10\rangle + |11\rangle)$

+ +

If Alice transfers 1st qubit to Bob then is this the resultant composite system state after transfer?

+ +

$\frac{1}{\sqrt2} (|01\rangle + |11\rangle)$

+",8249,,8249,,9/4/2019 7:21,9/4/2019 13:39,What is the resultant composite quantum state after the transfer?,,1,2,,,,CC BY-SA 4.0 +7179,2,,7175,9/4/2019 7:46,,4,,"

Yes, it is possible, same way as it is possible to measure a state with complex amplitudes in a basis with real amplitudes (say, a $|i\rangle$ state in the $[|0\rangle, |1\rangle]$ basis). Either way, the probability of measuring state $|\psi\rangle$ and getting measurement result corresponding to basis state $|a_i\rangle$ is defined as $P_i = |\langle a_i| \psi \rangle|^2$ - since you're taking absolute value of the amplitude before squaring it, it doesn't matter whether the value $\langle a_i| \psi \rangle$ is complex or real - the probability will still be a real number.

+ +

For your example, the probability of measuring $| i \rangle$ in the $| - \rangle$ state is

+ +

$$P_i = |\langle -| i \rangle|^2 = \big|\frac12 \big(\langle0| - \langle1|\big)\big(|0\rangle + i|1\rangle\big) \big|^2 = \big|\frac12 \big( \langle0|0\rangle - i \langle1|1\rangle\big)\big|^2 = \\ = \frac14|1-i|^2 = \frac14 \cdot (\sqrt2)^2 = \frac12$$

+",2879,,,,,9/4/2019 7:46,,,,0,,,,CC BY-SA 4.0 +7180,2,,7178,9/4/2019 13:39,,1,,"

It seems like you are saying that when Alice sends/teleports her qubit to Bob, the first (left) qubit ""becomes"" the second (right) qubit. It's like you want to relabel the left (Bob) qubit with the right (Alice) qubit.

+ +

However, the states that Alice and Bob have are already a product state and the qubits are not entangled.

+ +

For example, Alice's first (left) qubit is not in superposition - it is in the state $|1\rangle$, and her second qubit is superposition in the state $\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)$.

+ +

If she sends her first (left) qubit to Bob, then Bob has a qubit in the state $|1\rangle$ while Alice maintains the right qubit in superposition $\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)$.

+ +

The net is that up to the relabeling, the resulting qubit system is still $\frac{1}{\sqrt{2}}(|10\rangle+|11\rangle)$.

+",2927,,,,,9/4/2019 13:39,,,,7,,,,CC BY-SA 4.0 +7181,2,,7176,9/4/2019 13:53,,1,,"

As for Q1: - Presumably you mean she ""sends"" her first qubit to Bob by teleporting it to Bob. By the no-cloning theorem, if Alice sends her first qubit to Bob, she cannot have possession of both the first qubit and the second qubit. She only has possession of the second qubit.

+ +

As for Q2: - After teleportation, the overall composite system is in the same entangled state. A difference is presumably that if Alice had possession of both qubits initially she could have performed controlled operations on the qubits (e.g. the first qubit can control a rotation of the second qubit); now Alice and Bob may be causally separated, and Alice and Bob can only locally act on their respective qubits.

+",2927,,,,,9/4/2019 13:53,,,,0,,,,CC BY-SA 4.0 +7182,1,7183,,9/4/2019 15:30,,4,2272,"

The following statement is causing an error in Qiskit Version 0.9.0:

+ +
provider = IBMQ.load_account()
+
+ +

Error Message:

+ +
IBMQAccountError: 'IBM Q Experience v1 credentials found. Please update your accounts and programs by following the instructions here:\nhttps://github.com/Qiskit/qiskit-ibmq-provider#updating-to-the-new-ibm-q-experience'
+
+ +

The display of the account finformation from the stored location is working OK and matches the API key:

+ +
print(str(IBMQ.stored_account())) 
+
+{'token': '94....051', 'url': 'https://auth.quantum-computing.ibm.com/api'}
+
+ +

When using the provider = IBMQ.load_account(""94....051""), the authentication completed normally. I've already tried to manually delete the registry with rm ~/.qiskit/qiskitrc, or by using the IBMQ.delete_account() command, or by doing the IBMQ.update_account(), as well as doing a refresh of the token. The error persist at the the load_account() function.

+ +

Versions used:

+ +
0.9.0
+{'qiskit-terra': '0.9.0', 'qiskit-ignis': '0.2.0', 'qiskit-aqua': '0.6.0', 'qiskit': '0.12.0', 'qiskit-aer': '0.3.0', 'qiskit-ibmq-provider': '0.3.2'}
+
+",8427,,,,,9/4/2019 15:38,IBMQ.load_account from stored ACCOUNT is failing on Qiskit 0.9.0,,1,2,,,,CC BY-SA 4.0 +7183,2,,7182,9/4/2019 15:38,,4,,"

This error means that old credentials are still in use on your disk. Try getting a new API key from the website and then running IBMQ.save_account('APIKEY', overwrite=True). This should overwrite the existing old credentials with new ones.

+",5955,,,,,9/4/2019 15:38,,,,0,,,,CC BY-SA 4.0 +7185,2,,7078,9/4/2019 20:48,,1,,"

I got the answer 0.547 +I got this through the square root of 30/100. as the probability of ket 0 to ket 1 as a fraction.

+",8344,,,,,9/4/2019 20:48,,,,1,,,,CC BY-SA 4.0 +7186,2,,7117,9/5/2019 8:14,,5,,"

You can get a previous result by grabbing the corresponding job from the backend you sent it to:

+ + + +
from qiskit import *
+
+provider = IBMQ.load_account()
+backend = provider.get_backend('ibmq_BLAH')
+
+#if you know the job ID
+job = backend.retrieve_job('JOB_ID')
+
+# if not, get the last 10 jobs on backend
+jobs = backend.jobs()
+
+",332,,5955,,4/21/2020 10:59,4/21/2020 10:59,,,,3,,,,CC BY-SA 4.0 +7188,1,8389,,9/5/2019 13:59,,1,263,"

I'd like to better understand the Max-Cut algorithm from the qiskit tutorials. Particularly, the run_algorithm function inputs. The inputs are two dictionaries, but I can't find any documentation or explanation as to why these dictionaries are structured the way they are. Example from the tutorial:

+ +
algorithm_cfg = {
+    'name': 'ExactEigensolver',
+}
+
+params = {
+    'problem': {'name': 'ising'},
+    'algorithm': algorithm_cfg
+}
+result = run_algorithm(params,algo_input)
+
+ +

Why is the 'problem' key in the params dictionary labeled with 'Ising'? Why bother including the 'problem' entry if the algorithm is an exact eigensolver? For non-exact eigensolver algorithms, why would the algorithm need to know it's mapping to an Ising model if also_input already has the qubit operator mapping? I'm confused about these hyper parameters and can't seem to find resources/explanations for them. Please help!

+ +

There are great tutorials solving interesting problems with qiskit, but all the approaches are how to solve one specific problem using one specific algorithm. For example, the max-cut tutorial doesn't use the QAOA, but it should be able to solve the problem just as well as VQE which is used. Are there no tutorials/resources on the general use of qiskit Aqua algos? (e.g. how to implement each algorithm, explanations on the required inputs, what happens to the underlying quantum computing structure, and the math behind it?)

+",8420,,55,,9/28/2019 19:14,10/3/2019 1:46,How to understand run_algorithm() inputs in qiskit,,1,0,,,,CC BY-SA 4.0 +7189,1,7190,,9/5/2019 15:22,,2,568,"

Sorry if this question sounds too basic. But I can't find a word for those quantum gates than can be reversed (exchanging the target qubit with the control qubit) and still performs the same operation. Such as the CPhase or the SQSWAP.

+ +

I don't think they can be called ""reversibles"", because that means another thing.

+ +

Any ideas?

+",6017,,55,,3/10/2021 11:42,3/10/2021 11:42,What is the name for quantum gates that can be reversed?,,4,1,,,,CC BY-SA 4.0 +7190,2,,7189,9/5/2019 15:42,,7,,"

symmetric?

+ +

Again, can be used in other contexts, but it is the right word for this context because what you're talking about is something that's invariant under swap. Perhaps the first time you use it, one should clarify with the phrase ""symmetric under exchange of the inputs"".

+",1837,,,,,9/5/2019 15:42,,,,0,,,,CC BY-SA 4.0 +7192,2,,7189,9/5/2019 15:58,,2,,"

All quantum gates are reversible, in the sense that they always admit an inverse which is a quantum gate as well. This comes from the fact that quantum gates are (usually) required to be unitary.

+ +

What you probably meant to ask is how you call gates $U$ such that $U^2=I$. If you assume $U$ is unitary, that is $U^\dagger U=UU^\dagger=I$, then this is equivalent to the condition $U^\dagger =U$. Such gates are called Hermitian (or symmetric when they are real).

+ +

If, instead, you are referring to gates whose action is invariant under exchange of the inputs, then that can mean gates $U$ such that $U|a,b\rangle=U|b,a\rangle$ for all one-qubit states $|a\rangle$ and $|b\rangle$. This essentially means that the two middle columns of the matrix (in the standard choice of canonical basis) are the same. Yet another possible interpretation is that the matrix is required to have the same description when exchanging both the two input qubits and the two output qubits. This amounts to asking for $U$ to commute with the swap operation: $[U,\mathrm{SWAP}]=0$. You can compute explicitly the form of these matrices, but I don't think there is any universally accepted special name for these sorts of operations.

+",55,,55,,9/5/2019 16:27,9/5/2019 16:27,,,,9,,,,CC BY-SA 4.0 +7193,2,,7189,9/5/2019 16:36,,-1,,"

One might consider this to be equivalent to the definition of a unitary transformation. +All quantum gates are reversible, thus all quantum gates are unitary.

+",8133,,,,,9/5/2019 16:36,,,,0,,,,CC BY-SA 4.0 +7194,1,,,9/5/2019 16:48,,2,206,"

In the most simple example I can think of, we have:

+ +
    +
  • a linear operator $A$, which is also a 2 x 2 matrix.

  • +
  • a vector $|v_i⟩$, which can be considered a 2 x 1 matrix.

  • +
+ +

If we see an example of an operation such as $A|v_i⟩$, which is an operation on the vector. Are we, in all cases, to consider this equivalent to a simple matrix multiplication?

+ +

Are there any other considerations to be aware of? This is fascinating stuff, thanks for considering this simple problem.

+",8133,,7460,,9/7/2019 22:07,9/9/2019 19:04,Are all operations simply matrix multiplication?,,2,2,,,,CC BY-SA 4.0 +7196,2,,7194,9/6/2019 0:31,,1,,"

I think all unitary operations can be thought of as matrix multiplication, but something like a measurement is non-unitary, and looks like a partial trace over the density matrix, so there is a bit more going on there.

+",3056,,,,,9/6/2019 0:31,,,,0,,,,CC BY-SA 4.0 +7197,1,,,9/6/2019 1:11,,5,231,"

We know that the current quantum computers are noisy/error-prone. They are susceptible to gate errors (single qubit and multi-qubit), decoherence (relaxation and dephasing), readout error, etc. I want to know what is/are the underlying physical reason(s) behind each type of error. Answer for one type of qubit (say, superconducting qubit) is perfectly okay.

+",4722,,55,,9/10/2019 8:21,11/7/2019 21:16,What are the physical reasons behind noise/errors in quantum computers?,,1,0,,,,CC BY-SA 4.0 +7198,1,,,9/6/2019 5:08,,2,102,"

Consider physical systems such as electrons in metals, or Bose-Einstein condensates, or any crystal, which are realised in the real three-dimensional space.

+ +

If we want to simulate these systems on a quantum simulator, then we have to arrange our qubits in 3d.

+ +

Is it possible to do that on IBMQ Experience?

+",8365,,55,,9/7/2019 13:57,9/7/2019 13:57,Can we simulate quantum many-body systems with IBMQ Experience?,,1,1,,,,CC BY-SA 4.0 +7199,2,,7198,9/6/2019 23:29,,2,,"

To simulate a 3D material, the material's structure will need to be somewhat understood. That way the structure can be mapped to the qubit connectivity. Notice in this tutorial the qubits and their connections to each other are represented in graphs. The 3D material to be simulated can be put into a graph that will then be mapped to the qubit graph and the connections weighted according the physical interaction in the 3d material. This will probably be a very large circuit, but that doesn't mean it's not worth looking into!

+",8420,,,,,9/6/2019 23:29,,,,0,,,,CC BY-SA 4.0 +7200,1,,,9/7/2019 19:17,,1,24,"

how a single Pauli z-gate (on particular qubit) on the highest order qubit realize square well potential? +How upon acting same gate on the second highest qubit, realize double square well potential? +Can you provide some physical intuition and mathematics regarding this? +This question is regarding paper by Andrew T. Sornborger titled 'Quantum Simulation Of Tunneling in Small System ', https://www.nature.com/articles/srep00597 .

+",8365,,,,,9/7/2019 19:17,Quantum Simulation Of Tunneling in Small System,,0,0,,,,CC BY-SA 4.0 +7201,1,7202,,9/7/2019 21:40,,2,86,"

In the ""Superposition"" Microsoft quantum katas (https://github.com/microsoft/QuantumKatas/blob/master/Superposition/ReferenceImplementation.qs) the solution for Task 7 looks like this:

+ +
// ------------------------------------------------------
+// Task 7. All Bell states
+// Inputs:
+//      1) two qubits in |00⟩ state (stored in an array of length 2)
+//      2) an integer index
+// Goal: create one of the Bell states based on the value of index:
+//       0: |Φ⁺⟩ = (|00⟩ + |11⟩) / sqrt(2)
+//       1: |Φ⁻⟩ = (|00⟩ - |11⟩) / sqrt(2)
+//       2: |Ψ⁺⟩ = (|01⟩ + |10⟩) / sqrt(2)
+//       3: |Ψ⁻⟩ = (|01⟩ - |10⟩) / sqrt(2)
+
+operation AllBellStates_Reference (qs : Qubit[], index : Int) : Unit is Adj {
+H(qs[0]);
+CNOT(qs[0], qs[1]);
+
+// now we have |00⟩ + |11⟩ - modify it based on index arg
+if (index % 2 == 1) {
+    // negative phase
+    Z(qs[1]);
+}
+if (index / 2 == 1) {
+    X(qs[1]);
+}
+
+ +

}

+ +
+ +

And my alternative solution looks like this:

+ +
// Task 7. All Bell states 
+// Inputs: 
+//      1) two qubits in |00⟩ state (stored in an array of length 2) 
+//      2) an integer index 
+// Goal: create one of the Bell states based on the value of index: 
+//    0: |Φ⁺⟩ = (|00⟩ + |11⟩) / sqrt(2) 
+//    1: |Φ⁻⟩ = (|00⟩ - |11⟩) / sqrt(2) 
+//    2: |Ψ⁺⟩ = (|01⟩ + |10⟩) / sqrt(2) 
+//    3: |Ψ⁻⟩ = (|01⟩ - |10⟩) / sqrt(2)
+
+operation AllBellStates (qs : Qubit[], index : Int) : Unit 
+{
+H(qs[0]);
+CNOT(qs[0], qs[1]);
+
+if (index == 0){ 
+} elif(index == 1) {
+    Z(qs[0]);
+} elif(index == 2){
+    X(qs[0]);
+} elif(index == 3){
+    X(qs[0]);
+    Z(qs[1]);
+}
+
+ +

}

+ +
+ +

Yet BOTH solutions pass the unit tests. How is that possible, since the X-gate and Z-gate operators are being applied to the other qubit in the pair? +Could the unit test logic be incorrect?

+",8440,,8440,,9/12/2019 3:16,9/12/2019 3:16,How do these alternative Q# algorithms produce the same set of Bell states?,,1,0,,,,CC BY-SA 4.0 +7202,2,,7201,9/7/2019 22:01,,3,,"

The unit test logic is correct, no worries there! One of the really neat things about the four Bell states is that you can transform between each using single-qubit operations. +For example, consider the Bell state $\left|\Phi^{+}\right\rangle = \frac{1}{\sqrt{2}} \left(\left|00\right\rangle + \left|11\right\rangle\right)$. Flipping the first qubit with an X instruction transforms the state of your qubits to $\frac{1}{\sqrt{2}} \left(\left|10\right\rangle + \left|01\right\rangle\right)$, while flipping the second qubit with X(qs[1]) transforms your qubits into the state $\frac{1}{\sqrt{2}} \left(\left|01\right\rangle + \left|10\right\rangle\right)$. Since addition is commutative (that is, $a + b = b + a$), these two states are equal.

+ +

Thus, even though X(qs[0]) and X(qs[1]) are very different instructions, they do the same thing in the special case of the Bell state $\left|\Phi^{+}\right\rangle$. +In the same way, Z(qs[0]) and Z(qs[1]) do the same thing to $\left|\Phi^{+}\right\rangle$. +Another way of thinking of why this is is that the quantum programs ApplyToEach(X, qs) and ApplyToEach(Z, qs) do nothing to qubits in the state $\left|\Phi^{+}\right\rangle$, similarly to how Z(q) does nothing when q is in the state |0⟩. +If you're interested, there's a beautiful mathematical framework known as the stabilizer formalism for helping to track these kinds of symmetries of quantum states.

+",1978,,,,,9/7/2019 22:01,,,,1,,,,CC BY-SA 4.0 +7203,1,7206,,9/9/2019 5:08,,4,323,"

I am trying to implement the Deutsch oracle in classical computer, using direction from this talk.

+ +

There is this slide where they show how the CNOT gate modify 2 Hadamard transformed Qubits:

+ +

+ +

While I understand the math, I'm having trouble implementing the last part, where the resulting tensor product is factored into 2 qubits:

+ +

$ +\frac{1}{2} +\begin{pmatrix} +1\\ +-1\\ +1\\ +-1 +\end{pmatrix} += +\begin{pmatrix} +\frac{1}{\sqrt2}\\ +\frac{1}{\sqrt2}\\ +\end{pmatrix} +\otimes +\begin{pmatrix} +\frac{1}{\sqrt2}\\ +\frac{-1}{\sqrt2}\\ +\end{pmatrix} +$

+ +

In the talk, they say the control qubit is supposed to stay the same, so it is simple to derive the target qubit. However, in this case, the control qubit is modified, while the target qubit is not.

+ +

So should I implement this by using 2 different calculation for each case (control/target qubit stay the same)? If so, how do I choose which calculation to use?

+ +

Or is there a better way to do this, using just a single calculation?

+",8463,,55,,9/9/2019 13:36,10/2/2019 9:42,"How to factor the output of a CNOT acting on the input $|-,+\rangle$",,3,2,,,,CC BY-SA 4.0 +7204,2,,7203,9/9/2019 6:57,,2,,"

If you have already got, mathematically, to the point of having the vector $(1,-1,1,-1)/2$, you don't have to worry about the action of the controlled-not any more. You've already done that! All you have to do is factor the answer. Personally, I usually find the answer quite difficult to see when expressed in this way. Once you've got the answer you can easily verify that it's the right thing, however.

+ +

Instead, I would tend to write out the kets: +$$ +(|00\rangle-|01\rangle+|10\rangle-|11\rangle)/2. +$$ +You can start by grouping the terms on the first qubit: +$$ +|0\rangle(|0\rangle-|1\rangle)+|1\rangle(|0\rangle-|1\rangle), +$$ +where we recognise that the second qubit is in the same state in both parts, so this is the same as +$$ +(|0\rangle+|1\rangle)(|0\rangle-|1\rangle)/2. +$$

+ +
+ +

Let me come back to the question about the action of the controlled-not, because even if you've already taken care of the maths, the conceptual aspect that you're asking about is hugely important in the context of quantum algorithms. Yes, the controlled-not should always be thought of as ""do nothing if the control is 0, and flip the target if the control is 1"", and in that sense, it sounds as if the control should never change. If the control was classical, it would never change. This should make sense because that description we've given is very much based on a classical intuition of what an input is like. But weird stuff can happen when you input a superposition. As you've observed, you get this effect, called 'phase kick-back', where the change ought to happen on the target (from a classical perspective), but actually it changes the control. You still get there by arguing very carefully in the standard way. You don't have to do anything special, and the answer will just come out. It's just that you do actually have to do the maths, and can't just hand-wave.

+",1837,,,,,9/9/2019 6:57,,,,0,,,,CC BY-SA 4.0 +7205,2,,4104,9/9/2019 12:39,,3,,"

A Different Way Of Looking At Linear Algebra

+ +

Tensor Networks provide a different way of looking at linear algebra particularly within the context of tensor space systems.

+ +

Quantum Circuits Are Just Products of Vectors and Operators

+ +

A quantum circuit is inherently a tensor space system as when we have multiple qubits we must think of the whole circuit with all of the qubits in mind, in a tensor product vector space of all the state spaces of the individual qubits.

+ +

A quantum circuit can be understood as a product of linear operators on some quantum state and here lies the power of tensor networks. These diagrams provide a visual way of understanding these products which also allows for visual manipulation in a rigorous way allowing one to desgin algorithms in a novel way or look at information problems in a new light.

+ +

A Visual Way to Understand Linear Algebra Problems

+ +

This is the power of tensor networks.

+ +

I invite you to check out this document which really goes through these ideas I am motivating https://arxiv.org/pdf/1603.03039.pdf, particularly how quantum teleportation can be thought of as a tensor network.

+",4373,,4373,,9/9/2019 12:45,9/9/2019 12:45,,,,0,,,,CC BY-SA 4.0 +7206,2,,7203,9/9/2019 15:54,,2,,"

There are really two different questions here.

+ +
    +
  1. How can you figure out that a given output can be written as tensor product of two vectors?
  2. +
+ +

This is equivalent to asking: how do you figure out whether an output is separable? For pure states, which is what you are considering, this is rather easy.

+ +

In your specific case (two qubits), you might simply notice that if $\psi=\psi^A\otimes \psi^B$ then there must be some specific relations between its elements. More specifically, in your notation, you should have $$\psi_2/\psi_1=\psi_4/\psi_3=\psi^B_2/\psi^B_1,\tag A$$ +assuming $\psi_1,\psi_3,\psi^B_1\neq0$ (you should be able to work out the special cases with zeros without much difficulty).

+ +

In this way you get the value of $\psi^B_2/\psi^B_1$, which is enough to know the full $\psi^B$ remembering that it must a normalised vector. +You can similarly work out the $\psi^A$ vector.

+ +

If condition (A) is not satisfied, then you know that the output cannot be written as a product state, i.e. does not admit this kind of tensor product decomposition.

+ +

A more general technique to check for separability of pure states is to compute the entanglement entropy, which is the Von Neumann entropy of the reduced states. +Given a pure bipartite state $\psi_{ij}$ (I'm using the notation $|\psi\rangle\equiv\sum_{ij}\psi_{ij}|i,j\rangle$ and then identifying $|\psi\rangle$ with $\psi_{ij}$), the associated density matrix is $\rho_{ijk\ell}\equiv\psi_{ij}\bar\psi_{k\ell}$, and the reduced density matrix is $\rho_{ik}=\sum_j \rho_{ijkj}$, which then reads +$\rho_{ik}=\sum_j \psi_{ij}\bar \psi_{kj}.$

+ +

In the case of the output being separable, you have $\psi_{ij}=a_i b_j$ for some (normalised) vectors $a_i,b_j$, and thus +$\rho_{ik}=a_i \bar a_k$, whose entropy is zero. As it turns out, the Von Neumann entropy is zero if and only if the (pure) state is separable, and therefore this method gives you a definitive answer about the separability.

+ +
    +
  1. Why is the first qubit changed if the CNOT changes only the second one?
  2. +
+ +

The simple answer is that the statement ""with the CNOT the control qubit is supposed to stay the same"" is only true in the computational basis. +Indeed, as an example, by simply applying local Hadamard operations on the two qubits you can convert a CNOT into a CNOT in which control and target qubits are inverted. How to do this is shown for example in the Wikipedia page.

+",55,,,,,9/9/2019 15:54,,,,3,,,,CC BY-SA 4.0 +7207,2,,7194,9/9/2019 16:35,,3,,"

The question is a bit vague (in other equivalent representations of QM applying operators can have nothing to do with linear algebra) so I will answer with respect to the specific example given of $\mathbf{A} | v \rangle $.

+ +

If you've chosen to represent your states and operators as vectors in finite-dimensional Hilbert space, then you can describe the corresponding as matrices and vectors in terms of the elements of those matrices, eg:

+ +

$$ +\mathbf{A} := A_{ij}\\ +|v\rangle := v_i \\ +$$

+ +

with $i,j = 1, \dots, 2^n$ then yes, $\mathbf{A} | v \rangle $ will produce a new column vector $c_j = \sum_i A_{ij} v_i$ and the previous answer said as much. However, there's a more interesting an efficient way to do this! Suppose we know that $\mathbf{A}$ operates on only a size-k subset of the qubits that $|v\rangle$ is defined over and that we redefine how we index our operator and state so that they're tensors over two-dimensional axes:

+ +

$$ +\mathbf{A} := A_{i_1,i_2,\cdots, i_{2k}}\\ +|v\rangle := v_{i_1,\cdots,i_n} \\ +$$

+ +

with $i_m \in \{0, 1\}$ and $2k \leq n$. This is certainly allowed because $\mathbf{A}$ and $|v\rangle$ each have the same number of elements, just arranged in different ways to make computation easier. In certain cases, this allows us to calculate the action of $\mathbf{A}$ more efficiently. For example if $\mathbf{A}$ is a permutation matrix, then computing $\mathbf{A} | v \rangle $ is equivalent to shuffling some of the dimensions of $|v\rangle$ and requires no multiplication at all$^\dagger$. I give a worked example of this kind of operation at the end of this post.

+ +

Finally, I'll note that simulations of Clifford circuits (wherein $\mathbf{A} \in \{H, CNOT, S\}$ for example and $|v\rangle$ is generated by a similar such circuit) uses what is essentially a lookup table to compute $\mathbf{A} | v \rangle$. This method also uses minimal linear algebra which is what allows simulations of those kinds of circuits to be very efficient.

+ +
+ +

Worked example

+ +

Say $\mathbf{A}$ is $X^{(j)}$, the Pauli-X operator on the j-th qubit. The procedure to compute $X^{(j)}|v\rangle$ is as follows:

+ +
    +
  1. Initialize $\phi := v_{\cdots i_{j-1} ,0 ,i_{j+1} \cdots}$
  2. +
  3. $v_{\cdots i_{j-1} ,0, i_{j+1} \cdots} \rightarrow v_{\cdots i_{j-1} ,1 ,i_{j+1} \cdots}$ (""swap"" the amplitudes of $v$ representing $|0\rangle_j$ with the amplitudes representing $|1\rangle_j$)
  4. +
  5. $v_{\cdots i_{j-1} ,1, i_{j+1} \cdots} \rightarrow \phi$ (do another ""swap"", but this time use the amplitudes that we saved in step (1) that would have been overwritten otherwise)
  6. +
+ +
+ +

$^\dagger$ In practice, this process has a lot of memory overhead and requires an exponential number of read/write operations. But often that's still better than doing matrix multiplication which can require polynomial-of-exponential resources to do the same thing.

+",1939,,1939,,9/9/2019 19:04,9/9/2019 19:04,,,,2,,,,CC BY-SA 4.0 +7208,1,,,9/9/2019 18:40,,0,230,"

My understanding is that any unitary matrix must have its inverse be equal to its conjugate transpose.

+ +

Looking at the pauli x gate as shown here: $$\begin{bmatrix}0&1\\1&0\end{bmatrix}$$

+ +

It is its own inverse which is equal, of course, to its own conjugate transpose.

+ +

However, isn't it also true that neither of these form an identity matrix? +And isn't this a requirement for being considered unitary?

+",8133,,55,,1/5/2021 11:38,1/5/2021 11:38,Should a Pauli $X$ matrix equal the identity matrix to be unitary?,,1,0,,,,CC BY-SA 4.0 +7209,2,,7208,9/9/2019 19:21,,3,,"

No, the matrix, its inverse or its conjugate transpose don't have to equal the identity matrix to be unitary (that would make the class of unitary matrices rather restricted).

+ +

The definition of unitary matrix is that its conjugate transpose should equal its inverse, i.e., $U U^\dagger = U^\dagger U = I$. You can check that this is indeed the case for the Pauli X matrix.

+",2879,,,,,9/9/2019 19:21,,,,2,,,,CC BY-SA 4.0 +7212,1,7213,,9/10/2019 15:30,,3,1660,"
result = execute(circuit, backend=simulator)
+plot_histogram(result.get_counts(circuit))
+
+
+

I used the above code to plot a histogram for a simple entanglement circuit. I got the error mentioned below. I am running the code in Google Colab.

+
AttributeError: 'AerJob' object has no attribute 'get_counts'
+
+",8330,,1859,,12/27/2022 18:46,12/27/2022 18:50,AttributeError: 'AerJob' object has no attribute 'get_counts',,4,0,,,,CC BY-SA 4.0 +7213,2,,7212,9/10/2019 15:55,,2,,"

This should fix your problem:

+ +
result = execute(circuit, backend=simulator).result()
+plot_histogram(result.get_counts(circuit))
+
+",5157,,,,,9/10/2019 15:55,,,,1,,,,CC BY-SA 4.0 +7214,2,,7212,9/10/2019 15:59,,0,,"

I solved this problem by modifying the code to ...

+ +
counts=result.get_counts(circuit)
+plot_histogram(counts)
+
+ +

When I am using a variable counts to store the output, I am able to plot it but unable to execute the code in the question. Entire code goes like this...

+ +
from qiskit import *
+from qiskit.tools.visualization import plot_histogram
+circuit.h(qr[0])
+circuit.cx(qr[0], qr[1])
+circuit.measure(qr,cr)
+circuit.draw(output='mpl')
+simulator = Aer.get_backend('qasm_simulator')
+result = execute(circuit, backend=simulator)
+counts=result.get_counts(circuit)
+plot_histogram(counts)
+
+",8330,,,,,9/10/2019 15:59,,,,0,,,,CC BY-SA 4.0 +7215,1,12753,,9/10/2019 16:06,,6,89,"

In Horodecki, Horodecki and Horodecki (1998), Mixed-state entanglement and distillation: is there a ``bound'' entanglement in nature?, the authors remark in the conclusions (beginning of pag. 4, emphasis mine):

+ +
+

So, one is now faced with the problem similar + to the initial one, i.e., are the inseparable states with positive partial transposition nonlocal?

+
+ +

In other words, the question is whether inseparable states which have a positive partial transpose can (or must?) exhibit nonlocal correlations.

+ +

This was an open question in 1998. Has it been answered in the meantime, or were there developments in this direction?

+",55,,55,,6/13/2021 17:33,6/13/2021 17:33,Are inseparable states with positive partial transpose nonlocal?,,1,0,,,,CC BY-SA 4.0 +7216,1,7220,,9/10/2019 16:17,,0,102,"

I need a way to add scalar values to a quantum string.

+ +

Say if +$| v \rangle = |1 1 0 \rangle + |1 0 1 \rangle$ then $|v \rangle + 5 = |1 0 1 1 \rangle + |1 1 0 0\rangle$

+ +

Is there a known method to do this?

+ +

I don't want tot express 5 as a qubit string in order to save qubits.

+",7759,,55,,7/26/2020 18:09,7/26/2020 18:09,How to add scalar to quantum string,,3,1,,,,CC BY-SA 4.0 +7217,2,,7216,9/10/2019 16:57,,-1,,"

I don't know the answer to this question but I will try to put my thoughts. Why do you want to add a number to a state? A state is unknown untill it is measured. and in your equation the sum of squares of probabilities is 2, how could that be possible.

+ +

A classical 5 means 101 which means presence, absence, presence of electrons(not electron or photon). Another doubt I got is, we use classical gates to add scalars and quantum gates for quantum operations, how can we do both in one equation.

+ +

May be unless we measure the state we cannot add 5.

+",8330,,,,,9/10/2019 16:57,,,,0,,,,CC BY-SA 4.0 +7218,2,,7216,9/10/2019 17:30,,1,,"

There are definitely ways to do this; the first one I could find is described in this paper by Thomas Draper (page 6).

+",2879,,,,,9/10/2019 17:30,,,,0,,,,CC BY-SA 4.0 +7219,1,8275,,9/10/2019 18:50,,3,252,"

In a recent paper, the authors quote an older work of Bennett, Shor and others and make the following statement

+ +
+

While entanglement assistance can increase achievable rates for classical point-to-point channels in the zero-error and one-shot setting, it comes as a surprise that entanglement does not provide any advantage in the asymptotic setting with vanishing error.

+
+ +

However, in the abstract of the Bennett paper which is cited, it says

+ +
+

Prior entanglement between sender and receiver, which exactly doubles the classical capacity of anoiseless quantum channel, can increase the classical capacity of some noisy quantum channels by an arbitrarily large constant factor depending on the channel

+
+ +

My questions

+ +

1) I thought that the noisy channel coding theorem states that in the asymptotic limit, one has either zero error (if the rate was smaller than the capacity) or arbitrarily large error (if the rate was larger than the capacity). What is the asymptotic limit with vanishingly small error?

+ +

2) Why does the increased classical capacity by a constant factor due to entanglement not change anything in this limit?

+ +

EDIT: While the answer given by Serwyn is an excellent and correct one, I had a misunderstanding in the question. Essentially, Bennett et. al are talking about quantum channels in the second quote whereas the first quote is about classical channels only.

+",4831,,55,,8/5/2022 17:13,8/5/2022 17:13,Why does entanglement not increase the classical capacity of a channel?,,2,0,,,,CC BY-SA 4.0 +7220,2,,7216,9/10/2019 20:11,,2,,"

Generally you have to perform the addition modulo some constant; you can't grab another qubit if you need to overflow. Code for modular addition of a constant is available in the Increment.qs file in the Q# standard library, in the IncrementByInteger operation. Check out the documentation here.

+",4265,,,,,9/10/2019 20:11,,,,1,,,,CC BY-SA 4.0 +7221,2,,7212,9/11/2019 0:16,,1,,"

Execute returns a job instance. The job has a result, job.result(), and you get counts from the results, ie job.result().get_counts()

+",332,,,,,9/11/2019 0:16,,,,0,,,,CC BY-SA 4.0 +8221,1,,,9/11/2019 3:15,,5,4416,"

What is the difference between these frameworks or languages? What are the pros and cons of each of these? Do you know any similar framework/platform/language that gives some more advantages?

+",8330,,55,,11/3/2020 17:16,11/3/2020 17:16,"Overview of Cirq, qiskit, q#, ibmq(circuit board), other",,3,1,,9/19/2019 21:01,,CC BY-SA 4.0 +8222,2,,8221,9/11/2019 7:37,,2,,"

In my opinion, at the moment, qiskit is the most suitable one for learning and teaching.

+ +

For a basic introductory material (we have used it in 14 two-day or three-day workshops), I recommend the following repo:

+ +

https://gitlab.com/qkitchen/basics-of-quantum-computing

+ + +",5208,,5208,,9/11/2019 8:03,9/11/2019 8:03,,,,0,,,,CC BY-SA 4.0 +8223,2,,7219,9/11/2019 7:45,,2,,"

I will try to succinctly answer your first question given that I possess little knowledge regarding entanglement assistance.

+ +

Shannon's capacity theorem (the noisy channel coding theorem) states that for any code $\mathbf{C}$ of code rate $R \leq C$, where $C$ represents the channel capacity, an encoding and decoding scheme of rate $R$ with a probability of error $P_e < \epsilon$, where $\epsilon>0$, will exist. This probability of error will be vanishingly small only if the block length of the code is sufficiently large, i.e ${n\rightarrow\infty}$ leads to $\epsilon\rightarrow0$. Analogously, if $R>C$ then the error probability goes to $0.5$ as the block length of the code increases, i.e $$\lim_{n\to\infty}P_e = \frac{1}{2}$$.

+ +

Therefore, the asymptotic limit that defines when communications over a channel occur with an error probability $\epsilon < 0$ is the channel capacity. The condition of having a vanishingly small error probability will be determined by the block length of the code (for a null error probability you would need an infinite block length).

+",7855,,,,,9/11/2019 7:45,,,,3,,,,CC BY-SA 4.0 +8224,1,8225,,9/11/2019 8:51,,4,164,"

I'm working through Quantum Computing for Computer Scientists (Yanofsky & Mannucci, 2008), and am getting a little confused about Observables. From what I understand an observable is a question represented by a hermitian matrix. But that's as far as it goes. When we use an observable to make a measurement we obtain a real result, which can change the state space $|\Psi\rangle$. There is mention in the book that ""after an observation"" (presumably after a measurement is taken) then the result should be an eigenvalue, and the state of the system should collapse into the state which is the eigenvector corresponding to that eigenvalue.

+ +
+

Then, in example 4.3.1 on p.126 the authors use the observable + $$\Omega=\begin{bmatrix}-1&-i\\i&1\end{bmatrix},$$ + which they state has eigenvalues $\lambda_1=-\sqrt{2}$ and $\lambda_2=\sqrt{2}$, with corresponding eigenvectors $|e_1\rangle=[-0.923i,-0.382]^T$ and $|e_2\rangle=[-0.382,0.923i]^T$.

+ +

It goes on to say ""now, let us suppose that afer an observation of $\Omega$ on $|\Psi\rangle=\frac{1}{2}[1,1]^T$, the actual value observed is $\lambda_1$. The system has ""collapsed"" from $|\Psi\rangle$ to $|e_1\rangle$.

+
+ +

I'm finding it difficult to understand this. Do the authors mean to perform a measurement, i.e.

+ +

$$\Omega|\Psi\rangle=\begin{bmatrix}-1&-i\\i&1\end{bmatrix}\frac{1}{2}\begin{bmatrix}1\\1\end{bmatrix}= +\begin{bmatrix} + -\frac{i}{2}-\frac{1}{2} \\ + \frac{i}{2}+\frac{1}{2} \\ +\end{bmatrix} +$$

+ +

But then how have we observed $\lambda_1=\sqrt{2}$ ?

+ +

I think I've got the wrong end of the stick because the authors say ""now, let us suppose that after an observation...,"" so maybe there is no calculation to be made, but it's very confusing.

+ +

Can anybody help me understand this?

+",,user8328,26,,9/30/2019 3:45,9/30/2019 3:45,Help in understanding an exercise on observable / measurement,,1,0,,,,CC BY-SA 4.0 +8225,2,,8224,9/11/2019 9:53,,4,,"

When you give an observable, such as $\Omega$, that is used to define the measurement basis. It is not something that you would usually use to directly perform calculations (you can, and for $2\times 2$ matrices, we often do, as I'll detail below).

+ +

Normally, you want to take your observable, $\Omega$, and find the eigenvalues and eigenvectors. More specifically, you want projectors onto the different eigenspaces (this distinction is important if your matrix has degeneracy). So, we take +$$ +P_1=|e_1\rangle\langle e_1|,\qquad P_2=|e_2\rangle\langle e_2|. +$$ +In a sense, the eigenvalues are irrelevant, and hence so is $\Omega$. Our outcome is a state +$$ +|\Phi_i\rangle=P_i|\Psi\rangle, +$$ +up to normalisation (for rank 1 projectors, as here, the renormalised version is just $|e_i\rangle$), and the probability of getting outcome $i$ is $\langle\Phi_i|\Phi_i\rangle$. Note that you have to explicitly describe the branching outcomes (here, two different possibilities, with different probabilities). One simple calculation such as a matrix multiplication can't give you that.

+ +

Now, it turns out that you can use the matrix $\Omega$ directly if you want. This is because, by completeness, +$$ +\sum_iP_i=I, +$$ +and we know that $\Omega=\sqrt{2}(-P_1+P_2)$. Hence, we can rearrange for $P_1$: +$$ +P_1=\frac{1}{2}(I-\Omega/\sqrt{2}), +$$ +and we can perform the same calculation as previously without having directly calculated the eigenvectors first. There's always a trick like this for $2\times 2$ matrices. For $n\times n$ matrices, you'd probably have to describe each of your projectors as a polynomial in $\Omega$ up to a power $n-1$, which is why we don't usually do this for anything other than $2\times 2$ matrices - it just gets more messy.

+",1837,,,,,9/11/2019 9:53,,,,3,,,,CC BY-SA 4.0 +8226,2,,8221,9/11/2019 11:40,,3,,"

I would suggest to start with Quirk as it offers a drag-and-drop circuit model. Furthermore, Quirk offers some subroutines such as basic arithmetic operation (on integers) and allows to easily define new subroutines. (All drag an drop!) It can simulate up to 17 (?) qubits.

+ +

Once you want to go beyond an ""easy"" circuit representation I suggest Microsofts Q#. It features everything from a (complete) quantum simulation (up to about 30 qubits), to stabilizer circuits or a Toffoli-simulators with 1000s of (qu)bits. +In my opinion the documentation is a little messy, but you get great support from the developers in case you have any questions. Q# also offers libraries for arithmetic operation (integers and (!) floating-point numbers).

+ +

Finally, as @Abuzer mentioned, Qiskit is a good starting point to. It offers a circuit representation as well as a code representation. I am not aware of any arithmetic libraries, but the there exist community implementations on Github. Actually, I believe Qiskit has the biggest ""community"", so you ll likely find help on the web if you run into troubles. Qiskit also offers different simulators to perform a complete quantum simulation or just subset-models.

+ +

If you want to have a very rough overview over some (personal) pros/cons of simulations, you can read here Disclaimer: I asked this question

+",7824,,,,,9/11/2019 11:40,,,,0,,,,CC BY-SA 4.0 +8227,1,8228,,9/11/2019 13:35,,3,388,"

There's an exercise in Nielsen & Chuang asking us to show that if some third party intercepts Alice's qubit she's sending to Bob while attempting to transmit (2 bits of) classical information, then this third party can't actually infer anything about the information she's trying to communicate. Effectively, this comes down to showing that $\langle\psi|E_A \otimes I_B|\psi\rangle$ is the same whenever $\psi$ is any of the Bell states and $E$ is a positive operator.

+ +

This is simple to show, but I wonder if this is an incomplete concept, since it supposedly requires $E$ to be a positive operator. If we just check one of them:

+ +

$$\langle\Phi^+|E \otimes I|\Phi^+\rangle = \langle 00 + 11|E \otimes I|00 + 11 \rangle = \langle 0|E|0 \rangle\langle 0|0 \rangle + \langle 0|E|1 \rangle\langle 0|1 \rangle + \langle 1|E|0 \rangle\langle 1|0 \rangle + \langle 1|E|1 \rangle\langle 1|1 \rangle = \langle 0|E|0 \rangle + \langle 1|E|1 \rangle.$$

+ +

This is the same for each Bell state. Couldn't $E$ just be Hermitian and we would obtain the same result?

+",7816,,55,,9/11/2019 14:15,9/11/2019 14:23,Eavesdropping in superdense coding: why can't the third party infer anything about the message?,,2,0,,,,CC BY-SA 4.0 +8228,2,,8227,9/11/2019 13:46,,4,,"

Mathematically, this has nothing to do with the positivity of $E$. It doesn't really have anything to do with $E$ at all - it's a property of the Bell states themselves (you've probably not got there yet, but they have the same reduced density matrices). I presume the reason for specifying the positivity of $E$ in the question is to help you make the connection with the allowed operators that an eavesdropper could perform, such as measurements.

+ +

Incidentally, don't forget about normalisation factors. There's probably a factor of 1/2 missing from your final answer.

+",1837,,,,,9/11/2019 13:46,,,,0,,,,CC BY-SA 4.0 +8229,2,,8227,9/11/2019 14:23,,3,,"

This happens for any maximally entangled state $|\Psi\rangle$ and operator $E$.

+ +

Indeed, a maximally entangled state is, by definition, one whose partial trace is the maximally mixed one. Writing $|\Psi\rangle\equiv\sum_{ij}\psi_{ij}|ij\rangle$, this means that $\sum_i \psi_{ij}\bar\psi_{kj}=\delta_{ik}/D$, with $D$ the dimension of each space ($D=2$ in your case). +Thus you have (assume repeated indices are summed): +$$\langle\Psi|E\otimes I|\Psi\rangle=\bar \psi_{ij} E_{ik} \psi_{kj}=\frac{1}{D}\delta_{ik}E_{ik}=\frac{1}{D}\mathrm{Tr}(E).$$

+",55,,,,,9/11/2019 14:23,,,,0,,,,CC BY-SA 4.0 +8230,2,,7140,9/11/2019 18:10,,1,,"

Given your clarification in your comments (you might want to update your question to add these assumptions), I believe it is a valid entangled state of $2m$ qubits. If you are measuring the second set of $m$ qubits $|j\rangle_t$ in the computational basis, you will get the measurement result of $k$ (for $k \in \{0,\ldots,N-1\}$) with probability $$|\frac{1}{\sqrt{N}} e^{2\pi i \frac{x_1}{N} k}|^2=\frac{1}{N} e^{2\pi i \frac{x_1}{N} k} e^{-2\pi i \frac{x_1}{N} k} =\frac{1}{N},$$ and the first $m$ qubits $|j\rangle_h$ also in state $|k\rangle$, which gives $k$ upon measurement.

+",8321,,,,,9/11/2019 18:10,,,,0,,,,CC BY-SA 4.0 +8231,1,,,9/11/2019 21:23,,4,93,"

Given a product state $\rho_{AC} = \rho_A\otimes \rho_C$, what can we say about the structure of states $\rho_{ABC}$ that are extensions of $\rho_{A}\otimes \rho_C$? By extension I mean that $\text{tr}_B\rho_{ABC} = \rho_A \otimes \rho_C$, and I am not assuming that $\rho_{ABC}$ is pure. Ideally, I would know the most general form any such extension can take on. Less ambitiously, I'd like to know any general properties such extension states must have.

+ +

The closest related work to this question which I have found concerns the structure of states satisfying $I(A:C|B)=0$. Work by Hayden, Jozsa, Petz and Winter (arXiv:quant-ph/0304007) shows that whenever $I(A:C|B)=0$, there's a way to split up the $B$ Hilbert space $\mathcal{H}_B = \oplus_i \mathcal{H}_{b_L^i}\otimes \mathcal{H}_{b_R^i}$ such that

+ +

$$\rho_{ABC} = \sum_i q_i \rho_{Ab_L^i}\otimes \rho_{b_R^iC}$$

+ +

which in particular gives that $\rho_{AC}$ is separable. They also obtain as a corollary that $\rho_{AC}$ separable implies the existence of an extension such that $I(A:C|B)=0$.

+ +

My question is not addressed directly by the Hayden et al. result however as I am interested 1) in product states specifically, and 2) I'd like to know what general form the extensions are constrained to given that AC is product, rather than about the existence of an extension with a certain property.

+",8468,,26,,9/29/2019 15:32,9/29/2019 15:32,Extensions of product states,,1,2,,,,CC BY-SA 4.0 +8232,1,,,9/11/2019 21:56,,1,47,"

I remember reading a paper that described how a quantum circuit on a large amount of qubits can be simulated by doing many runs on a smaller quantum computer. They used techniques from tensor networks. I believe it was published in PRL somewhere after 2018, but I haven't been able to find it again. +It is not this paper: Computational Speedups Using Small Quantum Devices (Dunjko et al., 2018).

+ +

Does anybody know which paper I'm talking about it, or have I simply dreamt up the existence of this paper?

+",5998,,26,,9/29/2019 10:24,9/29/2019 10:24,Paper concerning distributing quantum computation on many small quantum computers,,0,6,,,,CC BY-SA 4.0 +8233,2,,1542,9/11/2019 21:59,,3,,"

Here is a way to think about the role of entanglement in quantum codes which I think is complementary to Felix Hubers response.

+ +

Suppose that we take a maximally entangled state $|\Psi\rangle_{RQ}$ and record the $Q$ system into some quantum error-correcting code. Suppose the code records $Q$ into subsystems $S_1,S_2,S_3$ such that erasure of any one subsystem can be corrected for (I've taken a simple example, but generalizations are possible).

+ +

Then, there is an entropic way of thinking about the error correction conditions (as compared to the more algebraic Knill-Laflamme conditions). Specifically, if

+ +

$$I(R:S_3) = 0$$

+ +

Then it follows that $Q$ can be recovered from $S_1S_2$. See for example arXiv:quant-ph/0112106 for a nice presentation of this fact.

+ +

Using this entropic approach to error correction there are fairly direct routes to understanding entanglement in codes. For instance, we can prove that,

+ +

$$I(S_1S_2:S_3) \geq 2\log d_R$$

+ +

as follows. First we write out this mutual information in terms of its definition,

+ +

$$I(S_1S_2:S_3) = S(S_1S_2) + S(S_3) - S(S_1S_2S_3)$$

+ +

We'll introduce a purifying system $X$, so that the state on $RS_1S_2S_3X$ is pure. Then using purity we can write

+ +

$$I(S_1S_2:S_3) = S(S_3XR) + S(S_3) - S(XR)$$

+ +

Note that since we can recover $Q$ from $S_1S_2$, $I(R:S_3X)=I(R:X)=0$. Using this in the above

+ +

$$I(S_1S_2:S_3) = S(S_3|X) + S(S_3)$$

+ +

Finally, we can bound the right hand side here below by $2 \log d_R$. The intuition behind how we can do this is that $S_3$ is ``significant'' in the sense that there is a set of shares (say $S_1$) which itself reveals no information about $Q$, but together with $S_3$ allows $Q$ to be recovered. Given this, we expect $S_3$ must carry $2\log d_R$ of entropy, since transferring it can be used to establish $2\log d_R$ worth of entanglement. A similar intuition appears in arXiv:quant-ph/0608223. More precisely we consider the quantity $I(R:S_1S_3) - I(R:S_1)$, which some basic manipulations reveal

+ +

$$I(R:S_1S_3) - I(R:S_1) = S(S_3|S_1) + S(S_3|XS_2) \leq S(S_3) + S(S_3|X)$$

+ +

But then we notice $I(R:S_1S_3) \geq 2\log d_R$ since $S_1S_3$ allows recovery of $Q$, while $I(R:S_1)=0$ by the entropic error correction condition. This lower bounds $S(S_3) + S(S_3|X)$ and so lower bounds $I(S_1S_2:S_3)$.

+",8468,,26,,9/29/2019 15:33,9/29/2019 15:33,,,,0,,,,CC BY-SA 4.0 +8234,2,,8221,9/12/2019 4:39,,3,,"

I am definitely biased (writing a book on quantum computing with Python and Q#), but I am a Pythonista and love using Q#. The design of the language is good for long term quantum computing development; it allows you to think more at the algorithmic level, not at the assembly level as many other quantum programming languages are targeting. It has a Jupyter kernel so I can use it like I do most of my Python development, is open source, great editor integration, and has some great libraries that mean you don't have to re-implement things over and over again. It also is inter-operable with Python so I can call into it from my regular Python code. For resources, check out the book in early access (if you want a discount code, hit me up on twitter), try qsharp.community, the katas, or the docs! And as with any open source project, get involved! Making pull requests and file issues are some of the fastest ways I find to learn a new language or package :)

+",4211,,,,,9/12/2019 4:39,,,,0,,,,CC BY-SA 4.0 +8235,1,,,9/12/2019 4:49,,3,2082,"

Inner product: how similar the vectors are

+ +

Outer product: ???

+ +

For inner product I can find this explanation. +""The inner product of two vectors therefore yields just a number. As we'll see, we can interpret this as a measure of how similar the vectors are.""

+ +

Any other usage on inner product?

+ +

But, what about outer product?

+ +

Why use outer product?

+ +

Only thing I can find ""we can write any matrix purely in terms of outer products""

+",8491,,26,,9/29/2019 9:03,8/8/2021 17:29,Why use inner and outer product?,,2,0,,,,CC BY-SA 4.0 +8236,1,,,9/12/2019 6:12,,3,323,"

Background

+ +

I previously asked this question, in which I'm trying to better understand this joshphysics's derivation of an interpretation of the time-energy uncertainty principle.

+ +

And the gist of what I get is (from the answers and the chatroom) within interpretations of quantum mechanics which say the measurement is non-unitary one can definitely make the case that the derivation cannot be applied to all situations (in fact I feel the application is quite limiting).

+ +

However, it seems intuitive to me (after chatroom discussion) with a quasi-classical measuring apparatus and the Copenhagen interpretation enables one to circumvent my objection? (And also enables one to apply it to cases involving a measurement - see related/objection).

+ +

Note: The below is a labyrinth of positions one can take on this argument. And I feel there are $2$ ways out (way $3$ or way $4$)of this maze. I'm asking for which way is better? (See Questions for what I mean by ""better"")

+ +

Math and Context

+ +

The proof (I questioned)

+ +

So let's begin with Joshphysics's answer:

+ +
+

Let a quantum system with Hamiltonian $H$ be given. Suppose the system occupies a pure state $|\psi(t)\rangle$ determined by the Hamiltonian evolution. For any observable $\Omega$ we use the shorthand + $$ + \langle \Omega \rangle = \langle \psi(t)|\Omega|\psi(t)\rangle. +$$ + One can show that (see eq. 3.72 in Griffiths QM) + $$ + \sigma_H\sigma_\Omega\geq\frac{\hbar}{2}\left|\frac{d\langle \Omega\rangle}{dt}\right| +$$ + where $\sigma_H$ and $\sigma_\Omega$ are standard deviations + $$ + \sigma_H^2 = \langle H^2\rangle-\langle H\rangle^2, \qquad \sigma_\Omega^2 = \langle \Omega^2\rangle-\langle \Omega\rangle^2 +$$ + and angled brackets mean expectation in $|\psi(t)\rangle$. It follows that if we define + $$ + \Delta E = \sigma_H, \qquad \Delta t = \frac{\sigma_\Omega}{|d\langle\Omega\rangle/dt|} +$$ + then we obtain the desired uncertainty relation + $$ + \Delta E \Delta t \geq \frac{\hbar}{2} +$$ + It remains to interpret the quantity $\Delta t$. It tells you the approximate amount of time it takes for the expectation value of an observable to change by a standard deviation provided the system is in a pure state. To see this, note that if $\Delta t$ is small, then in a time $\Delta t$ we have + $$ + |\Delta\langle\Omega\rangle| =\left|\int_t^{t+\Delta t} \frac{d\langle \Omega\rangle}{dt}\,dt\right| \approx \left|\frac{d\langle \Omega\rangle}{dt}\Delta t\right| = \left|\frac{d\langle \Omega\rangle}{dt}\right|\Delta t = \sigma_\Omega +$$

+
+ +

Before I go on about my objection. Let me let you know it's basic premise.

+ +

Basic premise

+ +
+

The measurement is cannot be modelled as a unitary transformation. + $$ |a \rangle + |b \rangle \to |a \rangle $$ + Cannot be done by a unitary transformation and I thought I was vindicated + in this post. Which is why the common referral of the measurement as ""non-unitary""

+
+ +

The Objection

+ +
+

joshphysics's answer makes use of Heisenberg's equation of motion + which rely on unitarity. I am not aware of a derivation of + Heisenberg's equation of motion which is applicable during a + non-unitary process (for example the measurement).

+ +

See the $2$'nd equation in his derivation. This clearly relies on + ""Heisenberg's equation."" Further the whole notion of getting a $\Delta t$ is only dimensionally true and not true even as an approximate (if this objection holds).

+ +

One way out: is your calling something velocity which has the same + dimensions of velocity but is not the time derivative of position. But + that is fundamentally wrong! (and abused in that case).

+ +

Another way out: is to claim that there is a kind of continuity + argument but I was under the impression the measurement is a + discontinuous process. So this one will fail.

+ +

The third way out: is to limit the physical scope of the applicability + of the this derivation. For example, one cannot use this derivation to + say the time between $2$ subsequent measurements cannot be taken to + $0$. Perhaps it can (pushing it's limitations) tell you some kind of + energy cost involved between $2$ subsequent measurements. But that + would be at the price of presupposing ""the time between $2$ subsequent + measurements cannot be taken to $0$"" as one would have assume that + between 2 measurements unitarity must reign and the time interval cannot be taken to $0$.

+
+ +

So far so good?

+ +
+

I was on board with the third way out. In fact, any interpretation of + quantum mechanics which uses the language ""collapse of the wave + function."" I am under the impression will be sympathetic to my + misunderstanding to say the least. Taken from wiki, + The existence of the wave function collapse is required in

+ +
    +
  1. the Copenhagen interpretation
  2. +
  3. the objective collapse interpretations
  4. +
  5. the transactional interpretation
  6. +
  7. the von Neumann interpretation in which consciousness causes + collapse.
  8. +
+
+ +

The fourth way out (?)

+ +
+

Now, another user in the chat is of the opinion my objection is + non-sensical (at least thats the impression I get) and upon conversing + it seems he has a fourth way to bypass my objection!

+ +

The fourth way: In this fourth way one stops the basic premise of + my objection which is the measurement being a non-unitary process! In + fact this is convincingly done with:

+ +

""A measurement is an interaction between a measuring apparatus which + is (quasi-)classical and a quantum system You can model this, it's in + Landau's QM section 7, I don't want to quote the whole thing, but this + wave function collapsing business is pretty straightforward there + without all the woo""

+ +

In fact, he claims to be a Copenhagen-ist but doesn't like the words + ""collapse of the wave-function.""

+ +

The fourth way out does manage to circumvent (if not completely + destroy) my objection and also enables one to use this derivation in + far more many many situations I previously see as unfathomable for + example: the time between $2$ measurements cannot be taken to $0$.

+ +

In fact, I'm under the opinion the number of physical experiments the $3$'rd way out + enables you to do are under $5$ (?). But the $4$'th way is clearly + superior in this metric (?). A better question might be where does it not apply?

+
+ +

More about way $4$

+ +
+

For those who are shocked that Landau was on board with way $4$ and (fairly) demanding evidence before investing time for an entire section $7$ of Landau's QM.

+
+ +

See page 6 of the file (page $9$ of .pdf) of this where he argues why one should take way-out $4$:

+ +
+

’...It is in principle impossible ... to formulate the basic concepts + of quantum mechanics without using classical mechanics.’ (LL2)

+ +

’...The possibility of a quantitative description of the motion of an + electron requires the presence also of physical objects which obey + classical mechanics to a sufficient degree of accuracy.’ (LL2)

+ +

’...the ’classical object’ is usually called apparatus and its + interaction with the electron is spoken of as measurement. However, it + must be emphasized that we are here not discussing a process ... in + which the physicist-observer takes part. By measurement, in quantum + mechanics, we understand any process of interaction between classical + and quantum objects, occurring apart from and independently of any + observer. The importance of the concept of measurement in quantum + mechanics was elucidated by N Bohr.’ (LL2)

+
+ +

The quotes go on ... The above is only the beginning (In fact the .pdf is a condensed version of ""pure gold"")

+ +
+

At some risk (I'm not sure if the person who exposed me to way $4$ + would agree this paper does justice to their arguments): + https://arxiv.org/abs/1406.5178

+ +

To be fair a different version of way $4$ has been asked on this site:

+ +

https://physics.stackexchange.com/questions/144325/unitarity-and-measurement?rq=1

+ +

Where the answer-er response ends with:

+ +

""Why not let the final state be in a superposition also, as quantum + mechanics requires? The alive cat is not aware of the dead cat, + because the Schrödinger equation is linear.""

+ +

For a non-absurd association of the same words above: + https://www.youtube.com/watch?v=gNAw-xXCcM8

+ +

(In light of this let me just say my question is not about the + plausibility of the Unitary of the measurement but it's about if + assumed can one assume this and push the number of physical situations + this derivation is applicable to?)

+
+ +

Is a unitary measurement compatible with broadening the usage of the time-energy uncertainity principle?

+ +
+

Also Landau states: ""From section $44$ of Landau, the $\Delta E$ in + the time-uncertainty relation is the difference ""between two exactly + measured values of the energy $E +\varepsilon$ at two different + instants, and not the uncertainty in the value of the energy at a + given instant"" (for a system of two parts with energies $E$ and + measuring apparatus energy $\varepsilon$)""

+ +

I added this part so it didn't seem like I was skipping any logic. I'm + sure Landau would have only said that if he felt his book justified + the case.

+
+ +

Question

+ +

Is this ""fourth way"" plausible? Can someone tell me an explicit case where if I assume this circumvention is indeed true what are the physical cases the this ""quasi-classical measuring apparatus and the Copenhagen interpretation"" seem to work for that the original objection stops (way $3$)? (I do mention one but am under-confident if it is right)

+ +

P.S: I feel this post was self-contained but to do justice to way $4$ I had to link it off. Please do not hesitate to contact me if you feel this question can be improved?

+ +
+ +

Cross-posted on PSE.SE

+",5045,,55,,11/7/2019 11:11,11/7/2019 11:11,"Does the Copenhagen interpretation (+ ""quasi-classical measuring apparatus"") allow one to bypass a derivation's objection?",,1,6,0,,,CC BY-SA 4.0 +8237,2,,8235,9/12/2019 6:48,,4,,"

This sort of ""why?"" is a deeply personal matter that depends on what you're willing to accept as a starting point. Ultimately, you might try to push it back to ""why is the world the way it is? "" for which I don't think there's a satisfactory answer.

+ +

Not pushing it quite so far, I choose to start from the theory of Quantum Mechanics itself (so this says nothing about the real world, it just happens that the theory is an incredibly good fit for what we see in the world around us).

+ +

The theory of Quantum Mechanics is based upon a set of assumptions/postulates. There is no real ""why?"" behind these, we just accept them as fact and derive the consequences. I would state the first of these as:

+ +
+
    +
  1. Quantum states are described by unit vectors in a Hilbert space.
  2. +
+
+ +

Right there, built in, is a Hilbert space, the key property being that it has an inner product.

+ +

The next two are, loosely,

+ +
+
    +
  1. The probability amplitude for two independent events both happening is equal to the product of the probability amplitudes for those two events.
  2. +
  3. The probability amplitude either of two (apparently) mutually exclusive events happening is the sum of their probability amplitudes.
  4. +
+
+ +

Put together, this essentially describes that transformation from one state to another using matrix multiplication (and combined with the first postulate imposes that it's a unitary matrix). So, to me, the root cause is matrix multiplication (which is computed using the inner product). One particularly natural way for expressing the matrices, as you say, is using the outer product. To my mind, it is useful in several ways:

+ +
    +
  • spectral decomposition (which also leads you towards projectors, as required for measurements)
  • +
  • unitaries describe basis transformations. The outer product represents that nicely as ""this orthonormal basis transforms into that orthonormal basis"". This is particularly important in the quantum information/computation context. At the theory level, we don't care about how a particular quantum gate works. All we care about is how inputs are transformed into outputs.
  • +
  • Once you start taking the trace, there's a very tight connection between inner products and outer products.
  • +
  • there is a mathematical distinction between an operator and its representation as a matrix. When talking about the operator, you pretty much have to use the outer product.
  • +
+",1837,,,,,9/12/2019 6:48,,,,0,,,,CC BY-SA 4.0 +8238,1,8248,,9/12/2019 6:53,,9,1023,"

Disclaimer: I am a software engineer who is curious about quantum computing. Although I understand some basic concepts, theory and math behind it, I am by no means experienced in this domain.

+ +

I am doing some preliminary research on the state of quantum software development. Part of my research is to evaluate Microsoft's QDK and some of its samples (written in Q#).

+ +

As I understand, certain optimization problems (the traveling salesman sort) may be tackled by first reducing them as QUBO or Ising problems and then solving them via quantum annealing or VQE algorithms. Part of this process is finding out the Hamiltonian and solving Schrodinger's equation. This is my understanding, kindly correct me if wrong.

+ +

QDK's Hamiltonian simulation samples have examples for Ising and Trotter–Suzuki based simulations. But recently 1Qbit has released a VQE-based solution.

+ +

My question is: do all the methods listed above (VQE, Ising, Trotter–Suzuki) do the same thing? That is, estimate ground state energy of a given system? For example, do the H2 simulation examples based on VQE and Trotter–Suzuki pretty much do the same thing in different ways? If so, which method should be preferred?

+",8493,,8787,,4/19/2022 14:51,4/19/2022 14:51,Ground state energy estimation - VQE vs. Ising vs. Trotter–Suzuki,,1,0,,,,CC BY-SA 4.0 +8239,1,8240,,9/12/2019 8:06,,3,76,"

The following general master equation (from this paper 'Dynamical quantum correlations of Ising models on arbitrary lattice and their resilience to decoherence') describes the various types of decoherence relevant to trapped ions, Rydberg atoms and condensed matter systems +\begin{equation} +\dot{\rho} = i \mathscr{H}(\rho) - \mathscr{L}_{ud}(\rho)-\mathscr{L}_{du}(\rho)-\mathscr{L}_{el}(\rho)~~~~~~~~~~~~~(1) +\end{equation} where $$\mathscr{H}(\rho) = [\mathcal{H},\rho],\\ +\mathscr{L}_{ud}(\rho) = \frac{\Gamma_{ud}}{2}\sum_{j}(\hat{\sigma}^{+}_j\hat{\sigma}^{-}_{j}\rho + \rho \hat{\sigma}^{+}_{j}\hat{\sigma}^{-}_{j}-2\hat{\sigma}^{-}_{j}\rho \hat{\sigma}^{+}_{j})\\ +\mathscr{L}_{du}(\rho) = \frac{\Gamma_{ud}}{2}\sum_{j}(\hat{\sigma}^{+}_j\hat{\sigma}^{-}_{j}\rho + \rho \hat{\sigma}^{+}_{j}\hat{\sigma}^{-}_{j}-2\hat{\sigma}^{-}_{j}\rho \hat{\sigma}^{+}_{j})\\ +\mathscr{L}_{el}(\rho) = \frac{\Gamma_{el}}{8}\sum_{j}(2\rho-2\hat{\sigma_j^z}\rho\hat{\sigma}_j^z) +$$ +The first term involving a commutator describes coherent evolution due to the Ising interaction, +and the various terms having subscripts ‘ud’, ‘du’ and ‘el’ correspond respectively to +spontaneous relaxation, spontaneous excitation and dephasing. Equation (1) has the formal solution $\rho(t) = \mathscr{U}(t)\rho(0)$, with +$$\mathscr{U}(t) = \text{exp}[-t(i\mathscr{H + \mathscr{L}_{ud}+\mathscr{L}_{du} + \mathscr{L}_{el})}]~~~~~~~~~~~~~~~~~(2)$$ An immediate simplification follows from the observation that $$[\mathscr{L}_{el}, \mathscr{H}] = [\mathscr{L}_{el},\mathscr{L}_{du}] = [\mathscr{L}_{el}, \mathscr{L}_{ud}] = 0~~~~~~~~~~~~~~~~~~(3)$$ +That the last two commutators vanish is less obvious than the firsts, but physically it has a very clear meaning: spontaneous relaxation/excitation on a site $j$ causes the $j$'th spin to have a well defined value of $\sigma^{z}_j$, and thus to be unentangled with the rest of the system. Since the dephasing jump operator $\hat{\sigma}_{j}^{z}$ changes the relative phase between the states $| \sigma_{j}^{z} = \pm 1 \rangle$, whether spontaneous relaxation/excitation occurs before or after a dephasing event only affects the sign of the overall wave function, which is irrelevant.

+ +
+

As a result, we can write $$\mathscr{U}(t) = e^{-t\mathscr{L}_{el}}e^{-t(i\mathscr{H} + \mathscr{L}_{ud} + \mathscr{L}_{du})}~~~~~~~~~~~~~~(4)$$

+
+ +

Question: I might be missing something simple, but can anyone see why equation (2) reduces to equation (4) as result of the commutativity in equation (3)?

+",2032,,55,,1/5/2021 11:38,1/5/2021 11:38,General Master Equation with Decoherence Query,,1,0,,,,CC BY-SA 4.0 +8240,2,,8239,9/12/2019 9:51,,2,,"

It's fundamentally similar to/the same as Baker–Campbell–Hausdorff (BCH).

+ +

Generally, in quantum physics, this is most often used (or at least taught) with commuting Hamiltonians: $$e^{-i\left(H_1+H_2\right)t} = \sum_{n=1}^\infty\frac{\left(-it\right)^n}{n!}\left(H_1+H_2\right)^n = e^{-iH_1t}e^{-iH_2t}e^{\frac{1}{2}\left[H_1, H_2\right]t^2}\cdots$$ where the terms of order $e^{t^3}$ and higher (represented by '$\cdots$') all involve the commutator $\left[H_1, H_2\right]$, so if $\left[H_1, H_2\right] = 0$, this becomes $$e^{-i\left(H_1+H_2\right)t} = e^{-iH_1t}e^{-iH_2t} .$$

+ +

Similarly, as this is a general mathematical result in Lie algebra (and not at all specific to Hamiltonians), if $$[\mathscr{L}_{el}, \mathscr{H}] = [\mathscr{L}_{el},\mathscr{L}_{du}] = [\mathscr{L}_{el}, \mathscr{L}_{ud}] = 0,$$ then $$[\mathscr{L}_{el}, \mathscr{H}+\mathscr{L}_{du}+\mathscr{L}_{ud}] = 0$$ and we can write \begin{align*}\mathscr{U}(t)\rho &= \exp[-t(i\mathscr{H + \mathscr{L}_{ud}+\mathscr{L}_{du} + \mathscr{L}_{el})}]\rho \\ &= \exp[-t(i\mathscr{H + \mathscr{L}_{ud}+\mathscr{L}_{du}) -\mathscr{L}_{el}t}]\rho \\ &= \exp[-t(i\mathscr{H + \mathscr{L}_{ud}+\mathscr{L}_{du})]\exp[-\mathscr{L}_{el}t}]\exp[\frac{1}{2}\left[i\mathscr H + \mathscr L_{ud} + \mathscr L_{du}, \mathscr L_{el}\right]t^2]\cdots\rho \\ &= \exp[-t(i\mathscr{H + \mathscr{L}_{ud}+\mathscr{L}_{du})]\exp[-\mathscr{L}_{el}t}]\rho\end{align*} and as this is true $\forall\,\rho$, $$\mathscr{U}(t) = e^{-t\mathscr{L}_{el}}e^{-t(i\mathscr{H} + \mathscr{L}_{ud} + \mathscr{L}_{du})} = e^{-t(i\mathscr{H} + \mathscr{L}_{ud} + \mathscr{L}_{du})}e^{-t\mathscr{L}_{el}}$$ (again, due to the same commutation relation, where $e^{-t\mathscr{L}_{el}}$ is doesn't matter). While this may initally look and feel weird as Master equations are superoperators, the underlying maths remains fundamentally unchanged as per e.g. Machnes and Plenio.

+",23,,,,,9/12/2019 9:51,,,,3,,,,CC BY-SA 4.0 +8241,2,,2651,9/12/2019 13:55,,4,,"

The ZX-calculus is a graphical language for dealing with linear maps of qubits, and it can in particular represent any state of qubits. Basically, ZX-diagrams are tensor networks, but there is an additional set of rewrite rules that allows you to manipulate them graphically. On the Wikipedia page you can find an example of how to prove that a certain quantum circuit indeed implements a GHZ-state. It has also been used to reason about Measurement-Based Quantum Computing, because it allows you to straightforwardly reason about graph states.

+ +

In PyZX (disclaimer: I am a lead developer) we use automated graph rewriting to reason and prove results with ZX-diagrams involving thousands of vertices, and we can visualize circuits and states on dozens of qubits.

+",5998,,,,,9/12/2019 13:55,,,,0,,,,CC BY-SA 4.0 +8242,2,,6561,9/12/2019 14:25,,3,,"

If we have a certain quantum system which is in a state $|\psi\rangle$ and has a Hamiltonian $H$, then if we look at the state after a time $t$ it will have evolved to $|\psi_t\rangle = e^{it H}|\psi\rangle$. The goal of Hamiltonian simulation is to answer some questions about $|\psi_t\rangle$ given a (usually simple) input state $|psi\rangle$, Hamiltonian $H$ and time $t$.

+ +

This was the original problem suggested by Feynman where quantum computers could reasonably do better than classical computers, as a quantum computer can naturally represent the unitary evolution.

+ +

This raises another question: Why would one want to do Hamiltonian simulation? +There are many reasons, but generally, if we can efficiently do Hamiltonian simulation (for instance on a quantum computer), then we can study directly how structures at the smallest scales (such as atoms or molecules, but also certain properties of Quantum Field Theory) interact and evolve. This is important to the field of quantum chemistry where one for instance wants to know how the physical structure of a molecule evolves trough time. At a larger scale it could also prove useful to for instance pharmaceutical companies who can then directly simulate the effect of their drugs on the cells in our bodies (although this is very much pie in the sky at the moment).

+",5998,,,,,9/12/2019 14:25,,,,0,,,,CC BY-SA 4.0 +8243,2,,5485,9/12/2019 14:36,,2,,"

The trick is that if we have a Hamiltonian $H$ with diagonalization $H=UDU^\dagger$, then $e^{it H} = U e^{it D} U^\dagger$.

+ +

In particular, if you have a Hamiltonian that is a product of Pauli's $H = \sigma_1\otimes\cdots\otimes \sigma_n$, (where for simplicity we assume $\sigma_i \neq I$ for all $i$) then we can diagonalise $H$ as

+ +

$$H = (\sigma'_1\otimes\cdots\otimes \sigma'_n) Z\otimes\cdot\otimes Z (\sigma'_1\otimes\cdots\otimes \sigma'_n)$$

+ +

As a result:

+ +

$$e^{it H} = (\sigma'_1\otimes\cdots\otimes \sigma'_n) e^{it Z\otimes\cdot\otimes Z} (\sigma'_1\otimes\cdots\otimes \sigma'_n) $$

+ +

Since Pauli matrices are easy to implement on a quantum computer, and we already know how to do $e^{it Z\otimes Z}$, we are then done.

+ +

If the Hamiltonian is a sum of Pauli products, then there is no general simple solution, but you can use the Lie product formula truncated to some large number of terms to reduce it to the above problem.

+",5998,,,,,9/12/2019 14:36,,,,0,,,,CC BY-SA 4.0 +8244,1,8370,,9/12/2019 15:34,,10,2280,"

I've noticed that Q# favors Little Endian. Meaning that most operations are designed for this type of encoding. +Is is it the same with Qiskit?

+",7759,,26,,9/29/2019 10:25,8/16/2022 7:26,Big Endian vs. Little Endian in Qiskit,,3,0,,,,CC BY-SA 4.0 +8245,1,8246,,9/12/2019 18:30,,1,187,"

I'm trying to do exercise 3 of this quantum course.

+ +

Alice and Bob prepare an EPR pair in the Bell + state. They each take one qubit home.

+ +

Suddenly, Alice decides she wishes to convey one of 4 +messages to Bob; in other words, she wants to convey a classical string $uv \in \{00, 01, 10, 11\}$ to Bob.

+ +

Alice does the following in the privacy of her own home: First, if $u = 1$, she applies a NOT gate to her qubit (else if $u = 0$ she does nothing here).

+ +

Next, if $v = 1$, she applies a $Z$ gate to her qubit (else if $v = 0$, she does nothing here).

+ +

Finally, she walks to Bob’s house and silently hands him her qubit. +Show that by measuring in a proper basis, Bob can determine the message that Alice wants to send.

+ +
+ +

My solution so far:

+ +

If you measure both in the standard computational basis you can tell that if the bits are different, the first digit that Alice wants to send is 1.

+ +

The problem I have is how to tell that Alice applied the $Z$ gate, while at the same time getting a 0-1 (apart from the phase that the gate added).

+ +

These being all the possible cases.

+ +

$$1/\sqrt{2} \left| 00 \right> - 1/\sqrt{2} \left| 11 \right>$$

+ +

$$1/\sqrt{2} \left| 00 \right> + 1/\sqrt{2} \left| 11 \right>$$

+ +

$$1/\sqrt{2} \left| 10 \right> - 1/\sqrt{2} \left| 01 \right>$$

+ +

$$1/\sqrt{2} \left| 10 \right> + 1/\sqrt{2} \left| 01 \right>$$

+ +

I think I am missing some extra bit of info? Bob should not be supposed to use an extra ancilla qubit to do a CNOT with the one that Alice gives him so that he makes 3 measurements (1 for +-, 1 for the first and one for the second bit), because it's just 22 cases. 2 measurements should suffice with the qubits that already exist but I am confused on how to proceed.

+",8391,,26,,9/29/2019 10:09,9/29/2019 10:09,How to decode 2-bit message from 2 entangled qubits?,,1,0,,,,CC BY-SA 4.0 +8246,2,,8245,9/12/2019 18:47,,3,,"

This procedure is referred to as superdense coding protocol; you can find a lot of detailed explanations of it, starting with the Wikipedia article. If you want a hint before getting a full explanation...

+ +

Effectively you need to distinguish the four Bell states. You can always do this with 100% accuracy, since all the states are orthogonal to each other. To do that, you need to find a unitary transformation which will convert these states to the four 2-qubit basis states $|00\rangle$, $|01\rangle$, $|10\rangle$ and $|11\rangle$. It might be easier to start thinking about converting the 2-qubit basis states to Bell states and then inverting that transformation.

+",2879,,,,,9/12/2019 18:47,,,,0,,,,CC BY-SA 4.0 +8247,1,,,9/12/2019 22:30,,2,214,"

I am on Ch.1 of the Mike & Ike book. On page 18, the text shows an X gate that essentially flips the $\alpha$ and $\beta$ amplitudes. The text shows the $X$ matrix but it doesn't show those for alpha and beta. I think the $\alpha$ is [1,0] and $\beta$ is [0,1], but I don't think that was ever defined or explained anywhere? +I don't understand this excerpt from the text:

+ +
+

Notice that the action of the NOT gate is to take the state $|0\rangle$ and replace it by the state corresponding to the first column of the matrix $X$. Similarly, the state $|1\rangle$ is replaced by the sate corresponding to the second column of the matrix $X$.

+
+ +

Can someone show me what matrixes are multiplied to make this flip happen? I would accept hand drawings!

+ +

I have the same question for the H and the CNOT gates - the matrices are shown on pages 19 and 21, but not the multiplication of matrices.

+ +

I'm refreshing on linear algebra, so please excuse me!

+ +

Thanks in advance for any help or guidance.

+ +

Yogesh

+",8500,,26,,9/29/2019 9:54,9/29/2019 9:54,"Can someone show the linear algebra calculations for X, H, and CNOT gates?",,1,0,,,,CC BY-SA 4.0 +8248,2,,8238,9/13/2019 0:05,,10,,"

In each of the examples you mentioned, the task breaks very roughly down into two steps: finding a Hamiltonian that describes the problem in terms of qubits, and finding the ground state energy of that Hamiltonian. From that perspective, the Jordan–Wigner transform is a way to find a qubit Hamiltonian corresponding to a given fermionic Hamiltonian.

+ +

Once you have your problem specified in terms of a qubit Hamiltonian, there's (again, very roughly) two families of approaches to finding a ground state energy. With variational approaches, you prepare states from a family of states called an ansatz, then estimate the expectation value of the Hamiltonian for each different input state, and minimize. To get each expectation value, you can do something like break the Hamiltonian $H$ up into a sum $H = \sum_i h_i H_i$, where each $h_i$ is a real number and each $H_i$ is a Hamiltonian that's easier to estimate the expectation value of, such as a Pauli operator. You can then estimate $\langle H \rangle$ by estimating each $\langle H_i \rangle$ in turn.

+ +

The other broad approach is to turn your energy estimation problem into a frequency estimation problem by evolving an input state under the qubit Hamiltonian $H$ that represents your problem. As you note in your question, this implicitly uses the Schrodinger equation $|\psi(t)\rangle = e^{-i H t} |\psi(0)\rangle$. In the special case that $|\psi(0)\rangle$ is the ground state (say, as the result of an adiabatic preparation), then this gives you that $|\psi(t)\rangle = e^{-i E t} |\psi(0)\rangle$; that is, a global phase about your initial state. Since global phases are unobservable, you can use the phase kickback trick (see Chapter 7 of my book once it's posted for more details) to make that global phase into a local phase. From there, as you vary $t$, the ground state energy appears as a frequency that you can learn using phase estimation. Phase estimation itself comes in two broad flavors (there's a bit of a theme here...), namely quantum and iterative phase estimation. In the first case, you use extra qubits to read out the phase into a quantum register, which is very helpful if you want to do further quantum processing of that energy. In the second case, you use one additional qubit to do classical measurements with phase kickback, letting you reuse your copy of the ground state. At that point, learning $E$ from your classical measurements is a classical stats problem that you can solve in a number of different ways, such as with Kitaev's algorithm, maximum likelihood estimation, Bayesian inference, robust phase estimation, random walk phase estimation, or many others.

+ +

That then leaves the problem of how to evolve under $H$. That's where techniques like Trotter–Suzuki come in. Using the Trotter–Suzuki decomposition, you break $H$ into a sum of terms that are each easy to simulate (that can be the same as the the decomposition you would use for VQE, but need not be), then rapidly switch between simulating each term. There's many other simulation algorithms out there, such as qubitization, but Trotter–Suzuki is a great place to start.

+ +

Given the plethora of different techniques, then, would you choose VQE over phase estimation or vice versa? That comes down to what kinds of quantum resources you want to use to solve your problem. At a very very high level, VQE tends to generate a very large number of quantum circuits that are each pretty shallow. By contrast, phase estimation uses quantum programs that dramatically reduce the amount of data you need by using coherent evolution (again roughly, this is the difference between Heisenberg-limited precision and the ""standard quantum limit,"" which is neither standard, quantum, nor a limit — but I digress). The downside is that phase estimation can use more qubits and deeper quantum programs. Understanding that trade-off is a large part of where tools like the trace simulator and resources estimator provided with the Quantum Development Kit come in. There's a lot out there, and being able to write up concrete implementations of each is now we can understand where each technique is most helpful.

+",1978,,,,,9/13/2019 0:05,,,,3,,,,CC BY-SA 4.0 +8249,1,8250,,9/13/2019 3:06,,7,2056,"

I started by assuming two antipodal states +$$ +|(\theta,\psi)\rangle = \cos\dfrac{\theta}{2}|0\rangle + \sin\dfrac{\theta}{2}e^{i\psi}|1\rangle\\ +|(\theta+\pi,\psi+\pi)\rangle= \cos\dfrac{\theta+\pi}{2}|0\rangle + \sin\dfrac{\theta+\pi}{2}e^{i(\psi+\pi)}|1\rangle +$$ +and then try to take the inner product of them. However, the math doesn't check out (as in the result I get $\ne0$). What is wrong with my deduction?

+",8421,,26,,10/14/2019 19:58,10/15/2019 0:17,How to prove that antipodal points on the Bloch sphere are orthogonal?,,2,0,,,,CC BY-SA 4.0 +8250,2,,8249,9/13/2019 4:20,,6,,"

In spherical coordinates antipodal point to $(\theta,\psi)$ is $(\theta+\pi,\psi)$, not $(\theta+\pi,\psi+\pi)$

+",5870,,,,,9/13/2019 4:20,,,,0,,,,CC BY-SA 4.0 +8251,2,,8247,9/13/2019 6:03,,4,,"

A quantum bit can be represented by a two-level quantum mechanical system, and described by a state vector in two-dimensional Hilbert space. Traditionally, Dirac, or bra-ket notation has been used to represent them. The two computational basis states are therefore often written as |0〉 and |1〉 (pronounced: 'ket 0' and 'ket 1' respectively). A pure qubit state is a linear superposition of the two states. This means that such a qubit can be represented as: + |ψ〉 = α|0〉 + β |1〉 or as $\begin{bmatrix} α \\ β \end{bmatrix}$ +where α and β are probability amplitudes and are in general complex numbers. When a qubit is measured in the standard basis, the probability that the outcome is |0〉 is $|α|^2$ and the probability that the outcome is |1〉 is $|β|^2$. As the absolute squares of the amplitudes represent probabilities, therefore α and β are constrained by the following equation: + $|α|^2$ + $|β|^2$ = 1

+ +

X is $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$

+ +

|ψ'〉 = X|ψ〉 = $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\begin{bmatrix} α \\ β \end{bmatrix} = \begin{bmatrix} 0*α + 1*β \\ 1*α + 0*β \end{bmatrix} = \begin{bmatrix} β \\ α \end{bmatrix}$

+ +

Now |0〉 is $\begin{bmatrix} 1 \\ 0 \end{bmatrix}$

+ +

and |1〉 is $\begin{bmatrix} 0 \\ 1 \end{bmatrix}$

+ +

|1〉 = X|0〉 = $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} 0*1 + 1*0 \\ 1*1 + 0*0 \end{bmatrix} = \begin{bmatrix} 0 \\ 1 \end{bmatrix}$

+ +

|0〉 = X|1〉 = $\begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}\begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} 0*0 + 1*1 \\ 1*0 + 0*1 \end{bmatrix} = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$

+ +

Similarly for H = $\begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}$

+ +

|ψ'〉 = H|ψ〉 = $\begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}\begin{bmatrix} α \\ β \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}}*α + \frac{1}{\sqrt{2}}*β \\ \frac{1}{\sqrt{2}}*α -\frac{1}{\sqrt{2}}*β \end{bmatrix} = \begin{bmatrix} \frac{α + β}{\sqrt{2}} \\ \frac{α - β}{\sqrt{2}} \end{bmatrix}$

+ +

Now |0〉 is $\begin{bmatrix} 1 \\ 0 \end{bmatrix}$

+ +

and |1〉 is $\begin{bmatrix} 0 \\ 1 \end{bmatrix}$

+ +

H|0〉 = $\begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}\begin{bmatrix} 1 \\ 0 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}}*1 + \frac{1}{\sqrt{2}}*0 \\ \frac{1}{\sqrt{2}}*1 -\frac{1}{\sqrt{2}}*0 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1 }{\sqrt{2}} \end{bmatrix}$ = $\frac{1}{\sqrt{2}}$[|0〉 + |1〉]

+ +

H|1〉 = $\begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}\begin{bmatrix} 0 \\ 1 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}}*0 + \frac{1}{\sqrt{2}}*1 \\ \frac{1}{\sqrt{2}}*0 -\frac{1}{\sqrt{2}}*1 \end{bmatrix} = \begin{bmatrix} \frac{1}{\sqrt{2}} \\ -\frac{1 }{\sqrt{2}} \end{bmatrix}$ =$\frac{1}{\sqrt{2}}$[|0〉 - |1〉]

+ +

CNOT is a two qubit gate so matrix representation is 4 X 4

+ +

CNOT= $\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}$

+ +

and lets define |$\phi$〉 = (α|0〉 + β|1〉) ⊗ ( б|0〉 + η|1〉) = $\begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_3 \\ \alpha_4 \end{bmatrix}$ +where $|α|^2$ + $|β|^2$ = 1 and $|б|^2$ + $|η|^2$ = 1

+ +

|$\phi$〉 = $α_1|00〉 + α_2|01〉 + α_3|10〉 + α_4|11〉 $
+where $|α_1|^2$ + $|α_2|^2$ + $|α_3|^2$ + $|α_4|^2$ = 1.

+ +

$α_1 = α ⊗ б$ +$α_2 = α ⊗ η$ +$α_3 = β ⊗ б$ +$α_4 = β ⊗ η$

+ +

|$\phi'$〉 = CNOT|$\phi$〉 = $\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}\begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_4 \\ \alpha_4 \end{bmatrix} = \begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_3 \\ \alpha_3 \end{bmatrix} = \begin{bmatrix} \alpha_1 \\ \alpha_2 \\ \alpha_4 \\ \alpha_4 \end{bmatrix} = \begin{bmatrix} α ⊗ б \\ α ⊗ η \\ β ⊗ б \\ β ⊗ η \end{bmatrix}$

+ +

Now when α = 1, there is no change in the state of second qubit, however, when β = 1 then the state of second qubit is flipped. It is easy to understand when α, β, б and η are either 0 or 1 but not otherwise. CNOT gate is one of the fundamental entangling gates. so if you have difficulty then I can elaborate further. I hope it helps...

+",8120,,,,,9/13/2019 6:03,,,,6,,,,CC BY-SA 4.0 +8252,1,,,9/13/2019 6:55,,2,117,"

Coherent state and squeezed states can be swapped why cloning coherent states can't be perfect to clone we obtain $$|\cos(|z|)b\rangle \otimes |\sin(|z|)b\rangle,$$

+ +

If we set $|z| = \pi/4$ then

+ +

$$|b\rangle \otimes |0\rangle = |b/\sqrt 2\rangle \otimes |b/\sqrt 2\rangle$$

+ +

which is imperfect cloning is there a way to perfectly clone?

+",8499,,26,,9/29/2019 10:03,9/29/2019 10:03,Is their a way to perfectly clone coherent state and squeezed states?,,1,0,,,,CC BY-SA 4.0 +8253,2,,8231,9/13/2019 7:14,,2,,"

The general form of all possible extensions is incredibly general. Let +$$ +\rho_A=\sum_ip_i|\psi_i\rangle\langle\psi_i|,\qquad \rho_C=\sum_jq_j|\phi_j\rangle\langle\phi_i|, +$$ +but remember that there are generally many choices for such a decomposition. Now, we could create a pure state +$$ +|\Psi\rangle=\left(\sum_i\sqrt{p_i}|\psi_i\rangle_A|i\rangle_{B_1}\right)\left(\sum_j\sqrt{q_j}|j\rangle_{B_2}|\phi_j\rangle_C\right)|0\rangle_D. +$$ +(I wonder if there are even more options if there are commensurate sets of values for $\sqrt{p_iq_j}$.) +Now, you can have +$$ +\rho_{ABC}=\text{Tr}_D\left(U_{B_1B_2D}|\Psi\rangle\langle\Psi|U_{B_1B_2D}^\dagger\right), +$$ +where $U_{B_1B_2D}$ is a unitary acting over the two $B$ parts, $B_1$ and $B_2$, and some auxiliary system $D$.

+ +

When $U$ does not act on $D$, the extension is a pure state. For example, if $U$ is the identity, there's a lot of bipartite entanglement between $A$ and $B_1$ and between $C$ and $B_2$, but no entanglement between $A$ and $C$. I assume varying $U$ gives you some control over entropies such as those conditioned on $B$ (but I haven't tried it).

+ +

At the other extreme of $U$, you can swap systems $B$ and $D$, which essentially leaves you with a form $\rho_{ABC}=\rho_A\otimes\rho_B\otimes \rho_C$.

+ +

I have no idea what implications this has for entropies and the like.

+",1837,,,,,9/13/2019 7:14,,,,0,,,,CC BY-SA 4.0 +8254,2,,8252,9/13/2019 16:38,,3,,"

The no-cloning theorem states that an unknown quantum state cannot be copied exactly --- so this rules out any algorithm that attempts to produce perfect copies of an arbitrary quantum state (including squeezed and coherent states).

+ +

As you note, however, the no-cloning theorem does not rule out the production of approximate quantum state clones. Andersen et al. introduced the most-optimal scheme for cloning of Gaussian states --- their algorithm produces a clone with fidelity of 65% to the original state (the proven optimum possible is $f=2/3$).

+ +

The circuit they use in their algorithm is here:

+ +

+ +

and can be implemented using Strawberry Fields like so:

+ + + +
# state to be cloned
+Coherent(0.7+1.2j) | q[0]
+
+# 50-50 beamsplitter
+BS = BSgate(pi/4, 0)
+
+# symmetric Gaussian cloning scheme
+BS | (q[0], q[1])
+BS | (q[1], q[2])
+MeasureX | q[1]
+MeasureP | q[2]
+Xgate(scale(q[1], sqrt(2))) | q[0]
+Zgate(scale(q[2], sqrt(2))) | q[0]
+
+# after the final beamsplitter, modes q[0] and q[3]
+# will contain identical approximate clones of the
+# initial state Coherent(0.1+0j)
+BS | (q[0], q[3])
+
+ +

You can check out the Gaussian cloning tutorial in the Strawberry Fields documentation for more information.

+",371,,,,,9/13/2019 16:38,,,,1,,,,CC BY-SA 4.0 +8255,2,,8244,9/15/2019 1:45,,1,,"
+

Note that the bits are labelled from right to left. So cr[0] is the one to the furthest right, and so on. As an example of this, here's an 8 qubit circuit with a Pauli X +on only the qubit numbered 7, which has its output stored to the bit numbered 7.

+
+

https://qiskit.org/textbook/ch-appendix/qiskit.html

+",7744,,15119,,5/18/2021 8:11,5/18/2021 8:11,,,,0,,,,CC BY-SA 4.0 +8257,2,,8236,9/15/2019 22:48,,3,,"

There are a lot of comments and objections in the question, too many in fact to go through them all. I will try to address some of the points that I think hide misconceptions, to hopefully give a clearer idea of what's going on.

+ +

About ""interpretations of QM in which the measurement is non-unitary""

+ +

The non-unitarity of the measuring process is not a matter of interpretations. The mapping between a state and a post-measurement state is non-unitary, period. Interpretations, by definition, do not change any predictions of a theory, and thus won't change this fact.

+ +

To be clear, this remains true even if one somehow ""explains"" at exactly what point, and due to what process, the non-unitarity of the measurement process ""happens"" (e.g. due to some collapse model, or if one adheres to the view that the non-unitarity of measurement is an effective description of a unitary process in which some of the information is neglected, à la Zurek). This is because any such model would essentially explain how/why the mapping +$$|\psi\rangle\mapsto|\psi_i\rangle\tag A$$ +happens with probability $|\langle\psi_i|\psi\rangle|^2$. However, the mapping (A) will remain non-unitary, regardless of such explanations, even though one might be able to explain the non-unitarity as arising from some other principle/axiom/mechanism.

+ +

All this is to say that the statement ""derivation X cannot be applied to Y due to interpretations of the measurement process"" is nonsense. Nonetheless, it is true that the quoted derivation cannot be applied ""to all situations"".

+ +

The derivation cannot be applied in ""all situations""

+ +

Sure: it can be applied in all and only the situations in which the derivation applies.

+ +

The derivation under consideration is nothing but Heisenberg's uncertainty relation for a pair of operators $A,B$, in the form $\sigma_A \sigma_B\ge |\langle[A,B]\rangle|/2$, in the special case $A=\Omega$ and $B=H$, plus some additional definitions and algebraic manipulations.

+ +

What this is telling us is that if, at any given moment $t$, we compute $\sigma_\Omega$ and $\sigma_H$ (which will require multiple repetitions of the experiment, as each experiment will produce a single sample from the underlying distributions, and $\sigma_\Omega$,$\sigma_H$ are the variances of such distributions), we'll find the relation $\sigma_H\sigma_\Omega\ge|\partial_t\langle\Omega\rangle|/2$ to bew satisfied. Again, note that to actually observe this, you would need to perform the same exact experiment multiple times, and then measure the relevant quantities all at the same time $t$ (and probably also at some future time $t+\epsilon$ to compute the time-derivative of $\langle\Omega\rangle$).

+ +

In other words, you can think of this relation as telling you what you would observe if, at any given point of the (unitary evolution), you were somehow able to know the values of the relevant variances and expectation values (which you cannot, but you can simulate the situation by doing many measurements repeating the experiment). This is, therefore, a statement about the values of the expected variances at any given point of time.

+ +

Furthermore, notice how the argument holds for any state, not just pure ones (although the interpretation of time provided in joshphysics' answer might not). This means that it doesn't care about whether measurements were performed at some point in the past of the considered instant of time $t$. The only thing that matters is the state of the system at the time $t$. +Note that you can also model measurement processes as (non-unitary) maps applied to the state. For example, measuring a state $\rho$ in the computational basis can be modelled as the mapping +$$\rho\mapsto\mathcal E(\rho)\equiv\sum_k \operatorname{Tr}(\rho P_k)P_k,$$ +where $P_k\equiv|k\rangle\!\langle k|$. This still produces a state, on which you can apply the uncertainty realtion.

+ +

But we use Heisenberg's equation to obtain the result!

+ +

True. So I guess to be more precise, the statement refers to the relation between $\sigma_\Omega,\sigma_H$ at a given time $t$, and the rate of increment of $\langle\Omega\rangle$ at the time $t$. This increment refers to the rate of increment of $\langle\Omega\rangle$ between some $t$ and $t+\epsilon$ when the state evolves unitarity in between the two times. +In other words, to compute it, you need to measure $\langle \Omega\rangle$ at time $t$, and then measure $\langle\Omega\rangle$ at time $t+\epsilon$ (and by this I mean that you repeat the measurement without measuring at $t$, but this time only measuring at $t+\epsilon$).

+",55,,55,,9/29/2019 10:52,9/29/2019 10:52,,,,12,,,,CC BY-SA 4.0 +8258,1,8259,,9/16/2019 12:31,,0,164,"

I have a hard time getting the exact difference between concepts of superposed and mixed states. Is it possible to represent the second one on the Bloch sphere, to show the main difference?

+",2098,,55,,9/16/2019 21:44,9/16/2019 21:44,Can a mixed state be represented on a Bloch sphere?,,1,0,,,,CC BY-SA 4.0 +8259,2,,8258,9/16/2019 15:38,,3,,"

Yes. A pure, superposed, state corresponds to a point on the surface of the sphere. A mixed state corresponds to a point inside the sphere. The closer to the centre, the more mixed the state is.

+",1837,,,,,9/16/2019 15:38,,,,0,,,,CC BY-SA 4.0 +8260,1,8261,,9/16/2019 19:06,,1,217,"

Let H be the Hadamard operator. + $$ H = (\left| 0 \right> \left< 0 \right| + \left| 0 \right> \left< 1 \right| + \left| 1 \right> \left< 0 \right| -\left| 1 \right> \left< 1 \right| )$$

+ +

prove that $$H^{\otimes n} \left| 0 \right>^{\otimes n} = \frac{1}{\sqrt{2^n}} \sum_{i=0}^{2^n -1} \left| i \right>$$

+ +

Now, it is evident that this works for $n=1$ and $n=2$, because we know that. +$$ \left| 0 \right>^{\otimes 2} = \left| 0 \right> \otimes \left| 0 \right> = \left| 00 \right> $$ +Then. +$$ H^{\otimes2}\left| 00 \right> = (\left| 0 \right> \left< 0 \right| + \left| 0 \right> \left< 1 \right| + \left| 1 \right> \left< 0 \right| -\left| 1 \right> \left< 1 \right| )(\left| 0 \right> \left< 0 \right| + \left| 0 \right> \left< 1 \right| + \left| 1 \right> \left< 0 \right| -\left| 1 \right> \left< 1 \right| )\left| 00 \right>$$

+ +

$$H^{\otimes2}\left| 00 \right> = \frac{1}{2}(\left< 00 \right|\left| 00 \right>\left| 00 \right> + \left< 00 \right|\left| 00 \right>\left| 01 \right> + \left< 00 \right|\left| 00 \right>\left| 10 \right> + \left< 00 \right|\left| 00 \right>\left| 11 \right>)$$

+ +

$$H^{\otimes2}\left| 00 \right> = \frac{1}{2}(\left| 00 \right> + \left| 01 \right> + \left| 10 \right> + \left| 11 \right>) = \frac{1}{2}\sum^{3}_{i=0}\left| i \right> = \frac{1}{\sqrt{2^2}}\sum^{2^2 -1}_{i=0}\left| i \right> $$

+ +

But I do not know how to prove that it works for $n = k + 1$.

+ +

Any clue is very welcome, thank you in advance for your time and advice.

+ +

For more information about bra-ket notation, or the Hadamard operator you can consult those links.

+",8528,,2879,,9/16/2019 20:17,9/16/2019 21:35,Prove by induction $H^{\otimes n} \left| 0 \right>^{\otimes n} = \frac{1}{\sqrt{2^n}} \sum_{i=0}^{2^n -1} \left| i \right>$,,2,1,,,,CC BY-SA 4.0 +8261,2,,8260,9/16/2019 20:13,,2,,"

To do the step of the induction, you assume that you've already proven that

+ +

$$H^{\otimes k} \left| 0 \right>^{\otimes k} = \frac{1}{\sqrt{2^k}} \sum_{i=0}^{2^k -1} \left| i \right>$$ (note the appropriate normalization factor).

+ +

Now, you have to consider $H^{\otimes k+1} \left| 0 \right>^{\otimes k+1}$:

+ +

$$H^{\otimes k+1} \left| 0 \right>^{\otimes k+1} = \big( H^{\otimes k} \left| 0 \right>^{\otimes k} \big) \otimes \big( H|0\rangle \big) = \big(\frac{1}{\sqrt{2^k}} \sum_{i=0}^{2^k -1} \left| i \right> \big) \otimes \frac{1}{\sqrt2}(|0\rangle + |1\rangle)$$

+ +

Once you open the brackets, you'll get $\sum_{i=0}^{2^k -1} \big( | i \rangle \otimes |0\rangle + | i \rangle \otimes |1\rangle \big)$, which is exactly $\sum_{i=0}^{2^{k+1} -1} | i \rangle$ (you'll see it if you write out the binary representations of the sum elements).

+",2879,,,,,9/16/2019 20:13,,,,1,,,,CC BY-SA 4.0 +8262,2,,8260,9/16/2019 21:35,,0,,"

As pointed out in the comments, induction is not necessary here. You can simply notice that +$$H^{\otimes n}|0\rangle^{\otimes n}\equiv\bigotimes_nH|0\rangle=\bigotimes_n|+\rangle\equiv|+\rangle^{\otimes n}\equiv|\underbrace{+,+,...,+}_n\rangle,\tag A$$ +where $|+\rangle\equiv\frac{1}{\sqrt2}(|0\rangle+|1\rangle)$, and thus +$$|+\rangle^{\otimes n}=\frac{1}{2^{n/2}}\sum_{i=0}^{2^n-1}|i\rangle.\tag B$$ +At the last step we are observing that $|+\rangle^{\otimes n}$ is a balanced sum over all bitstrings of length $n$, which we can write as in the RHS, in which we identify $i$ with the bitstring equal to the $i$-th integer in binary notation.

+ +
+ +

Another way is to observe that the matrix elements of $H$ equal $\sqrt2 H_{ij}=(-1)^{ij}$. +From this one can derive the matrix elements of $H^{\otimes n}$: +$$(H^{\otimes n})_{I,J}=\prod_{k=1}^n (H)_{i_k,j_k}=2^{-n/2}\prod_{k=1}^n (-1)^{i_k j_k} +=2^{-n/2}(-1)^{\sum_k i_k j_k}\equiv 2^{-n/2}(-1)^{I\odot J},$$ +where $I\equiv(i_1,...,i_n), J\equiv (j_1,...,j_n)$, and $I\odot J\equiv\sum_k i_k j_k$. In other words, $I,J$ are bitstrings with components $i_k,j_k\in\{0,1\}$.

+ +

From this, we can see that +$$H^{\otimes n}|0\rangle^{\otimes n}=\sum_I (H^{\otimes n})_{I,\underbrace{(0,...,0)}_{\equiv J}} |I\rangle +=2^{-n/2}\sum_I (-1)^{I\cdot \boldsymbol 0}|I\rangle +=2^{-n/2}\sum_I |I\rangle,$$ +where $\sum_I |I\rangle$ is here just another way to write $\sum_{i=0}^{2^n-1}|i\rangle$.

+",55,,,,,9/16/2019 21:35,,,,1,,,,CC BY-SA 4.0 +8263,1,,,9/16/2019 21:36,,3,88,"

Say I have a quantum register consisting of two qubits like this $\left| -,0\right>$ which as a vector would be $\frac{1}{\sqrt{2}}(1, 0, -1, 0)$. If I only started with this vector, would it possible using only the vector formulation to find the two qubits that make it up ie. $\left|-\right> = \frac{1}{\sqrt{2}}(1, -1)$ and $\left|0\right> = (1, 0)$? How would that be done in a general case where we only have a vector $(v_{1},v_{2}, ....v_{n})$ and we know it consists of $log_{2}(n)$ qubits?

+",8530,,55,,9/16/2019 21:49,9/17/2019 6:53,Can I find the states of individual qubits in a quantum register using only linear algebra?,,1,1,,,,CC BY-SA 4.0 +8264,1,8268,,9/17/2019 1:12,,1,75,"

I'd like to run the optimizations from Qiskit's level 3 transpiler pass on some example programs for benchmarking, but when I try to include the Collect2qBlocks() and ConsolidateBlocks() passes I get an error. The code below is based on the example here.

+ +
from qiskit import QuantumCircuit
+from qiskit.compiler import transpile
+from qiskit.transpiler import PassManager
+from qiskit.transpiler.passes import Unroller, Optimize1qGates, CommutativeCancellation, CXCancellation, Depth, FixedPoint, Collect2qBlocks, ConsolidateBlocks
+
+circ = QuantumCircuit.from_qasm_file(""example.qasm"")
+
+basis_gates = ['u1', 'u2', 'u3', 'cx']
+_unroll = Unroller(basis_gates)
+_depth_check = [Depth(), FixedPoint('depth')]
+def _opt_control(property_set):
+    return not property_set['depth_fixed_point']
+_opt = [Collect2qBlocks(), ConsolidateBlocks(),
+        Unroller(basis_gates),  # unroll unitaries
+        Optimize1qGates(), CommutativeCancellation()]
+pm = PassManager()
+pm.append(_unroll)
+pm.append(_depth_check + _opt, do_while=_opt_control)
+circ = pm.run(circ)
+print(circ.count_ops())
+
+ +

This seems to run fine if I exclude the Collect2qBlocks() and ConsolidateBlocks() passes, but when I include them I get the following error:

+ +
Traceback (most recent call last):
+  File ""test_qiskit.py"", line 19, in <module>
+    circ = pm.run(circ)
+  File ""/usr/local/lib/python3.7/site-packages/qiskit/transpiler/passmanager.py"", line 146, in run
+    dag = self._do_pass(pass_, dag, passset.options)
+  File ""/usr/local/lib/python3.7/site-packages/qiskit/transpiler/passmanager.py"", line 183, in _do_pass
+    pass_.run(FencedDAGCircuit(dag))
+  File ""/usr/local/lib/python3.7/site-packages/qiskit/transpiler/passes/collect_2q_blocks.py"", line 59, in run
+    these_qubits = sorted(nd.qargs)
+TypeError: '<' not supported between instances of 'QuantumRegister' and 'QuantumRegister'
+
+ +

Am I invoking the methods incorrectly? I have the most recent version of Qiskit available on pip. Please let me know if you have any advice, thanks.

+",8532,,,,,9/18/2019 12:58,Question on using the Collect2qBlocks() and ConsolidateBlocks() optimizations,,1,3,,,,CC BY-SA 4.0 +8265,2,,8263,9/17/2019 6:53,,3,,"

Here's a simple method that will work on any state that is not entangled with other qubits. It's also pretty efficient; it's the method used by the amplitude displays in Quirk.

+ +
    +
  1. Find the index $k$ of any one of the largest magnitude entries in the vector. In your case this would be index 0 or index 2. Technically any non-zero entry will do, but if you aren't being perfectly precise then picking the largest will reduce numerical error.

  2. +
  3. Split $k$ into the ""included in my subsystem"" part and the ""excluded from my subsystem"" part. For example the index $k=2$ splits into the index pair $(k_i, k_e) = (1, 0)$ whereas the index 0 would split into (0, 0).

  4. +
  5. Let $w_{r}$ be the vector formed by holding $k_i=r$ fixed while you vary $k_e$ over all possible exterior values and tale the corresponding amplitude in the state vector. For example, you hold the 1 in (1, 0) constant while iterating the other. So you need to look up (1, 0) which is $-1$ and (1, 1) which is $0$. So $w_{k_i}$ would be $(-1, 0)$.

  6. +
  7. Let $v = w_{k_i} / |w_{k_i}|$ be the renormalized vector. This is the state vector of the subsystem, up to global phase. Note that in our case it equals $-|0\rangle$, which is in fact one of the qubit states (up to global phase).

  8. +
  9. [Optional] Verify. If $v$ is actually the subsystem vector, then all $w_r$ should be parallel to $v$. You can check this by checking that $|\sum_r \langle v | w_r\rangle | = 1$. If it's not, the internal and external states are entangled.

  10. +
+",119,,,,,9/17/2019 6:53,,,,0,,,,CC BY-SA 4.0 +8266,2,,7050,9/17/2019 19:52,,0,,"

Just in case you want to try writing code for quantum computers using something from the Lisp family of languages instead of Python, which is used by most people in this field, I wrote a GNU Guile (Scheme) to QASM2 toy compiler called g2q

+",7804,,,,,9/17/2019 19:52,,,,0,,,,CC BY-SA 4.0 +8268,2,,8264,9/18/2019 12:58,,1,,"

Answering my question, as per the comments above. The solution was installing the latest version of qiskit. To get 0.12.0, I needed to 'pip uninstall' qiskit and then 'pip install' it again.

+",8532,,,,,9/18/2019 12:58,,,,0,,,,CC BY-SA 4.0 +8269,1,8271,,9/19/2019 0:43,,1,512,"

I am using QAOA to solve the max-cut problem. On my machine, 10 qubits already takes a minute or two to simulate. I'm hoping that the ibmq-qasm-simulator could simulate 32 qubits faster than my laptop would. Here's my code:

+ +

After loading in my IBMQ token and such...

+ + + +
optimizer = COBYLA()
+# Simulate using IBM's cloud service
+backend = provider.get_backend('ibmq_qasm_simulator')
+quantum_instance = QuantumInstance(backend, shots=1)
+
+part_array = part.values
+w = calc_w(part_array)  # Calculate pairwise distances between points
+
+# Execute algorithm
+qubit_ops, offset = max_cut.get_max_cut_qubitops(w)
+qaoa = QAOA(qubit_ops, optimizer, p)
+result = qaoa.run(quantum_instance)
+
+ +

While the code runs a message in red (like a warning but without ""Warning:"") displays saying, ""The skip Qobj validation does not work for IBMQ provider. Disable it."" How do I do what this message is asking?

+",8420,,55,,9/28/2019 19:15,9/28/2019 19:15,Backend Warning: The skip Qobj validation does not work for IBMQ provider. Disable it,,1,0,,,,CC BY-SA 4.0 +8270,2,,4975,9/19/2019 10:24,,26,,"

You can build your gate with Operator and unitary function e.g:

+
from qiskit import QuantumCircuit, QuantumRegister
+from qiskit.quantum_info.operators import Operator
+
+controls = QuantumRegister(2)
+circuit = QuantumCircuit(controls)
+
+cx = Operator([
+    [1, 0, 0, 0],
+    [0, 0, 0, 1],
+    [0, 0, 1, 0],
+    [0, 1, 0, 0]
+])
+circuit.unitary(cx, [0, 1], label='cx')
+
+Output:
+         ┌──────────┐
+q0_0: |0>┤0         ├
+         │  unitary │
+q0_1: |0>┤1         ├
+         └──────────┘
+
+

This is identical to:

+
circuit.cx(controls[0], controls[1])
+
+Output:
+
+q0_0: |0>──■──
+         ┌─┴─┐
+q0_1: |0>┤ X ├
+         └───┘
+
+

For more info look Qiskit tutorials: https://qiskit.org/documentation/tutorials/simulators/4_custom_gate_noise.html

+",8116,,8116,,7/23/2020 7:55,7/23/2020 7:55,,,,1,,,,CC BY-SA 4.0 +8271,2,,8269,9/19/2019 14:14,,3,,"

There is a parameter when instantiating a QuantumInstance() called skip_qobj_validation. This parameter is set to True by default. When creating the QuantumInstance, you can set it to False, and that will get rid of the warning.

+ +
q_instance = QuantumInstace(skip_qobj_validation=False)
+
+",6180,,,,,9/19/2019 14:14,,,,1,,,,CC BY-SA 4.0 +8272,1,,,9/19/2019 14:14,,2,185,"

I tried to follow the HHL tutorial. Since the 8x8 problem is not realistically simulable (I stopped after a few minutes), I tried to make it run on another backend, starting on the easiest example:

+ + + +
params = {
+    'problem': {
+        'name': 'linear_system'
+    },
+    'algorithm': {
+        'name': 'HHL'
+    },
+    'eigs': {
+        'expansion_mode': 'suzuki',
+        'expansion_order': 2,
+        'name': 'EigsQPE',
+        'num_ancillae': 3,
+        'num_time_slices': 50
+    },
+    'reciprocal': {
+        'name': 'Lookup'
+    }
+}
+provider = IBMQ.get_provider(hub='ibm-q')
+backend = provider.get_backend('ibmq_16_melbourne')
+
+matrix = [[1, 0], [0, 2]]
+vector = [1, 4]
+params['input'] = {
+    'name': 'LinearSystemInput',
+    'matrix': matrix,
+    'vector': vector
+}
+
+result = run_algorithm(params, backend = backend)
+print(""solution "", np.round(result['solution'], 5))
+
+
+ +

If I use

+ +
run_algorithm(params, backend = BasicAer.get_backend('qasm_simulator'))
+
+ +

It take a bit of time (30 seconds) but it works. However with 'ibmq_16_melbourne', it runs without any sign of ever stopping (close to an hour now). It doesn't seem to be queud or something, because it consume 20% of my processor and the quantum-computing.ibm.com page says I have no result pending. I tried to restart everything already. +Can you help me and guess what is happening ? +Thank you very much

+ +

Edit 1:

+ +

I've observed that the circuit generated by Aqua to use HHL on a diagonal matrix of size 2 has a depth of 29 000 . So it explains why the simulation is taking so damn long. This is much much bigger than what it should be. The tutorial (which i was running) says the the depth of the generated circut is 129. (I was running the exact same code). I suppose there was some change in the library after the tutorial was done. So my guess is there is some bug in HHL that makes it create a lagrely oversized circuit.

+",8550,,8550,,9/30/2019 14:28,9/30/2019 14:28,Running HHL tutorial on real backend,,0,1,,,,CC BY-SA 4.0 +8273,2,,2177,9/19/2019 21:02,,10,,"

Qiskit's QuantumCircuit has mct method to build multiple-control Toffoli gate with several modes: basic, basic-dirty-ancilla, advanced, noancilla. For instance Toffoli gate with 3 control qubits:

+ +
from qiskit import QuantumCircuit, QuantumRegister
+
+controls = QuantumRegister(3, ""c_qb"")
+target = QuantumRegister(1, ""t_qb"")
+circuit = QuantumCircuit(controls, target)
+
+circuit.mct(controls, target[0], None, mode='advanced')
+
+print(circuit)
+
+ +

Output:

+ +
c_qb_0: |0>──────■────────■────────────────■──────────────────────────────────■──────────────────────────────────■────────────────────
+                 │      ┌─┴─┐            ┌─┴─┐                                │                                  │                    
+c_qb_1: |0>──────┼──────┤ X ├──────■─────┤ X ├──────■────────■────────────────┼─────────────────■────────────────┼────────────────────
+                 │      └───┘      │     └───┘      │      ┌��┴─┐            ┌─┴─┐             ┌─┴─┐            ┌─┴─┐                  
+c_qb_2: |0>──────┼─────────────────┼────────────────┼──────┤ X ├──────■─────┤ X ├──────■──────┤ X ├──────■─────┤ X ├──────■───────────
+           ┌───┐ │-pi/4 ┌───┐┌───┐ │pi/4 ┌───┐┌───┐ │-pi/4 ├───┤┌───┐ │pi/4 ├───┤┌───┐ │-pi/4 ├───┤┌───┐ │pi/4 ├───┤┌───┐ │-pi/4 ┌───┐
+t_qb_0: |0>┤ H ├─■──────┤ H ├┤ H ├─■─────┤ H ├┤ H ├─■──────┤ H ├┤ H ├─■─────┤ H ├┤ H ├─■──────┤ H ├┤ H ├─■─────┤ H ├┤ H ├─■──────┤ H ├
+           └───┘        └───┘└───┘       └───┘└───┘        └───┘└───┘       └───┘└───┘        └───┘└───┘       └───┘└───┘        └───┘
+
+",8116,,,,,9/19/2019 21:02,,,,1,,,,CC BY-SA 4.0 +8274,1,8278,,9/19/2019 22:23,,3,1158,"

I already know how to do that for Z, Y, and H gates. How can I make a controlled sqrt-of-NOT gate? I mean the controlled version of the gate described here.

+",6083,,55,,9/21/2019 12:03,8/20/2020 5:08,How to implement the controlled square root of NOT gate on the IBM Q composer?,,3,3,,,,CC BY-SA 4.0 +8275,2,,7219,9/20/2019 8:17,,2,,"

In my understanding, the key part for entanglement to increase capacity is to have a suboptimal channel. +Suppose the input of you channel can take value in the set $X$, and note $G(X)$ the graph where nodes are possible inputs and there is an edge between to inputs if the range of their corresponding output is overlapping, i.e. When going through the channel they may become the same output. In a one-shot, error free communication scheme, you can't use two linked edge. So the maximum capacity is defined by the size of the maximum independent set of $G(X)$. However you may have a really good channel with large $|X|$ and low collision probabilities, but maybe only two independent inputs.

+ +

Using Quantum entenglement you can somehow relax this condition and use some possible imputs that you couldn't use before, with 0 error probability! The exact scheme and conditions are described in https://arxiv.org/pdf/0911.5300.pdf (Cubitt, Leung, Matthews and Winter)

+ +

But it is the same tool that one can use with classical long block coding. In that case using for exemple Polar Coding (long blocks), you can get arbitrarily low error and capacity arbitrarily close to theoretical maximum capacity.

+ +

Quantum entanglement increases 0-error, one shoot capacity only in case of an imperfect channel. It permits to uses ressources that couldn't be used otherwise. But that's also what assympotic long block coding does, so once you use let say Polar Coding, you have no ""unperfect ressource"" to improve with quantum entanglement anymore.

+",8550,,8550,,9/20/2019 10:03,9/20/2019 10:03,,,,0,,,,CC BY-SA 4.0 +8276,1,,,9/20/2019 9:45,,2,141,"

I would like to know if it is possible to recreate or simulate a cryptographic encryption algorithm like DES or AES using the quantum computing platform Qiskit from IBM?

+",8554,,26,,9/29/2019 10:19,9/29/2019 10:19,Is it possible to simulate or replicate a cryptographic algorithm using Qiskit?,,0,1,,,,CC BY-SA 4.0 +8278,2,,8274,9/20/2019 18:10,,4,,"

Here's one decomposition:

+ +

+ +

It was made by decomposing a controlled S (which is easier to think about because it only phases; it's diagonal) and then converting the basis of the target by conjugating with Hadamards.

+ +

It generalizes in-place to any $\text{CNOT}^{2t}$:

+ +

+",119,,,,,9/20/2019 18:10,,,,1,,,,CC BY-SA 4.0 +8280,1,8294,,9/21/2019 3:01,,3,471,"

When creating multi-bit quantum and classical registers, what is the ordering of MSB to LSB? For instance, I created a quantum register via

+ + + +
import qiskit
+qr = qiskit.QuantumRegister(2, name='qr')
+
+ +

Is qr[1] the MSB, or is it qr[0]?

+ +

For an example of why I'm asking, please review the following:

+ + + +
import qiskit
+qr = qiskit.QuantumRegister(2, name='qr')
+cr = qiskit.ClassicalRegister(2, name='cr')
+qc = qiskit.QuantumCircuit(qr, cr)
+
+# Result should be Bell state (|00>+|11>)/sqrt(2)
+qc.h(qreg[0])
+qc.cx(qreg[0], qreg[1])
+
+# Result should be state |00>
+qc.cx(qreg[0], qreg[1])
+qc.h(qreg[0])
+
+# Result should be state |10>
+qc.x(qreg[0])
+
+qc.measure(qreg, creg)
+qc.draw()
+
+ +

+ +

At the end here I expect the quantum register to be in the state |10>, but the histogram below shows the state |01>. This indicates to me the MSB is the right-most bit, but I don't understand why the authors would do that. Is there some fundamental misunderstanding in my approach?

+ +

EDIT: Also the example is a bit convoluted--I initialized a Bell state because that's what the input to my circuit will be, but the same result happens with just the NOT gate on qr[0].

+ +

+",8560,,55,,5/18/2021 9:58,11/2/2021 13:08,"In Qiskit, when creating multi-bit quantum and classical registers, what is the ordering of MSB to LSB?",,1,0,,,,CC BY-SA 4.0 +8282,2,,2407,9/21/2019 18:06,,2,,"

Your question can in parts be seen as a notational issue.

+ +

The notation $[[n,k,d]]_D$ is often (but not always) reserved for codes is of stabilizer type. As the paper by Calderbank et al shows, qubit stabilizer codes are equivalent to additive self-orthogonal GF(4)^n classical codes. This construction generalizes, see Refs. Ketkar et al. and Ashikhmin and Knill. Here, the dimension of the code is $D^k$ for quDits.

+ +

Some authors use $((n,K,d))_D$ to denote (stabilizer and non-stabilizer) codes that have dimension $K$. Note that $K$ is then not necessarily a power of $D$.

+ +

Rains et al. were the first to construct a $((5,6,2))$ code that is of non-stabilizer type, and which is provably better than any stabilizer code on five qubits: in comparison, the best one has parameters $[[5,2,2]]$, and is thus of dimension $2^2 = 4 < 6$. You'll find more examples for non-additive quantum codes in Yu et al., Smolin et al., and Grassl and Beth.

+",2192,,,,,9/21/2019 18:06,,,,0,,,,CC BY-SA 4.0 +8283,1,8288,,9/21/2019 22:01,,4,625,"

I'm struggling with understanding a bit of basic quantum mechanics math that I was hoping someone could clarify.

+ +

If I have two states such as these:

+ +

$$\frac{1}{\sqrt{2}}(|0\rangle+|1\rangle)$$

+ +

and

+ +

$$\frac{1}{\sqrt{2}}(|0\rangle-|1\rangle)$$

+ +

What is the right way to go about showing whether they're indistinguishable or not? I know that because these two states differ by a relative phase change that they're not the same. Should I substitute in an alternate basis like $|+\rangle$ and $|-\rangle$ for the $|0\rangle$ and $|1\rangle$, and then take measurements? Is showing that they're not orthogonal enough to show that they are either the same state (if they're not orthogonal) or different states (if they are orthogonal)?

+ +

Thanks!

+",8568,,26,,9/29/2019 7:11,9/29/2019 7:11,How to show whether two states are indistinguishable or not by measuring in a different basis?,,1,3,,,,CC BY-SA 4.0 +8284,1,8343,,9/22/2019 15:46,,4,352,"

It is my understanding that, given a quantum computer with $n$ qubits and a way to apply $m$ single- and 2-qubit gates, quantum supremacy experiments

+ +
    +
  1. Initialize the $n$ qubits into the all-zero's ket $|000\cdots\rangle$
  2. +
  3. Generate a random unitary $U$ of $m$ gates
  4. +
  5. Apply the quantum gate $U$ to these qubits, e.g. produce the state $|\Psi\rangle=U|000\cdots\rangle$
  6. +
  7. Measure $|\Psi\rangle$ to produce an $n$-bit classical string
  8. +
  9. Measure some property the sampled string, such as a cross-entropy, and determine if quantum supremacy is achieved based on the sampled string, as compared to, say, the uniform distribution.
  10. +
+ +

This can be repeated multiple times.

+ +
    +
  • Would a claim of quantum supremacy require applying the same random unitary $U$ each time, for each sample? Or is there a different pseudo-random $U$ for each sample?
  • +
+ +

I think I'm reading that $U$ is broken up into a set of pseudo-random single-qubit gates, followed by a set of 2-qubit gates. Are either or both of these fixed, or do they change for each sample?

+",2927,,26,,9/28/2019 16:21,9/28/2019 18:34,Do quantum supremacy experiments repeatedly apply the same random unitary?,,2,9,,,,CC BY-SA 4.0 +8285,1,8289,,9/22/2019 17:11,,3,224,"

I am referring to Exercise 7.18 of ""Quantum Computing and Information 10th Anniversary Edition"" by Nielsen and Chuang. The exercise wants me to show that the time evolution operator related to Rabi Oscillation is given by Eqn(7.77):

+ +

$$ U = e^{-iHt}\\= e^{-i\delta t}|00\rangle \langle 00| +(\cos(\Omega t)+i\frac{\delta}{\Omega}\sin(\Omega t))|01\rangle \langle 01| + \\(\cos(\Omega t)-i\frac{\delta}{\Omega}\sin(\Omega t))|10\rangle \langle 10|-i\frac{g}{\Omega}\sin\left(\Omega t\right)(|01\rangle \langle 10|+|10\rangle \langle 01|)$$

+ +

with $H$ given as Eqn(7.76):

+ +

$$H=-\begin{pmatrix} \delta&0&0\\0&\delta&g\\0&g&-\delta\end{pmatrix}$$

+ +

I tried to work this out by splitting $H$ into the sum of two parts:

+ +

$$H_{-1}=-\begin{pmatrix} \delta&0&0\\0&0&0\\0&0&0\end{pmatrix}=-H_{1}\\H_{-2}=-\begin{pmatrix} 0&0&0\\0&\delta&g\\0&g&-\delta\end{pmatrix}=-H_{2}$$

+ +

Since $H_{-1}H_{-2}=0$ and by the Baker-Campbell-Hausdorff (BCH) Formulae, $U = e^{-it(H_{-1}+H_{-2})}=e^{-itH_{-1}}e^{-itH_{-2}}=e^{itH_{1}}e^{itH_{2}}$. I then introduced $\Omega=\sqrt{\delta^2+g^2}$ such that $\big(\frac{H_{2}}{\Omega}\big)^2=\begin{pmatrix} 0&0&0\\0&1&0\\0&0&1\end{pmatrix}$. So now $U$ can be written as such:

+ +

$$U=e^{itH_{1}}e^{it\Omega\frac{H_{2}}{\Omega}}\\ +=\bigg[\sum_{m=0}^{\infty} \frac{(-1)^m}{(2m)!}(it H_{1})^{2m}+\sum_{m=0}^{\infty} \frac{(-1)^m}{(2m+1)!}(it H_{1})^{2m+1}\bigg]\times \\ \bigg[\sum_{n=0}^{\infty} \frac{(-1)^n}{(2n)!}(it H_{2})^{2n}+\sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!}(it H_{2})^{2n+1}\bigg]$$

+ +

There are four terms in the above multiplication so I'll list down each of them.

+ +

$$\sum_{n=0}^{\infty}\sum_{m=0}^{\infty} \frac{(-1)^m}{(2m)!}(it H_{1})^{2m} \frac{(-1)^n}{(2n)!}(it H_{2})^{2n}\\ =\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(it H_{2})^{2n}+\sum_{n=0}^{\infty}\sum_{m=1}^{\infty} \frac{(-1)^m}{(2m)!}(it H_{1})^{2m} \frac{(-1)^n}{(2n)!}(it H_{2})^{2n}\\ =\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(it H_{2})^{2n}+\sum_{m=1}^{\infty} \frac{(-1)^m}{(2m)!}(it H_{1})^{2m}$$

+ +

\

+ +

$$\sum_{n=0}^{\infty}\sum_{m=0}^{\infty}\frac{(-1)^m}{(2m)!}(it H_{1})^{2m}\frac{(-1)^n}{(2n+1)!}(it H_{2} )^{2n+1}=\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}(it H_{2} )^{2n+1}$$

+ +

\

+ +

$$\sum_{n=0}^{\infty}\sum_{m=0}^{\infty}\frac{(-1)^m}{(2m+1)!}(it H_{1})^{2m+1}\frac{(-1)^n}{(2n)!}(it H_{2} )^{2n}=\sum_{m=0}^{\infty}\frac{(-1)^m}{(2m+1)!}(it H_{1} )^{2m+1}$$

+ +

\

+ +

$$\sum_{n=0}^{\infty}\sum_{m=0}^{\infty}\frac{(-1)^m}{(2m+1)!}(it H_{1} )^{2m+1}\frac{(-1)^n}{(2n+1)!}(it H_{2} )^{2n+1}=\begin{pmatrix} 0&0&0\\0&0&0\\0&0&0\end{pmatrix}$$

+ +

Adding the right side of each of the four terms, I get:

+ +

$$U=\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(it\Omega \frac{H_{2}}{\Omega})^{2n}+\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n+1)!}(it\Omega \frac{H_{2}}{\Omega})^{2n+1}\\+\sum_{m=1}^{\infty} \frac{(-1)^m}{(2m)!}(it H_{1})^{2m}+\sum_{m=0}^{\infty}\frac{(-1)^m}{(2m+1)!}(it H_{1} )^{2m+1} +\\=\cos(\Omega t)\begin{pmatrix} 0&0&0\\0&1&0\\0&0&1\end{pmatrix}+i\frac{\sin(\Omega t)}{\Omega}\begin{pmatrix} 0&0&0\\0&\delta&g\\0&g&-\delta\end{pmatrix} \\+\sum_{m=1}^{\infty} \frac{(-1)^m}{(2m)!}(it H_{1})^{2m}+\sum_{m=0}^{\infty}\frac{(-1)^m}{(2m+1)!}(it H_{1} )^{2m+1} $$

+ +

The major problem here is the 2nd last term. The term that is supposed to sum to cosine starts with $m=1$. If I were to force the summation over $m$ to start from 0, it looks like the final form of $U$ has to subtract an Identity Matrix from it. Even so, the sign of some of the terms seem different than what is given by Eqn(7.77). But what troubles me most is the summation over $m$. Is anyone patient enough to look through it and point out whats going on?

+",5253,,23,,9/22/2019 19:27,9/23/2019 11:55,Time Evolution Operator of Rabi Oscillations,,2,0,,,,CC BY-SA 4.0 +8286,1,,,9/23/2019 2:16,,2,243,"

How do I learn Q#? What languages should I know prior to learning Q#? How do I get started with quantum computing?

+",8580,,26,,9/29/2019 7:12,9/29/2019 7:12,How do I start as a quantum computing programmer?,,3,0,,,,CC BY-SA 4.0 +8287,1,8291,,9/23/2019 3:52,,0,115,"

When I evaluate the following equation using $U = ZX$ and $a = 0, b = 0$ [for Bell state], I am getting LHS not equal to RHS.

+
+

Before describing the protocol, let us first review the teleportation protocol and introduce the notation used in the paper. In general, Bell states are of the following form

+

$$|B_{xy}\rangle = \frac{1}{\sqrt 2}(|0,x\rangle + (-1)^y|1, x\oplus 1\rangle),\tag{1}$$

+

where $x, y \in \{0, 1\}$ and $\oplus$ represents addition modulo $2$. The relationship between Bell states and classical bits can be defined as

+

$$|B_{xy}\rangle \leftrightarrow xy, x, y \in \{0,1\} \tag{2}$$

+

For any qubit $|\phi\rangle$ and any single-qubit unitary operation $U$, a general teleportation equation, based on an initial Bell state $|B_{ab}\rangle$, $a, b \in \{0, 1\}$, shared between the two users, can be written as

+

$$\boxed{|\varphi\rangle_1 \otimes (I\otimes U)|B_{ab}\rangle_{2,3} = \frac{1}{2}\sum_{\mathrm{x\in\{0,1\}}}\sum_{\mathrm{x\in\{0,1\}}}(-1)^{b.x}|B_{x,y}\rangle_{1,2}\otimes UZ^{y\oplus b}X^{x\oplus a}|\varphi\rangle} \tag{3}$$

+

where $X = (|0\rangle\langle 1| + |1\rangle\langle 0|)$, $Z = (|0\rangle\langle 0| - |1\rangle\langle 1|)$ and the subscripts denote different systems.

+
+

Paper Reference

+",8249,,-1,,6/18/2020 8:31,9/29/2019 9:52,"Evaluate the following teleportation equation for $U = ZX$ and $a = 0, b = 0$",,1,2,,,,CC BY-SA 4.0 +8288,2,,8283,9/23/2019 6:26,,5,,"

If you wish to distinguish two states $|\psi\rangle$ and $|\phi\rangle$, you can only guarantee to do this if $\langle\psi|\phi\rangle=0$. You do this by measuring in a basis defined by the two states (alternatively, you apply a unitary $U$ such that +$$ +U|\psi\rangle=|0\rangle,\qquad U|\phi\rangle=|1\rangle, +$$ +and then measure in the standard $Z$ basis.

+ +

However, provided $|\langle\psi|\phi\rangle|\neq 1$, you can distinguish the states with some non-zero probability. There are a couple of different strategies that you can follow depending on how you want to interpret the result.

+ +

For example, to succeed with maximum probability, construct the operator $|\psi\rangle\langle\psi|-|\phi\rangle\langle\phi|$, and construct two projectors $P_+$ and $P_-$ which project onto the positive and negative eigenspaces of that operator. When you measure using the projectors $P_{\pm}$, if you get the + answer, assume you had $|\psi\rangle$, while if you get the - answer, assume you had $|\phi\rangle$. This is known as the Helstrom measurement, and you can show it has the maximum success probability.

+ +

Alternatively, if you don't want there to be any ambiguity in the result (thinking it was $|\psi\rangle$ when it was actually $|\phi\rangle$, you can use a POVM. Define +$$ +E_1=p|\psi^\perp\rangle\langle\psi^\perp|,\qquad E_2=p|\phi^\perp\rangle\langle\phi^\perp|,\qquad E_3=1-E_1-E2. +$$ +The states $|\psi^\perp\rangle$ and $|\phi^\perp\rangle$ are orthogonal to $|\psi\rangle$ and $|\phi\rangle$ respectively. You must choose the parameter $p$ to be as large as possible, but such that $E_3$ has no negative eigenvalues. When you measure with these, if you get answer $E_1$, you definitely did not have $|\psi\rangle$, hence you definitely had $|\phi\rangle$. Similarly, if you got answer 2, you definitely had $|\psi\rangle$. However, if you get answer 3, this corresponds to a ""not sure"" answer.

+ +

In the case of orthogonal states, such as your example, all these strategies are equivalent and have a probability of success of 1. You can describe the strategy either as ""measure in the $X$ basis"" or ""apply Hadamard and measure in the standard ($Z$) basis"".

+",1837,,,,,9/23/2019 6:26,,,,1,,,,CC BY-SA 4.0 +8289,2,,8285,9/23/2019 6:41,,4,,"

You seem to be overcomplicating this somewhat!

+ +

You are right to split it up into the two terms $H_1$ and $H_2$. So, we have +$$ +e^{-i(H_1+H_2)t}=e^{-iH_1t}e^{-iH_2t}. +$$ +Now, straightforwardly, +$$ +e^{-iH_1t}=I+(e^{-i\delta t}-1)|00\rangle\langle 00|. +$$ +Next, we need to think about the $e^{-iH_2t}$ term. Of course, it maps $|00\rangle$ to $|00\rangle$. So, we only have to think about the subspace spanned by $\{|01\rangle,|10\rangle\}$. In this subspace, we have $H_2$ written as +$$ +\delta Z+gX=(g,0,\delta)\cdot\vec{\sigma}, +$$ +using the Pauli matrices. Now we can use the formula we're given (except that the formula in my version of N&C is incorrect, with sin and cos swapped. this is in the errata list) +$$ +e^{i\vec{n}\cdot\vec{\sigma}}=\cos(\Omega t)+i\sin(\Omega t)\frac{\delta Z+gX}{\Omega}, +$$ +where $\Omega=\sqrt{\vec{n}\cdot\vec{n}}=\sqrt{\delta^2+g^2}$. So, overall, we have +$$ +e^{-iH_2t}=|00\rangle\langle 00|+\cos(\Omega t)(|01\rangle\langle 01|+|10\rangle\langle 10|)-i\frac{\sin(\Omega t)}{\Omega}\left(\delta (|01\rangle\langle 01|-|10\rangle\langle 10|)+g(|01\rangle\langle 10|+|10\rangle\langle 01|)\right). +$$ +I think, overall, this gives slightly different signs to those in equation 7.77.

+",1837,,,,,9/23/2019 6:41,,,,4,,,,CC BY-SA 4.0 +8290,1,8295,,9/23/2019 8:07,,3,226,"

I am new to the quantum world and wondering the bounds of which the technology is at the current state of the art: specifically in computing prime numbers.

+ +

I would like to, if possible, create a project that seeks to find Mersenne prime numbers (see here and here for more info).

+ +

I know there have been an algorithm(s) proposed for finding primes, but are there any actual languages I can make use of at the current state of the art? I have access to a QPU/Lattices using the pyquil language but haven't seen anything in the documentation that does this (at least in English I understand).

+",8570,,26,,10/14/2019 10:20,10/14/2019 10:20,Newbie Project: Calculate a Mersenne Prime with Quantum Computing,,1,0,,,,CC BY-SA 4.0 +8291,2,,8287,9/23/2019 8:35,,2,,"

There's a mistake. It's incorrect even for $a=0,b=0,U=I$. In this case the correct formula is +$$ +|\phi\rangle \otimes |B_{00}\rangle = \frac{1}{2} \bigg(|B_{00}\rangle \otimes |\phi\rangle + |B_{01}\rangle \otimes Z|\phi\rangle + |B_{10}\rangle \otimes X|\phi\rangle + |B_{11}\rangle \otimes XZ|\phi\rangle\bigg) +$$ +but their formula swaps $X$ and $Z$ in the last term. +It looks like if we swap $X$ and $Z$ terms in their formula then it will be correct (I checked on the computer).

+ +

Update

+ +

The correct formula is with the swapped $X$ and $Z$ terms: +$$ +|\phi\rangle \otimes (I \otimes U)|B_{ab}\rangle = \frac{1}{2} \bigg(\sum_{x \in \{0,1\}}\sum_{y \in \{0,1\}} (-1)^{b\cdot x}|B_{xy}\rangle \otimes UX^{x\oplus a}Z^{y\oplus b}|\phi\rangle\bigg) +$$

+ +

I've used Julia programming language to check this. Note that both sides of equality are linear on $|\phi\rangle$, so we can check it only for $\phi = 0$ and $\phi = 1$. Also both sides are linear on $U$, so we can check equality only for $I, X, Z$ and $XZ$.

+ +
using LinearAlgebra
+
+const ⊗ = kron
+const ⊕(x,y) = (x+y) % 2
+
+const Z = zeros(2,2) + [1 0; 0 -1]
+const X = zeros(2,2) + [0 1; 1 0]
+const Id = zeros(2,2) + I
+
+function basis(x)
+  return Id[:,x+1]
+end
+
+function bell(x,y)
+  ret = zeros(4)    
+  ret += basis(0) ⊗ basis(x)
+  ret += (-1)^y * basis(1) ⊗ basis(x ⊕ 1)
+  ret /= sqrt(2)
+  return ret
+end
+
+function check()
+  for a=0:1, b=0:1, ϕ=0:1, U in [Id, X, Z, X*Z]
+    lhs = basis(ϕ) ⊗ ( (Id ⊗ U) * bell(a,b) )
+    rhs = zeros(8)
+    for x=0:1, y=0:1
+      rhs += (-1)^(b*x) * bell(x,y) ⊗ (U * X^(x⊕a) * Z^(y⊕b) * basis(ϕ))
+    end
+    rhs /= 2
+    err = norm(lhs - rhs)    
+    println(err)
+  end  
+end
+
+check()
+
+ +

Note that this check is numerical, though one can also try to use symbolic math packages, like SymPy.

+",5870,,5870,,9/24/2019 14:44,9/24/2019 14:44,,,,2,,,,CC BY-SA 4.0 +8292,2,,8285,9/23/2019 11:41,,1,,"

In the first summation for $U$: +$$\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(it\Omega \frac{H_{2}}{\Omega})^{2n}=\cos(\Omega t)\begin{pmatrix} 0&0&0\\0&1&0\\0&0&1\end{pmatrix}(\text{This is wrong})$$

+ +

$$\sum_{n=0}^{\infty}\frac{(-1)^n}{(2n)!}(it\Omega \frac{H_{2}}{\Omega})^{2n}=\begin{pmatrix} 1&0&0\\0&0&0\\0&0&0\end{pmatrix}+\cos(\Omega t)\begin{pmatrix} 0&0&0\\0&1&0\\0&0&1\end{pmatrix}(\text{This is correct})$$

+ +

I mentioned that $m$ starts summing from $1$ so I will force it to sum from $0$, which in this case indeed I have to subtract an Identity Matrix. This will result in an exponential of $H_{1}$ subtract an Identity whereby the steps will look like:

+ +

$$\sum_{m=1}^{\infty} \frac{(-1)^m}{(2m)!}(it H_{1})^{2m}+\sum_{m=0}^{\infty}\frac{(-1)^m}{(2m+1)!}(it H_{1} )^{2m+1}\\=\sum_{m=0}^{\infty} \frac{(-1)^m}{(2m)!}(it H_{1})^{2m}+\sum_{m=0}^{\infty}\frac{(-1)^m}{(2m+1)!}(it H_{1} )^{2m+1}-\begin{pmatrix} 1&0&0\\0&1&0\\0&0&1\end{pmatrix}\\=\begin{pmatrix} e^{i\delta t}&0&0\\0&1&0\\0&0&1\end{pmatrix}-\begin{pmatrix} 1&0&0\\0&1&0\\0&0&1\end{pmatrix}$$

+ +

Adding everything up including the $sin(\Omega t)$ term will give the correct expression except for maybe some sign issues.

+",5253,,5253,,9/23/2019 11:55,9/23/2019 11:55,,,,0,,,,CC BY-SA 4.0 +8293,2,,8286,9/23/2019 11:52,,-2,,"

I'm not familiar with q#, but I have used qiskit extensively. Qiskit is a python package supported by IBM, so obviously you need to know python. There are many tutorials and instructive Jupyter notebooks on the qiskit syntax and even some basic quantum mechanics. A qiskit based textbook was just released. I haven't read it yet, but maybe you'll find it useful. Lastly, linear algebra is the language of qubits. You will want to have a solid understanding of linear algebra.

+",8420,,,,,9/23/2019 11:52,,,,0,,,,CC BY-SA 4.0 +8294,2,,8280,9/23/2019 15:25,,1,,"

Pulling from another question (Big Endian vs. Little Endian in Qiskit) and their documentation (https://qiskit.org/textbook/ch-appendix/qiskit.html), it appears that the register is intentionally labeled right-to-left so that integers are intuitively represented. Consider your example, where you applied X(qr[0]):

+

$ |00\rangle \rightarrow |01\rangle $, which is "1" as an integer. $1 = 2^0$

+

There example used X(qr[7]) on an 8 qubit register:

+

$ |00000000\rangle \rightarrow |10000000\rangle = 32 = 2^7 $

+",8343,,15119,,5/18/2021 8:11,5/18/2021 8:11,,,,1,,,,CC BY-SA 4.0 +8295,2,,8290,9/23/2019 15:37,,3,,"

It's likely that this algorithm hasn't yet been implemented in QISKit / Q# / pyquil etc. It's also important to note that you would not be discovering new Mersenne primes with a quantum computer - the paper referenced says:

+ +
+

We propose a quantum circuit that creates a pure state corresponding to the quantum superposition of all prime numbers less than $2^n$, where $n$ is the number of qubits of the register.

+
+ +

Even with new quantum computers, this might only amount to $ 2^{73} $, at best. And, there's no guarantee that these quantum computers will have the required coherence times.

+ +

This doesn't mean that it would be a waste to implement this algorithm - any contribution to a quantum programming language (QISKit / Q# / pyquil) is welcomed! But this algorithm won't be beating classical computers anytime soon.

+",8343,,,,,9/23/2019 15:37,,,,0,,,,CC BY-SA 4.0 +8296,2,,8286,9/23/2019 16:04,,3,,"

To get started with quantum computing in general, you need to start by learning some of the theory behind it - unlike classical programming, you don't have any intuition about what is going on from your previous experiences, so jumping right into programming might be a bit too steep. There are a lot of resources out there to help you with this, you might want to check out other questions tagged with resource-request or the Awesome Quantum Computing list.

+ +
+ +

For Q#, here are the resources you might want to start with:

+ +
    +
  • Official documentation, including a brief review of quantum computing concepts.
  • +
  • Quantum Katas - self-paced programming exercises and tutorials designed to accompany a course on quantum computing theory. Each kata consists of a set of exercises of increasing complexity for you to solve and a behind-the-scenes testing harness which checks whether your code is correct, providing you immediate feedback, so I believe they are a great way to learn (disclaimer: I am the primary maintainer of the Quantum Katas project).
    +The existing katas cover a nice set of introductory topics, and we are working on more tutorials bridging the gap between ""not knowing anything about quantum computing"" and ""knowing enough to solve first exercises"" - check back in two-three weeks :-)
  • +
  • Awesome Q# list lists a variety of other resources, including blogs, videos, standalone tutorials and even a book!
  • +
+ +

Finally, I don't think it's as important what programming language you know before learning Q# as just knowing some programming language. C# and Python come to mind first, since they both allow to run Q# from them (you'll need a classical program to invoke quantum code), but you don't need them to start solving the katas.

+",2879,,,,,9/23/2019 16:04,,,,0,,,,CC BY-SA 4.0 +8297,2,,8286,9/23/2019 16:26,,4,,"

Probably the first big reference I would highlight is qsharp.community. Its a community org where we work on projects and collecting learning materials for Q#. Contributions are always welcome, so just make a PR on a repo or hop on the gitter and say hi!

+ +

I'll also add that I am working on a textbook that is currently in Early Access called Learn Quantum Computing with Python and Q#. It is intended for folks who want to learn how to program for a quantum computer, and learn the basics of how a quantum computer works along the way. Only knowledge prerequisites are programming in some language (Python helps but not really required) and a bit of linear algebra (multiple matrices and vectors sort of stuff). My co-author @chris-granade and I would love feedback on what is currently out on the forums associated with the book, and there are discount codes floating around for conferences and podcasts and such, hmu and I can help find one for ya!

+",4211,,,,,9/23/2019 16:26,,,,0,,,,CC BY-SA 4.0 +8298,2,,6317,9/23/2019 18:30,,5,,"

We should generally think of QASM as agnostic to timing. Time is not represented anywhere in a quantum circuit diagram. The wires between circuit operations simply represent a quantum state. I could move the CNOTs as far to the right as I want in your diagram, or generally modify any spacing between any operations however I like, and the circuits would be exactly equivalent. It's analogous to beads on a multi-chain necklace. The necklace is only different when we add new operations, or change the order of operations. For this reason, it's perfectly acceptable for the printed QASM output to be ""misleading"" about timing.

+ +

Time is a lower level construct. IBM's OpenPulse framework is the system for which asking these kinds of questions is more defined. Nonetheless, your questions do have answers.

+ +

How does scheduling work on IBM devices?

+ +

If you would like to see some concrete code, IBM backends follow a scheduling procedure similar to what is implemented in this PR as the ""as_late_as_possible"" (ALAP) method: https://github.com/Qiskit/qiskit-terra/pull/2650 (It will be merged once a constraint on the backend is relaxed.)

+ +

In words, this scheduling procedure is roughly to reverse the circuit, schedule operations greedily, and then reverse again. This ALAP scheduling can improve fidelity by maximizing the time that qubits remain in the ground state.

+ +

Note: Keep in mind that IBM does not promise to schedule circuits this way. It is totally up to the respective backend/provider to decide how they want to schedule QASM operations. If the backends added an extra 10ns delay between every operation, that is totally within their right. Only in OpenPulse can you expect any real guarantee about the timing of the program execution.

+ +

Now, assuming scheduling does happen as described, let's think about how your circuit will be scheduled. Since qubits 0 and 1 are separate from qubit 3, as late as possible and as soon as possible scheduling is identical: it's just greedily scheduled. (I don't think the ending time is aligned.)

+ +

Your example would be more interesting if we add a global (across qubits 0, 1, 3) measure. The measure will be scheduled across all qubits at the same time. Then, ALAP is indeed different than ASAP. The timing would be:

+ +
CNOT q0 q1 @ t=0
+CNOT q0 q1 @ t=758ns
+MEASURE q0 q1 q3 @ t=1516ns
+(solve for the H times backwards)
+H q3 @ t=1156ns
+H q3 @ t=1276ns
+H q3 @ t=1396ns
+
+ +

I said circuits are timing agnostic, but we can use barriers to make requests to the compiler to add timing constraints. Barriers are pragmas (info for the compiler), not operations. It depends on the compiler to actually respect your request. If you want the Hadamards to be aligned with the CNOTs, you could use barriers:

+ +
c = ClassicalRegister(14, 'c')
+circ = QuantumCircuit(q, c)
+circ.cx(q[1], q[0])
+circ.h(q[3])
+circ.barrier(q[0], q[3])
+
+circ.cx(q[1], q[0])
+circ.h(q[3])
+circ.barrier(q[0], q[3])
+
+circ.h(q[3])
+
+ +

Then, given that the compiler listens to your request and still uses the ALAP scheduling method, the first H would play at t=(758-120)ns=638ns, the second would play at t=(1516-120)ns=1396ns, and the third would play at t=1516ns.

+ +

Answers to questions

+ +

1) The first H and the first CNOT both play at t=0, the remaining H are scheduled with no extra delays (i.e. at t=120ns and t=140ns).

+ +

2) There are a couple ways. You could try to calculate the circuit runtime using backend.properties() and adding up gate_lengths if they are provided. If you have access to an OpenPulse enabled device, you can checkout the scheduler branch I linked and check the duration property on the resulting schedule. There has also been discussion to add this as a circuit feature: https://github.com/Qiskit/qiskit-terra/issues/2749

+ +

3) If I understand correctly, I think this goes back to the idea that timing is not acknowledged by QuantumCircuits or by QASM -- it doesn't get translated or represented.

+",7755,,,,,9/23/2019 18:30,,,,0,,,,CC BY-SA 4.0 +8299,1,8307,,9/23/2019 18:59,,-2,247,"
qr = QuantumRegister(2,'qr')
+cr = ClassicalRegister(2,'cr')
+circ = QuantumCircuit(qr,cr)
+
+circ.x(qr[0])
+circ.measure(qr,cr)
+
+provider = IBMQ.get_provider(group = 'open')
+backends = provider.get_backend(['ibmqx2', 'ibmq_16_melbourne', 'ibmq_vigo', 'ibmq_ourense'])
+job = execute(circ, backend=backends, shots=1024) 
+job_monitor(job, interval = 5)
+
+result = job.result()
+counts = result.get_counts(circ)
+plot_histogram(counts)
+
+ +

How do I run my quantum code on more than one backend at the same time?

+",8586,,26,,9/29/2019 10:42,9/29/2019 10:42,Running jobs on different backends at the same time,,1,0,,,,CC BY-SA 4.0 +8300,1,,,9/24/2019 4:09,,3,1201,"

I have tried it with decomposing controlled S then conjugating with H gate. But I want to construct it using a minimum number of gates.

+",8548,,55,,5/29/2020 7:38,8/25/2020 6:46,How can we construct a square root of NOT gate in Qiskit and IBMQ circuit composer using universal gates?,,3,0,0,,,CC BY-SA 4.0 +8301,2,,8300,9/24/2019 8:10,,0,,"

Use u3 function and rotate by an angle of 90 degrees.

+",4206,,26,,9/29/2019 10:15,9/29/2019 10:15,,,,1,,,,CC BY-SA 4.0 +8302,1,,,9/24/2019 10:31,,1,145,"

I've been reading this article in order to understand how to implement a VQE on a quantum computer.

+ +

Equation 38 involves the imaginary part of +$ \langle\psi_0 |V_k^{j\dagger}(t)O_iU(t)|\psi_0\rangle $ and they show the circuit (figure 3) for finding it. I don't understand how this circuit works and why it finds the imaginary part.

+ +

I would appreciate if someone could explain each part of the circuit or forward me to a source which explains this.

+ +

Also, why is the measurement of the ancilla qubit happening in the Y basis and why is the $R_x(\pi/2)$ gate making sure that the measurement is in the Y basis?

+",5632,,26,,9/29/2019 9:28,9/29/2019 9:28,Variational Quantum Eigensolver (VQE) - Question about finding the imaginary part of measurement,,1,0,,,,CC BY-SA 4.0 +8304,1,8306,,9/24/2019 10:34,,2,168,"

I have executed an experiment using IBMQ and receive a Result object. +I am writing the ASCII repr of the result with f.write(res) into a file and see a line like

+ +
Result(backend_name='ibmq_16_melbourne', backend_version='1.1.0',...
+
+ +

How can I reconstruct the Result object from that line? Which methods do I have to call?

+",8592,,26,,9/29/2019 9:08,9/29/2019 9:08,How to unpickle a Result object returned by an IBMQ experiment?,,2,0,,,,CC BY-SA 4.0 +8305,2,,8304,9/24/2019 11:20,,1,,"

You could recreate the object by reading the parameters and then creating a new result object result = Result(parameters). You can see the method that does this here.

+ +

If you have access to the account that submitted the job you can also simply retrieve the job from the backend again using get_job().

+",5955,,,,,9/24/2019 11:20,,,,1,,,,CC BY-SA 4.0 +8306,2,,8304,9/24/2019 12:51,,3,,"

I found a solution: +to serialise instead of print(res) I need to do:

+ +
print(res.to_dict())
+
+ +

To load the serialized string (eg. line from a file)

+ +
dict = eval(line)
+res = Result.from_dict(dict)
+
+ +

all of the above with

+ +
from qiskit.result import Result
+
+",8592,,55,,9/24/2019 14:17,9/24/2019 14:17,,,,0,,,,CC BY-SA 4.0 +8307,2,,8299,9/24/2019 13:36,,1,,"

You would need to send a job to each backend you want to run on. For example, if you wanted to send to ibmqx2 and ibmq_ourense you could execute code similar to this:

+ +
backend_1 = provider.get_backend('ibmqx2')
+backend_2 = provider.get_backend('ibmq_ourense')
+
+job_1 = execute(circuit, backend_1)  # Sends a job to run on ibmqx2
+job_2 = execute(circuit, backend_2)  # Sends a job to run on ibmq_ourense
+
+ +

You can then get the results from each job normally:

+ +
result_1 = job_1.result().get_counts(circuit)
+result_2 = job_2.result().get_counts(circuit)
+
+",6180,,,,,9/24/2019 13:36,,,,7,,,,CC BY-SA 4.0 +8308,1,8309,,9/25/2019 5:59,,1,262,"

I have a circuit where I only use 3 qubits but need to utilize hundreds of classical registers. My questions are: what is the maximum number of classical bits on the current IBM Qs? What is the quantum computer with the highest number of classical bits right now that is available for researchers and the public?

+",7598,,7598,,7/12/2020 7:31,7/12/2020 7:31,How many classical registers are there on (IBM) quantum computers?,,3,2,,,,CC BY-SA 4.0 +8309,2,,8308,9/25/2019 7:18,,2,,"

As far as I am aware you can have as many ClassicalRegisters as you need, assuming they fit in the memory of the classical device controlling the Quantum Computer. I would suggest trying to reuse them if possible if you are concerned about this!

+",5955,,,,,9/25/2019 7:18,,,,3,,,,CC BY-SA 4.0 +8310,1,,,9/25/2019 8:08,,4,136,"

Is there a quantum algorithm allowing to determine the state with the highest probability of occurring (i.e. highest square amplitude), more efficiently than repeatedly measuring and estimating a histogram?

+",8598,,55,,9/28/2019 16:44,9/28/2019 16:44,Is there a quantum algorithm allowing to efficiently determine the state with the highest probability of occurring?,,2,0,,,,CC BY-SA 4.0 +8312,2,,8310,9/25/2019 9:28,,1,,"

Yes. It is, for instance, part of Grover's algorithm and to be precise it is the 'Amplitude Amplification' part. $2| \psi \rangle \langle \psi | - I$, which will increase the amplitudes by +their difference from the average

+",2561,,,,,9/25/2019 9:28,,,,1,,,,CC BY-SA 4.0 +8313,2,,2688,9/25/2019 10:09,,1,,"

I think your confusion starts at the point where you refer to 'amplitude of the qubit'. The amplitude of a qubit is constant and always 1. When you measure it, you will always get a quantity of ""1"". Basically, this is the Bloch sphere: the qubit can point to any point on the surface of the sphere, so it has radius (amplitude) of 1. Amplitude amplification does not apply to this aspect but applies on another level. +The qubit in general has a state that is a linear combination of the base states: $|\psi \rangle = \alpha|0\rangle + \beta|1\rangle$. The coefficients $\alpha$ and $\beta$ are the amplitudes of the base states $|0\rangle$ and $|1\rangle$, respectively. And because the 'amplitude of the qubit' is always 1 the condition $|\alpha|^2 + |\beta|^2=1$ must hold. +If we apply an amplitude magnification to $|\psi\rangle$ and, for instance favor the base state $|1\rangle$ then this process should result in an increase of $|\beta|^2$ and, consequently, to a decrease in $|\alpha|^2$.

+",2561,,,,,9/25/2019 10:09,,,,0,,,,CC BY-SA 4.0 +8314,2,,8308,9/25/2019 10:45,,1,,"

Why do you need so many classical registers? One usually only uses them to catch the measurement at the end of the quantum algorithm; one for every qubit. If you do repeated measurements and intend to store statistics in separate classical registers, then you can better repeat the whole experiment. There is also on option to keep individual result of every single experiment (memory=true). Your quantum code is part of a larger whole where you mix classical and quantum computing. In the classical code (probably python) you can store any amount of data in standard facilities like lists.

+",2561,,,,,9/25/2019 10:45,,,,1,,,,CC BY-SA 4.0 +8315,1,8316,,9/25/2019 13:04,,-1,92,"

Let A has quantum memories $M_1$ and $M_2$ and B has quantum memories $M_3$ and $M_4$ capable of holding one qubit.

+ +

2 Bell states are shared among A & B in the following way:

+ +

First Bell state $|B_{00}\rangle$ has been shared among $M_1$ and $M_3$. +Second Bell state $|B_{00}\rangle $ has been shared among $M_2$ and $M_4$.

+ +

Assume all calculations are in Bell basis.

+ +

How to calculate the Bell states of A[$M_1$ and $M_2$] and B[$M_3$ and $M_4$]?

+",8249,,26,,9/29/2019 7:14,9/29/2019 7:14,Find the Bell States of A and B in the following scenario,,1,2,,,,CC BY-SA 4.0 +8316,2,,8315,9/25/2019 15:46,,3,,"

Simply start by writing out everything +$$ +|B_{00}\rangle_{13}|B_{00}\rangle_{24}=\frac12\left(|00\rangle_{13}|00\rangle_{24}+|00\rangle|11\rangle+|11\rangle|00\rangle+|11\rangle|11\rangle\right) +$$ +Let me rearrange each of these terms +$$ +\frac12\left(|00\rangle_{12}|00\rangle_{34}+|01\rangle|01\rangle+|10\rangle|10\rangle+|11\rangle|11\rangle\right). +$$ +Now you can use the fact that the Bell states form a basis to rewrite each of those terms, although maybe it helps to notice that +$$ +|00\rangle_{12}|00\rangle_{34}+|11\rangle|11\rangle=|B_{00}\rangle|B_{00}\rangle+|B_{01}\rangle|B_{01}\rangle +$$ +Hence, we get a final answer of +$$ +\frac12\left(|B_{00}\rangle|B_{00}\rangle+|B_{01}\rangle|B_{01}\rangle+|B_{10}\rangle|B_{10}\rangle+|B_{11}\rangle|B_{11}\rangle\right) +$$

+",1837,,,,,9/25/2019 15:46,,,,0,,,,CC BY-SA 4.0 +8317,1,,,9/25/2019 16:48,,-1,3511,"

With $4$ bits there are $2^4=16$ combinations. How many combinations can you have with $4$ qubits (assuming they are all superimposed)?

+ +

EDIT:

+ +

As per here, the argument is that if a qubit can hold more information when it's measurement(probability) is collapsed to give a $|1\rangle$ or a $|0\rangle$ (assuming measurement is without errors). For a superimposed qubit holding two values at the same time depending on how it has been encoded i.e. as per the parallel measurement (probably in a quantum gate) we could get $|00\rangle$, $|01\rangle $, $|10\rangle$, $11\rangle$. I am seeing this as if observed in parallelism 4 qubits would yield a combination ($2^8$) of 8 classical bits (i.e. n qubits having $2^{n+n}$ number of combinations in parallel). Is this correct?

+",8605,,26,,9/29/2019 9:24,9/29/2019 16:45,How many combinations can 'n' qubits have?,,4,3,,,,CC BY-SA 4.0 +8319,2,,8317,9/25/2019 17:59,,1,,"

Well, it's still $2^4 = 16$ I believe. The point of superposition is that these 16 combinations can encode 16 inputs, and with something called ""quantum parallelism"" they can be calculated simutaneously. Even though they don't give out all $16$ results simultaneouly, the result can be manipulated in various ways to give you what you need while drastically reduce the running time, compare to a similar process done on a classical computer.

+",7598,,,,,9/25/2019 17:59,,,,4,,,,CC BY-SA 4.0 +8321,2,,8317,9/26/2019 6:10,,2,,"

This depends on precisely what you mean by ""combinations"". Let's go back to just one qubit to be clear. For one qubit, there are two classical states, $|0\rangle$ and $|1\rangle$. These are really the only things you can count. Of course, as a qubit, you are allowed any superposition of the form +$$ +\alpha|0\rangle+\beta|1\rangle,\qquad |\alpha|^2+|\beta|^2=1. +$$ +This is a continuum of possibilties that you cannot count.

+ +

Similarly for four qubits, there are $2^4=16$ classical states, $|0000\rangle, |0001\rangle,\ldots,|1111\rangle$, and this is the only thing you can really count. Again, because it's a quantum system, you can have an arbitrary superposition +$$ +\sum_{x\in\{0,1\}^4}c_x|x\rangle,\qquad\sum_{x\in\{0,1\}^4}|c_x|^2=1, +$$ +but it is also a continuum of possibilities that you cannot count.

+",1837,,,,,9/26/2019 6:10,,,,0,,,,CC BY-SA 4.0 +8322,2,,8302,9/27/2019 8:46,,1,,"

Measurements cannot produce an imaginary result. So if you want to measure an imaginary part, you need a suitable transformation before you measure. I haven't looked into the details of the mentioned operations but I'm sure that is what they do.

+ +

On the last part of your question: the operation $R_x (\pi /2)$ can be visualized on the Bloch sphere by a quarter clockwise turn around the x-axis. How does this help? If you start with Y-basis vectors (one pointing to the right and the other pointing to the left on the Bloch sphere) above operation transforms them to the Z-axis basis vectors (one pointing up and the other pointing down). So then the standard (Z-basis) measurement is able to distinguish the original Y-basis vectors.

+",2561,,,,,9/27/2019 8:46,,,,0,,,,CC BY-SA 4.0 +8323,2,,8317,9/27/2019 9:17,,1,,"

As other have said, you can see 4 qubits as having either 16 different combinations, or as continuum-many superpositions of these combinations. (Continuum-many means ""the cardinality of the real numbers"") However you can also ask about the dimension of the space, whcich is a different notion of size.

+ +

A single qbit is described by a vector in a 2-dimensional Hilbert space, so that you need 2 complex numbers to describe it. Equivalently, you need 4 real numbers. +However, since the norm of the qubit has to be 1, you in fact only need 3 real numbers. But also a global phase is irrelevent ! So only 2 real numbers are needed to describe a qubit. That's why you can position it on the Bloch sphere, which is a real two dimensional space.

+ +

With 4 qubits you're in a Hilbert space of dimension 2*4 = 8. Hence you need at first glance 16 real numbers. But in fact, considering that a global phase doesn't matter and the norm must be 1, you only need 14 real dimensions to describe it.

+",8550,,8550,,9/27/2019 13:07,9/27/2019 13:07,,,,0,,,,CC BY-SA 4.0 +8325,1,,,9/27/2019 15:13,,2,252,"

I am using QAOA to solve maxcut problem. It takes a very long time to simulate 10 qubits and I never get the results. Is there a way to simulate faster for larger qubit?

+ +

Here is my code

+ +
backend = provider.get_backend('ibmq_qasm_simulator')
+seed = 50
+
+cobyla = COBYLA()
+cobyla.set_options(maxiter=250)
+qaoa = QAOA(qubitOp, cobyla, 3)
+qaoa.random_seed = seed
+
+quantum_instance = QuantumInstance(backend=backend,seed_transpiler=seed,skip_qobj_validation=False)
+
+result = qaoa.run(quantum_instance)
+
+",8586,,55,,9/28/2019 19:12,10/2/2019 20:16,QAOA Maxcut for larger qubits,,1,2,,,,CC BY-SA 4.0 +8326,1,,,9/27/2019 18:05,,11,1401,"

I need to make a general implementation of Shor's algorithm that factors, at least, N = 15. I have been able to perform an implementation that works in simulators, with ProjectQ, but when running it on a real quantum computer.

+ +

I have decided to try it using Qiskit. Currently, I'm trying to find the first implementations in Qiskit, to see if it's possible to do what I want because I already doubt it.

+ +

I have tried, among others, whit these implementations. Also with IBM's own implementation. But either they use too many qubits 4n+2, which for N = 15 would be 18 qubits, and the public quantum computer with more qubits has only 14, or they use several measurements in the same qubit, which is not supported by IBM quantum computers. Now, I just want to know if it is possible to do what I want with current computers and how. I have read many papers, but their conclusions and methods are not supported by the current publicly available quantum computers, or the maximum N that they can factor is less than 15.

+ +

Thank you in advance. Greetings.

+",8626,,8626,,9/29/2019 19:39,8/5/2020 6:56,Is it possible to run a general implementation Shor's algorithm on a real IBM quantum computer at least for N = 15?,,1,6,,,,CC BY-SA 4.0 +8327,2,,8284,9/27/2019 19:58,,2,,"

In the Sycamore paper linked in the comments, in the description of FIG. 4, the authors state:

+ +
    +
  • ...For each $n$, each instance is sampled with $N_s$ between 0.5 M and 2.5 M... For $m=20$, obtaining 1M samples on the quantum processor takes 200 seconds, while an equal fidelity classical sampling would take 10,000 years on 1M cores, and verifying the fidelity would take millions of years.
  • +
+ +

Thus, it is clear that the authors of the Sycamore paper repeatedly apply the same unitary each time.

+ +

Thinking about it now this makes sense, you would need to sample more than once to be able to accurately estimate the fidelity of your samples.

+",2927,,,,,9/27/2019 19:58,,,,1,,,,CC BY-SA 4.0 +8328,1,,,9/27/2019 20:13,,1,106,"

If someone wanted to pinpoint the seminal reference on the subject of quantum computing, what would it be? Thanks.

+",8616,,26,,9/29/2019 6:59,9/29/2019 6:59,What is the seminal reference for quantum computing?,,1,2,,10/1/2019 21:56,,CC BY-SA 4.0 +8329,1,,,9/27/2019 21:13,,4,815,"

How can I create a custom gate in qiskit that is plotted using latex formatting (or another type of formatting)? For example the following code generates a circuit diagram

+ +
from qiskit import QuantumCircuit
+from qiskit.circuit import Gate
+
+qc = QuantumCircuit(1, 1)
+qc.append(Gate(name=r'X_t', num_qubits=1, params=[]), [0])
+qc.measure([0, ], [0,])
+qc.draw(output='latex', interactive=False, filename='test.png')
+
+ +

The custom gate is labelled as X_t, but I want the name to be formatted as an X with subscript t. I tried variations as

+ +
qc.append(Gate(name=r'$X_t$', num_qubits=1, params=[]), [0])
+
+ +

but that does not work.

+ +

Note: reported on github as well https://github.com/Qiskit/qiskit-terra/issues/3171

+",8627,,8627,,9/30/2019 9:34,9/30/2019 12:09,How to plot custom gate labels in Qiskit?,,3,0,,,,CC BY-SA 4.0 +8330,1,,,9/27/2019 22:00,,3,324,"

Let

+ +

$$ \rho = \begin{bmatrix} .7738 & -.0556 \\ -.0556 & .0040 \end{bmatrix} , + \sigma = \begin{bmatrix} .9454 & -.2273 \\ -.2273 & .0546 \end{bmatrix} \\$$

+ +

As you can see $\rho$ is an operator of mixed states and $\sigma$ is a density operator from a pure state. I can calculate entropy of them individually. But can I calculate the relative entropy between them? I am not sure about what it would mean. Anyways, considering the definition of relative entropy:

+ +

$$S(\rho || \sigma) = \mathrm{tr}(\rho \log (\rho)) - \mathrm{tr}(\rho \log ( \sigma))$$

+ +

I know that I can calculate the entropy of $\sigma$ from it's eigenvalues. But here I can't use the eigenvalue approach, can I? I have to take the logarithm I think. But there is no logarithm for $\sigma$ in matlab. What can I do in this sort of cases?

+",2403,,55,,1/5/2021 11:38,1/5/2021 11:38,How do I compute the Relative Entropy between pure and mixed states?,,1,1,,,,CC BY-SA 4.0 +8332,2,,8328,9/28/2019 0:11,,2,,"

Quantum Computation and Quantum Information by Nielsen and Chuang.

+",8623,,,,,9/28/2019 0:11,,,,5,,,,CC BY-SA 4.0 +8333,1,,,9/28/2019 6:48,,1,40,"

Just to report that the notebook ""Quantum Circuit Properties"" under the Tutorial uses a circuit named qc2 but afterwards the sample code still uses the qc circuit rather than qc2.

+",8629,,26,,9/29/2019 6:57,9/29/2019 6:57,Quantum Circuit Properties typo (documentation bug?),,1,0,,,,CC BY-SA 4.0 +8334,1,,,9/28/2019 7:07,,-1,111,"

+ +

When running my code, sometimes I find this 524 Server Error: Origin Time-out for url and then my code stop. The error is in job_monitor? And how can I solve it?

+",8272,,26,,10/9/2019 6:37,10/9/2019 6:37,What is ''524 Server Error''?,,1,1,,,,CC BY-SA 4.0 +8335,2,,8333,9/28/2019 11:02,,3,,"

Great to see you are engaging with the tutorials! I have had a look and I think this is deliberate, I believe that qc2 is only introduced to demonstrate one type of circuit. The notebook then goes on to create circuits qc3 and qc4 to demonstrate other concepts.

+ +

If you find any other bugs please report them to the Git repo by creating a new Issue.

+",5955,,,,,9/28/2019 11:02,,,,0,,,,CC BY-SA 4.0 +8336,2,,8329,9/28/2019 11:06,,1,,"

I don't think that this is currently possible with Qiskit, could you please add this as an Enhancement to the GitHub repo? This is done by creating an Issue and then selecting that it is an Enhancement.

+",5955,,,,,9/28/2019 11:06,,,,0,,,,CC BY-SA 4.0 +8337,1,8377,,9/28/2019 14:23,,12,879,"

I was recently going through the paper titled ""Quantum supremacy using a programmable superconducting processor"" by NASA Ames Research Centre and the Google Quantum AI team (note that the paper was originally posted on the NASA NTRS but later removed for unknown reasons; here's the Reddit discussion). It believe they're referring to ""quantum supremacy"" in the ""quantum ascendency"" sense.

+ +

In their 54 qubit Sycamore processor, they created a 53 qubit quantum circuit using a random selection of gates from the set $\{\sqrt{X}, \sqrt{Y}, \sqrt{W}\}$ in the following pattern:

+ +
+

+ +

FIG 3. Control operations for the quantum supremacy circuits. a, Example quantum circuit instance used in our + experiment. Every cycle includes a layer each of single- and two-qubit gates. The single-qubit gates are chosen randomly from $\{\sqrt X, \sqrt Y, \sqrt W\}$. The sequence of two-qubit gates are chosen according to a tiling pattern, coupling each qubit sequentially to + its four nearest-neighbor qubits. The couplers are divided into four subsets (ABCD), each of which is executed simultaneously + across the entire array corresponding to shaded colors. Here we show an intractable sequence (repeat ABCDCDAB); we also + use different coupler subsets along with a simplifiable sequence (repeat EFGHEFGH, not shown) that can be simulated on a + classical computer. b, Waveform of control signals for single- and two-qubit gates.

+
+ +

They also show some plots in FIG 4, apparently proving their claim of quantum supremacy.

+ +
+

+ +

FIG. 4. Demonstrating quantum supremacy. a, Verification of benchmarking methods. $\mathcal{F}_\mathrm{XEB}$ values for patch, elided, and full verification circuits are calculated from measured bitstrings and the corresponding probabilities predicted by classical simulation. Here, the two-qubit gates are applied in a simplifiable tiling and sequence such that the full circuits can be simulated out to $n = 53, m = 14$ in a reasonable amount of time. Each data point is an average over 10 distinct quantum circuit instances that differ in their single-qubit gates (for $n = 39, 42, 43$ only 2 instances were simulated). For each $n$, each instance is sampled with $N$s between $0.5 M$ and $2.5 M$. The black line shows predicted $\mathcal{F}_\mathrm{XEB}$ based on single- and two-qubit gate and measurement errors. The close correspondence between all four curves, despite their vast differences in complexity, justifies the use of elided circuits to estimate fidelity in the supremacy regime. b, Estimating $\mathcal{F}_\mathrm{XEB}$ in the quantum supremacy regime. Here, the two-qubit gates are applied in a non-simplifiable tiling and sequence for which it is much harder to simulate. For the largest + elided data ($n = 53$, $m = 20$, total $N_s = 30 M$), we find an average $\mathcal{F}_\mathrm{XEB} > 0.1\%$ with $5\sigma$ confidence, where $\sigma$ includes both systematic and statistical uncertainties. The corresponding full circuit data, not simulated but archived, is expected to show similarly significant fidelity. For $m = 20$, obtaining $1M$ samples on the quantum processor takes 200 seconds, while an equal fidelity classical sampling would take 10,000 years on $1M$ cores, and verifying the fidelity would take millions of years.

+
+ +

Question:

+ +

Why did they specifically choose the gate set $\{\sqrt{X}, \sqrt{Y}, \sqrt{W}\}$? $W$ is $(X+Y)/\sqrt 2$ as per the supplementary material. Also, why are they using randomly generated circuits?

+ +

User @Marsl says here that: ""In case you are confused by the need for a random unitary, it needs to be random in order to avoid that the classical sampler trying to reproduce the right prob. distribution can adapt to the particular unitary. Basically, if I wanted build a classical sampling algorithm that solves the problem for any unitary you hand over to me (or a description of the circuit), then the randomness assures that my sampler has to be ""general-purpose"", I have to design it such that it works well for any instance!"" It not clear to me what they mean by ""adapt""-ing to some particular unitary in this context.

+ +
+ +

Sequel(s):

+ +

Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 2): simplifiable and intractable tilings

+ +

Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 3): sampling

+",26,,26,,9/30/2019 1:41,11/5/2019 18:43,Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 1): choice of gate set,,2,4,,,,CC BY-SA 4.0 +8340,2,,8310,9/28/2019 16:42,,0,,"

It looks like you want an algorithm that, given a state of the form $|\psi\rangle=\alpha|0\rangle+\beta|1\rangle$ with $|\alpha|\ge|\beta|$, gives back $|0\rangle$ with probability greater than $|\alpha|^2$.

+ +

I don't think this is possible. +Indeed, say such a mapping $\mathcal E$ existed. This $\mathcal E$ must be such that the probability of finding $\mathcal E(\psi)$ in $|0\rangle$, that is, $\mathrm{Tr}[\mathbb P_0\mathcal E(\psi)]$, is greater than $|\alpha|^2$ if $|\alpha|\ge|\beta|$, while at the same time +$\mathrm{Tr}[\mathbb P_1\mathcal E(\psi)]\ge |\beta|^2$ when $|\beta|\ge|\alpha|$. +In other words, this map would have to satisfy +\begin{aligned} +\mathrm{Tr}[\mathbb P_0\mathcal E(\psi)]&\ge |\alpha|^2,\quad\text{if }|\alpha|\ge1/2\\ +\mathrm{Tr}[\mathbb P_0\mathcal E(\psi)]&\le |\alpha|^2,\quad\text{if }|\alpha|\le1/2. +\end{aligned} +Note that I'm using the shorthand notation $\mathbb P_\psi\equiv|\psi\rangle\!\langle\psi|$ here.

+ +

Consider how such a $\mathcal E$ would have to act on the input $|\psi\rangle=|0\rangle$. The only way to satisfy the above relations is to have $\mathcal E(\psi)=\mathcal E(\mathbb P_0)=\mathbb P_0$, and similarly $\mathcal E(\mathbb P_1)=\mathbb P_1$. But this, by linearity, fully characterises $\mathcal E$, forcing it to equal the identity operation.

+ +

In other words, no, you cannot have an algorithm which magically amplifies the amplitude of the state with the largest probability.

+ +

Note that this argument relies on the fact that $\mathcal E$ cannot contain knowledge about the state to be amplified. If you instead ask for an algorithm which amplifies the amplitude of a target state, then this is possible, and it's called amplitude amplification, as has already been mentioned in the other answers.

+",55,,,,,9/28/2019 16:42,,,,0,,,,CC BY-SA 4.0 +8341,1,8351,,9/28/2019 16:55,,9,970,"

In Google's 54 qubit Sycamore processor, they created a 53 qubit quantum circuit using a random selection of gates from the set $\{\sqrt{X}, \sqrt{Y}, \sqrt{W}\}$ in the following pattern:

+ +
+

+ +

FIG 3. Control operations for the quantum supremacy circuits. a, Example quantum circuit instance used in our + experiment. Every cycle includes a layer each of single- and two-qubit gates. The single-qubit gates are chosen randomly from $\{\sqrt X, \sqrt Y, \sqrt W\}$. The sequence of two-qubit gates are chosen according to a tiling pattern, coupling each qubit sequentially to + its four nearest-neighbor qubits. The couplers are divided into four subsets (ABCD), each of which is executed simultaneously + across the entire array corresponding to shaded colors. Here we show an intractable sequence (repeat ABCDCDAB); we also + use different coupler subsets along with a simplifiable sequence (repeat EFGHEFGH, not shown) that can be simulated on a + classical computer. b, Waveform of control signals for single- and two-qubit gates.

+
+ +

They also show some plots in FIG 4, apparently proving their claim of quantum supremacy.

+ +
+

+ +

FIG. 4. Demonstrating quantum supremacy. a, Verification of benchmarking methods. $\mathcal{F}_\mathrm{XEB}$ values for patch, elided, and full verification circuits are calculated from measured bitstrings and the corresponding probabilities predicted by classical simulation. Here, the two-qubit gates are applied in a simplifiable tiling and sequence such that the full circuits can be simulated out to $n = 53, m = 14$ in a reasonable amount of time. Each data point is an average over 10 distinct quantum circuit instances that differ in their single-qubit gates (for $n = 39, 42, 43$ only 2 instances were simulated). For each $n$, each instance is sampled with $N$s between $0.5 M$ and $2.5 M$. The black line shows predicted $\mathcal{F}_\mathrm{XEB}$ based on single- and two-qubit gate and measurement errors. The close correspondence between all four curves, despite their vast differences in complexity, justifies the use of elided circuits to estimate fidelity in the supremacy regime. b, Estimating $\mathcal{F}_\mathrm{XEB}$ in the quantum supremacy regime. Here, the two-qubit gates are applied in a non-simplifiable tiling and sequence for which it is much harder to simulate. For the largest + elided data ($n = 53$, $m = 20$, total $N_s = 30 M$), we find an average $\mathcal{F}_\mathrm{XEB} > 0.1\%$ with $5\sigma$ confidence, where $\sigma$ includes both systematic and statistical uncertainties. The corresponding full circuit data, not simulated but archived, is expected to show similarly significant fidelity. For $m = 20$, obtaining $1M$ samples on the quantum processor takes 200 seconds, while an equal fidelity classical sampling would take 10,000 years on $1M$ cores, and verifying the fidelity would take millions of years.

+
+ +

Question:

+ +

What do the terms simplifiable tiling and non-simplifiable (intractable) tiling mean in this context? They're calling the sequence $\mathrm{ABCDCDAB}$ intractable whereas they're calling $\mathrm{EFGHEFGH}$. It's not clear what they mean by that. What are the terms $\mathrm{A, B, C, D}$ and $\mathrm{E, F, G, H}$ anyway? I mean, I understand that they're two-qubit gates (couplers), but are the gates $\{\mathrm{A, B, C, D}\}$ different from the gates $\{\mathrm{E, F, G, H}\}$ or do they mean that they're the same gates arranged in a different sequence?

+ +

Also which exact types of 2-qubit gates can be used in this case? Can I replace all of A, B, C, D (or E, F, G, H) by CNOT gates? Or are only specific categories of two-qubit gates allowed? If yes, what are those?

+ +
+ +

Prequel(s):

+ +

Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 1): choice of gate set

+ +

Sequel(s):

+ +

Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 3): sampling

+",26,,26,,9/28/2019 17:11,2/23/2020 14:24,Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 2): simplifiable and intractable tilings,,1,4,,,,CC BY-SA 4.0 +8342,1,8344,,9/28/2019 16:56,,6,719,"

In Google's 54 qubit Sycamore processor, they created a 53 qubit quantum circuit using a random selection of gates from the set $\{\sqrt{X}, \sqrt{Y}, \sqrt{W}\}$ in the following pattern:

+ +
+

+ +

FIG 3. Control operations for the quantum supremacy circuits. a, Example quantum circuit instance used in our + experiment. Every cycle includes a layer each of single- and two-qubit gates. The single-qubit gates are chosen randomly from $\{\sqrt X, \sqrt Y, \sqrt W\}$. The sequence of two-qubit gates are chosen according to a tiling pattern, coupling each qubit sequentially to + its four nearest-neighbor qubits. The couplers are divided into four subsets (ABCD), each of which is executed simultaneously + across the entire array corresponding to shaded colors. Here we show an intractable sequence (repeat ABCDCDAB); we also + use different coupler subsets along with a simplifiable sequence (repeat EFGHEFGH, not shown) that can be simulated on a + classical computer. b, Waveform of control signals for single- and two-qubit gates.

+
+ +

They also show some plots in FIG 4, apparently proving their claim of quantum supremacy.

+ +
+

+ +

FIG. 4. Demonstrating quantum supremacy. a, Verification of benchmarking methods. $\mathcal{F}_\mathrm{XEB}$ values for patch, elided, and full verification circuits are calculated from measured bitstrings and the corresponding probabilities predicted by classical simulation. Here, the two-qubit gates are applied in a simplifiable tiling and sequence such that the full circuits can be simulated out to $n = 53, m = 14$ in a reasonable amount of time. Each data point is an average over 10 distinct quantum circuit instances that differ in their single-qubit gates (for $n = 39, 42, 43$ only 2 instances were simulated). For each $n$, each instance is sampled with $N$s between $0.5 M$ and $2.5 M$. The black line shows predicted $\mathcal{F}_\mathrm{XEB}$ based on single- and two-qubit gate and measurement errors. The close correspondence between all four curves, despite their vast differences in complexity, justifies the use of elided circuits to estimate fidelity in the supremacy regime. b, Estimating $\mathcal{F}_\mathrm{XEB}$ in the quantum supremacy regime. Here, the two-qubit gates are applied in a non-simplifiable tiling and sequence for which it is much harder to simulate. For the largest + elided data ($n = 53$, $m = 20$, total $N_s = 30 M$), we find an average $\mathcal{F}_\mathrm{XEB} > 0.1\%$ with $5\sigma$ confidence, where $\sigma$ includes both systematic and statistical uncertainties. The corresponding full circuit data, not simulated but archived, is expected to show similarly significant fidelity. For $m = 20$, obtaining $1M$ samples on the quantum processor takes 200 seconds, while an equal fidelity classical sampling would take 10,000 years on $1M$ cores, and verifying the fidelity would take millions of years.

+
+ +

Question:

+ +

In FIG 4 caption there's this sentence: ""For $m = 20$, obtaining 1M samples on the quantum processor takes 200 seconds, while an equal +fidelity classical sampling would take 10,000 years on 1M cores, and verifying the fidelity would take millions of years"". What does ""obtaining samples"" mean in this context? Are they saying that in 200 seconds their quantum processor executed the circuit 1M times (as in 1M ""shots"") and they consequently measured the output state vector 1M times? Or something else?

+ +

More importantly, I don't really understand the overall claim in the paper. Is the paper (FIG 4 caption) saying that for some random unitary $U$ (over 53 qubits and 20 cycles), a classical computer would take 10,000 years to calculate the resultant state vector $|\Psi_U\rangle$? As far as I understand, determining the final state vector is simply matrix multiplication that scales as $\mathcal O(n^3)$ (in this context, $n=2^{\text{total number of qubits}}$) in general (or lesser, depending on the algorithm used). Is it claiming that a classical computer would take 10,000 years to perform that matrix multiplication, and so using a quantum computer would be more efficient in this case?

+ +
+ +

Prequel(s):

+ +

Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 1): choice of gate set

+ +

Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 2): simplifiable and intractable tilings

+ +
+ +

Related:

+ +

Do quantum supremacy experiments repeatedly apply the same random unitary?

+",26,,26,,9/30/2019 1:42,9/30/2019 1:42,Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 3): sampling,,1,0,,,,CC BY-SA 4.0 +8343,2,,8284,9/28/2019 16:59,,3,,"

Generally speaking, to prove quantum supremacy, you don't need to sample several times from the same unitary/circuit/output probability distribution. If you extract even a single sample from the output probability distribution of a circuit which you know is extremely hard to simulate classically, then you already achieved something that you couldn't do (efficiently) classically.

+ +

This is because these are sampling problems. Such problems are not about estimating some property of some output probability distribution, but rather simply about the sampling itself.

+ +

The caveat in this is that, in practice, just observing one output state from a given circuit wouldn't look all that great an achievement. In other words, one needs to gather enough ""circumstantial evidence"" to manage to convince most people that the claim is solid and legit. This often includes actually retrieving some statistical features of the distribution, which allows checking that the distribution was indeed the intended one. It is, however, important to realise that the problem is not that of computing such features, but rather only that of sampling from the underlying probability distribution.

+ +

In conclusion, to more directly address some of the points raised: one unitary sampled once is, in principle, enough. But one wants to gather enough evidence to make the claim as solid as possible, and for this it is useful to do things like estimating properties of the experimental output distribution.

+",55,,55,,9/28/2019 18:34,9/28/2019 18:34,,,,3,,,,CC BY-SA 4.0 +8344,2,,8342,9/28/2019 17:16,,7,,"
+

What does ""obtaining samples"" mean in this context?

+
+ +

The same thing it means in a more classical context. Consider the probability distribution of the possible outcomes of a (possibly biased) coin flip. Sampling from this probability distributions means to flip the coin once and record the result (head or tail). If you sample many times, you can retrieve better and better estimates of the underlying probability distribution, fully characterising it in the limit of infinite samples collected.

+ +

In the context of quantum supremacy experiments, the sampling refers to the probability distribution at the output of the circuit/experiment. Given a circuit modelled by a unitary $\mathcal U$, fixing an input state $|\psi_i\rangle$, and fixing a measurement choice (say the computational basis), you get a probability distribution over the possible outputs: $p_{\boldsymbol j}\equiv|\langle \boldsymbol j|\mathcal U|\psi_i\rangle|^2$, where $|\boldsymbol j\rangle\equiv|j_1,...,j_n\rangle$ denotes a possible output state (a possible sequence of ones and zeros).

+ +

Sampling from the circuit then means to sample from this $\boldsymbol p$; to repeat the same experiment multiple times and record the outcomes.

+ +
+

re they saying that in 200 seconds their quantum processor executed the circuit 1M times (as in 1M ""shots"") and they consequently measured the output state vector 1M times? Or something else?

+
+ +

Sort of. They are not ""measuring the output state vector"", as that would require to do tomography of the output state. Rather, if the output state $|\psi_o\rangle$ expands in the computational basis as +$$|\psi_o\rangle=\sum_{\boldsymbol j}c_{\boldsymbol j}|\boldsymbol j\rangle,$$ +what they are doing is observing which of the $|\boldsymbol j\rangle$ comes out of the experiment, and ""writing down"" the sequence of such observed events.

+ +
+

Is the paper (FIG 4 caption) saying that for some random unitary $U$ (over 53 qubits and 20 cycles), a classical computer would take 10,000 years to calculate the resultant state vector $|\Psi_U\rangle$?

+
+ +

Again, as per the above, not quite. They are not calculating $|\Psi_U\rangle$, but rather only sampling from its associated probability distribution. To actually compute the state would require tomography, which would be even harder (indeed, I'm not sure about the specific result underlying this experiment, but in other similar scenarios one can show that not even a quantum computer can reconstruct efficiently the output state). Retrieving the output state is a harder task than just sampling from it.

+ +
+

Is the overarching claim of the paper that a classical computer would not be able to ""calculate"" the theoretical noise-free ""probability distribution"" by simple matrix multiplication (in any reasonable time-frame)?

+
+ +

Indeed, these quantum supremacy experiments rely on such classical hardness results. Actually, it is not even that you can prove that classical computers cannot efficiently compute the output probability distribution of these IQP circuits, but rather that they cannot even sample from these probability distributions. You might try to have a look at the references in Appendix VII (page S8) of Neill et al. for the relevant papers and results.

+ +

Note that sampling from a distribution is a much easier task than computing it. To understand this, consider the trivial example of sampling from the output distribution of a $50$-qubit circuit which solely consists of Hadamard gates applied at each qubit. In this case, the output probability distribution is the uniform distribution: each output configuration $|\boldsymbol j\rangle$ is equally likely. Sampling from such a thing is trivial: just have your classical computer draw $50$ random bits and you're done. However, computing the probability distribution would require to store $2(2^{50}-1)\sim 2\times 10^{15}$ real numbers, which while still doable, is clearly much harder.

+ +

Now imagine what happens in a less trivial example in which there are actual non-trivial entangling gates in the circuit: to compute the output state you will need to perform a number of operations on these giant-dimensional vectors ${}^{(1)}$. On the other hand, the quantum device solves the sampling task naturally: you just look at the output of the device.

+ +
+

As far as I understand, determining the final state vector is simply matrix multiplication that scales as $O(n^3)$ (in this context, $n=2\times\text{total number of qubits}$) in general (or lesser, depending on the algorithm used). Is it claiming that a classical computer would take 10,000 years to perform that matrix multiplication, and so using a quantum computer would be more efficient in this case?

+
+ +

They are. I mean, you say ""just $n^3$"", but this means to operate with vectors of dimension $\sim(2^{50})^3\sim 2^{150}\sim 10^{45}$. Try to create a list of this dimension with your preferred programming language and see how fast your laptop crashes! They mention in page 5 in the paper how they managed to use a $250 \mathrm{TB}$ device to store up just to $43$ qubits, which I think shows quite well the hardness of the task. Mind you, one can use other data types to store this kind of states, e.g. exploiting the sparseness of the states, and this is why, as mentioned in the caption you transcribed, the number of cycles increase the hardness. At each cycle, the state is spanning larger and larger sections of the Hilbert space, thus becoming less sparse and making it harder to use tricks to simulate the behaviour of the system.

+ +
+

I guess I'm confused about what they really mean by ""classical sampling"" as compared to ""Sycamore sampling""

+
+ +

""Classical sampling"" means that you have a program that gives you a sequence of configurations (length-$50$ bitstrings) $\boldsymbol j$ according to the correct probability distribution. ""Sycamore sampling"" means that they are using their physical device to achieve this, and thus do not need to bother with computing anything, but instead just need to observe the output of their device.

+ +

More explicitly, suppose you have a $5$-qubit circuit. Three samples from the output probability distributions could be the following three bitstrings: +$$10111, 11111, 00010.$$ +Being able to produce these three bitstrings is not the same as being able to produce the set of $2^5-1$ real numbers that are the probabilities of each occurrence.

+ +

What you write as ""Sycamore sampling"", is exactly the same thing. The problem is still that of producing a number of samples such as the above ones. But now you don't need a classical computer to run an algorithm to produce them, using directly the quantum device instead. This will evolve a quantum system in some way, and then you measure the qubits at the end and you find, for each experimental run, a configuration of five bits. +You repeat the experiment three times, and you get three samples like the above ones.

+ +
+ +

(1) Note that, for the sake of exposition, I might be giving the impression here that to solve the sampling problem classically one needs to compute and store in memory the full probability distribution. While this is the naive way to do it, there are better ways. The computational complexity results rule out more generally that the sampling is classically hard, and make no reference to actually computing the probability distribution.

+",55,,55,,9/28/2019 18:46,9/28/2019 18:46,,,,11,,,,CC BY-SA 4.0 +8345,2,,8317,9/28/2019 18:50,,1,,"

In addition to @D. Tran's answer and for anyone out there (just in case), this did it for me.

The first mistake I made was that I kept on thinking superimposed qubits could only hold 0s and 1s as pairs (2 states) i.e. say for $n=3$ qubits I thought it was equivalent of ##-##-## (e.g. 01-11-01 which is just $2^{n+n}$ combinations at max) but it turned out a superimposed qubit can represent multiple states and each of these can be represented by complex numbers on a Bloch sphere.

The second thing that got me confused again was that I thought because $n$ qubits could store all combinations ($2^n$) for $n$ bits at once (from the video in the question's EDIT), it meant this was the limit of $n$ qubits and thus I was trying so hard to relate the confusion and the mistake.


At least now that I am aware qubits can represent multiple states which can employ ""quantum parallelism"" to store all combinations of $n$ classical bits I'd argue a single qubit can be used to represent information for more complex-numbers/digits while a bit can only represent a binary digit.

+",8605,,8605,,9/29/2019 16:45,9/29/2019 16:45,,,,0,,,,CC BY-SA 4.0 +8348,1,8423,,9/28/2019 21:44,,5,230,"

The Sycamore paper from Google notes that Sycamore is a $54$-qubit quantum processor, but for their experiments only $53$ qubits were working.

+ +

The ""bad"" qubit was on the edge of the array.

+ +

Is this just good fortune?

+ +

That is, if the ""bad"" qubit were in the middle of the array, would that have made processing more difficult? How many Sycamore processors are made at any given time? Are they fabricated on a wafer as an integrated circuit? Do they pick-and-choose the Sycamore chip with the best performing array of qubits? etc.

+",2927,,26,,9/29/2019 16:48,10/30/2019 18:44,"Location of ""bad"" qubits on Sycamore",,2,0,,,,CC BY-SA 4.0 +8349,2,,8329,9/29/2019 2:49,,2,,"

The problem seems to stem from the utf8tolatex parsing in the pylatexenc.latexencode package, line 370 here. Use of this function is not yet depreciated, but it is discouraged, and it has the unfortunate behavior of escaping the underscore, changing 'X_t' to 'X{\\_}t' (this is already inserted into the latex source in a math environment, so no need for $...$). A flag to disable this parsing and pass the string directly to \\gate{%s} would be very nice.

+ +

Also the mpl plots have a style dict kwarg structure, so that you can arbitrarily change the default name mapping with a JSON style sheet. Unfortunately, the latex plots ignore these style sheets and the mapping is hardcoded, e.g. line 384.

+ +

As far as I can tell, right now there's no way to accomplish what you want without running off your own branch. That is, unless anybody knows a trick to get utf8tolatex to stop escaping the underscore.

+",8623,,8623,,9/29/2019 3:00,9/29/2019 3:00,,,,0,,,,CC BY-SA 4.0 +8350,1,,,9/29/2019 13:11,,9,434,"

Google's Sycamore paper describes achieving quantum supremacy on a $53$-qubit quantum computer. The layout of Sycamore is $n=6\times 9=54$ nearest neighbors, with one qubit nonfunctional. They apply $m=20$ total cycles in their experiment; each cycle is a random single-qubit rotation $\{\sqrt{X},\sqrt{Y},\sqrt{W}\}$ followed by a two-qubit tile of their Sycamore-specific gate, similar to an $\mathrm{iSWAP}$.

+ +

However, Alibaba had previously indicated that such size quantum computers are simulatable classically on a supercomputer. See, e.g. Classical Simulation of Intermediate-Size Quantum Circuits + by Chen, et al., which states:

+ +
+

...by successfully simulating quantum supremacy circuits of size $9×9×40$, $10×10×35$, $11×11×31$, and $12×12×27$, we give evidence that noisy random circuits with realistic physical parameters may be simulated classically.

+
+ +

Was the random quantum circuit on Sycamore specifically designed to make Alibaba's (or others) approach of classical simulation difficult?

+ +

Did Google close a hole in Alibaba's work? Or am I misreading some aspect of the work?

+",2927,,2927,,9/29/2019 16:34,10/14/2022 2:07,Number of qubits to achieve quantum supremacy?,,1,0,,,,CC BY-SA 4.0 +8351,2,,8341,9/29/2019 14:17,,8,,"

TL/DR: The two-qubit gates are going by the moniker "Sycamore gates" in the paper, and it appears that they would ideally want to explore more of the $(\phi, \theta)$ phase-space but for their purposes (of quantum supremacy) their current Sycamore gate is sufficient. The pattern of gates $\mathrm{ABCDCDAB}$ was chosen to avoid "wedges" and maximize/optimize entanglement.

+
+

The two-qubit Sycamore gates are described in the Supplementary Information paper for example on pp. 13 and 14.

+

+

See FIG. S10 above, wherein the gates are described as an $\mathsf{iSWAP}$ (imaginary swap) combined with a small phase for $\mathsf{CZ}$ (controlled Z). They put their Sycamore gates (green stars) closer to $\mathsf{iSWAP}$'s on their phase diagram of FIG. S10(c). I think the $|00\rangle$ state is unchanged, the $|01\rangle$ and $|10\rangle$ state are swapped and multiplied by $i$, and the state $|11\rangle$ will see a $30^\circ$ phase shift.

+

Further, page 26 of the Supplementary Information states "The former sequence [e.g., the $\mathrm{ABCDCDAB}$ sequence] makes SFA simulation harder by facilitating prompt transfer of entanglement created at promising circuit cuts into the bulk of each circuit partition." Here SFA is the Schrodinger/Feynman hybrid simulation algorithm.

+

+

The Supplementary Information paper, especially FIG. S22 above, notes that the formation of what is called a "wedge" of gates acting on qubits that are separated/partitioned with the SFA algorithm may not efficiently increase entanglement, and may be more efficiently simulatable. +

+

Reviewing FIG. S21's illustration of the qubits toggled with the $\mathrm{ABCDCDAB}$ pattern and comparing them to the $\mathrm{EFGH}$ sequence above, the $\mathrm{EFGH}$ pattern includes a number of these "wedges" for less entanglement/more efficient simulation. That is, I think we can say that the $\mathrm{EFGH}$ pattern of gates has a simpler Schmidt decomposition. The $\mathrm{ABCD}$ gates have a different wallpaper group/packing density than the $\mathrm{EFGH}$ gates. (I'm sorry I forgot the right group-theoretical way to say what I mean).

+
+

EDIT

+

Comment #39 from Craig Gidney on this SO blog post provides more context on the $\mathrm{ABCD}$ vs. $\mathrm{EFGH}$ circuits.

+

From Craig:

+
+

The supremacy paper mentions “verification circuits” [i.e., $\mathrm{EFGH}$ circuits], which are circuits that are identical to the supremacy circuits [i.e., $\mathrm{ABCD}$ circuits] except the verification circuits use a slightly different ordering of the two qubit gates. This ordering introduces a weakness that can be exploited to perform simulation much more efficiently.

+

The verification circuits were not originally intended to be verification circuits. They were intended to be the actual supremacy circuits. We didn’t know the ordering was so important; someone just picked something that looked reasonable. It was only after we collected the experimental data for these circuits that the weakness was noticed.

+
+

To me, the claim of supremacy is made stronger by having switched over to the $ABCD$ circuits during the experiment, at least because more confidence is achieved when the fidelity of the verification circuits were actually verified to be on-line in FIG. 4.

+",2927,,-1,,6/18/2020 8:31,2/23/2020 14:24,,,,0,,,,CC BY-SA 4.0 +8352,1,8365,,9/29/2019 14:44,,9,3052,"

Many sources seem to loosely use the terms ""relaxation"", ""dephasing"", and ""decoherence"" interchangeably, while others seem to treat certain of them as special cases of another terms, but I can't find any statements that explictly distinguish them.

+ +

To me, ""decoherence"" refers to the process of a pure-state density operator evolving into a mixed state, typically via the off-diagonal entries of the density matrix in some semiclassical ""pointer basis"" decaying to zero via uncontrolled interactions with the environment. I beleive that ""relaxation"" and ""dephasing"" are special cases of decoherence, but what are their definitions (as contrasted with general decoherence)?

+",551,,,,,9/30/2019 6:34,"What is the difference between relaxation, dephasing, and decoherence?",,1,0,,,,CC BY-SA 4.0 +8353,2,,8350,9/29/2019 17:56,,0,,"

From the paper you refer, it turns out that the possible simulation of quantum circuit is made for certain type of circuits: simplificable ones.

+ +

From another post [1] I observed the Google's supremacy was achieved on non-simplificable, so called intractable sequence.

+ +

So to answer the question, whether Alibaba's approach was made difficult: yes - definitively that was the case.

+ +

Sources:

+ +

[1] Understanding Google's “Quantum supremacy using a programmable superconducting processor” (Part 3): sampling

+ +

Edit:

+ +

You're right, only my source post and Google's paper speak about simplificable vs. intractable in the sense I was thinking:

+ +
+

Here we show an intractable sequence (repeat ABCDCDAB); we also use different coupler subsets along with a simplifiable sequence (repeat EFGHEFGH, not shown) that can be simulated on a classical computer.

+
+ +

(take from Google's paper, fig.3 figure text.)

+ +
+

Here, the two-qubit gates are applied in a non-simplifiable tiling and sequence for which it is much harder to simulate.

+
+ +

(take from Google's paper, fig.4 figure text.)

+ +

Another points I found:

+ +

Alibaba calculates only one amplitude of the signal. All amplitudes of 50 qubits would have taken 16 petabytes, but they used only one peta in their whole experiment, so they did not actually simulate all, as Google guys tried.

+ +

Google used different algorithms and their classical power ended in 40 qubits size. As I understand this Alibaba guys went here beyond, but needed to compromise the amount of data simulated. Google guys made it through another algorithm to get 'amplitudes of individual bitstrings', only that they stopped, as the amount of expected time went out of their hands.

+ +

Situation: Alibaba got one amplitude and Google got an estimate of time for all amplitudes.

+",4280,,4280,,9/29/2019 20:29,9/29/2019 20:29,,,,2,,,,CC BY-SA 4.0 +8354,2,,8308,9/29/2019 21:08,,2,,"

The problem with your circuit is not the number of classical bits. There is no practical limit to those. The circuit that you have drawn will not run because you are doing repeated measurements on a single qubit. This is not supported on any IBM machine currently available (this would require new control electronics for operating the qubits).

+",2503,,,,,9/29/2019 21:08,,,,0,,,,CC BY-SA 4.0 +8355,1,8356,,9/29/2019 22:11,,3,205,"

For example in Deutsch's Algorithm, we apply $H$ to $|0\rangle$ and $|1\rangle$ respectively. I have seen the notation this result in the state: +$$\frac{1}{2}(|0\rangle+|1\rangle)(|0\rangle-|1\rangle)$$ +However, it is unclear to me how exactly I should read this. From my understanding, the result should be the outer product of $\begin{pmatrix} 1/\sqrt{2} \\ 1/\sqrt{2} \end{pmatrix}$ and $\begin{pmatrix}1/\sqrt{2} \\ -1/\sqrt{2}\end{pmatrix}$, but then I would expect to see a bra vector like so: $\langle x \mid$.

+ +

So how should I read a notation like: $|0\rangle (|0\rangle+|0\rangle)$?

+",8638,,26,,9/30/2019 3:42,9/30/2019 16:09,Notation question: How would one read $|0\rangle (|0\rangle+|0\rangle)$?,,1,0,,,,CC BY-SA 4.0 +8356,2,,8355,9/30/2019 0:23,,6,,"

As a starting point, the state $\Psi = \frac{\vert 0 \rangle + \vert 1 \rangle}{\sqrt{2}}$ is a superposition of states $\vert 0 \rangle$ and $\vert 1 \rangle$, both with amplitude $\frac{1}{\sqrt{2}}$, indicating both states are equally likely to be measured. The critical point to understand is that $\vert 0 \rangle$ and $\vert 1 \rangle$ are orthogonal basis elements, so $\Psi$ doesn't reduce in the way you indicated (consider the analogous unit vector $\frac{x+y}{\sqrt{2}}$ in a Euclidean coordinate system).

+ +

Next, it's important to note that the sum of the square of the amplitudes always equals one because the magnitude of each amplitude squared represents the probability that we would observe that state if a measurement was taken. In other words, measurement will cause $\Psi$ to collapse to state $\vert 0 \rangle$ with probability $\left(\frac{1}{\sqrt{2}} \right)^2=\frac{1}{2}$, and the same for $\vert 1 \rangle$. So $\vert 0 \rangle + \vert 0 \rangle$ is not physical, since measuring $\vert 0 \rangle$ with probability $2$ is not physically realistic.

+ +

When you see two kets next to each other this implies a tensor product, i.e. $\vert i \rangle \vert j \rangle$ implies $\vert i \rangle \otimes \vert j \rangle$. So $\frac{1}{2}(|0\rangle+|1\rangle)(|0\rangle-|1\rangle)$ is a shorthand way of writing $$\frac{1}{2}\left(\vert 0 \rangle \otimes \vert 0 \rangle + \vert 1 \rangle \otimes \vert 0 \rangle - \vert 0 \rangle \otimes \vert 1 \rangle - \vert 1 \rangle \otimes \vert 1 \rangle \right).$$ +You can see that this is properly normalized since $\sum \limits_i p_i = 4(\frac{1}{2})^2 =1$.

+ +

Reducing this to vector representations, if we take the vector representation $\vert 0 \rangle \equiv \begin{bmatrix} 1 \\ 0 \end{bmatrix}$ and $\vert 1 \rangle \equiv \begin{bmatrix}0 \\ 1\end{bmatrix}$, then $$\vert 0 \rangle \otimes \vert 0 \rangle = \begin{bmatrix} 1 \\0\\0\\0 \end{bmatrix}, \;\; \vert 1 \rangle \otimes \vert 0 \rangle = \begin{bmatrix} 0 \\0\\1\\0 \end{bmatrix}, \;\; \vert 0 \rangle \otimes \vert 1 \rangle = \begin{bmatrix} 0 \\1\\0\\0 \end{bmatrix}, \;\; \vert 1 \rangle \otimes \vert 1 \rangle = \begin{bmatrix} 0 \\0\\0\\1 \end{bmatrix}.$$

+ +

As a final point, since you mentioned outer products, in bra-ket notation outer products are indicated by a ket to the left of a bra, e.g. $\vert i \rangle \langle j \vert$.

+ +

Edit:

+ +

Since the final paragraph opened the door to outer products, it might be helpful to clarify that notion as well.

+ +

Where a ket represents a basis vector, a bra represents a dual vector (sometimes referred to as a covector). In this context, for an arbitrary basis vector, the corresponding dual vector is the conjugate transpose of the basis vector. For $\vert 0 \rangle$ and $\vert 1 \rangle$, as defined above (conventionally known as the computational basis), this simply gives $$\langle 0 \vert = \begin{bmatrix} 1 & 0 \end{bmatrix}, \;\;\; \langle 1 \vert = \begin{bmatrix} 0 & 1 \end{bmatrix}.$$

+ +

For any orthonormal set of basis vectors, orthonormality is characterized by the inner product $$\langle j \vert k \rangle = \delta_{jk},$$ where $\delta_{jk}$ is the Kronecker delta. For any complete orthonormal set of basis vectors, completeness is characterized by the outer product $$\sum \limits_j \vert j \rangle \langle j \vert = I,$$ where $I$ is the identity matrix with appropriate dimensions. Using this, you can readily confirm that both the computational basis and the basis used in Deutsch's algorithm are both orthonormal and complete.

+",8623,,8623,,9/30/2019 16:09,9/30/2019 16:09,,,,0,,,,CC BY-SA 4.0 +8361,1,8362,,9/30/2019 3:54,,2,67,"

I was reading the Qiskit tutorial on circuit properties and there is a section (Unitary Factors) which states that even though an example circuit is made of 12 qubits, it may not need 12 qubits to run.

+ +

The original circuit: here

+ +

+ +

The layers of the circuit: here

+ +

+ +

It is stated that: We can see that at the end of the computation there are three independent sets of qubits. Thus, our 12 qubit computation is actual two two qubit calculations and a single eight qubit computation.

+ +

I am struggling to understand where in this diagram it is illustrating that we only need two 2 qubit calculations and one 8 qubit calculation.

+",8405,,26,,9/30/2019 4:09,9/30/2019 6:12,n-qubit circuit run with > n qubits?,,1,0,,,,CC BY-SA 4.0 +8362,2,,8361,9/30/2019 6:12,,2,,"

Look at the picture of layer #9. It tells you explicitly how to group the qubits. There's a pair (q0,q5), another pair (q3,q8) and the rest of the qubits (q1,q2,q4,q6,q7,q9,q10,11). To see the relevance, look back to the circuit. Start with qubits 0 and 5. You can see that there's a two-qubit gate between them, but there are no two-qubit gates going from one of those to any other qubit. So qubits 0 and 5 will be in a product state from everything else (assuming they start in a product state), and you can perform that part of the computation independently from everything else. The same is true for the qubit pair 3 and 8.

+",1837,,,,,9/30/2019 6:12,,,,0,,,,CC BY-SA 4.0 +8363,2,,8330,9/30/2019 6:20,,3,,"

As @NorbertSchuch said in a comment, matlab has a function for taking the logarithm of a matrix: logm. In general, there is a standard method for calculating the function $f(\sigma)$ of a matrix $\sigma$. You first diagonalise the matrix: +$$ +\sigma=UDU^\dagger, +$$ +where $U$ is a unitary and $D$ is diagonal. We then say +$$ +f(\sigma)=Uf(D)U^\dagger, +$$ +where $f(D)$ simply involves calculating the function $f$ on just the diagonal elements of the matrix.

+ +

Note this means that in your particular case, since $\sigma=|\psi\rangle\langle\psi|$ corresponds to a pure state, one of the eigenvalues is 0, so unless $\rho$ is an identical pure state, the answer you get will be $\infty$.

+",1837,,,,,9/30/2019 6:20,,,,0,,,,CC BY-SA 4.0 +8364,1,,,9/30/2019 6:30,,1,22,"

In Gottesman's introduction, it writes

+ +
+

A code that corrects t errors is said to have distance 2t + 1, because it takes 2t + 1 single-qubit changes to get from one codeword to another.

+
+ +

Other reviews have slight different definitions but I think they are all equivalent. I am still new to QEC...and a little confused about how these $2t+1$ single-qubit changes take place during quantum error correction..Could anyone give a more detailed explanation?

+ +

Thanks!

+",4178,,,,,9/30/2019 6:30,Distance and number of corrected errors in quantum error correction,,0,2,,9/30/2019 7:34,,CC BY-SA 4.0 +8365,2,,8352,9/30/2019 6:34,,7,,"

Decoherence is the very general term which, more or less, is anything resulting in a loss of purity during the evolution of a system. Sometimes, when people are being a bit non-specific, they might be thinking of a particular type of decoherence such as dephasing (or perhaps depolarising) when they use the term decoherence.

+ +

Relaxation and dephasing are two very special cases of decoherence. In relaxation, we generally think of the qubits as being two-level systems where one level (say $|1\rangle$) is at a higher energy than the other ($|0\rangle$). Over time, there is the tendency of the $|1\rangle$ to 'relax' back to the state $|0\rangle$. If you want to visualise this, think of the Bloch Sphere. The action of the relaxation map is to contract the sphere towards to $|0\rangle$ point (so $|0\rangle$ stays as $|0\rangle$). This is Figure 8.14 in Nielsen and Chuang.

+ +

Dephasing is the same as ""Z noise"". This is the process that tends to reduce the off-diagonal entries of the density matrix, basically defining the ""pointer basis"". To visualise the effect on the Bloch sphere, it's a contraction of the sphere where every point moves towards the Z axis (every point on the Z axis is preserved). It's figure 8.9 in Nielsen & Chuang.

+ +

Their proper definitions can be given mathematically as Lindblad operators. The main equation is 8.134 in Nielsen and Chuang, with the operators (effectively) being defined in 8.96 (dephasing) and 8.108 (relaxation, also referred to as amplitude damping)

+",1837,,,,,9/30/2019 6:34,,,,2,,,,CC BY-SA 4.0 +8366,2,,8329,9/30/2019 12:09,,2,,"

There is not a way to have the latex drawer do the subscript currently. As ChainedSymmetry pointed out the use of pylatexenc prevents that because it will escape or convert the underscore and symbols to their latex equivalents. This was added because when we first added custom gates support to the drawer people had issues with passing things like custom_gate to the drawer it would make the 'g' a subscript (see https://github.com/Qiskit/qiskit-terra/pull/2246 ). While I still think this is a sane default for people, I agree we probably should add a flag to disable the conversion to the draw() functions, so I quickly wrote up a patch for that here:

+ +

https://github.com/Qiskit/qiskit-terra/pull/3172

+ +

That being said the mpl drawer should work fine in the meantime for your second example with the label name=r'$X_t$'. That should tell matplotlib to use math mode when rendering the gates name and use a subscript.

+",5529,,,,,9/30/2019 12:09,,,,1,,,,CC BY-SA 4.0 +8367,2,,8334,9/30/2019 14:33,,1,,"

This error code means there was a time-out waiting for a response from the server. It could have been caused by a blip in the network. I would try running the same code again, and seeing if you consistently get this error. If not, then I would not worry, as you are unlikely to see it again.

+",6180,,,,,9/30/2019 14:33,,,,0,,,,CC BY-SA 4.0 +8368,1,,,9/30/2019 15:10,,9,77,"

I reading the paper EXIT-Chart Aided Quantum Code Design +Improves the Normalised Throughput +of Realistic Quantum Devices, which proposes the use of QTCs in order to do quantum error correction for realistic quantum devices whose error model can be approximated by asymmetric depolarizing channels. Before presenting the error correcting methods, the authors present a discussion on the entanglement assisted hashing bound as a function of the asymmetry presented in the channel, which can be formulated as:

+ +

$C_Q^{EA} = 1 + (1-p)\log_2(1-p)+p_x\log_2(p_x)+p_y\log_2(p_y)+p_z\log_2(p_z) + \theta E_{max}$,

+ +

where $p=p_x+p_y+p_z$, $\theta\in[0,1]$ and $E_{max}$ is the maximum entanglement consumption.

+ +

At a first glance, the expression does not differ much from the EA hashing bounds of symmetric depolarizing channels, but a further observation of it presents the doubt I have about the topic. If one takes a look to the figures 5b, 5c or 5d of the paper, one can see that for channels presenting asymmetries, there are codes using entanglement-assistance with rates that do not present a noise limit $p^*$ for their performance.

+ +

I do not know if I am getting this correctly, but does that mean that we can construct codes that are error free? Does that mean that quantum information using such methods would be perfect?

+",2371,,55,,1/5/2021 11:37,1/5/2021 11:37,Entanglement-assisted hashing bound for asymmetric depolarizing channels,,0,0,,,,CC BY-SA 4.0 +8369,1,8371,,9/30/2019 17:10,,20,7834,"

I just started studying IBM Qiskit, and cannot find details about the barrier method on the QuantumCircuit class. It is shown in the circuit drawing, but I never heard about it after reading quantum computing text books. Is it a unitary gate? If so, how is it defined? Thanks.

+",8321,,26,,10/9/2019 6:34,8/13/2021 1:49,"What is a ""barrier"" in Qiskit circuits?",,1,0,,,,CC BY-SA 4.0 +8370,2,,8244,9/30/2019 17:40,,12,,"

Qiskit uses little-endian for both classical bit ordering and qubit ordering.

+

For classical bits:

+

A 3-bit classical register creg with value abc has creg[0]=c, creg[1]=b, creg[2]=a.

+

For qubits:

+

The ordering is with respect to the tensor-product structure of the state space. So a 3-qubit quantum register qreg with wave-function $|\psi\rangle = |A\otimes B\otimes C\rangle = |ABC\rangle$ has qreg[0]$= |C\rangle$, qreg[1]$= |B\rangle$, qreg[2]$= |A\rangle$.

+

Similarly for representing unitary matrices of a circuit. $U = U_A \otimes U_B \otimes U_C = U_A U_B U_C$ would have $U_C$ acting on qreg[0], $U_B$ acting on qreg[1] and $U_A$ acting on qreg[2].

+",8650,,16092,,6/1/2021 10:19,6/1/2021 10:19,,,,1,,,,CC BY-SA 4.0 +8371,2,,8369,9/30/2019 18:05,,30,,"

You won't find the barrier in quantum computing textbooks because it isn't a standard primitive of quantum information theory like unitary gates and quantum circuits.

+

The barrier acts as a directive for circuit compilation to separate pieces of a circuit so that any optimizations or re-writes are constrained to only act between barriers (and if there are no barriers they act on the whole circuit). +This only comes into play when using the transpile or execute functions in Qiskit (execute includes a transpile step).

+

Below is an example, and you can find more examples in these Qiskit tutorial notebooks:

+ +

Example

+

If a circuit has several 1-qubit gates in a row acting on the same qubit these can be combined into a single 1-qubit gate. If you explicitly want to prevent this sort of behaviour you can place a barrier between them.

+

Create a 1-qubit circuit with several gates

+
from qiskit import QuantumCircuit, QuantumRegister, transpile
+
+qr = QuantumRegister(1)
+circuit1 = QuantumCircuit(qr)
+circuit1.u1(0.2, qr[0])
+circuit1.u2(0.1,0.2, qr[0])
+circuit1.u3(0.1, 0.2, 0.3, qr[0])
+circuit1.draw()
+
+

This circuit is

+
         ┌─────────┐┌─────────────┐┌─────────────────┐
+q0_0: |0>┤ U1(0.2) ├┤ U2(0.1,0.2) ├┤ U3(0.1,0.2,0.3) ├
+         └─────────┘└─────────────┘└─────────────────┘
+
+

If we transpile it, these gates are combined using the default settings

+
circuit1t = transpile(circuit1)
+circuit1t.draw()
+
+

The returned circuit is

+
         ┌───────────────────────────┐
+q0_0: |0>┤ U3(1.6629,0.6018,0.43905) ├
+         └───────────────────────────┘
+
+

Now if we want to avoid the gates being combined we could add barriers:

+
qr = QuantumRegister(1)
+circuit2 = QuantumCircuit(qr)
+circuit2.u1(0.2, qr[0])
+circuit2.barrier(qr)
+circuit2.u2(0.1,0.2, qr[0])
+circuit2.barrier(qr)
+circuit2.u3(0.1, 0.2, 0.3, qr[0])
+circuit2.draw()
+
+         ┌─────────┐ ░ ┌─────────────┐ ░ ┌─────────────────┐
+q1_0: |0>┤ U1(0.2) ├─░─┤ U2(0.1,0.2) ├─░─┤ U3(0.1,0.2,0.3) ├
+         └─────────┘ ░ └─────────────┘ ░ └─────────────────┘
+
+

In this case transpiling wont change the circuit:

+
circuit2t = transpile(circuit2)
+circuit2t.draw()
+         ┌─────────┐ ░ ┌─────────────┐ ░ ┌─────────────────┐
+q1_0: |0>┤ U1(0.2) ├─░─┤ U2(0.1,0.2) ├─░─┤ U3(0.1,0.2,0.3) ├
+         └─────────┘ ░ └─────────────┘ ░ └─────────────────┘
+
+",8650,,17931,,8/13/2021 1:49,8/13/2021 1:49,,,,0,,,,CC BY-SA 4.0 +8372,2,,8235,9/30/2019 18:12,,6,,"

Outer product is a mapping operator. You can use it to define quantum gates, just sum up outer products of desired output and input basis vectors. For example, +$$\vert{0}\rangle\rightarrow\vert{1}\rangle,\vert{1}\rangle\rightarrow\vert{0}\rangle$$ +$$\vert{1}\rangle\langle{0}\vert+\vert{0}\rangle\langle{1}\vert=\begin{pmatrix} +0 & 1 \\ +1 & 0 +\end{pmatrix}$$ +In general, you can define an operator (gate) as +$$ +U=\sum_{n} \vert{v_i}\rangle\langle{u_i}\vert +$$ +where ${u_i}$ are input and ${v_i}$ output basis vectors. In short, outer products can be used to construct operators.

+",8651,,8651,,10/29/2019 8:03,10/29/2019 8:03,,,,0,,,,CC BY-SA 4.0 +8373,1,,,9/30/2019 22:14,,1,327,"

Can anyone help me to find the mean value of the displacement operator $$D(\alpha) = \exp( \alpha a^\dagger -\alpha^* a)$$ for a Coherent State $\left|\beta\right> = D\left(\beta\right)\left|0\right>$?

+",8655,,26,,10/9/2019 6:35,10/9/2019 6:35,What is the mean value of displacement operator for the coherent state?,,1,1,,,,CC BY-SA 4.0 +8374,1,8410,,10/1/2019 13:29,,10,317,"

I am interested how quantum computing can contribute to the development of artificial intelligence, I did some searching, but could not find much. Does somebody have an idea (or speculations)?

+",8654,,26,,10/9/2019 6:41,6/15/2021 20:46,Can quantum computing contribute to the development of artificial intelligence?,,1,3,,,,CC BY-SA 4.0 +8375,2,,8337,10/1/2019 18:18,,3,,"

This answer only addresses the part about the necessity of the randomness of the circuit because I am by no means familiar with the physical implementation of the qubits at Google and what kind of constraints these impose on the implementation of certain gates.

+ +

Now, for the randomness: Consider the problem of sampling from the output distribution of a quantum circuit. An instance of this problem is specified by one particular circuit. Of course, many of these instances might be extremely easy to solve for a general purpose classical sampler. Explicitly, take for example Clifford circuits for which we know we could build a poly-time sampler that could actually solve all these instances.

+ +

Edit: In fact, having thought about this a bit more, I believe that a single instance of any problem is always trivial to solve: You can just ""hard-code"" the right solution into your algorithm/Turing machine and it would then run in constant time (a single step) and return the right thing but of course would fail on any other instance. Thus, while we might intuitively speak about particular circuits being harder than others, this does not really make sense from a rigorous point of view. + (Here, it might help to think about more conventional problems that people look at in complexity-theory like Satisfiability or whatnot.) +But even for a big chunk of instances, you might still find some pattern in them, that allows you to solve all these but not all instances.

+ +

However, solving a problem means designing a general purpose algorithm/machine that solves all instances but of course asserting whether this criterion was met might be difficult. Thus, a nice way to pose the task that ought to be achieved by a sampler (be it quantum or classical) is sampling from the output distribution of a random instance.

+ +

Basically, if you cannot know which instance you will have to solve beforehand, then you have to prepare for all. To illustrate this:

+ +

Consider a competition where everyone hands in as a project their classical computer program for this task. There is simply no way you could ever exploit any particular structure in the circuit that you need to sample from because your are only told which instance you need to solve after handing in the project. Then the judges assess all submissions based on how well they do on some instance they have drawn randomly.

+ +

Facing this competition, the only thing you can do classically is just simulating the quantum circuit which of course takes exponential resources.

+",5322,,5322,,10/2/2019 17:26,10/2/2019 17:26,,,,0,,,,CC BY-SA 4.0 +8376,1,8380,,10/1/2019 19:57,,3,106,"

Consider the Deutsch-Jozsa, algorithm, which first initializes the state $|0 \rangle^{\otimes n} | 1 \rangle$, creates a superposition using the the Hadamard gate and the $U_f$ to get into the state: $$\sum_x (-1)^{f(x)} |x \rangle (|0 \rangle - | 1 \rangle).$$

+

So far I can follow. +What I don't understand is the step where we we apply the Hadamard gate to the first $n$ qubits, which gives (ignoring the last qubit) +$$\frac{1}{\sqrt{2^n}} \sum_{x=0}^{2^n-1} (-1)^{f(x)} \left [ \sum_{y=0}^{2^n-1} (-1)^{x \cdot y} |y\rangle \right ].$$

+

How can I prove that applying the Hadamard to the $n$ qubits in the state +$\sum_x (-1)^{f(x)} | x \rangle$ gives the above sum?

+",8638,,2927,,4/27/2021 22:59,4/27/2021 22:59,Analysis of the second Hadamard in the Detusch-Jozsa Algorithm,,1,0,,,,CC BY-SA 4.0 +8377,2,,8337,10/1/2019 22:12,,4,,"

While a follow-up question asks for the motivation behind the two-qubit gates used in Sycamore, this question focuses on the random nature of the single qubit operations used in Sycamore, that is, the gates $\{\sqrt{X},\sqrt{Y},\sqrt{W}=(X+Y)/\sqrt{2}\}$ applied to each of the $53$ qubits between each of the two-qubit gates.

+ +

Although I agree with @Marsl that these gates were likely relatively easy to realize with the transmon qubits used in Sycamore, I suspect that there is a little more to the story.

+ +

For example, page 26 of the Supplementary Information notes that although $\sqrt{X}$ and $\sqrt{Y}$ belong to the Clifford group, $\sqrt{W}$ does not. I believe $\sqrt{W}$ was added, at least partly, because it is not a member of the Clifford group. This may help to avoid the pitfalls of the Gottesman-Knill theorem, which says that circuits consisting of only normalizers of the Pauli group $(I,X,Y,Z)$ are efficiently simulatable.

+ +

Thus, for example, if $\sqrt{Z}$ were used as opposed to $\sqrt{W}$, then the claim of quantum supremacy would have to overcome the implications of easy simulatability in view of Gottesman-Knill.

+ +

Furthermore, I believe at least three single-qubit gates are needed to help support the claim of quantum supremacy.

+ +

For example further review of page 26 of the Supplemental Information states that although the first cycle randomly chooses among the $3$ gates, subsequent cycles never use the same gates used in the immediately preceding cycle.

+ +

It's hard to scramble a Rubik's cube by giving two half-twists to the same face twice in a row. Similarly their circuit used for quantum supremacy is chosen randomly from all of the $3^n2^{nm}$ such words on $n$ qubits and $m$ cycles of single- and two-qubit gates.

+",2927,,2927,,11/5/2019 18:43,11/5/2019 18:43,,,,0,,,,CC BY-SA 4.0 +8378,1,8384,,10/1/2019 23:59,,9,296,"

I'm trying to understand if there is some sort of formula or procedural way to determine if a vector is separable or entangled – aka whether or not a vector of size $m$ could be represented by the tensor product of two vectors of size $\sqrt{m}$

+ +

For example, I understand that the following 9-dimensional vector is separable because it can be represented as a tensor product of two 3-dimensional vectors:

+ +

\begin{equation} + \begin{pmatrix} + 0 \\ + \frac{1}{2} \\ + \frac{1}{2} \\ + 0 \\ + 0 \\ + 0 \\ + 0 \\ + \frac{1}{2} \\ + \frac{1}{2} \\ + \end{pmatrix} + = + \begin{pmatrix} + \frac{1}{\sqrt{2}} \\ + 0 \\ + \frac{1}{\sqrt{2}} \\ + \end{pmatrix} + \otimes + \begin{pmatrix} + 0 \\ + \frac{1}{\sqrt{2}} \\ + \frac{1}{\sqrt{2}} \\ + \end{pmatrix} +\end{equation}

+ +

Whereas the following 9-dimensional vector can't be represented as the tensor product of two 3-dimensional vectors:

+ +

\begin{equation} + \begin{pmatrix} + \frac{1}{2} \\ + 0 \\ + 0 \\ + 0 \\ + 0 \\ + 0 \\ + 0 \\ + 0 \\ + \frac{1}{2} \\ + \end{pmatrix} + \neq + \begin{pmatrix} + a_0 \\ + a_1 \\ + a_2 \\ + \end{pmatrix} + \otimes + \begin{pmatrix} + b_0 \\ + b_1 \\ + b_2 \\ + \end{pmatrix} +\end{equation}

+ +

But I'm looking for a computational way of determining if a vector is separable or entangled. Thanks for your help! Let me know if I can clarify anything.

+ +

Also – just a little disclaimer – I'm pretty new to all this, so sorry if this is a beginner question or if I got some of the math wrong.

+",8663,,,,,10/9/2019 6:43,Is there an algorithm for determining if a given vector is separable or entangled?,,2,0,,,,CC BY-SA 4.0 +8379,1,8386,,10/2/2019 0:04,,3,404,"

I am having trouble understanding the following step. From:

+

$$\operatorname{trace}\left(\sum_z |z\rangle\langle z| \rho_A |z\rangle\langle z| \times \log( \sum_z |z\rangle\langle z| \sum_x |\langle x|z \rangle |^2 \langle x | \rho_A | x \rangle)\right) \\ += \sum_z \langle z | \rho_A | z \rangle \times \log(\sum_x |\langle x|z \rangle |^2 \langle x | \rho_A | x \rangle)$$

+

Where $\rho_A$ is a quantum density operator, $X$ and $Z$ are quantum measurement operators, which of course would have to be hermitian. I think the line of reasoning is that those $|z\rangle$ are orthogonal to each other. So essentially it would be like

+

$$\operatorname{trace}(\text{diagonal matrix} \times \log(\text{another diagonal matrix}))$$ So the trace would simply be the sum of the diagonal elements. But I don't know how to argue about the orthogonality of them. What would be a good approach to go?

+",2403,,55,,12/21/2020 9:58,12/21/2020 9:58,Trace of Hermitian Operator and Operator Function,,1,4,,,,CC BY-SA 4.0 +8380,2,,8376,10/2/2019 2:24,,5,,"

If you look at the formula you want to prove term-by-term, you'll notice that the sum and the $(-1)^f(x)$ part is the same in both formulas; you just need to show that

+ +

$$H^{\otimes n} |x\rangle = \frac{1}{\sqrt{2^n}} \left( \sum_{y=0}^{2^n-1} (-1)^{x \cdot y} |y\rangle \right )$$

+ +

You can either show this strictly by induction (similar to this question but accounting for the fact that $|x\rangle$ can have both $|0\rangle$ and $|1\rangle$ bits which contribute different signs to the term).

+ +

Alternatively, you can just look at it: $|x\rangle$ is a sequence of $|0\rangle$ and $|1\rangle$ states, so applying a Hadamard gate to each of them will produce all possible sequences of $|0\rangle$s and $|1\rangle$s to serve as $|y\rangle$s. The sign before each $|y\rangle$ term is defined as follows: minus signs only appear when you apply Hadamard to a $|1\rangle$ bit of $|x\rangle$ and you consider a term $|y\rangle$ which has a $|1\rangle$ bit in the corresponding position. The coefficient $(-1)^{x \cdot y}$ accumulates from counting such positions for the given $|x\rangle$ and $|y\rangle$ and multiplying the signs.

+",2879,,,,,10/2/2019 2:24,,,,0,,,,CC BY-SA 4.0 +8381,1,8383,,10/2/2019 2:55,,3,209,"

I'm studying Quantum Computing: A Gentle Introduction. On page 33, Section 3.1.2, after defining tensor product with 3 properties (distribution over addition on both left and right, scalar on both sides), it says all element of $V \otimes W$ have form $|v_1\rangle \otimes |w_1\rangle +|v_2\rangle \otimes |w_2\rangle +\ldots+|v_k\rangle \otimes |w_k\rangle$, where $k$ is the minimum of the dimensions of $V$ and $W$.

+ +

Assume $V$ has $k+1$ dimensions (and $W$ has $k$ dimensions), why the basis $|v_{k+1}\rangle$ is not used?

+ +

Similarly, in the classic Quantum computing and quantum information textbook, section 2.1.7, formula 2.46, it also uses a single index $i$ $$(A\otimes B)(\sum_i a_i|v_i\rangle \otimes |w_i\rangle).$$ I thought it should be $$(A\otimes B)(\sum_ +{i,j} a_{i,j}|v_i\rangle \otimes |w_j\rangle).$$

+ +

Is there anything deeper to explain that a single index with a subset of bases is sufficient?

+ +

Thanks

+",8321,,26,,10/9/2019 6:47,10/9/2019 6:47,Understanding the action of operators on vectors in tensor product spaces,,1,0,,,,CC BY-SA 4.0 +8382,2,,8378,10/2/2019 3:47,,2,,"

Here is a possible, though expensive, way. First, find all prime factors of the dimension d of your vector. In your example, the dimension is 9, and the only prime factor is 3. Next for each prime factor $p$, try a tensor product of a vector of dimension p and another vector of dimension $d/p$. Then you need to solve $d$ quadratic equations with $p+d/p$ variables to ensure the tensor product holds, you also need two additional quadratic equations to ensure unit vectors.

+ +

When your vectors are sparse, i.e., with lots of zeros, it might be easy to trace out variables that must be zero first. In your second example, $a_0, b_0$ cannot be zero due to $a_0 b_0=\frac{1}{2}$, so $b_1=b_2=0$ to satisfy the second and third entries. Later when considering the last entry, you will find $b_2$ cannot be zero, hence there is no solution. In your first example, you can determine the two zero entries and solve the rest by solving the equations.

+",8321,,26,,10/9/2019 6:43,10/9/2019 6:43,,,,1,,,,CC BY-SA 4.0 +8383,2,,8381,10/2/2019 4:22,,4,,"

The reason is relatively straightforward. Consider an $m$ dimensional vector space $V$ with basis $\lbrace \vert v_1 \rangle,...,\vert v_m \rangle \rbrace$, and an $n$ dimensional vector space $W$ with basis $\lbrace \vert w_1 \rangle,...,\vert w_n \rangle \rbrace$. As your intuition suggests, we can naturally express any element $A \in V \otimes W$ in the form +$$A = \sum \limits_{j=1}^{m} \sum \limits_{k=1}^n \lambda_{jk} \vert v_j \rangle \otimes \vert w_k \rangle,$$ where $\lambda_{jk}$ are scalar coefficients.

+ +

The reason we can express $A$ in $\text{min}(m,n)$ terms is that we can group the set of $m$ vectors $\lambda_{jk} \vert v_j \rangle$ into a new set of $n$ vectors $\vert a_k \rangle$ given by +$$\vert a_k \rangle=\sum \limits_{j=1}^m \lambda_{jk} \vert v_j \rangle,$$ which gives an expression for $A$ with one index in $n$ terms as +$$A=\sum \limits_{k=1}^n \vert a_k \rangle \otimes \vert w_k \rangle.$$ +We can do the same to express $A$ in $m$ terms by +$$A = \sum \limits_{j=1}^m \vert v_j \rangle \otimes \vert b_j \rangle, \;\;\;\; \vert b_j \rangle = \sum \limits_{k=1}^n \lambda_{jk} \vert w_k \rangle,$$ +showing that $A$ can always be expressed in $\text{min}(m,n)$ terms.

+ +

However, to show that the $mn$ elements $\lbrace \vert v_j \rangle \otimes \vert w_k \rangle \rbrace$ form a basis in $V \otimes W$, we still need to show that these elements are linearly independent. That proof is not so easy (or concise). I would refer you to Linear Algebra via Exterior Products by Winitzki, section 1.7.3, if you want that level of rigor.

+",8623,,8623,,10/2/2019 12:59,10/2/2019 12:59,,,,6,,,,CC BY-SA 4.0 +8384,2,,8378,10/2/2019 9:15,,9,,"

Imagine you have a vector that can be written in the form +$$ +|\psi\rangle=\sum_{i=0}^{d_A-1}\sum_{j=0}^{d_B-1}c_{ij}|i\rangle|j\rangle. +$$ +The coefficients can be arranged as a $d_A\times d_B$ matrix $C$, with the elements $c_{ij}$ (in your special case, you're talking about setting $d_A=d_B=\sqrt{m}$).

+ +

Now, if you calculate $\rho_A=CC^\dagger$, this is known as the reduced density matrix of subsystem $A$. If the state $|\psi\rangle$ is separable, then $\rho_A$ corresponds to a pure state. Otherwise, it is mixed. Separability can be detected using a quantity known as the mixedness, effectively the condition $\text{Tr}(\rho_A^2)=1$. If $|\psi\rangle$ is not separable (i.e. $\rho_A$ is mixed), it is entangled.

+",1837,,1837,,10/2/2019 12:10,10/2/2019 12:10,,,,0,,,,CC BY-SA 4.0 +8385,2,,7203,10/2/2019 9:42,,1,,"

I don't think you can factor. There are many cases where the result of the gate will produce a combined CNOT output (4 numbers) that cannot be factored. I think most states between two qbits is entangled from our perspective. So you cannot trust in factoring. Instead, the four products remain in memory while your program writes the data to both of your inputs so that they now share the memory in different ways. Then when you apply the Hadamard to the lines after the CNOT, it actually operates on the 4 numbers as a whole to obtain the observed results.

+ +

I don't know the answer yet, but I am looking at the exact same problem and I think I know what you mean. I am seeing a connection between Cayley-Dickson constructions (complex numbers of high dimension) and probability states and manipulations. Gates also look like multiplications by (hyper) complex numbers.

+ +

Once you write a Cayley-Dickson calculator with tensor functions you can model the rotations of single gate manipulations. +But I am also having trouble getting the CNOT gate to work. I suspect it is just a simple Cayley Dickson number something like this: 1/sqrt(4)*(1-i+j-k) or something simple like that.

+ +

CNOT works for me when producing a tensor and flipping the complex side.

+ +

I'm working on some code to do this here: https://metacpan.org/source/PEASWORTH/Tangle-0.01

+",8666,,,,,10/2/2019 9:42,,,,0,,,,CC BY-SA 4.0 +8386,2,,8379,10/2/2019 11:55,,2,,"

If $|z\rangle$ are orthogonal to each other, then +$$ +\log(\sum_z |z\rangle\langle z| \cdot b_z) = \sum_z |z\rangle\langle z| \cdot \log(b_z) +$$ +So +$$ +\mathrm{trace}(\sum_z |z\rangle\langle z| \cdot a_z \cdot \log(\sum_{z^\prime} |z^\prime\rangle\langle z^\prime| \cdot b_{z^\prime})) +$$ +$$ +=\mathrm{trace}(\sum_z \sum_{z^\prime} |z\rangle\langle z| \cdot |z^\prime\rangle\langle z^\prime| \cdot a_z \cdot \log( b_{z^\prime})) +$$ +$$ += \mathrm{trace}(\sum_z |z\rangle\langle z|a_z\cdot \log(b_z)) = \sum_z a_z\cdot \log(b_z) +$$

+",5870,,26,,10/9/2019 6:45,10/9/2019 6:45,,,,0,,,,CC BY-SA 4.0 +8387,2,,8325,10/2/2019 20:16,,3,,"

There are a few ways to speed up this execution in Aqua. One way in the case of noiseless simulation is to use SLSQP instead of Cobyla, which we've noticed empirically seems to converge faster in noiseless environments. Another is to set skip_qobj_validation=True in the QuantumInstance init. I would start with these two and see how they do. QAOA in general can be tricky because the initial values can have a big impact on the execution time, and a graph as large as 10 nodes can have many singular values (saddle points). If you enable logging in Aqua, you can see whether the bottleneck is the circuit simulation or the number of iterations before convergence.

+",4379,,,,,10/2/2019 20:16,,,,0,,,,CC BY-SA 4.0 +8388,1,8391,,10/2/2019 22:17,,3,143,"

Given that classical physics emerges from quantum physics on a macroscopic scale, and all quantum operators are unitary, how are we able to perform non-unitary operations (such as setting a register to zero) in classical computation?

+ +

I suspect that unitarity must be preserved because information leaks to the environment as heat. However if this is the case, it begs a second question, why can quantum computers not 'simply' leak information to the environment as a hack to allow non-unitary transformations?

+",5174,,26,,10/9/2019 6:49,10/9/2019 6:49,How can classical computations be non-unitary?,,1,0,0,,,CC BY-SA 4.0 +8389,2,,7188,10/3/2019 1:46,,1,,"

That tutorial was recently updated. In it you'll find a more familiar way to declare and execute algorithms.

+ +
ee = ExactEigensolver(qubitOp, k=1)
+result = ee.run()
+
+ +

The problem section of the older declarative form of Aqua execution (which is gradually being moved away from) is a way for the Aqua UI to display a list of algorithms applicable to a user-selected ""problem."" It doesn't add anything here.

+",4379,,,,,10/3/2019 1:46,,,,0,,,,CC BY-SA 4.0 +8390,1,,,10/3/2019 5:06,,3,210,"

I found this explanation.

+ +

""The Hadamard gate can also be expressed as a 90º rotation around the Y-axis, followed by a 180º rotation around the X-axis. So $H=XY^{1/2}H = X Y^{1/2}H=XY^{1/2}$.""

+ +

Can everything in QM be explained with degrees instead of matrices and vectors?

+",8491,,55,,1/3/2021 11:09,1/3/2021 11:09,Can everything in QM be described with degrees instead of matrices and vectors?,,3,0,,,,CC BY-SA 4.0 +8391,2,,8388,10/3/2019 5:30,,5,,"

Quantum computers can leak information to the environment in order to perform non-unitary transformations. The problem is that this irreversibly entangles the computer's state with the environment, i.e. it is equivalent to measuring the qubits that were leaked. This will collapse the state of the computer and prevent the interference effects that are needed if you want to do a quantum computation that's not secretly just a classical computation.

+",119,,,,,10/3/2019 5:30,,,,0,,,,CC BY-SA 4.0 +8392,1,,,10/3/2019 5:59,,2,100,"

Let's say 1000 years from now powerful quantum computers are still a matter of fiction and no useful calculations can be carried out using them. Would this mean that the entire industry of quantum computers was a waste of time? Or did any useful innovations come out of the industry despite there being no quantum computers as of yet?

+",8674,,26,,10/9/2019 6:54,10/9/2019 6:54,Would all quantum computing research be for naught if a powerful enough quantum computer is never built?,,1,1,,,,CC BY-SA 4.0 +8393,1,,,10/3/2019 8:19,,7,376,"

I'm trying to show/convince myself the following statement is correct (I haven't been able to find any similar posts):

+ +

""There is no reversible quantum operation that transforms any input state to a state orthogonal to it.""

+ +

I can see how this could be true based on the operation being unitary and that you could likely find some input state that isn't transformed into an orthogonal state. Is there a simple way to show/prove this? My unsuccesful approach has been:

+ +

Let $U$ be some unitary transformation/operation, +and $|x\rangle$ some input state decomposed as +$$|x\rangle=\lambda_1|0\rangle + \lambda_2|1\rangle + \lambda_1|2\rangle + \cdots + \lambda_n|n\rangle$$ where $$\lambda_1 \lambda_1+\lambda_2 \lambda_2+\cdots+\lambda_n\lambda_n=1,$$ and

+ +

$$U|x\rangle = \langle x|U^\dagger$$

+ +

I'm trying to show that there exists an input state $x$ such that $\langle x|U^\dagger|x\rangle = 0$ isn't true.

+ +

I've tried to make use of the properties of unitary matrices but haven't had much luck.

+ +

Any assistance or suggestions on alternative approaches on how to show this would be greatly appreciated.

+",8675,,55,,2/4/2020 12:10,2/4/2020 12:10,Is there a quantum operation whose output is always orthogonal to the input?,,3,1,,,,CC BY-SA 4.0 +8394,2,,8393,10/3/2019 8:37,,4,,"

This is easiest to show by contradiction, so lets suppose that there exists an operation TransformToOrthogonal that maps the state of its input qubits to an orthogonal state. Reversible quantum operations can be simulated using unitary operators, so we can simulate TransformToOrthogonal by a matrix $U$ such that $UU^\dagger = 𝟙$. Since $U$ is unitary, $U$ is also normal (that is, $U$ commutes with its transpose, $UU^T - U^T U= 0$), so that we can use the spectral theorem to decompose $U$ into eigenvalues and eigenvectors, +$$ + U = \sum_i \lambda_i |\psi_i\rangle\langle\psi_i|. +$$ +At this point, we're almost at the contradiction; consider what happens if you input qubits that are in one of the eigenstates $|\psi_i\rangle$.

+",1978,,,,,10/3/2019 8:37,,,,4,,,,CC BY-SA 4.0 +8395,2,,8392,10/3/2019 9:59,,3,,"

On the practical side:

+ +

A lot of work is currently going into getting small scale quantum computers to work, and this involves fundamental understanding and manipulation of small quantum systems, be it ions, photons or whatever else. I can only imagine what other uses we would be able to find for having a better grasp on handling these fundamental systems. A side of effect of the industry of quantum computers is also that a lot of research and development is going into for instance cryogenic cooling. If this means that cooling to low temperatures becomes cheaper or easier this could have a multitude of benefits in other areas. The same holds for any other technology being developed for quantum computers.

+ +

On the theoretical side:

+ +

There are of course the ""quantum-inspired"" algorithms that run on classical computers, but would perhaps have been hard to come up with without thinking about these problems trough the lens of a quantum computer (see for instance the work by Ewin Tang on dequantizing certain quantum algorithms). Beyond that I think the concepts of BQP and related complexity classes helps to have a more clear idea in complexity theory of which problems are hard, and exactly how hard they are. And to paraphrase Scott Aaronson, if the future does not contain large scale quantum computers, then this raises the very interesting question of why? What would have stopped us from achieving this? Are there some theoretical boundaries that prevent us from doing so? Because that would certainly be a very interesting topic of research.

+",5998,,,,,10/3/2019 9:59,,,,1,,,,CC BY-SA 4.0 +8396,2,,8390,10/3/2019 10:05,,1,,"

The state of single qubit can be described as a point on the Bloch sphere. All the allowed transformations of a single qubit can then be described as rotations on the Bloch sphere. Unfortunately, bigger quantum systems can no longer be described as fitting on a sphere like geometry. As a result, this idea of considering transformations as rotations does not hold for all quantum systems.

+",5998,,,,,10/3/2019 10:05,,,,4,,,,CC BY-SA 4.0 +8397,2,,8373,10/3/2019 10:12,,1,,"

So you want to calculate $\left<\beta |D\left(\alpha\right)|\beta\right>$ where $\left|\beta\right>$ is a coherent state and $D\left(\alpha\right)$ is the displacement operator.

+ +

The easiest way of doing this is to take $\left<\beta |D\left(\alpha\right)|\beta\right> = \left<0|D^\dagger\left(\beta\right) D\left(\alpha\right)D\left(\beta\right)|0\right>$ and write this in terms of the exponential of creation and annihilation operators $D(\alpha) = \exp( \alpha a^\dagger -\alpha^* a)$, which I'll denote as $D(\alpha) = \exp(Y)$.

+ +

At this point, note that $D^\dagger(\beta) = \exp( \beta^* a -\beta a^\dagger) = D\left(-\beta\right) = \exp(-X)$ and from here, we can use the Baker–Campbell–Hausdorff formula. In this case, $$\left[X,Y\right] = \left[\beta a^\dagger -\beta^* a,\alpha a^\dagger -\alpha^* a\right] = \beta\alpha^*\left[a, a^\dagger\right] - \beta^*\alpha\left[a, a^\dagger\right] = \beta\alpha^* - \beta^*\alpha$$ as $\left[a, a^\dagger\right] = 1$.

+ +

As $\beta\alpha^* - \beta^*\alpha$ is just a constant, this commutes with both $\beta a^\dagger -\beta^* a$ and $\alpha a^\dagger -\alpha^* a$ and so, all the higher order terms in BCH are $0$.

+ +

This gives that $e^{-X}e^Y = e^{-X+Y-\frac{1}{2}\left[X, Y\right]}$ and further that $$e^{-X}e^Ye^X = e^{-X+Y-\frac{1}{2}\left[X, Y\right] + X + \frac{1}{2}\left[-X+Y-\frac{1}{2}\left[X, Y\right],X\right]} = e^{Y - \left[X, Y\right]}.$$

+ +

While this still looks complicated, $\left[X, Y\right] = \beta\alpha^* - \beta^*\alpha$ is still a constant, so we can rewrite this as $$\left<0|e^{-X}e^Ye^X|0\right> = \left<0|e^{-\left[X, Y\right]}e^Y|0\right> = e^{-\left[X, Y\right]}\left<0|e^Y|0\right>.$$

+ +

At this point, we can write $e^Y\left|0\right> = D\left(\alpha\right)\left|0\right> = e^{-\frac{1}{2}\left|\alpha\right|^2}e^{\alpha a^\dagger}\left|0\right>$ (which can also be shown using BCH) to get $$\left<\beta |D\left(\alpha\right)|\beta\right> = e^{-\beta\alpha^* + \beta^*\alpha}\left<0|e^{-\frac{1}{2}\left|\alpha\right|^2}e^{\alpha a^\dagger}|0\right> = e^{-\beta\alpha^* + \beta^*\alpha - \frac{1}{2}\left|\alpha\right|^2}$$

+",23,,,,,10/3/2019 10:12,,,,0,,,,CC BY-SA 4.0 +8398,1,8422,,10/3/2019 11:32,,2,93,"

A Pauli channel is defined as a convex combination of Pauli operators, i.e. $\epsilon_{\text{Pauli}} (\rho)=\sum_{j} q_j\sigma_j\rho \sigma_j$, where $0 \leq q_j \leq 1$ and $\sum_j q_j=1$. Now, I want to transmit firstly a pure state qubit through it, and then a Bell state. How do I start working on this?

+",8027,,26,,10/9/2019 6:57,10/9/2019 6:57,The solution when we transmit a qubit through a Pauli channel?,,1,0,,,,CC BY-SA 4.0 +8399,1,,,10/3/2019 12:56,,-3,152,"

I'm prepared to explore quantum computing which is completely new to me. Searching for a while on the Internet, I found IBM Qiskit which is an Open Source software necessitated for Quantum Computing. Also, I found the following documentation;

+ +

1) Hello Quantum: Taking your first steps into quantum computation

+ +

2) Installing Qiskit

+ +

3) Coding with Qiskit

+ +

4) Qiskit 0.12

+ +

5) Qiskit API documentation

+ +

6) Qiskit IQX Tutorials

+ +

Before starting I expect to know whether I need a quantum computer for my exploration? Or a classic computer, a desktop PC, can do the job?

+ +

Please shed me some light? Thanks in advance.

+",8678,,26,,10/9/2019 7:14,10/15/2019 13:20,Exploring quantum computing with Qiskit,,1,2,0,10/8/2019 14:34,,CC BY-SA 4.0 +8400,2,,8390,10/3/2019 13:06,,0,,"

Short answer: Yes, except for measurement.

+ +

There two postulates in play here:
+1- the evolution of a closed QM system can always be described by a unitary matrix.
+2- measurement operators (observable operator) are always hermitian

+ +

Hermitian operators can't (always) be described as a rotation in any space.

+ +

Unitary operators can always be considered as rotation around some axis since they always preserve the inner products. However the dimensions of the space where the rotation happens increases as the dimension of the system increase:

+ +
    +
  • operation on 1 qubit is a rotation on the 2D surface of a 3D sphere (Bloch sphere).
  • +
  • operation on m qubits is a rotation on the $2^{m+1}$ − 2 dimensions surface of some $2^{m+1}$ − 1 sphere.
  • +
+ +

Which makes this visualization (degrees of rotation) not very helpful when applied to a multi-qubit system.

+",8647,,26,,10/9/2019 6:52,10/9/2019 6:52,,,,14,,,,CC BY-SA 4.0 +8401,2,,8399,10/3/2019 13:22,,1,,"

IBM's Qiskit consists of multiple components. Qiskit terra provides you the tools for building quantum circuits. You can either run these circuits on an actual quantum device on IBMQ Experience which is a free cloud-based Quantum computer service.

+ +

Or you can run your circuit on Qiskit Aer; another Qiskit component. This component simulates the circuit on your classical device to obtain results. plus it provides you with the tools to visualize the quantum state in multiple ways (Bloch sphere, unitary, state vector...).

+ +

At the end of the day, your computation is limited by either the number of the qubits available on the different IBMQ devices or your computer's ability to simulate a quantum circuit. Either way, for learning and exploration this should be enough.

+",8647,,26,,10/15/2019 13:20,10/15/2019 13:20,,,,1,,,,CC BY-SA 4.0 +8402,2,,8393,10/3/2019 16:15,,3,,"

Every unitary matrix can be diagonalized as $U=S^\dagger \Lambda S$, where $S$ is unitary and $\Lambda$ is diagonal and contains the eigenvalues ($\lambda_i$) of $U$. So you can consider instead $$\langle x \vert U \vert x \rangle=\langle x \vert S^\dagger \Lambda S \vert x \rangle = 0.$$ Defining $\vert \tilde x \rangle \equiv S \vert x \rangle$, you only have to convince yourself that there always exists a state $\vert \tilde x \rangle$ such that $$\langle \tilde x \vert \Lambda \vert \tilde x \rangle = \sum \limits_i \lambda_{i}\tilde x_i^\ast \tilde x_i \ne 0.$$ +That should be pretty easy to see in this form.

+",8623,,8623,,10/3/2019 16:57,10/3/2019 16:57,,,,0,,,,CC BY-SA 4.0 +8403,1,8404,,10/4/2019 2:32,,2,71,"

A source constantly produces a stream of photons in one of the following states

+ +

$$|\varphi_1\rangle=\dfrac{1}{\sqrt2}(a|00\rangle+ b|01\rangle+c|10\rangle+d|11\rangle)$$

+ +

$$|\varphi_2\rangle=\dfrac{1}{\sqrt2}(b|00\rangle+ a|01\rangle+d|10\rangle+ c|11\rangle)$$

+ +

where $a,b,c,d$ are some (valid) scalar values you know beforehand and $a\ne b\ne c\ne d$.

+ +

You are only sent the first qubit and have no access to the second qubit.

+ +

How to design a measurement (on the first qubit) that allow yout to tell whether the source is producing $|\varphi_1\rangle$ or $|\varphi_2\rangle$?

+ +

Assume you can measure as many times as you want.

+",8421,,26,,10/9/2019 6:58,10/9/2019 6:58,How to design a measurement that distinguishes the following pair of two-qubit states?,,1,0,,,,CC BY-SA 4.0 +8404,2,,8403,10/4/2019 5:23,,4,,"

Write down the two reduced density matrices of the single qubits that you have access to. Apply the Helstrom measurement (there are several descriptions of this on the site already).

+ +

The problem is that, in this case, the two reduced density matrices are the same. That means that you cannot tell them apart. More explicitly, +$$ +|\varphi_2\rangle=(I\otimes X)|\varphi_1\rangle +$$ +The only different between the two states is on the second qubit.

+",1837,,1837,,10/4/2019 7:19,10/4/2019 7:19,,,,0,,,,CC BY-SA 4.0 +8405,2,,8393,10/4/2019 7:15,,5,,"

The existing answers have quite an elegant idea behind them. However, my concern is that they don't seem to allow for the introduction of an ancilla. If we introduced an ancilla in a fixed state, and applied a unitary across the two systems, then it could be that all the eigenvectors are entangled across the two subsystems, and the basic argument wouldn't apply since we'd only be trying to make an argument about a separable input.

+ +

The way that I would approach such a calculation (I'll do it only for a single qubit here. That's sufficient to make the necessary argument, but you could extend it to any Hilbert space if you wanted). Let $\Phi$ be the Choi map of our operation. This means that, for an input state $|\psi\rangle$, the output state would be +$$ +\rho_{\psi}=2\text{Tr}_1(|\psi\rangle\langle\psi|^T\otimes I\cdot\Phi). +$$ +This is successful if +$$ +\text{Tr}((I-|\psi\rangle\langle\psi|)\rho_{\psi})=1. +$$ +Now, we need this to be true for all possible input states $|\psi\rangle=\cos\frac{\theta}{2}|0\rangle+\sin\frac{\theta}{2}e^{i\phi}|0\rangle$, so the average over all possible input states must also be 1. In other words, we want +$$ +\frac{1}{2\pi}\int_0^{2\pi}d\phi\int_0^{\pi}\sin\theta d\theta\ \text{Tr}\left(|\psi\rangle\langle\psi|^T\otimes(I-|\psi\rangle\langle\psi|)\Phi\right)=1. +$$ +If we work this out, it means that we require +$$ +\text{Tr}\left(M\Phi\right)=1 +$$ +where +$$ +M=\left(\begin{array}{cccc} +\frac{1}{3} & 0 & 0 & -\frac{1}{3} \\ +0 & \frac{2}{3} & 0 & 0 \\ +0 & 0 & \frac{2}{3} & 0 \\ +-\frac13 & 0 & 0 & \frac13 +\end{array}\right). +$$ +So, what's the best choice of $\Phi$? It's an eigenvector of maximum eigenvalue of $M$. But the maximum eigenvalue is $\frac23$, meaning that it is impossible to achieve $\text{Tr}(M\Phi)>\frac23$, and hence it is impossible to give an orthogonal output for all possible single-qubit input states.

+ +

By way of contrast, if we restrict to just real states (i.e. $\phi=0$), the maximum eigenvalue of $M$ is larger that 1, which leaves open the possibility for creating an orthogonal state, which we know is possible just by applying Pauli-$Y$. This corresponds with $\Phi=(I\otimes Y)|B_{00}\rangle\langle B_{00}|(I\otimes Y)$.

+",1837,,,,,10/4/2019 7:15,,,,0,,,,CC BY-SA 4.0 +8409,2,,6519,10/4/2019 18:36,,6,,"

Mathematically it is a relationship between a bipartite linear operator vector space $L(X\otimes Y)$ and a superoperator vector space $C(X): L(X)\to L(Y)$ (maps of linear operators to linear operators). Bipartite density matrices are contained in the former, and quantum channels in the latter. The real ""physical"" meaning of the isomorphism for quantum information theory is that a superoperator is a valid quantum channel if and only if its Choi-state is a valid density matrix. You can read more about properties of the Choi-representation (and other representations of quantum channels) in my review article [1].

+ +

This also has several quantum computing applications outside of quantum information theory. The most common two are probably

+ +
    +
  1. Quantum process tomography
  2. +
  3. Gate teleportation (especially in measurement based quantum computing)
  4. +
+ +

Matthew Leiffer has a good blog post [2] which describes point 2 (and talks more generally about the Choi-Jamiolkowski isomorphism in the context of some of his research on conditional states).

+ +

For point 1. If if one wants to experimentally reconstruct a description of a quantum channel they basically need to reconstruct the Choi-matrix representation of the channel. This is typically done by preparing a tomographically complete set of input states (states that span the input state space), and perform a tomographyically complete set of measurements (measurements with outcomes projectors that span the output state space) and use the resulting probabilities to reconstruct the description of the channel.

+ +

From the point of view of measurement probabilities, the ""channel"" is indistinguishable from a bipartite ""state"" that we would have performed state tomography on, and so we can reconstruct the description as if we were simply reconstructing a bipartite density matrix using state tomography (there are some subtleties concerning the trace preserving property which I won't get into). You can see an example of process tomography in this Qiskit Ignis tutorial notebook [3].

+ +

The is also another way to do process tomography called Ancilla assisted process tomography [4] which is a physical implementation of the Choi-Jamiolkowski isomorphism. You could prepare a maximally entangled bell state, send half of it through the channel to be investigated (and do nothing to the other half), and then perform state tomography of the full output to directly reconstruct the Choi-state for the unknown channel. This is rarely used in practice as it is typically less accurate than the standard method due to errors in preparing the maximally entangled input state.

+ +

[1] Quant. Inf. Comp. 15, 0579-0811 (2015) arXiv:1111.6950 [quant-ph]

+ +

[2] http://mattleifer.info/2011/08/01/the-choi-jamiolkowski-isomorphism-youre-doing-it-wrong/

+ +

[3] qiskit-iqx-tutorials/qiskit/advanced/ignis/6b_process_tomography.ipynb +

+ +

[4] Physical Review Letters 90, 193601 (2003), arXiv:quant-ph/0303038

+",8650,,26,,10/11/2019 5:02,10/11/2019 5:02,,,,2,,,,CC BY-SA 4.0 +8410,2,,8374,10/4/2019 19:13,,8,,"

In my view, if artificial general intelligence (AGI) is ever 'solved', it likely won't be because of the development of a quantum AI algorithm. Rather, it will be because of a breakthrough in the training of existing classical algorithms.

+

That said, much like in the classical case (i.e. classical machine learning), research on quantum algorithms with plausible applications to some future AGI largely center on quantum machine learning (QML). QML research is still in its infancy relative to classical machine learning research and its practical benefits are only beginning to be understood. Here’s a broad overview of some general themes that appear to be emerging:

+
    +
  1. We know that QML can provide algorithmic speedups. Much of the work in QML has been based on the quantum linear systems algorithm (QLSA, also known as HHL). This algorithm can be used to invert a covariance matrix, which is useful for the training of (for example) support vector machines and Gaussian process models. While somewhat controversial, the speedups of QML algorithms based on the HHL algorithm were originally thought to be superpolynomial (given some caveats, see this paper by Aaronson and another by Childs). Now, however, the speedups are generally believed to be polynomial (in many cases) due to the assumptions made in developing many QML algorithms and dequantization arguments (see here and here). For a nice overview, see this Quanta article. Also note that some of the caveats discussed in the links above have been addressed by refinements to the HHL algorithm. Also, it's notable that these specific algorithms often require quantum data as their input, which means they can't simply be added into a classical ML pipeline.

    +
  2. +
  3. It's unclear to what extent quantum information enhances or limits model representations. When developing a machine learning model, one of the central goals is to learn a representation (e.g. the parameters of a neural network model) that enables us to make accurate predictions on unseen data drawn from a distribution we assume to be i.i.d. with the training data. An interesting question in this respect is whether using qubits to generate a learned representation offers any advantage over the standard (classical) representations currently being generated. Intuitively, quantum representations may have advantages for certain problems that inherently involve quantum effects, such as molecular simulation. Some recent work in this area indicates that certain QML algorithms may have improved trainability (i.e. fewer barren plateaus and narrow gorges), lower generalization error, and reduced sample complexity.

    +
  4. +
  5. How should we be performing regularization in the QML context. It's been argued that some existing QML algorithms would massively overfit the data, severely limiting generalizability (for example, Peter Wittek notes the issue here while discussing quantum support vector machines). In classical machine learning, to ensure the ability of a model to generalize, we usually make use of some kind of regularization technique. I haven't yet seen any research around a QML approach to regularization (although variational quantum algorithms, discussed below, represent a glaring exception); perhaps someone else can comment on whether such approaches have been proposed for algorithms processing quantum data. A linking concept here may be the recent development of quantum kernel methods.

    +
  6. +
  7. Limited complexity guarantees. Typically, we like our algorithms to offer some kind of guarantee around the worst-case behavior in terms of resource usage given some input size. Variational quantum algorithms, which are now central to the pursuit of practical quantum advantages in the near term, rarely provide these guarantees. While a lack of these guarantees doesn't preclude the possibility of a practical application in any way, it does mean that evidence that a classical approach couldn't do better is heterogenous, often informal, and highly problem specific.

    +
  8. +
  9. I/O Another aspect is the input and output of the QML algorithm – are we inputting and outputting classical data like a traditional ML algorithm but doing quantum processing in the middle? Or rather is our input or output quantum? Or maybe they're both quantum? These details are hugely important to the realization of quantum advantages and, in particular, how to best input classical data into a QML algorithm is an area of great interest (and the input problem, in general, is not new).

    +
  10. +
+

There's certainly more that could be discussed relating to this question and, to be transparent, I am still very much learning this area. I hope more answers roll in but, until then, perhaps the information above can provide some context around what I would suggest the answer to your question is: We don't really know, yet.

+",1937,,1937,,6/15/2021 20:46,6/15/2021 20:46,,,,3,,,,CC BY-SA 4.0 +8411,1,,,10/4/2019 22:59,,2,158,"

What is the cost of implementing the Quantum Fourier transform (QFT) in a classical computer? We know we require at least $\log{n}$ depth quantum circuits to do a QFT in a quantum computer, with $n$ being the number of input qubits. Is there a similar result for classical computers?

+",1351,,26,,10/9/2019 7:17,10/9/2019 7:17,What is the cost of implementing the Quantum Fourier transform in a classical computer?,,0,4,,3/22/2021 7:19,,CC BY-SA 4.0 +8412,1,8414,,10/5/2019 1:10,,1,71,"
operation Task12 (queryRegister : Qubit[], target : Qubit, pattern : Int[]) : Unit {
+
+    body (...) {
+        using (c = Qubit[Length(queryRegister)]) {
+
+           ApplyToEachA(X, c);
+
+            for (i in 0..Length(queryRegister) - 1) {
+
+                if (pattern[i] == 0) {
+                    CNOT(queryRegister[i], c[i]);
+                } elif (pattern[i] == 1)  {
+                    X(c[i]);
+                    CNOT(queryRegister[i], c[i]);
+                }
+            }
+
+            Controlled X(c, target);
+            // ResetAll(c);
+        }
+    }
+
+    adjoint auto;
+}
+
+ +

I want to uncomment that ResetAll(c) line as I believe the right thing to do is to return the system the qubits in the same state as they were borrowed. But somehow the adjoint auto gives an error to the ResetAll(c) line. Will my code work just fine without the Reset line?

+ +

Edit:

+ +
operation Task12 (queryRegister : Qubit[], target : Qubit, pattern : Int[]) : Unit {
+
+        body (...) {
+            using (c = Qubit[Length(queryRegister)]) {
+
+                within {
+
+                    ApplyToEachA(X, c);
+
+                    for (i in 0..Length(queryRegister) - 1) {
+
+                        if (pattern[i] == 0) {
+                            CNOT(queryRegister[i], c[i]);
+                        } elif (pattern[i] == 1)  {
+                            X(c[i]);
+                            CNOT(queryRegister[i], c[i]);
+                        }
+                    }
+                }
+
+                apply {
+
+                    Controlled X(c, target);
+                }
+            }
+        }
+
+        adjoint auto;
+    }
+
+ +

Will this work? I don't have the driver file of this code, hence have to rely completely off the error detection of vscode. Thanks for help.

+",8695,,26,,10/9/2019 7:18,10/9/2019 7:19,ResetAll with adjoint auto,,1,0,,,,CC BY-SA 4.0 +8413,1,,,10/5/2019 4:32,,1,57,"

I know just the basics of quantum computer i.e. superposition, entanglement, gates and few other kinds of stuff.

+ +

Now the question is it possible to transfer a trained machine learning model from IBM Q(don't much about quantum algorithms) to AWS, GCP or Azure?

+ +

If yes will it have the same accuracy that we get IBM Q?

+ +

If yes how to do that?

+",8693,,8693,,10/5/2019 18:14,10/5/2019 18:14,Transfer trained machine learning model,,0,1,,,,CC BY-SA 4.0 +8414,2,,8412,10/5/2019 4:51,,2,,"

Yes, removing the ResetAll will prevent your code from running. Q# assumes that released qubits are in the 00..0 state.

+ +

One option is uncomputation - essentially, applying the adjoint of the operations you've applied. For instance,

+ +

+ +

The first two ancilla qubits are left unchanged by the last operation, but the last qubit has been modified and is dependent on $x_1, x_2, x_3 $. In your case, you'd want to apply the adjoints of your operations in reverse order ($U_a U_b CX U_b^{\dagger} U_a^{\dagger}$, where $U_a U_b$ are arbitrary unitaries and $CX$ is the CNOT gate).

+ +

Q# has conjugation functionality that may be useful in your case!

+",8343,,26,,10/9/2019 7:19,10/9/2019 7:19,,,,0,,,,CC BY-SA 4.0 +8415,1,8419,,10/5/2019 8:08,,2,80,"

I'm told that the input register is in little-endian format. But the vscode gives me error telling me that it is wrong argument for QFT even after using a suitable converter. Am I missing something here?

+ +
    operation Task31 (qs : Qubit[]) : Unit {
+        X(qs[Length(qs)-1]);
+        ApplyReversedOpBE(QFT, qs);
+    }
+
+",8695,,26,,10/9/2019 6:44,10/9/2019 6:44,Unable to recognise little-endian format,,1,0,,,,CC BY-SA 4.0 +8416,1,8439,,10/5/2019 10:09,,9,331,"

It is known that every state $\rho$ of a $d$-level system (or if you prefer, qudits living in a $d$-dimensional Hilbert space) can be mapped into elements of $\mathbb R^{d^2-1}$ through the mapping provided by the Bloch representation, by writing it as +$$\rho=\frac{1}{d}\left(I+\sum_{k=1}^{d^2-1} c_k \sigma_k\right),$$ +with $\{\sigma_k\}$ traceless Hermitian matrices satisfying $\operatorname{Tr}(\sigma_j\sigma_k)=d\delta_{jk}$ and $c_k\in\mathbb R$. +We can then consider the mapping $f:\rho\mapsto f(\rho)\equiv\boldsymbol c\in\mathbb R^{d^2-1}$. +One can also show that the set of all states maps into a compact set in $\mathbb R^{d^2-1}$, and furthermore characterise the boundary of this set in ""spherical coordinates"", as shown for example in this answer.

+ +

Moreover, as shown for example in the answers to this question, the purity of a state $\rho$ translates into the norm of $f(\rho)$ (i.e. its distance from the origin): $\operatorname{Tr}(\rho^2)=(1+\|f(\rho)\|^2)/d$. +It follows that if $\rho$ is pure, that is $\operatorname{Tr}(\rho^2)=1$, then $\|f(\rho)\|=\sqrt{d-1}$. This means that the set of pure states is a subset of the hypersphere $S^{d^2-2}\subseteq\mathbb R^{d^2-1}$ with radius $\sqrt{d-1}$.

+ +

However, the pure states do not cover this hypersphere: the boundary of the set of states is not comprised of pure states (see e.g. this question), and many (most) elements on $S^{d^2-2}$ do not correspond to physical states. This tells us that the set of pure states does not lie on a hypersphere in the Bloch representation (which must obviously be true, as we know that the set of pures has a much smaller dimension).

+ +

But then again, this does not (I think?) rule out the possibility that the set of pure states lies on some lower-dimensional hypersphere $S^{2d-3}$ embedded in $\mathbb R^{d^2-1}$. Is this the case?

+",55,,55,,7/26/2020 11:57,7/26/2020 11:57,Do pure qudit states lie on a hypersphere in the Bloch representation?,,1,0,,,,CC BY-SA 4.0 +8417,1,,,10/5/2019 11:35,,3,130,"

I need to do some popularization of science for an event, and I would like to talk about the ""best"" applications of quantum computing.

+ +

I know there is code-breaking (Shor algorithm), simulation of quantum systems, deep learning, etc.

+ +

However, I would like an example that talks to the public. I think I have read at some point that we could be using chemistry simulation simulating drugs on computers. So basically the concept of drugs would enter in the simulation era.

+ +

However, as I haven't found source easily on this again I would like to check if it is science fiction or it is true we could do it by simulating large molecules (because if it is true it would be for my perspective the best application of quantum computer by far).

+ +

I am also interested in other nice applications of quantum computing ""not too abstract"" if you have ideas or sources on them.

+",5008,,26,,10/8/2019 21:44,10/8/2019 21:44,Applications of quantum computing for science popularization,,1,1,,,,CC BY-SA 4.0 +8418,2,,8417,10/5/2019 12:58,,4,,"

There is good reason to believe that quantum computers will eventually play an important role in drug discovery. Perhaps the best way to show that it's not science fiction is to talk about the startups forming that are focused on QC-enabled drug discovery. The companies that I know of that fit this description are

+ + +",8623,,,,,10/5/2019 12:58,,,,0,,,,CC BY-SA 4.0 +8419,2,,8415,10/5/2019 15:07,,3,,"

You'll need to cast your qubit array as type LittleEndian:

+ +
let LEArray = LittleEndian(qs);
+
+ +

A good example of this is in the QuantumKatas under Quantum Phase Estimation.

+",8343,,,,,10/5/2019 15:07,,,,0,,,,CC BY-SA 4.0 +8422,2,,8398,10/6/2019 2:22,,1,,"

Let's say $|a\rangle$ is the pure state qubit and $|b\rangle$ is the bell state.

+ +

Putting $|a\rangle$ through the Pauli channel depends on which of the Pauli gates (which of the $\sigma_j$) you want acting on it. Once you choose this (call it $\sigma_a$), apply $2\times2$ Identity operators to it on either side until it's the same size as $\rho$, then just do the matrix multiplication: $q_a\sigma_a \rho \sigma_a$, where the $\sigma_a$ are both implicitly including enough identity matrices to make them the same size as $\rho$.

+ +

The Bell state will involve two qubits, so you can choose up to two Pauli operators ($\sigma_b$ and $\sigma_c$) that will act on it. You take the result of the previous matrix multiplication and do another matrix multiplication.

+ +

I can fill in more details, but it is starting to feel like I'm doing homework for you so let's see if you can follow what I've written and if you have follow-up questions in the comments I can modify my answer.

+",5518,,,,,10/6/2019 2:22,,,,1,,,,CC BY-SA 4.0 +8423,2,,8348,10/6/2019 2:42,,4,,"

When I visited the Google Hardware Lab, they were extremely secretive about everything. It is unlikely anyone will be able to answer this question except for the narrow range of Google Hardware Lab employees, and the ones I know are not very open about what Google is doing.

+ +

What I can do is answer what a different superconducting-qubit hardware company (D-Wave) does. When I did the D-Wave tour, I was shown a ""wafer"" which was an NxN array of 2000Q chips. So I was looking at $N\times N\times2048$ qubits. Each of these chips will have defects in random places. Some might have bad qubits only on an edge, some might have bad qubits in the middle, etc. Therefore, it is probably just good fortune that they published a paper where the bad qubit was in a convenient location. This hopefully answers your first question.

+ +

Next you ask if a bad qubit in the middle would make processing more difficult and I think the answer is yes, because middle qubits are connected to more qubits, so there's more potential gate operations which are affected.

+ +

If you want to know how many Sycamore processors are made at any given time, you'll probably need an answer from someone at the Google Hardware Lab, but D-Wave gets a new $N\times N$ array of 2000Q chips every week, where $N$ is about 10.

+ +

Are they fabricated on a wafer? D-Wave's ones are, and likely Google does the same. They are all making super-conducting qubits.

+ +

Do they pick-and-choose the Sycamore chip with the best performance? Probably the answer is ""yes"" because you say the bad qubit was on an edge, and the chances of that seem less likely than it being in the middle. Furthermore, it is unlikely that they had much motivation to choose a ""random"" chip or a ""bad"" chip rather than a ""good"" one. The company is interested in making profits, so I don't see the motivation to choose a more ""fair"" chip for a publication.

+",5518,,,,,10/6/2019 2:42,,,,1,,,,CC BY-SA 4.0 +8424,1,,,10/6/2019 12:24,,11,291,"

Are there quantum algorithms for Prolog (SLD resolution - unification and depth-first-search) or for automated theorem proving in general (negation, resolution, and SAT)?

+ +

Usually automated theorem proving involves SAT problem for the negation of the initial statement and there is some better (but no exceptionally better) algorithms for that, e.g. Do any quantum algorithms improve on classical SAT?. But maybe there are some new ideas, some holistic approaches that involve the parallel search available on quantum computers? Google is of no help (""automated theorem proving quantum algorithm"" no any result).

+",1326,,55,,9/23/2020 12:21,12/30/2021 15:58,Quantum algorithms for Prolog or automated theorem proving?,,1,1,,,,CC BY-SA 4.0 +8427,1,8565,,10/6/2019 21:20,,5,2390,"

I was skimming through the Google quantum supremacy paper but got stuck on this section:

+
+

For a given circuit, we collect the measured bit-strings $\{x_i\}$ and compute the linear XEB fidelity [24-26, 29], which is the mean of the simulated probabilities of the bit strings we measured:

+

$$\mathcal{F}_{\text{XEB}} = 2^n\langle P(x_i)\rangle - 1 \tag {1}$$

+

where $n$ is the number of qubits, $P(x_i)$ is the probability of bitstring $x_i$ computed for the ideal quantum circuit, and the average is over observed bitstrings. Intuitively, $\mathcal{F}_\text{XEB}$ is correlated with how often we sample high probability bitstrings. When there are no errors in the quantum circuit, sampling the probability distribution will produce $\mathcal{F}_\text{XEB} = 1$. On the other hand, sampling from the uniform distribution will give $\langle P(x_i)\rangle_i = 1/2^n$ and produce $\mathcal{F}_\text{XEB} = 0$. Values of $\mathcal{F}_{XEB}$ between $0$ and $1$ correspond to the probability that no error has occurred while running the circuit.

+
+

Questions:

+
    +
  1. If $\mathcal{F}_{XEB} = 1$ when $x_i$ are sampled from the correct distribution then $\left< P(x_i) \right>_i$ must be $2^{1-n}$ (for any quantum circuit). That seems to restrict the output probability distributions of all quantum circuits to rather high entropy distributions. This is not what I would have expected for any kind of computation. Is this correct?

    +
  2. +
  3. If $P(x_i)$ is the probability of bitstring $x_i$ computed for the ideal quantum circuit, then how can $\left< P(x_i) \right>_i$ equal $1/2^n$ when the bitstrings $x_i$ are sampled from the uniform distribution? This is the result we would see if $P(x_i)$ had been $1/2^n$ for all $x_i$ (i.e. the probability mass function for the uniform distribution), but it is explicitly stated that $P(x_i)$ is the probability of bitstring $x_i$ computed for the ideal quantum circuit. Intuitively it seems to me more reasonable to assume that $\left< P(x_i) \right>_i$ with $x_i$ sampled from the uniform distribution would be much closer to zero, because if $P(x_i)$ concentrates much of its probability mass to a relatively low number of bitstrings (as I would assume computation to do) then $P(x_i) = 0$ for almost all bitstrings from the uniform distribution.

    +
  4. +
  5. How can the value of $\mathcal{F}_{XEB}$ correspond to "the probability that no error has occurred while running the circuit"? This sounds so simple/simplistic to me that it's hard to believe.

    +
  6. +
+

UPDATE 2019-10-23: The article Quantum supremacy using a programmable superconducting processor has now been published in Nature, and the Supplementary Information is available there.

+

Having read section IV (XEB Theory) of the Supplemental Information I'd like to adjust my questions as follows:

+
    +
  1. Subsection C (Two limiting cases) derives this fact from the properties of probability distributions of the Porter-Thomas +shape. The derivation looks correct to me. The answer here seems to be that my intuition (that the output distribution would be relatively low entropy) was simply wrong.

    +
  2. +
  3. Subsection C also contains this passage: "[Suppose] bitstrings $q_i$ are sampled from the uniform distribution. In this case $P(q_i) = 1/D$ [where $D = 2^n$] for every i and $F_{XEB} = 0$." I see this as very problematic since the main text of the article makes the claim that "$P(x_i)$ is the probability of bitstring $x_i$ computed for the ideal quantum circuit". How can these two statements be reconciled?

    +
  4. +
  5. Subsection V (Quantifying errors) contains a lengthy discussion of this. I can't say I understand it in full, but I'll give it the benefit of a doubt for now.

    +
  6. +
+

So, in summary, my question is now: The main article states that "$P(x_i)$ is the probability of bitstring $x_i$ computed for the ideal quantum circuit". However, Supplementary Information section IV.C seems to argue that if the "qubits are in the maximally mixed state" (i.e. the quantum computer doesn't work) then "the estimator [$F_{XEB}$] yields zero fidelity" since $P(x_i) = 1/2^n$ for every $i$ in this case. But then, in this case, $P(x_i)$ is clearly the probability of sampling bitstring $x_i$ from the non-ideal empirical distribution. Isn't this a contradiction?

+

As I see it either $F_{XEB}$ is computed such that $P(x_i)$ is the probability of $x_i$ being sampled from the ideal quantum circuit, or it is computed such that $P(x_i)$ is the probability of $x_i$ being sampled from the empirical non-ideal distribution. It can't be both. Which is it?

+",8704,,-1,,6/18/2020 8:31,10/24/2019 14:23,Quantum Supremacy: Some questions on cross-entropy benchmarking,,3,2,,,,CC BY-SA 4.0 +8428,1,,,10/7/2019 4:02,,1,84,"

I was going through a paper in which protocol said that the party computes modulo 'd' sum of other party secrets directly. It was not mentioned that the computation is classical. Can I assume that it was done classically? Am I wrong?

+",8249,,26,,10/8/2019 21:41,10/8/2019 21:41,Can quantum computer perform classical computation?,,1,0,,10/8/2019 14:35,,CC BY-SA 4.0 +8429,2,,8428,10/7/2019 6:13,,1,,"

Yes, assume it's classical.

+ +

That is, unless the protocol requires you to start computing it on superpositions. In that case, you'd have to perform the calculation on a quantum computer, although you can still use the reversible version of the classical algorithm on that quantum computer (because quantum computers can implement any classical computation, you just have to embed it in a reversible form first).

+",1837,,,,,10/7/2019 6:13,,,,0,,,,CC BY-SA 4.0 +8430,2,,8427,10/7/2019 19:06,,2,,"

As an initial matter, I think the Supplementary Information (linked in some other answers on this sight) has a significant amount of discussion on $\mathcal{F}_{XEB}$.

+ +

However, as I understand it (misunderstandings are my own):

+ +
    +
  1. There is indeed a concentration of outputs from a random quantum circuit, away from a state wherein the square of the coefficients of each basis is $1/2^n$. It's clear that sampling from a random quantum circuit will never output a string $x_i$ when the amplitude $\alpha$ of $|x_i\rangle$ is $0$ - that is, if, after application of the quantum circuit, we have $\alpha|x_i\rangle$ and $\alpha=0$, then sampling will never output $x_i$. Instead, sampling from a state so produced leads to the ""Porter-Thomas"" distribution, about which I don't know much. That is, if you were to sample a string from a state generated from a random quantum circuit, and if you were to, then, calculate the squared amplitude of sampling said string from said quantum circuit, then the expected squared amplitude is $2/2^n$, and not $1/2^n$.

  2. +
  3. I think in the uniform distribution, $P(x_i)=1/2^n$ for all $x_i$, but if we get any string from the random quantum circuit, there's good odds that that string is more likely to be seen from the random quantum circuit than from the uniform distribution. For $i$ that are in the ""shadow"" of the speckle, you would never sample them. As I understand it, classical simulation does not generate all $2^{53}$ coefficients; instead, classical simulation looks at the string output of the random circuit and asks whether the squared coefficient of that basis is greater than $1/2^{53}$.

  4. +
  5. Upon review, I think that the average fidelity $\mathcal{F}_{XEB}$ of a sample of strings wherein there was at least one randomly-introduced single Pauli-error (bit-flip/phase-shift) is $0$. That is, if we were to sample a string from such a circuit that has a hidden Pauli-error somewhere within, and calculate the probability of obtaining that string with that circuit, the expected probability so calculated would be $1/2^n$. Thus, if we were to say that $\mathcal{F}_{XEB}=0.9$, I believe this means that 90% of the runs of the quantum circuit were totally error-free, while 10% had at least one error.

  6. +
+ +

At one of Martinis' presentations on Google's plans for quantum supremacy, an audience member asked about a quantum sampler beating the uniform distribution; Aaronson commented that generating an output away from the uniform distribution is necessary to establish quantum supremacy, regardless of whether it's sufficient.

+",2927,,2927,,10/13/2019 12:40,10/13/2019 12:40,,,,0,,,,CC BY-SA 4.0 +8431,1,,,10/8/2019 2:29,,5,1254,"

I know for instance I can derive a cccX gate using 2 Toffoli gates on 5 qubit wire or ccccX with 3 Toffoli gates and 7 qubits and so on. you will notice the depth is increasing as the number of control qubits increase, that is for every additional c, there are 2 additional qubits. Is there a better way I can derive these multiple controlled x gate using fewer resources (gates and qubits)?

+",8714,,26,,10/8/2019 21:31,7/28/2020 0:53,Is there a way to develop a multiple controlled X or Z gate on Qiskit without using ancillary qubits?,,1,0,,,,CC BY-SA 4.0 +8435,1,,,10/8/2019 16:33,,3,101,"

Say, we have a $\require{mhchem}\ce{^87Rb}$ atom having an electric dipole transition on the $D_{1}$ line and we have two hyperfine ground states, one on $F = 1$ and one on $F = 2$ level. So, we take two pair of states $|F=2, m=-2\rangle$ and $ |F=1, m = -1\rangle$ as the ground state. The details on this can be found here. I need to find time evolution of the probability of being in the initial state $$|\Psi(0)\rangle \equiv | 1, -1 \rangle \otimes | 0 \rangle_{\text{cav}}.$$

+ +

I don't understand how to define the initial state in QuTiP. I have gone through the paper 'QuTiP: An open-source Python framework for the dynamics of open quantum systems' by J.R. Johansson, P.D. Nation, Franco Nori. I have found few examples such as cavity in its ground state which coupled to a qubit in a balanced superposition of its ground and excited state $$|\Psi(0)\rangle=\left(|0\rangle_{c}|0\rangle_{q}+|0\rangle_{c}|1\rangle_{q}\right) / \sqrt{2}$$ and atom in excited state $$|\Psi(0)\rangle=\operatorname{tensor}(\text { fock }(\mathrm{N}, 0), \text { fock }(2,1)).$$ But I am still not able to understand how to define the initial state $|\Psi(0)\rangle \equiv | 1, -1 \rangle \otimes | 0 \rangle_{\text{cav}} $ in QuTiP.

+ +

Can anyone please help me understand this?

+",8716,,8716,,10/9/2019 9:52,10/9/2019 9:52,"How to define initial state $\rvert \Psi(0) \rangle \equiv \rvert 1, -1 \rangle \otimes \rvert 0 \rangle_{\text{cav}} $ of a system in QuTiP?",,0,3,,,,CC BY-SA 4.0 +8436,1,8438,,10/8/2019 21:52,,2,182,"

I am still confused when I am trying to use the IBM Q composer to reproduce some quantum circuits I found in different papers, and I am wondering if it is because there are two ways to represent a multi-qubit state in a quantum circuit.

+ +

The multi-qubit state $|xy\rangle$ can be represented in a quantum circuit by

+ +
    +
  1. putting the $|x\rangle$ qubit (left) on top, and the $|y\rangle$ one below, or by
  2. +
  3. putting the $|y\rangle$ qubit (right) on top, and the $|x\rangle$ one below.
  4. +
+ +

Is that correct?

+ +
    +
  1. The convention of putting on top of the circuit the qubit that is the furthest to the left on the state, is called big-endian, while
  2. +
  3. The convention of putting on top of the circuit the qubit that is the furthest to the right on the state, is called little-endian.
  4. +
+ +

Is that correct?

+ +

IBM Q composer is putting the on top of the circuit the qubit that is the furthest to the right on the state, meaning it is using the little-endian representation of multi-qubit states.

+ +

Is that correct?

+",4121,,26,,10/9/2019 6:30,10/9/2019 6:30,Is IBM Q composer using little-endian representation for multi-qubit states?,,1,1,,,,CC BY-SA 4.0 +8437,2,,6839,10/8/2019 23:51,,0,,"

Qiskit does have a density matrix class. See: +qiskit-terra/qiskit/quantum_info/states/densitymatrix.py

+ +

Also see here for some usage examples like initializing from a pure state, adding, subtracting, etc.

+",2503,,26,,10/9/2019 15:13,10/9/2019 15:13,,,,0,,,,CC BY-SA 4.0 +8438,2,,8436,10/9/2019 6:28,,1,,"

IBM Q Experience and Qiskit both use the little-endian format.

+ +
+

The multi-qubit state $|xy\rangle$ can be represented in a quantum + circuit by

+ +
    +
  1. putting the $|x\rangle$ qubit (left) on top, and the $|y\rangle$ one below, or by
  2. +
  3. putting the $|y\rangle$ qubit (right) on top, and the $|x\rangle$ one below.
  4. +
+ +

Is that correct?

+
+ +

Yes. The IBM Q Composer uses convention 1.

+ +
+
    +
  1. The convention of putting on top of the circuit the qubit that is the furthest to the left on the state, is called big-endian, + while
  2. +
  3. The convention of putting on top of the circuit the qubit that is the furthest to the right on the state, is called + little-endian.
  4. +
+ +

Is that correct?

+
+ +

Yes. The point being that the qubits are numbered starting from the top (i.e., q[0], q[1], q[2],...).

+ +
+

IBM Q composer is putting the on top of the circuit the qubit + that is the furthest to the right on the state, meaning it is + using the little-endian representation of multi-qubit states.

+ +

Is that correct?

+
+ +

Correct.

+",26,,,,,10/9/2019 6:28,,,,1,,,,CC BY-SA 4.0 +8439,2,,8416,10/9/2019 11:36,,6,,"

Upon some reflection, the answer is that no, they most definitely do not.

+ +

The easiest way to see this is to observe that there are $d^2-1$ orthogonal directions in the Bloch representation (i.e. orthogonal Hermitian traceless operators) containing pure states. This means that that the pure states are not contained in any linear subspace of dimension less than $d^2-1$, and thus in particular cannot be contained in any lower-dimensional hypersphere.

+ +

More specifically, given any orthogonal basis of Hermitian traceless operators $\{\boldsymbol\sigma_j\}_{j=1}^{d^2-1}$, and any versor $\hat{\mathbf n}\in\mathbb R^{d^2-1}$ with $\|\hat{\mathbf n}\|=1$, there are always pure states in the direction $\boldsymbol\sigma_{\hat{\mathbf n}}\equiv\hat{\mathbf n}\cdot\boldsymbol\sigma$ (this follows from the fact that the operator norm satisfies $\|\boldsymbol\sigma_{\hat{\mathbf n}}\|>0$ and the characterisation in spherical coordinates explained e.g. here). +It follows that there cannot be less than $d^2-1$ elements of $\mathbb R^{d^2-1}$ whose span contains the set of pure states.

+ +
+ +

A concrete example: three-level systems

+ +

Consider a generic pure state of a three-level system: +$$|\psi\rangle=\cos\alpha|0\rangle+e^{i\phi}\sin\alpha \cos\beta |1\rangle+e^{i\theta}\sin\alpha\sin\beta|2\rangle,$$ +for all $\alpha,\beta,\phi,\theta\in\mathbb R$. +Let us also use the standard operatorial basis for this space (the matrices used at the bottom of this answer):

+ +

$$ +Z^{(1)}=\sqrt{\frac{3}{2}}\begin{pmatrix}1 & 0&0 \\ 0 & -1&0\\0&0&0\end{pmatrix}, +\quad +Z^{(2)}=\sqrt{\frac{3}{6}}\begin{pmatrix}1 & 0&0 \\ 0 & 1&0\\0&0&-2\end{pmatrix}, +$$ +\begin{align} +X^{(12)}=\sqrt{\frac{3}{2}}\begin{pmatrix}0 & 1&0 \\ 1 & 0&0\\0&0&0\end{pmatrix}, +\quad +X^{(13)}=\sqrt{\frac{3}{2}}\begin{pmatrix}0 & 0&1 \\ 0 & 0&0\\1&0&0\end{pmatrix}, +\quad +X^{(23)}=\sqrt{\frac{3}{2}}\begin{pmatrix}0 & 0&0 \\ 0 & 0&1\\0&1&0\end{pmatrix} +\end{align} +\begin{align} +Y^{(12)}=\sqrt{\frac{3}{2}}\begin{pmatrix}0 & -i&0 \\ i & 0&0\\0&0&0\end{pmatrix}, +\quad +Y^{(13)}=\sqrt{\frac{3}{2}}\begin{pmatrix}0 & 0&-i \\ 0 & 0&0\\i&0&0\end{pmatrix}, +\quad +Y^{(23)}=\sqrt{\frac{3}{2}}\begin{pmatrix}0 & 0&0 \\ 0 & 0&-i\\0&i&0\end{pmatrix}. +\end{align} +Then, the surface covered by the pure states in $\mathbb R^8$ has the following parametrisation: +\begin{cases} +\langle Z^{(1)}\rangle&=\sqrt{3/2} (\cos^2\alpha-\sin^2\alpha\cos^2\beta),\\ +\langle Z^{(2)}\rangle&=\sqrt{3/6} [\cos^2\alpha+\sin^2\alpha(\cos^2\beta-2\sin^2\beta)],\\\hline +\langle X^{(12)}\rangle&=\sqrt{3/2}\sin(2\alpha)\cos\beta \cos\phi,\\ +\langle X^{(13)}\rangle&=\sqrt{3/2}\sin(2\alpha)\sin\beta \cos\theta,\\ +\langle X^{(23)}\rangle&=\sqrt{3/2}\sin^2(\alpha)\sin(2\beta) \cos(\phi-\theta),\\\hline +\langle Y^{(12)}\rangle&=\sqrt{3/2}\sin(2\alpha)\cos\beta \sin\phi,\\ +\langle Y^{(13)}\rangle&=\sqrt{3/2}\sin(2\alpha)\sin\beta \sin\theta,\\ +\langle Y^{(23)}\rangle&=\sqrt{3/2}\sin^2(\alpha)\sin(2\beta) \sin(\phi-\theta).\tag A +\end{cases}

+ +

To easily check that these points do indeed lie on a hypersphere (which we also know from this answer must have a radius of $\sqrt2$), just run the following snippet in Mathematica:

+ +
$Assumptions = Element[{\[Alpha], \[Beta], \[Theta], \[Phi]}, Reals];
+
+expvalZ1[\[Alpha]_, \[Beta]_, \[Phi]_:0, \[Theta]_:0] = Sqrt[3/2]*(Cos[\[Alpha]]^2 - Sin[\[Alpha]]^2*Cos[\[Beta]]^2); 
+expvalZ2[\[Alpha]_, \[Beta]_, \[Phi]_:0, \[Theta]_:0] = Sqrt[3/6]*(Cos[\[Alpha]]^2 + Sin[\[Alpha]]^2*(Cos[\[Beta]]^2 - 2*Sin[\[Beta]]^2)); 
+expvalX12[\[Alpha]_, \[Beta]_, \[Phi]_, \[Theta]_:0] = Sqrt[3/2]*Sin[2*\[Alpha]]*Cos[\[Beta]]*Cos[\[Phi]]; 
+expvalX13[\[Alpha]_, \[Beta]_, \[Phi]_:0, \[Theta]_] = Sqrt[3/2]*Sin[2*\[Alpha]]*Sin[\[Beta]]*Cos[\[Theta]]; 
+expvalX23[\[Alpha]_, \[Beta]_, \[Phi]_, \[Theta]_] = Sqrt[3/2]*Sin[\[Alpha]]^2*Sin[2*\[Beta]]*Cos[\[Phi] - \[Theta]]; 
+expvalY12[\[Alpha]_, \[Beta]_, \[Phi]_, \[Theta]_:0] = Sqrt[3/2]*Sin[2*\[Alpha]]*Cos[\[Beta]]*Sin[\[Phi]]; 
+expvalY13[\[Alpha]_, \[Beta]_, \[Phi]_:0, \[Theta]_] = Sqrt[3/2]*Sin[2*\[Alpha]]*Sin[\[Beta]]*Sin[\[Theta]]; 
+expvalY23[\[Alpha]_, \[Beta]_, \[Phi]_, \[Theta]_] = Sqrt[3/2]*Sin[\[Alpha]]^2*Sin[2*\[Beta]]*Sin[\[Phi] - \[Theta]];
+
+Simplify[Total[(#1[\[Alpha], \[Beta], \[Phi], \[Theta]]^2 & ) /@ {expvalZ1, expvalZ2, expvalX12, expvalX13, expvalX23, expvalY12, expvalY13, expvalY23}]]
+
+ +

Now, what sort of $4$-dimensional surface in $\mathbb R^8$ is this? +I don't know a full answer to this, but if it was a hypersphere, then the sections would look like lower-dimensional hyperspheres (e.g. plotting only in two dimensions should result in a series of circles). This is most definitely not the case.

+ +

Indeed, for completeness, here is what some of the sections look like (I will again use Mathematica for the plotting):

+ +

$Z^{(1)}, Z^{(2)}$ section

+ +

These coordinates only depend on the $\alpha,\beta$ parameters. It follows that the full space is contained in a sort of ""tubular region"" with the following triangular 2D section:

+ +
ParametricPlot[{expvalZ1[\[Alpha], \[Beta]], 
+  expvalZ2[\[Alpha], \[Beta]]}, {\[Alpha], 0, Pi}, {\[Beta], 0, Pi}]
+
+ +

+ +

So again, most definitely not what a hypersphere would look like.

+ +

Two-dimensional $X^{(ij)}$ sections

+ +

The two-dimensional sections obtained using two of the three available $X^{(ij)}$ coordinates look like ellipses when varying $\alpha,\beta$ for fixed $\theta,\phi$ (with the principal axes varying with $\theta,\phi$). Interestingly, if we instead vary $\theta,\phi$ for fixed $\alpha,\beta$, the sections look instead like rectangles. +I won't include the plots, but you can use the following code to show these sections:

+ +
Manipulate[
+ ParametricPlot[{expvalX12[\[Alpha], \[Beta], \[Theta], \[Phi]], 
+   expvalX13[\[Alpha], \[Beta], \[Theta], \[Phi]]}, {\[Alpha], 0, 
+   Pi}, {\[Beta], 0, Pi}, PerformanceGoal -> ""Quality"", 
+  PlotRange -> {{-2, 2}, {-2, 2}}],
+ {{\[Theta], 0}, 0, Pi, 0.01, Appearance -> ""Labeled""}, {{\[Phi], 0}, 
+  0, Pi, 0.01, Appearance -> ""Labeled""}]
+
+Manipulate[
+ ParametricPlot[{expvalX12[\[Alpha], \[Beta], \[Theta], \[Phi]], 
+   expvalX13[\[Alpha], \[Beta], \[Theta], \[Phi]]}, {\[Theta], 0, 
+   Pi}, {\[Phi], 0, Pi}, PerformanceGoal -> ""Quality"", 
+  PlotRange -> {{-2, 2}, {-2, 2}}],
+ {{\[Alpha], 0}, 0, Pi, 0.01, Appearance -> ""Labeled""}, {{\[Beta], 0},
+   0, Pi, 0.01, Appearance -> ""Labeled""}]
+
+ +

Three-dimensional $X^{(ij)}$ section

+ +

This is where it starts to look pretty cool.

+ +

If we vary $\alpha,\beta$ for $\theta,\phi$ fixed, we get this nice 3D shape (sorry for the poor quality, SE doesn't allow more than 2MB for images):

+ +
Manipulate[
+ ParametricPlot3D[{expvalX12[\[Alpha], \[Beta], \[Theta], \[Phi]], 
+   expvalX13[\[Alpha], \[Beta], \[Theta], \[Phi]], 
+   expvalX23[\[Alpha], \[Beta], \[Theta], \[Phi]]}, {\[Alpha], 0, 
+   Pi}, {\[Beta], 0, Pi}, PerformanceGoal -> ""Quality"", 
+  PlotRange -> Evaluate[{{-#, #}, {-#, #}, {-#, #}} &@Sqrt@2]],
+ {{\[Theta], 0}, 0, Pi, 0.01, Appearance -> ""Labeled""}, {{\[Phi], 0}, 
+  0, Pi, 0.01, Appearance -> ""Labeled""}, ControlPlacement -> Right]
+
+ +

+ +

Changing the values of $\phi,\theta$ mostly just changes the scales of the surface, without modifying its structure. +Here is a better quality, still picture of this surface:

+ +

+ +

The $Y^{(ij)}$ sections have pretty much the same structure, modulo changing the values of $\phi,\theta$.

+ +

So yea, in conclusion, definitely not a hypersphere.

+ +
+ +

PS: +For anyone that wants to see how the pure states move in the overall $8$-dimensional surface, you can use the following code to see the point corresponding to the given state in the $X,Y$ and $Z$ sections at the same time, changing the values of the $\alpha,\beta,\theta,\phi$ parameters (the blue dot represents the state for the given values of the parameters):

+ +
pointOnXSection[\[Alpha]_, \[Beta]_, \[Theta]_, \[Phi]_] := \
+{expvalX12[\[Alpha], \[Beta], \[Theta], \[Phi]], 
+   expvalX13[\[Alpha], \[Beta], \[Theta], \[Phi]], 
+   expvalX23[\[Alpha], \[Beta], \[Theta], \[Phi]]};
+pointOnYSection[\[Alpha]_, \[Beta]_, \[Theta]_, \[Phi]_] := \
+{expvalY12[\[Alpha], \[Beta], \[Theta], \[Phi]], 
+   expvalY13[\[Alpha], \[Beta], \[Theta], \[Phi]], 
+   expvalY23[\[Alpha], \[Beta], \[Theta], \[Phi]]};
+pointOnZSection[\[Alpha]_, \[Beta]_, \[Theta]_, \[Phi]_] := \
+{expvalZ1[\[Alpha], \[Beta], \[Theta], \[Phi]], 
+   expvalZ2[\[Alpha], \[Beta], \[Theta], \[Phi]]};
+Manipulate[
+ GraphicsRow[{
+   Show[
+    ParametricPlot3D[
+     pointOnXSection[\[Alpha], \[Beta], \[Theta], \[Phi]], {\[Alpha], 
+      0, Pi}, {\[Beta], 0, Pi}, PerformanceGoal -> ""Quality"", 
+     PlotRange -> Evaluate[{{-#, #}, {-#, #}, {-#, #}} &@Sqrt@2], 
+     AxesLabel -> {1, 2, 3}, ImageSize -> 400, 
+     PlotStyle -> Directive[Opacity@0.7], RotationAction -> ""Clip""],
+    Graphics3D[{Blue, PointSize@0.03, 
+      Point@pointOnXSection[dot\[Alpha], 
+        dot\[Beta], \[Theta], \[Phi]]}]
+    ],
+   Show[
+    ParametricPlot3D[
+     pointOnYSection[\[Alpha], \[Beta], \[Theta], \[Phi]], {\[Alpha], 
+      0, Pi}, {\[Beta], 0, Pi}, PerformanceGoal -> ""Quality"", 
+     PlotRange -> Evaluate[{{-#, #}, {-#, #}, {-#, #}} &@Sqrt@2], 
+     AxesLabel -> {1, 2, 3}, ImageSize -> 400, 
+     PlotStyle -> Directive[Opacity@0.7], RotationAction -> ""Clip""],
+    Graphics3D[{Blue, PointSize@0.03, 
+      Point@pointOnYSection[dot\[Alpha], 
+        dot\[Beta], \[Theta], \[Phi]]}]
+    ],
+   Show[
+    ParametricPlot[
+     pointOnZSection[\[Alpha], \[Beta], \[Theta], \[Phi]], {\[Alpha], 
+      0, Pi}, {\[Beta], 0, Pi}, PerformanceGoal -> ""Quality"", 
+     PlotRange -> Evaluate[{{-#, #}, {-#, #}} &@Sqrt@2], 
+     AxesLabel -> {1, 2, 3}, ImageSize -> 300, 
+     PlotStyle -> Directive[Opacity@0.7]],
+    Graphics[{Blue, PointSize@0.03, 
+      Point@pointOnZSection[dot\[Alpha], 
+        dot\[Beta], \[Theta], \[Phi]]}]
+    ]
+   }, ImageSize -> 800],
+ {{\[Theta], 0}, 0, Pi, 0.01, Appearance -> ""Labeled""}, {{\[Phi], 0}, 
+  0, Pi, 0.01, Appearance -> ""Labeled""},
+ {{dot\[Alpha], 0, ""\[Alpha]""}, 0, Pi, 0.01, 
+  Appearance -> ""Labeled""}, {{dot\[Beta], 0, ""\[Beta]""}, 0, Pi, 0.01, 
+  Appearance -> ""Labeled""},
+ ControlPlacement -> Right]
+
+",55,,55,,6/1/2020 17:58,6/1/2020 17:58,,,,4,,,,CC BY-SA 4.0 +8440,1,,,10/9/2019 13:19,,5,57,"

What was the first paper/who was the first person to phrase anyon theory in terms of tensor categories?

+ +

Going through Wilczek's book on fractional statistics, some of the reprinted papers anticipate such a formulation, but I am looking for the historically first paper(s) which seriously uses tensor category language.

+ +

Is it Kitaev?

+",8727,,26,,10/9/2019 13:33,10/9/2019 13:33,"History of anyon theory, braidings and tensor categories",,0,1,,,,CC BY-SA 4.0 +8441,1,,,10/9/2019 16:42,,9,3716,"

I think there can't be a computer running software without having a clock signal.

+

A fast classical computer has a clock rate between 4 to 5 GHz.

+

If quantum computers are so much faster they must have a clock rate which is a multiple of this.

+

Is this true?

+

Edit: +I started programming Q# and I think I now understand. (For those who want to know). +The quantum computer itself does not have a clock rate. +But because a quantum computer always has a classical computer connected to it, there is always the clock rate of the classical computer.

+",8661,,8661,,4/6/2021 15:28,4/6/2021 15:28,Does a quantum computer have a clock signal and if yes how big is it?,,4,3,,,,CC BY-SA 4.0 +8442,2,,8441,10/9/2019 17:34,,4,,"

There's no straightforward equivalent of the concept of clock rate in quantum computing. Quantum computers are supposed to produce algorithmic speedups only for very specific categories of problems. In simple words, quantum algorithms can be represented by quantum circuits which are basically a sequence of quantum gates. To give you an idea of how quantum gates are applied, I'll quote Peter Shor's answer:

+ +
+

Consider an ion trap. The ions represent qubits by using one electronic state as a $|0\rangle$ and another as a $|1 \rangle$. A quantum gate is performed by applying a $4 \times 4$ unitary matrix to two of these ions. This is done by shining a sequence of laser pulses on the ions. It's not a physical device into which two ions are input, in which they interact, and out of which the ions come with their states changed.

+
+ +

Such laser pulses are applied at certain intervals of time. You might consider that rate to be a clock cycle rate of some sort. However, you can't immediately map it to a classical notion of ""how many instructions are performed per clock cycle?"", as quantum instructions (i.e., the state evolution of qubits induced by a single layer of simple quantum gates) can't directly be compared to classical instructions (e.g., bit shifting). So, your statement: ""If quantum computers are so much faster they must have a clock rate which is a multiple of this."" isn't quite right. In some sense, they might even have lower clock rates (say, 100 MHz) but perform a greater number of effective (classical) instructions per clock cycle (i.e., per contemporary set of laser pulses). Note that this notion of clock cycle rate will be lower bounded by the decoherence times of the qubits.

+ +

More importantly, even here, just like in classical computing, the clock cycle rate isn't the only factor determining the performance. Furthermore, it wouldn't make sense to compare the clock cycle rates of different architectures, say ion trap quantum computers with superconducting quantum computers.

+",26,,26,,10/9/2019 17:51,10/9/2019 17:51,,,,8,,,,CC BY-SA 4.0 +8443,2,,8441,10/9/2019 17:43,,6,,"

Quantum computing does not promise computational speed-ups due to faster clock rates. +Rather, the speed-ups are algorithmic. This means that, to achieve the same task (for suitable tasks that allow for this speed-up), quantum computers would need a smaller number of operations to produce an answer. +These speed-ups exist even if each ""single operation"" takes the same time in a quantum computer as it does classically.

+",55,,55,,10/9/2019 18:33,10/9/2019 18:33,,,,0,,,,CC BY-SA 4.0 +8444,1,8478,,10/9/2019 20:10,,4,724,"

I am new to quantum computing and I am having trouble understanding the notation used for input/output qubits in quantum gates. I will use the CNOT gate as an example.

+ +

In several (most) references I've seen, the CNOT operation is defined as follows:

+ +

CNOT: $$|x⟩|y⟩ \to |x⟩|x \oplus y\rangle,$$

+ +

with the following circuit representation: +

+ +

This input/output qubit notation seems to work well when the CNOT is being used in classical reversible computation, or when $|x\rangle$ and $|y\rangle$ are strictly qubits in the standard basis that are not in superposition:

+ +

$$|00\rangle \to |00\rangle$$

+ +

$$|01\rangle \to |01\rangle$$

+ +

$$|10\rangle \to |11\rangle$$

+ +

$$|11\rangle \to |10\rangle$$

+ +

So, as described by the definition/circuit:

+ +

The first qubit remains unchanged: $|x\rangle \to |x\rangle$.

+ +

The second qubit flips when the first qubit is equal to 1: $$|y⟩ \to |x\oplus y⟩.$$

+ +

Now, if the input qubits $|x\rangle$ and $|y\rangle$ do not strictly align with the standard basis, the input/output notation seems rather strange to me (actually, extremely confusing to be honest). For instance, if $|x⟩$ and $|y\rangle$ are qubits aligned with the Hadamard basis as follows:

+ +

$$|x\rangle = |+\rangle = \frac{1}{\sqrt2} (|0\rangle + |1\rangle)$$

+ +

$$|y\rangle = |-\rangle = \frac{1}{\sqrt 2} (|0\rangle - |1\rangle)$$

+ +

Then the CNOT operation will result in:

+ +

$$|+-\rangle \to |--\rangle$$

+ +

This means that $|x\rangle$ changed from $|+\rangle$ to $|-\rangle$, when the notation seems to say it should have stayed the same.

+ +

Furthermore, if the output bits end up entangled, then my output result can't really be represented as $|x⟩|x \oplus y\rangle = |x\rangle \otimes |x \oplus y\rangle$ because I can't describe that final state as two separate qubits.

+ +

So, my question(s) is (are):

+ +
    +
  1. Am I supposed to know that the input $|x\rangle$ and output $|x\rangle$ do not have to be the same in value or even an independent value in the case when it's entangled?
  2. +
  3. Is this notation is only valid for when $|x\rangle$ and $|y\rangle$ are orthonormal qubits in the standard basis?
  4. +
  5. Is this just poor notation in general and I should try to avoid it?
  6. +
  7. If so, why is it so common across quantum computing references, and is there a better way to express this?
  8. +
+",8731,,2927,,10/9/2019 20:56,10/14/2019 21:18,Input and output qubit notation in quantum gates,,2,0,,,,CC BY-SA 4.0 +8445,2,,8444,10/9/2019 20:55,,2,,"

Initially $|x\rangle|x\oplus y\rangle$ is a perfectly valid state. The first qubit is in $|x\rangle$ and the second qubit is in $|x\oplus y\rangle$ - that is, the second qubit is entangled with the first qubit. As you study other algorithms you might grok that we can have a state $|x\rangle|f(x)\rangle$ for some function $f(x)$ - the first register might be a number of qubits and the second register might also be a number of qubits.

+ +

As to the nature of your question, by ""aligning the qubits in the Hadamard basis"" you are implicitly putting a Hadamard gate in front of both registers. The gate-level notation would have to be adjusted to include the $H$ gate in front of each qubit, and then the $\mathrm{CNOT}$ gate between the first and second qubits. Does that help in understanding? The standard basis is also called the ""computational basis,"" perhaps for a reason.

+ +

The Dirac bra-ket notation has some intuitive challenges but it should be learned to be able to speak a common language with others. Based on the effort you put into your question it seems like you do understand it. The Dirac notation makes learning about inner- and outer-products that much easier.

+",2927,,26,,10/9/2019 20:57,10/9/2019 20:57,,,,5,,,,CC BY-SA 4.0 +8446,1,8448,,10/9/2019 21:23,,2,120,"

I cobbled together a few programs with Qiskit several months back which worked fine on both the BasicAer simulators and the actual IBMQ computers. However, when I tried to revisit them recently, executing on the actual quantum computers ran into issues because no computers would appear in IBMQ.backends(). After testing, it seems that while I can save an account (and I have successfully overwritten my old accounts with a new API key), loading accounts runs into an issue and throws the following error:

+ +
+

""ConnectionError: Couldn't connect to IBMQ server: error during login: License required. You need to accept the License from Web Platform. https://quantumexperience.ng.bluemix.net""

+
+ +

However, the link redirects me to the new website and I've accepted the most recent license agreement there. The closest answer I've found seems to indicate that I need to manually input a new URL, but it doesn't actually provide what that URL is. Instead it suggests copying it from a button that I can't find at the linked page.

+ +

If I'm barking up the wrong tree with the solution to my error, I'd love if someone could set me straight. If I'm on the right track, where in the world do I find the new URL?

+",8734,,,,,10/9/2019 22:58,"When I load a saved account, I get a license-agreement error (links to old website)",,1,0,,,,CC BY-SA 4.0 +8447,1,,,10/9/2019 22:15,,5,994,"

We know that the Pauli matrices are:

+ +

$$\sigma_x = \begin{bmatrix}0 & 1 \\ 1 & 0\end{bmatrix}, \sigma_y = \begin{bmatrix}0 & -i \\ i & 0\end{bmatrix}, \sigma_z = \begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix}$$

+ +

I was wondering what would these matrices would represent in the physical world. I know that they can measure quantum state and get certain results. Would I be wrong if I assume that $\sigma_x$ measures the Diagonal polarization of a photon or $\sigma_z$ represents the measurement of vertical/horizontal polarization of a photon?

+",2403,,,,,11/17/2021 5:08,Physical Interpretation of Pauli Matrices as Polarization Check,,2,0,,,,CC BY-SA 4.0 +8448,2,,8446,10/9/2019 22:58,,1,,"

If you have defintely accepted the license agreement then the case is usually the credentials haven't updated locally. Try generating a new API token on the website and then run :

+ +
IBMQ.delete_account()
+IBMQ.save_account(APITOKEN, overwrite=True)
+IBMQ.load_account()
+
+ +

This should clear up anything that could possibly still be around linked to your old credentials and replace it with credentials to point to the new API.

+",5955,,,,,10/9/2019 22:58,,,,6,,,,CC BY-SA 4.0 +8449,2,,8447,10/9/2019 23:57,,1,,"

I see the heart of your question. I'd like to clarify a bit, before answering your question though. Matrices (aka operators) do not measure quantum states--they operate on them. Specifically, they project the state into the matrix's eigenvectors. We can then measure that projected state in a particular basis that may be the same or different than what the quantum state was projected into. But, those are technical details...

+ +

A photon does not quite capture the whole picture. Let's see why not.

+ +

If you were to use photon polarization to ''visualize'' the Pauli matrices, $\sigma_z$ would represent the up and down possibilities and basis while $\sigma_x$ would be right and left. It gets a little tricky with $\sigma_y$ because we need a third dimension for polarization. As gIS pointed out, circular polarization can be paired with $\sigma_y$. Specifically, the right- and left-handed circular polarizations would be paired with $\sigma_y$.

+ +

A very standard way to ''visualize'' the Pauli matrices is with the Bloch sphere. It's a unit sphere with a vector pointing from the center to a point on the sphere. The z-axis of the sphere is paired with $\sigma_z$; the x-axis is paired with $\sigma_x$; and, the y-axis is paired with $\sigma_y$. This video from IBM can explain it better it a bit further and gives some nice images of the Bloch sphere.

+",8420,,8420,,10/10/2019 13:33,10/10/2019 13:33,,,,2,,,,CC BY-SA 4.0 +8450,2,,6325,10/10/2019 3:39,,1,,"

Grover's algorithm is a (quantum-)circuit-SAT solver. I suppose it could also be a literal black box solver, but it would only work with black boxes that don't decohere your entangled input state, and I'm having trouble believing that such things exist.

+ +

I don't know why Grover or anyone else ever called it a database search algorithm. You can of course give it a circuit that implements a set membership test, with some of the inputs hardwired to the key you're looking up and the rest representing the output value, and call it a database search. But you could do the same thing with a classical SAT solver and no one calls them database search algorithms to my knowledge. And for Grover (or classical SAT solvers) to be competitive on this type of problem, the ""database"" has to be fundamentally unindexable, which means it's too large to be indexable, which means it isn't actually stored anywhere, which makes it in my opinion not a database (and not data).

+ +

Finding an efficient circuit implementing a given function is an important and interesting problem, but it's also incredibly broad; it includes much of what's called computer science. I don't see what can be said about it in the context of Grover's algorithm that wouldn't apply equally in any other context. Grover's algorithm just takes an optimized circuit once you've found it and evaluates it about √N times. The circuit does need to be reversible, making it somewhat different from the usual classical circuits, but that's still not directly related to Grover.

+ +

In summary, I think that people don't talk about finding the oracle circuit because it's not actually related to the quantum algorithm (despite Grover's paper's title) and because it's such a complex and far-reaching topic that no treatment could do it justice anyway.

+",3030,,,,,10/10/2019 3:39,,,,0,,,,CC BY-SA 4.0 +8451,2,,6325,10/10/2019 7:03,,5,,"

Grover's algorithm does not have an advantage when searching an unordered database, because encoding the oracle into a circuit requires $\tilde \Omega(n)$ operations. You can prove this with a simple circuit counting argument. If the circuit had size $O(n^{0.99})$ then there would be fewer distinct circuits than distinct oracles. So the actual operational complexity is $\tilde \Omega(n^{1.5})$, even though the query complexity is $O(n^{0.5})$.

+ +

Grover's algorithm only has an advantage when the thing you are searching over is abstract, like possible solutions to a SAT problem, as opposed to literally stored in hardware somewhere, like a database.

+",119,,,,,10/10/2019 7:03,,,,5,,,,CC BY-SA 4.0 +8452,1,,,10/10/2019 8:08,,4,121,"

In almost all research on (universal) quantum computation the common models assumed from the outset are either the quantum circuit model with unitary gates, the measurement-based one-way model or the adiabatic model - all of which are (polynomially) equivalent in computational power and employ the idealization of pure states.

+ +

But as an alternative, one can consider quantum computation models based on mixed states and general superoperators (quantum operations/channels given by CPTP maps, not necessarily unitary) as gates. This possibility had for example been studied by Tarasov around 2000. Of course any mixed state can be purified in a larger state space (additional qubits) and any CPTP map obtained via a unitary acting on the larger space by tracing out these ancilla qubits, but the generalized view might have its own merits for scalable quantum information processing due to the present obstacles with decoherence/noise for the standard (unitary) approaches.

+ +

Theoretical considerations based on “open quantum computation” might lead to new quantum algorithms or insights into other physical implementations. Why is most of science and industry focused on the strict model with unitary gates and delicate pure states - while the obvious alternative seems to be entirely neglected? Does the problem with the second approach merely boil down to insufficient control over non-unitary gates or am I missing something more fundamental?

+ +
+ +

Cross-posted on physics.SE

+",7802,,55,,10/12/2019 18:52,10/13/2019 5:47,Why do quantum computation models based on open quantum systems receive so little attention?,,1,3,,,,CC BY-SA 4.0 +8454,1,,,10/10/2019 12:22,,4,459,"

I would like to prepare an initial state for variational quantum algorithms.

+ +

The initial state should include the following states: $|000\rangle, |010\rangle, |100\rangle$, and $|001\rangle$.

+ +

How can I prepare this initial state?

+ +

FYI, I referred to this paper. +In this paper, the circuit creates $|100\rangle$, $|101\rangle$, and $|001\rangle$.

+ +

In addition, the Hamiltonian I want to solve is +$$ +H = - \frac{1}{2} \varepsilon \sum_{i=1}^{N} Z_i + \frac{1}{4} V \sum_{i,j=1}^N(X_iXj - Y_iY_j) \;,$$ +where $\varepsilon$ and $V$ is the coefficients and $N$ is the number of quits.

+",8673,,26,,10/10/2019 13:37,10/10/2019 18:09,How to prepare an initial state for variational quantum algorithms?,,1,0,,,,CC BY-SA 4.0 +8455,2,,8390,10/10/2019 16:43,,2,,"

In principle, yes, you can always do it. The Bloch representation can be generalised to arbitrary dimensions, and you can always parametrise states in it by their ""angle coordinates"".

+ +

For example, you can write an arbitrary 3-modes pure state as +$$|\psi\rangle=\cos\alpha|0\rangle + e^{i\theta}\sin\alpha\cos\beta|1\rangle+e^{i\phi}\sin\alpha\sin\beta|2\rangle,$$ +for $\alpha,\beta,\theta,\phi\in\mathbb R$.

+ +

It should be noted, however, that things get much with spaces of dimension larger than $2$. For example, it's harder to interpret arbitrary unitary gates as rotations in this larger space. By this, I mean that even if it is always true that for any given unitary $U$ there is some (and in general an infinity of) Hermitians $H$ such that $e^{-iHt}=U$ at some time $t$, whether these should be considered ""rotations"" is arguable.

+ +

On the one hand, if you represent $H$ as a point in the Bloch representation (you can always do this because the Bloch representation associates a point to any Hermitian matrix, even though this point will in general fall outside of the region representing the set of physical states), then you can think of $H$ as the ""axis"" of the rotation, as the direction associated with this point will be fixed by the rotation.

+ +

On the other hand, in general $t\mapsto e^{-iHt}$ is not a rotation, in the sense that it doesn't ""loop back"" as rotations do in the Bloch sphere. By this I mean that in general there is no $t>0$ such that $e^{-iHt}=I$, which is what you would expect from a rotation. An easy example of this is: +$$H\equiv \begin{pmatrix}\alpha&0&0\\0&\beta&0\\0&0&\gamma\end{pmatrix},\quad\alpha,\beta,\gamma\in\mathbb R.$$ +Then, $e^{-iHt}=\mathrm{diag}(e^{-i\alpha t},e^{-i\beta t},e^{-i\gamma t})$, and $e^{-iH t}=I$ if and only if $e^{-i\alpha t}=e^{-i\beta t}=e^{-i\gamma t}=1$, which aren't simultaneously satisfiable for incommensurable $\alpha,\beta,\gamma$.

+",55,,,,,10/10/2019 16:43,,,,0,,,,CC BY-SA 4.0 +8456,2,,8454,10/10/2019 18:09,,3,,"

To prepare this state specifically, start with $|000\rangle$ and apply H to the 0th and 1st qubits, yielding

+ +

$$ \frac{1}{4} (|000\rangle + |010\rangle + |100\rangle + |110\rangle) $$

+ +

Then, we can apply the Toffoli gate to the 0th and 1st qubit with the 2nd qubit as the target, yielding:

+ +

$$ \frac{1}{4} (|000\rangle + |010\rangle + |100\rangle + |111\rangle) $$

+ +

Now, apply a CNOT with 2nd qubit as control and 0th and 1st qubits as targets, yielding:

+ +

$$ \frac{1}{4} (|000\rangle + |010\rangle + |100\rangle + |001\rangle) $$

+ +

As desired.

+ +
+ +

More talk on state prep

+ +

Because your Hamiltonian is relatively simple, both Trotterization and Variational Quantum Eigensolvers (VQEs) could work. I'll refer to the VQE, because it talks more about quantum state prep, specifically:

+ +
+

If a quantum state is characterized by an exponentially + large number of parameters, it cannot be prepared with + a polynomial number of operations. The set of efficiently + preparable states are therefore characterized by polynomially many parameters, and we choose a particular set + of ansatz states of this type.

+
+ +

Basically, especially for quantum chem algorithms with complex ansatzes, we need efficient state preparation algorithms that are parametrized with a polynomial number of parameters. This is still an active area of research and especially important for Trotterization/VQEs/Qubitization, etc.

+",8343,,,,,10/10/2019 18:09,,,,5,,,,CC BY-SA 4.0 +8457,2,,8441,10/10/2019 20:59,,1,,"

Quantum computers can be seen as ""quantum accelerators"" attached to a classical computer.

+ +

The application of quantum gates is a problem of sending signals to the quantum device/accelerator.

+ +

The classical aspect of signal sending is clocked by the classical computer. The speed of the quantum machine is determined:

+ +
    +
  • relatively: to the worst case complexity of executing the algorithm on the classical machine instead of the quantum one (imagine using a CPU instead of the quantum accelerator)

  • +
  • exactly: time needed to run the algorithm on the quantum accelerator

  • +
+ +

The latter depends on the ""gate times"" of the accelerator.

+ +

Therefore, a quantum computer is clocked in multiple ways:

+ +
    +
  • by the clock of the classical one controlling the quantum accelerator

  • +
  • by the unit of time needed to apply the quantum gate on the accelerator

  • +
+ +

However, the clock speed does not play a significant role to why quantum machines seem for particular algorithms more powerful.

+",8592,,,,,10/10/2019 20:59,,,,0,,,,CC BY-SA 4.0 +8458,1,9601,,10/10/2019 21:05,,3,190,"

IBM announced a 53 qubit chip.

+ +

Will the advertised chip be available for non-paying users, or only to IBM clients?

+",8592,,,,,1/20/2020 17:13,IBM 53 qubit cloud access,,3,0,,,,CC BY-SA 4.0 +8459,2,,8458,10/11/2019 1:27,,1,,"

I'm not sure if official information has been released yet, though it will likely have a mix of research and industry applications, considering IBM's previous policies (research, industry)

+",8343,,,,,10/11/2019 1:27,,,,0,,,,CC BY-SA 4.0 +8460,1,,,10/11/2019 4:14,,1,112,"

I used the following code. Can anyone say what that error is about?

+ + + +
from qiskit.aqua.circuits.gates import mct
+q = QuantumRegister(32)
+c = ClassicalRegister(11)
+qc = QuantumCircuit(q,c)
+ite = 5 #number of iteration
+
+#initialization
+qc.h(q[0:11])
+qc.x(q[22])
+qc.h(q[22])
+qc.barrier()
+
+for i in range(ite):
+#oracle part
+    ccheck(0,1,11)
+    ccheck(0,2,12)
+    ccheck(0,3,13)
+    ccheck(0,4,14)
+    ccheck(0,5,15)
+    ccheck(0,6,16)
+    ccheck(0,7,17)
+    ccheck(0,8,18)
+    ccheck(0,9,19)
+    ccheck(0,10,20)
+    qc.mct([q[11],q[12],q[13], q[14],q[15],q[16], q[17],q[18],q[19], q[20]], q[29] , [q[21], q[22], q[23], q[24], q[25], q[26], q[27], q[28]], mode='basic') 
+    iccheck(0,10,20)
+    iccheck(0,9,19)
+    iccheck(0,8,18)
+    iccheck(0,7,17)
+    iccheck(0,6,16)
+    iccheck(0,5,15)
+    iccheck(0,4,14)
+    iccheck(0,3,13)
+    iccheck(0,2,12)
+    iccheck(0,1,11)
+    qc.barrier()
+#diffusion part
+    qc.h(q[0:11])
+    qc.barrier()
+    qc.x(q[0:11])
+    qc.barrier()
+    qc.h(q[10])
+    qc.mct([q[0],q[1],q[2], q[3],q[4],q[5], q[6],q[7],q[8], q[9]], q[10] , [q[21], q[22], q[23], q[24], q[25], q[26], q[27], q[28]], mode='basic')
+    qc.h(q[10])
+    qc.barrier()
+    qc.x(q[0:11])
+    qc.barrier()
+    qc.h(q[0:11])
+    qc.barrier()
+
+qc.measure(q[0:11], c[0:11])
+
+backend = Aer.get_backend('qasm_simulator')
+job = execute(qc, backend, shots=10000)
+result = job.result()
+count =result.get_counts()
+print(count)
+qc.draw(output='mpl')
+
+```
+
+",8330,,26,,10/11/2019 4:58,10/11/2019 4:58,'ERROR: QasmSimulator: Circuit cannot be run using available methods.',,0,9,,,,CC BY-SA 4.0 +8462,1,8465,,10/11/2019 19:40,,7,936,"

The Multiple-Control Toffoli (mct) gate takes as input: + 1. a register containing the control qubits, + 2. the target qubits and + 3. a register containing ancilla qubits.

+ +

I don't know how many ancilla qubits I need to pass in for a number of $n$ controll qubits. +I've seen examples and used mct gates with 4 control qubits and 2 ancillas so I know the number of ancillas is not $n-1$ like suggested in this answer

+ +

Is there a strict dependency meaning for 10 control qubits you need 5 ancillas or does the implementation adapt to the number or ancillas that are passed in?

+",7759,,,,,6/22/2021 14:04,How many ancilla qubits to use with Multiple-Control Toffoli (mct) gate in Qiskit?,,2,0,,,,CC BY-SA 4.0 +8463,1,8637,,10/11/2019 20:59,,7,263,"

In the answer to this question about random circuits, James Wootton states:

+ +
+

One way to see how well we [fully explore the Hilbert space] is to focus on just randomly producing $n$ qubit states. These should be picked uniformly from all possible states, and not be biased towards the tiny set of states that it is easy for us to produce or write down. This can be done by running a random circuits of sufficient circuit depth. The number of gates for this thought to be efficient (i.e. polynomial in $n$), though I'm not sure if this is proven or is just a widely held conjecture. (Emphasis added).

+
+ +

The Google Sycamore team ran a cycle of $m=20$ repetitions of random single- and 2-qubit gates on $n=53$ qubits.

+ +

Can there be a claim that Sycamore was able to prepare a state drawn uniformly at random from the Hilbert space of dimension $2^{53}$? That is, with the gate sets of Sycamore, are we getting far enough away from the $|000\cdots 0\rangle$ initial state to be uniformly random?

+ +

Certainly a simple counting argument is sufficient to show that there are many states in the Hilbert space that would never be achieved, or are even $\epsilon$-close to being acheived, by only $20$ repetitions of the Sycamore gate-set; however, can we say that the states that could be achieved by $20$ such repetitions are uniformly distributed within the Hilbert space?

+ +

I suspect the answer is most assuredly ""yes"", the Sycamore repetition is sufficient to uniformly explore the entirety of the Hilbert space, much as only $7$ dovetail shuffles are sufficient to randomly shuffle a deck of cards. However, in the setting of a Hilbert space, can this conjecture be placed on any theoretical footing?

+ +

Note that I think this question is independent of the claim of supremacy. Even if the circuit wasn't deep enough to fully and uniformly explore all corners of the Hilbert space, it may be difficult/impossible for a classical computer to compute any such state produced by Sycamore.

+",2927,,2927,,10/12/2019 14:19,10/31/2019 23:59,Are 20 repetitions of Sycamore's one- and 2-qubit gates sufficient to produce a uniformly random state?,,1,1,,,,CC BY-SA 4.0 +8464,2,,8447,10/12/2019 11:23,,2,,"

Your understanding is correct.

+

In the theory of photon polarization, the parametrization of the Bloch sphere (or its surface) has traditionally another name. On the wikipedia page for the Jones calculus (the parametrization of the Bloch sphere surface), you'll find a table for the correspondence between kets and polarizations.

+

To summarize, eigenstates of the Pauli matrix $\sigma_Z$ can be seen as the horizontal and vertical polarizations (commonly written as $|H\rangle$ and $|V\rangle$), +eigenstates of $\sigma_X$ correspond to diagonal and anti-diagonal polarizations, and eigenstates of $\sigma_Y$ correspond to the left and right-handed polarizations of light.

+

Thus a measurement corresponding to $\sigma_X$ can be seen as putting a beam splitter in front of the light path, that splits the light into the horizontal and vertical polarization components. (You can also put a polarization filter, but as such filter measurements are destructive, the post-measurement will be different. And because of that, destructive measurements technically don't quite correspond to the Pauli's. Do it with beam splitters instead of filters, and the analogy is fine again.)

+

Of course, you can always choose a different basis (by a unitary transformation). Just make sure that choice made gives the correct commutation relations between the Pauli matrices.

+

PS: A similar concept to the Jones vector, but which also covers the interior of the Bloch Ball, are the so-called Stokes parameters.

+",2192,,18853,,11/17/2021 5:08,11/17/2021 5:08,,,,0,,,,CC BY-SA 4.0 +8465,2,,8462,10/12/2019 14:33,,4,,"

I found out the number of ancillas is minimum $n-2$.

+ +

I found this line in the Qiskit source code of mct:

+ +
if len(ancillary_qubits) < len(control_qubits) - 2:
+    raise AquaError('Insufficient number of ancillary qubits.')
+
+",7759,,,,,10/12/2019 14:33,,,,2,,,,CC BY-SA 4.0 +8466,2,,2603,10/12/2019 22:53,,3,,"

Thinking about the theoretical capabilities of quantum computers has led to important insights on the theory of classical computers.

+ +

One example is the proof that the (classical) complexity class PP is closed under intersection. While there was already a purely classical proof due to Beigel, Reingold, and Spielman, there exists a simpler proof that uses concepts from quantum computing.

+ +

A more impressive example is the classical recommendation algorithms (1, 2, 3) discovered by Ewin Tang and collaborators, which were inspired by the quantum Kerendis-Prakash algorithm. These algorithms were genuinely new, and might not have been discovered without the inspiration of the quantum algorithm.

+",551,,,,,10/12/2019 22:53,,,,0,,,,CC BY-SA 4.0 +8467,2,,8452,10/12/2019 23:02,,1,,"

I know this isn't really what you're thinking of with your question, but measurement-based quantum computing is pretty well studied. Under the many-worlds interpretation, the system counts as open for that protocol, because every time you perform a measurement you're becoming entangled with the system.

+",551,,551,,10/13/2019 5:47,10/13/2019 5:47,,,,2,,,,CC BY-SA 4.0 +8468,1,8471,,10/13/2019 1:15,,9,499,"

Say we had a Hadamard-like gate with the -1 in the first entry instead of the last. Let's call it $H^1$.

+ +

$$H = \begin{bmatrix}1&1\\1&-1\end{bmatrix}$$

+ +

$$H^1 = \begin{bmatrix}-1&1\\1&1\end{bmatrix}$$

+ +

From my maths it's a unitary matrix, so it's a valid quantum gate that does the following:

+ +

$$H^1|0\rangle = \left(\frac{-|0\rangle+|1\rangle}{\sqrt{2}}\right)$$

+ +

$$H^1|1\rangle = \left(\frac{|0\rangle+|1\rangle}{\sqrt{2}}\right)$$

+ +

These are similar to the true Hadamard gate, but with the sign flipped on the $|0\rangle$ instead of the $|1\rangle$.

+ +

Was the choice of the Hadamard as we know it an arbitrary decision like the right hand rule? Or is there a mathematical or historical reason for it?

+",8520,,26,,10/14/2019 4:20,10/14/2019 4:20,Could the Hadamard gate have been constructed differently with similar characteristics?,,2,0,,,,CC BY-SA 4.0 +8469,1,8470,,10/13/2019 2:41,,4,405,"

$\def\braket#1#2{\langle#1|#2\rangle}\def\bra#1{\langle#1|}\def\ket#1{|#1\rangle}$ +When using Grover's algorithm to invert a function $f\colon \{0,1\}^m \rightarrow \{0,1\}$, an ancilla bit is used in order to ""flip the sign"" of basis vectors $\ket{i_0}$ such that $f(i_0) = 1$. In many expositions that I've seen, the ancilla bit is omitted afterwards because we don't touch it again. I'm wondering why we are able to do this.

+ +

In particular, in [BBHT96], they say that the action of a single Grover iteration (assuming a single satisfying assignment) is to map

+ +

$$k\ket{i_0}+l\sum_{i \neq i_0} \ket{i}$$ +to +$$\left(\frac{N-2}{N}k+\frac{2(N-1)}{2}l\right)\ket{i_0} + \left(\frac{N-2}{N}l-\frac{2}{N}k\right)\sum_{i \neq i_0} \ket{i} $$

+ +

However, I'm wondering why it isn't actually a map to

+ +

$$\left(\frac{N-2}{N}k\ket{1}+\frac{2(N-1)}{2}l\ket{0}\right)\ket{i_0} + \left(\frac{N-2}{N}l\ket{0}-\frac{2}{N}k\ket{1}\right)\sum_{i \neq i_0} \ket{i}$$

+ +

which I think is what we get if we keep track of the ancilla qubit rather than forgetting about it. Note that these are both normalized states.

+ +

The reason that I think this ought to matter is that if we measure the state after a Grover iteration, the probability of observing $\ket{i_0}$ would, if I understand partial measurements correctly, be

+ +

$$\left(\frac{N-2}{N}k\right)^2 + \left(\frac{2(N-1)}{2}l\right)^2$$

+ +

rather than what they have, which is

+ +

$$\left(\frac{N-2}{N}k+\frac{2(N-1)}{2}l\right)^2.$$

+ +

I assume something I've written above is wrong, but I'm not sure what. Why are we able to forget about this bit in general? Why do we even expect this to yield a normalized state - I know it does here, but why ought it?

+",8758,,55,,1/3/2021 11:09,1/3/2021 11:09,Why can we forget about the ancilla bit in Grover's algorithm?,,1,0,,,,CC BY-SA 4.0 +8470,2,,8469,10/13/2019 2:53,,5,,"

$\def\braket#1#2{\langle#1|#2\rangle}\def\bra#1{\langle#1|}\def\ket#1{|#1\rangle}$ +I was being silly :)

+ +

The sign change that happens is in some sense either associated with the $\ket{a}$ or with the ancilla qubit. By taking the ancilla qubit to be (say) $\left(\frac{\ket{0}-\ket{1}}{\sqrt{2}}\right)$, upon XORing with $f(x)$ we get a sign change that we can stick onto the state qubits and leave the oracle qubits untouched. More formally,

+ +

$$\ket{a}\left(\frac{\ket{0}-\ket{1}}{\sqrt{2}}\right) \mapsto \ket{a}\left(\frac{\ket{1}-\ket{0}}{\sqrt{2}}\right) = (-\ket{a})\left(\frac{\ket{0}-\ket{1}}{\sqrt{2}}\right).$$

+ +

We can forget about the ancilla qubit because it literally doesn't change and is the same everywhere.

+",8758,,55,,10/13/2019 11:38,10/13/2019 11:38,,,,0,,,,CC BY-SA 4.0 +8471,2,,8468,10/13/2019 5:03,,8,,"

The Hadamard gate has close ties to the discrete Fourier transform. Consider the DFT for an $N$-level system: +$$\vert j \rangle = \frac{1}{\sqrt{N}} \sum\limits_{k=0}^{N-1} e^{\frac{i2 \pi j k}{N}} \vert k \rangle.$$ +For $N=2$ this is simply +$$\vert j \rangle = \frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1 \\ 1 & -1 \end{bmatrix} \, \vert k \rangle = H \vert k \rangle.$$ +For $H$ applied to $d$ qubits in parallel, this generalizes naturally to a $d$-dimensional DFT, $H^{\otimes d}$. In this sense, the sign convention of $H$ clearly aligns with its function as a unitary DFT matrix.

+ +

The choice of sign for $H$ also aligns, less directly, to the conventional $X$, $Y$, $Z$ basis of the Lie algebra $\mathfrak{su}_2$. For example, $H$ plays a part in the spectral decomposition of $X$ as +$$X = H Z H,$$ +noting that $H$ is both unitary and Hermitian. That $H$ contains both the eigenvectors and dual-eigenvectors of $X$, with eigenvalues in $Z$ can be a useful property. $H^1$, as defined in the question, would swap the position of the eigenvalues.

+",8623,,8623,,10/13/2019 7:46,10/13/2019 7:46,,,,0,,,,CC BY-SA 4.0 +8472,2,,8468,10/13/2019 11:35,,4,,"

You can easily check that $H^1=XHX$, which is another way to say that $H^1$ is the same as $H$ modulo swapping $|0\rangle$ and $|1\rangle$.

+ +

This means that it is a different gate.

+ +

On the other hand, it is ""equivalent"" in the sense that, given an arbitrary circuit given as a sequence of gates $\prod_k U_k$, if you swap all the $|0\rangle$s and $|1\rangle$s, all the $H$ gates will become $H^1$ gates (and vice versa).

+",55,,,,,10/13/2019 11:35,,,,0,,,,CC BY-SA 4.0 +8473,1,8480,,10/13/2019 16:51,,4,294,"

Take the Bell state +$$\frac{1}{\sqrt{2}}\left(|00\rangle +|11\rangle\right) $$ +and measure the first qubit with respect to some axis $\vec{n}_1$ on the Bloch sphere, i.e. measure the observable +$$\vec{n}_1\cdot \vec{\sigma}$$ +where $\vec{n}_1$ is normalized and $\vec{\sigma}$ is the vector of Pauli matrices.

+ +

Now, measure the second qubit with respect to a different axis $\vec{n}_2$.

+ +

What is the probability of equal measurement outcomes as a function of the two axes $\vec{n}_1,\vec{n}_2$, or, say, as a function of the angle between the axes?

+ +

I have read somewhere that the right answer is $p(\text{same outcome})=\cos^2\left(\frac{\theta}{2}\right)$ where $\theta$ is the angle between the axes.

+ +

I am looking for an easy way to obtain this result, or any kind of intuition. I believe I am capable of just carrying out the full-blown calculation myself. In fact, I started but it is very tedious and does not seem to provide me with any intuition about the geometry that's happening here.

+",5322,,55,,10/16/2019 14:12,10/16/2019 14:12,"Probability of equal outcomes measuring a Bell state in the directions $\vec{n}_1,\vec{n}_2$",,2,0,,,,CC BY-SA 4.0 +8474,2,,8473,10/13/2019 18:42,,1,,"

Intuitively, you can rotate $\vec{n}_1$ to $Z$. As $Z$ axis has two antipodal points $|0\rangle$ and $|1\rangle$, let $\vec{n}_1$ have two antipodal points $|b_0\rangle$ and $|b_1\rangle$. Now the Bell state can be rewritten as $\frac{1}{\sqrt{2}}(|b_0b_0\rangle+|b_1b_1\rangle)$. Now in this new basis, the calculation shall be much easier.

+ +

To be precise, please clarify your notation first. What is your $\vec{n}_1$? Is it an axis or unitary operator? In Quantum Computation and Quantum Information, section 4.2, an axis $\hat{n}$ is defined as three dimensional real unit vector. Only a rotation around the axis, not the axis itself, becomes an unitary operator. Apparently, the two antipodal points are eigenvectors for any such unitary operator since these two points do not move under rotation. Again, with this understanding of axis, you can always rotate $\hat{n}_1$ to the $Z$ axis by first rotating it around $Z$ to the $X-Y$ plane and then around $Y$ to $Z$.

+",8321,,8321,,10/13/2019 23:08,10/13/2019 23:08,,,,2,,,,CC BY-SA 4.0 +8475,1,,,10/13/2019 21:25,,2,25,"

I'm curious if there's any consensus on this question among actual practitioners, but please feel free to close it if it's hopelessly opinion-based (since we've only taken baby steps toward the experimental demonstration of scalable QEC).

+ +

The standard presentation of quantum error correction presents ""manual"" error correction. In that case, the (macroscopic/classical/fully decohered) operator repeatedly measures the ancilla qubits to determine which error syndromes (if any) occurred in the data qubits to which they're coupled, and then applies to the data qubits whichever unitary operations are necessary to correct those errors. But it's also possible to ""automate"" the error correction by having the ancillas control controlled unitaries that correct the errors automatically (cf. Mermin's Intro to Quantum Computing pg. 106). This keeps the error-correction almost completely unitary, although not quite (because the ancillas need to be reset to the reference state for the next round of error correction, and in a closed system this reset operation requires a measurement followed by an operation contingent on the measurement result).

+ +

Is successful ""manual"" or ""automated"" error correction considered easier to achieve, based on our current capabilities? I can think of an argument for either:

+ +
    +
  1. Manual error correction requires shallower quantum circuits, and might therefore require less time to perform, thereby reducing the amount of time for errors to occur.
  2. +
  3. Automated error correction is ""more unitary"" and requires fewer measurements, i.e. fewer controlled interactions between the system and the environment. This might allow the experimental designers to keep the system better physically isolated during the computation, thereby reducing uncontrolled environmental interactions that cause errors. (On the other hand, even if this is the case, then the need to repeatedly measure the ancilla qubits might eliminate that advantage in practice.)
  4. +
+",551,,,,,10/13/2019 21:25,Is manual or automated error correction more practically promising in the near term?,,0,0,,,,CC BY-SA 4.0 +8477,1,8499,,10/14/2019 3:09,,5,1099,"

I'm trying to solve the following question:

+ +
+

""Prove that one way to compute $\mathrm Tr_B$ is to assume that someone has measured system + $B$ in any orthonormal basis but does not tell you the measurement outcome."" + - ""An Introduction to Quantum Computing"" by Phillip Kaye.

+
+ +

Where $\mathrm{Tr}_B$, represents the partial trace with respect to some subsystem in say a bipartite system $H_A \otimes H_B$.

+ +

I have some reasoning behind it, but I don't see this as a proof. For example if we have say if we have $|\phi_1\rangle, |\phi_2\rangle \in H_A \otimes H_B$, $|\phi_1\rangle = |a_1\rangle \otimes |b_1\rangle$, $|\phi_2\rangle = |a_2\rangle \otimes |b_2\rangle$

+ +

So $|\phi_1\rangle\langle\phi_2| = |a_1\rangle\langle a_2| \otimes |b_1\rangle\langle b_2|$, and if someone were to measure the system $H_B$, then $|\phi_1\rangle\langle\phi_2|$ becomes the zero operator if $ |b_1\rangle \neq |b_2\rangle$. Since the $H_B$ component of the $|\phi_i\rangle$ has already collapsed only the operators on $H_B$ that don't change the state, i.e. where $|b_1\rangle = |b_2\rangle$ make sense. But since the info from $H_B$ was discarded we haven't learned anything about $H_A$, so the result is just $(\langle b_1 ||b_2\rangle)(|a_1\rangle\langle a_2|)$.

+ +

I kind of see how this becomes the partial trace, since $\mathrm{Tr}_B(|b_1\rangle \langle b_2|) = \langle b_1 ||b_2\rangle $.

+ +

I am looking for hints about how to extend this to a proof, or to fill in any gaps in my understanding.

+",8765,,55,,10/16/2019 14:14,10/16/2019 14:28,Prove that the partial trace is equivalent to measuring and discarding,,2,2,,,,CC BY-SA 4.0 +8478,2,,8444,10/14/2019 4:03,,4,,"

I think I understand where you're getting tripped up. When considering this portion of a circuit,

+ +

+ +

it seems contradictory that both $\vert x \rangle$ is unchanged by $\text{CNOT}$, and $\text{CNOT}$ maps $\vert \psi_1 \rangle = \vert +- \rangle \rightarrow \vert -- \rangle = \vert \psi_2 \rangle$. It turns out that this is not a contradiction, but it is unintuitive (a frequent theme in QM). I will try to clarify what's happening mathematically, then answer your questions explicitly.

+ +

You seem to be clear on what's happening on the left side +$$\vert \psi_1 \rangle = \vert xy \rangle = \frac{1}{2} \left(\vert 0 \rangle + \vert 1 \rangle \right) \left( \vert 0 \rangle - \vert 1 \rangle \right),$$ +but if anything is fuzzy here, I went through the interpretation of this specific basis in a previous answer. To state the obvious, $\vert \psi_2 \rangle$ is defined by the tensor product of the states on the data register, $\text{q}_{dat}$, and the target register, $\text{q}_{tar}$, to the right of $\text{CNOT}$, just as $\vert \psi_1 \rangle$ is to the left of $\text{CNOT}$.

+ +

A critical observation is that the tensor product of the subspace of $\vert \psi_2 \rangle$ corresponding to $\vert 0 \rangle$ on $\text{q}_{dat}$ and the subspace of $\vert \psi_2 \rangle$ corresponding to $\vert 1 \oplus y \sqrt{2} \rangle$ on $\text{q}_{tar}$ must have magnitude 0, i.e. +$$\lambda \vert 0 \rangle \otimes \vert 1 \oplus y \sqrt{2} \rangle = 0,$$ +and vice versa. Hopefully there is no confusion here as this is required by the assumption that if $x = 0$ on $\text{q}_{dat}$ then $x \ne 1$ on $\text{q}_{tar}$.

+ +

Accordingly, the tensor product for $\psi_2$ is +$$\vert \psi_2 \rangle = \frac{1}{2} \left(\, \vert 0 \rangle \vert 0 \oplus y \sqrt{2} \rangle + \vert 1 \rangle \vert 1 \oplus y \sqrt{2} \rangle \,\right).$$ +The symbol $\oplus$ in this context indicates addition modulo 2, e.g., $\vert 1 \oplus 1 \rangle = \vert 0 \rangle$, which leads to +$$\vert \psi_2 \rangle = \frac{1}{2} \left[\, \vert 0 \rangle \left(\, \vert 0 \rangle - \vert 1 \rangle \, \right)+ \vert 1 \rangle \left( \, \vert 1 \rangle - \vert 0 \rangle + \, \right) \, \right].$$ +Carrying this through gives +$$\vert \psi_2 \rangle = \frac{1}{2} \left(\, \vert 00 \rangle + \vert 11 \rangle - \vert 01 \rangle - \vert 10 \rangle \, \right).$$ +Finally it's readily seen that the preceding equation factors into +$$\vert \psi_2 \rangle = \frac{1}{2} \left( \, \vert 0 \rangle - \vert 1 \rangle \, \right) \, \left( \, \vert 0 \rangle - \vert 1 \rangle \, \right) = \vert -- \rangle,$$ +as desired.

+ +

As alluded to by Mark S, this problem is very closely related to the Deutsch and Deutsch-Jozsa algorithms.

+ +

To answer your questions explicitly:

+ +
    +
  1. By definition, the input $\vert x \rangle$ and the output $\vert x \rangle$ on the data register of $\text{CNOT}$ are the same. As shown above, this is not in contradiction with $\vert \psi_2 \rangle = \vert -- \rangle$.
  2. +
  3. The notation is agnostic to orthonormality of vectors.
  4. +
  5. This notation is very efficient for these types of problems. You should try to get more comfortable with it. If you study or work in this space for long, it will soon become second nature.
  6. +
  7. N/A
  8. +
+",8623,,8623,,10/14/2019 21:18,10/14/2019 21:18,,,,3,,,,CC BY-SA 4.0 +8479,2,,8477,10/14/2019 6:59,,3,,"

Let me give you the structure for how you go about answering this question. Let $|\Psi\rangle$ be the pure state shared between Alice and Bob. Bob measures his system in an orthonormal basis $\{|\phi_i\rangle\}$. Thus, Bob gets an answer $i$ with probability $p_i$, and the overall system is left in the state $|\psi_i\rangle|\phi_i\rangle$.

+ +

Now, Alice does not know which result Bob got, all she knows is that with probability $p_i$ she has the state $|\psi_i\rangle$. Thus, what is the density matrix that she uses to describe her system?

+ +

Next, you want to explicitly calculate what $p_i$ and $|\psi_i\rangle$ are based on $|\Psi\rangle$ and $|\phi_i\rangle$. This gives you an explicit expression for Alice's density matrix.

+ +

Finally, you want to compare this to the partial trace. Remember that when you trace over one subsystem, you can use any orthonormal basis that you want, so we'll pick $\{|\phi_i\rangle\}$: +$$ +\text{Tr}_B(|\Psi\rangle\langle\Psi|)=\sum_i(I\otimes\langle\phi_i|)|\Psi\rangle\langle\Psi|(I\otimes|\phi_i\rangle) +$$

+",1837,,,,,10/14/2019 6:59,,,,0,,,,CC BY-SA 4.0 +8480,2,,8473,10/14/2019 7:14,,4,,"

You can calculate the probability of a given answer $\pm 1$ to each measurement by evaluating +$$ +\langle B|\frac{I+(-1)^{\eta_1}\vec{n}_1\cdot\vec{\sigma}}{2}\otimes\frac{I+(-1)^{\eta_2}\vec{n}_2\cdot\vec{\sigma}}{2}|B\rangle +$$ +Thus, the probability of equal measurement outcomes is +$$ +\langle B|\left(\frac{I+\vec{n}_1\cdot\vec{\sigma}}{2}\otimes\frac{I+\vec{n}_2\cdot\vec{\sigma}}{2}+\frac{I-\vec{n}_1\cdot\vec{\sigma}}{2}\otimes\frac{I-\vec{n}_2\cdot\vec{\sigma}}{2}\right)|B\rangle. +$$ +This simplifies to +$$ +\langle B|\left(\frac{I+\vec{n}_1\cdot\vec{\sigma}\otimes\vec{n}_2\cdot\vec{\sigma}}{2}\right)|B\rangle. +$$ +I can also write this as +$$ +\frac12+\frac12\text{Tr}\left(|B\rangle\langle B|\vec{n}_1\cdot\vec{\sigma}\otimes\vec{n}_2\cdot\vec{\sigma}\right), +$$ +with +$$ +|B\rangle\langle B|=\frac14(X\otimes X-Y\otimes Y+I+Z\otimes Z). +$$ +So, the calculation that we want is all products of Pauli matrices. They are traceless unless the product is identity. That gives us an easy way to pick out terms: +$$ +\frac12+\frac12(n_1^Xn_2^X-n_1^Yn_2^Y+n_1^Zn_2^Z). +$$ +This is not quite the result you were expecting because of a negative sign (unless your bases have no $Y$-component, as would be the typical case of a Bell test, for example), so you cannot write it in terms of the angle between the two vectors. If you want to do that, then you should use the Bell state $|B_{11}\rangle=(|01\rangle-|10\rangle)/\sqrt{2}$ because $|B_{11}\rangle\langle B_{11}|=\frac12(I-Z\otimes Z-X\otimes X-Y\otimes Y)$, and hence we find that the probability of getting equal results is +$$ +\frac12\left(1-\vec{n}_1\cdot\vec{n}_2\right). +$$ +If the angle between the two vectors is $\theta$, then this is $\frac12(1-\cos\theta)=\sin^2\frac{\theta}{2}$.

+ +

If you want some sort of intuition, think of the Bell state as performing a teleportation. (Mathematically, $\text{Tr}_1(|\psi\rangle\langle\psi|\otimes I \cdot|B\rangle\langle B|)=\frac12|\psi\rangle\langle\psi|^T$ on the second qubit.) So, it's like the first state being teleported through to the second state, where the inner product is calculated.

+",1837,,1837,,10/15/2019 6:08,10/15/2019 6:08,,,,2,,,,CC BY-SA 4.0 +8481,1,,,10/14/2019 10:02,,2,1091,"

I am a Swiss student and have 2 years left at school. In these 2 years, I have to do a special piece of work on a specific subject. I decided to do it on quantum computers. For this, I have to find a question to answer.

+ +

I would gladly take in any feedback, propositions or problem to solve about quantum physics.

+ +

Here are some things to take into consideration :

+ +
    +
  • It should be under the form of a problem that needs some thinking to be solved. I just have to show the way I tackled it and I should propose a solution to it.
  • +
  • It shouldn't need some very advanced knowledge of quantum physics. I am a high school student and not a university expert
  • +
  • I do know about programming. I am pretty good at python and I know about basic algorithms.
  • +
  • I am documenting myself: I am currently reading the documentation of the IBM Q Experience. I am also considering to buy a couple of these books (books 1-3)
  • +
+ +

I hope you will be able to propose something. If you need any further information to help, feel free to ask.

+",8746,,26,,10/14/2019 10:14,10/16/2019 6:35,Ideas for school-level project on quantum computing,,3,1,,,,CC BY-SA 4.0 +8482,1,,,10/14/2019 14:49,,4,100,"

Used memory-profiler to check why I get memory spikes in what I though were small circuits. The circuit itself is constructed using qiskit.aqua.algorithms.single_sample.shor.shor.Shor, the backend ended up being ibmq_qasm_simulator with the default number of shots (1024).

+ +

The results:

+ + + +
Line #    Mem usage    Increment   Line Contents
+================================================
+   302    180.6 MiB    180.6 MiB       @profile
+   303                                 def _shors_period_finder(self, job_descriptor: ShorJobDescriptor, fleet: QFleet, shots=None):
+   ...    ...            ...
+   310    180.6 MiB      0.0 MiB           shor = Shor(N=9, a=4)
+   311    324.0 MiB    143.4 MiB           circ = shor.construct_circuit(measurement=True)
+   ...    ...            ...
+   315    326.1 MiB      2.0 MiB           qcomp = fleet.get_best_backend(circ.n_qubits, job_descriptor.allow_simulator)
+   ...    ...            ...
+   324    668.9 MiB    342.9 MiB           job = execute(circ, backend=qcomp, shots=shots if shots else 1024)
+   ...    ...            ...
+
+ +

Why am I getting the memory spike on line 324?

+ +

Is a (9,4) Shor circuit really 143.4MB? Am I using the wrong Shor object?

+ +

Or am I just optimistic about the circuits I can construct without this volume of overhead?

+",8770,,26,,10/14/2019 15:59,10/14/2019 15:59,`execute()` hangs and eats memory,,0,5,,,,CC BY-SA 4.0 +8483,2,,8249,10/14/2019 19:38,,5,,"

In the most widespread convention, the Bloch sphere uses $\theta = 0$ radians latitude to indicate the north pole $|0\rangle$, $\theta = \pi$ to refer to the south pole $|1\rangle$ and $\theta = \pi/2$ to refer to the equator, which includes the superpositions $(1+i)/\sqrt 2$ and $(1-i)/\sqrt 2$ as well as $i|1\rangle$ and $-i|1\rangle$.

+ +

If two great circles are distinct and intersect at a given point they will intersect exactly one other time at the opposite point on the sphere and such that a ray passing through both points will also pass through the center of the sphere. Given this, the difference in latitude between one point and the equator will be of equal magnitude but opposite sign relative to the other, with the equator being at $\pi/2$. As such, the latitude of the antipode to $(\theta,\psi)$ will be $\pi-\theta$. As there are $2\pi$ radians of longitude to a sphere, the opposite of a given longitude with be $\pi+\psi$.

+ +

This being the case, coordinates for the antipode $(\theta,\psi)$ is $(\pi-\theta,\pi+\psi)$. Trigonometric identities will be sufficient for the rest.

+",8774,,8774,,10/15/2019 0:17,10/15/2019 0:17,,,,1,,,,CC BY-SA 4.0 +8484,1,,,10/15/2019 3:56,,3,94,"

I’m starting an engineering degree in computer systems and I’m starting to get really interested in quantum computing. First of all, I don’t know where or how to start and I would really like to learn about this. Second and last I think I have a good level of English but I would really like to give all this information and manuals to my friends and professors so it surely would be awesome to have information in Spanish too.

+",8775,,26,,10/16/2019 15:22,10/16/2019 15:22,Resources in Spanish to start learning quantum computing and quantum programming (Qiskit),,1,2,,,,CC BY-SA 4.0 +8485,2,,8484,10/15/2019 8:56,,4,,"

Check out the resources on this page especially the textbook as that starts from the very fundamentals and works up. There are also tutorials to teach you about the basics of quantum computing and work up to very complex topics.

+ +

As for resources in Spanish, if you join the qiskit Slack community there is a channel #spain where they discuss quantum computing in Spanish.

+",5955,,,,,10/15/2019 8:56,,,,0,,,,CC BY-SA 4.0 +8486,1,,,10/15/2019 11:13,,5,147,"

I’m studying the paper Expressive power of tensor-network factorizations for probabilistic modeling by Glasser et al. In equation S6 (page 2 of supplementary material, excerpt of paper figure below) it is claimed that a 2-local unitary $\rm U$ may be split into a contraction of two 1-local gate tensors through a singular value decomposition (SVD). How this is done, however, is not clear to me.

+ +

+ +

In tensor notation, the entries of a unitary $\rm U$ acting on two qudits may be written $U^{ij}_{kl}$, with the first upper and lower index referring to the first qudit, and the second upper and lower index referring to the second qudit. Splitting $\rm U$ into a contraction of two 1-local gate tensors $\rm A$ and $\rm B$ would mean that +$$U^{ij}_{kl}=\sum_\alpha A^{i\alpha}_kB^j_{l\alpha}\tag{1}$$ +or, equivalently +$${\rm U}=\sum_\alpha{\rm A}^{\kern-0.085em\alpha}\otimes{\rm B}_\alpha\tag{2}$$ +with $\rm A$ acting on the first qudit and $\rm B$ acting on the second. +Now, when $\rm U$ is decomposed into $\rm C\Sigma\rm D^\dagger$, we have in tensor notation that +$$U^{ij}_{kl}=\sum_{\gamma\delta}\sigma_{\gamma\delta}C^{ij}_{\gamma\delta}(D^\dagger)^{\gamma\delta}_{kl}.\tag{3}$$ +This is much different from the first decomposition, as $\rm C$ and $\rm D$ still act on both qudits.

+ +

Can somebody explain how the decomposition should be carried out so as to arrive at eq. 1 or 2?

+",2687,,2687,,10/16/2019 12:19,10/16/2019 12:19,How to split a 2-local unitary operator through singular value decomposition?,,1,0,,,,CC BY-SA 4.0 +8487,1,,,10/15/2019 15:33,,3,46,"

I knew that we usually use circuit instead of Turing machine in Quantum computation.

+ +

In a deterministic Turing machine one has transition rules, +$$ +\delta: Q\times\Gamma\rightarrow Q\times\Gamma\times\{\pm 1, 0\}, +$$ +where $Q, \Gamma$ are set of states and symbols respectively. In the quantum Turing machine, we instead have, +$$ +\delta:Q\times\Gamma\rightarrow\mathbb{C}^{Q\times\Gamma\times\{\pm1,0\}}. +$$ +Suppose all that needed for the induced evolution $U_\delta$ being unitary. However, I feel tremendously obstructed when trying to construct even a toy example. Then I realize one difference between quantum circuit family and Turing machine when manipulating the computation is the following.

+ +

When constructing a quantum circuit, one could decide which qubit to act on, this decision is a classical advice that is precomputed before the quantum computating even started. When constructing a quantum Turing machine, we need to make sure that even the arrangement of gates must obeys the unitary property.

+ +

For instance, if we would like to apply $2$-local $U$ on a tape. Say, suppose the configuration in computational basis after truncated infinitely long tape is $|n,q\rangle|x_0,x_1\rangle$ where $n,q,x_i$ represents the current pointer location, state, and value of 2 cells on the tape. We would like to maps it to $|n,q\rangle U|x_0,x_1\rangle$, but unfortunately we could only apply our basic gate on $n,q, x_n$. In the circuit paradigm, we might use a trick that swaps information between $q$ and $x_0$ to perform multi-qubit gates. So we might say,

+ +
    +
  1. Let $(q,s)\in Q=Q_L\times \Gamma$ composed of ""logical state"" and a dummy register state. Write computational basis as $|n,q,s,x_0,x_1\rangle$ and we starts at $|0,q,s,x_0,x_1\rangle$
  2. +
  3. Interchange $s,x_n$, so $|0,q,s,x_0,x_1\rangle\mapsto|n,q,x_0,s,x_1\rangle$.
  4. +
  5. Logical flip the pointer bit, $|n,q,s,x_0,x_1\rangle\mapsto|\lnot n,q,s,x_0,x_1\rangle$.
  6. +
  7. Perform $2$-local operator $U$ on $s,x_n$, so $|1,q,s,x_0,x_1\rangle\mapsto|1,q\rangle U|s,x_1\rangle|x_0\rangle.$
  8. +
  9. Swap back everything as prevously done, $|1,q,s,x_0,x_1\rangle\mapsto|0,q,x_0,s,x_1\rangle$.
  10. +
+ +

But we cannot do this directly on quantum Turing machine, it is because we must also guarantee that the way we arrange these rules mentioned above should induce a unitary evolution. +Even to simulate a classical Turing machine is non-trivial because though without superposition, in order to preserve unitary property, you need to permute classical states instead of making straight transition logic. I understand that quantum circuit is usually more used in the context of quantum computation, but at this stage even manipulating really simple rules are quite painful, in the above example, I even have to construct the states to transition cyclicly just to preserve unitary property.

+ +
+

If we would like to instantiate classical arrangements of quantum gates in a quantum Turing machine, is there better ways, perhaps more expressive, to constuct them explicitly?

+
+",4855,,55,,9/23/2020 12:21,9/23/2020 12:21,Explicit Construction of Classical Rules in Quantum Turing Machine,,0,0,,,,CC BY-SA 4.0 +8488,2,,8481,10/15/2019 15:54,,0,,"

I would say you could start with the basic implementation of gates. For example, adding two binary numbers is trivial in classical digital circuits. Try to think about how could you solve that with a quantum circuit.

+ +

On this line, you could think of what things are easy in the classical world and would be difficult to do in the quantum world.

+",8782,,,,,10/15/2019 15:54,,,,0,,,,CC BY-SA 4.0 +8489,2,,8481,10/15/2019 16:53,,3,,"

I'll reiterate on my earlier answer to What can be a mini research project based on Grover's algorithm or the Deutsch Jozsa algorithm?: I think ""Applying Grover's search algorithm to solve problem X"" is a great topic for a small (or not-so-small) project.

+ +
    +
  1. It is a very well-known algorithm (well, at least it is featured in the writings about quantum computing very frequently).
  2. +
  3. The problem you're trying to solve is very simple to explain to somebody who is not familiar with the topic, so it is an easy presentation start.
  4. +
  5. You can make the project as extensive as you want (or have time to), depending on the problem you choose, and even for the same problem, since there are a lot of things you can explore within a project: + +
      +
    • the algorithm itself,
    • +
    • the implementation nuances and high-level behavior (see this example I did for a recent workshop),
    • +
    • picking an interesting problem to solve and implementing an oracle for it,
    • +
    • optimizing the oracle to make it possible to simulate a small instance of a problem on 30-ish qubits,
    • +
    • estimating the resources necessary to run the algorithm on a larger instance,
    • +
    • counting the number of solutions to the problem instead of finding a solution (""quantum counting""), etc.
    • +
  6. +
+",2879,,,,,10/15/2019 16:53,,,,1,,,,CC BY-SA 4.0 +8490,1,8496,,10/15/2019 19:38,,3,68,"

So starting with an up particle: +$$ +\lvert \uparrow \rangle = \begin{bmatrix} + 1 \\ + 0 \\ + \end{bmatrix} +$$ +My understanding is that you can measure $\lvert \uparrow \rangle$ in $X$ and have a 50% chance of getting $\lvert \leftarrow \rangle$ and a 50% chance of getting $\lvert \rightarrow \rangle$ where: +$$ +\lvert \rightarrow \rangle = \begin{bmatrix} + \frac{1}{\sqrt{2}} \\ + \frac{1}{\sqrt{2}} + \end{bmatrix} +\text{ and } +\lvert \leftarrow \rangle = \begin{bmatrix} + \frac{1}{\sqrt{2}} \\ + \frac{-1}{\sqrt{2}} + \end{bmatrix} +$$ +but you could also operate in $X$ which would be the equivalent of passing it though a NOT gate: +$$ +X \cdot \lvert \uparrow \rangle = +\begin{bmatrix} + 0 & 1 \\ + 1 & 0 \\ + \end{bmatrix} +\cdot +\begin{bmatrix} + 1 \\ + 0 \\ +\end{bmatrix} = \begin{bmatrix} + 0 \\ + 1 \\ +\end{bmatrix} = \lvert \downarrow \rangle +$$

+ +

I've read that measuring qubit spin is more or less equivalent to measuring the orientation of a photon which can be done by passing it through polarized filters. If the photon is measured to be in one orientation and then is measured in a different orientation it has a certain probability of snapping to be in that other direction.

+ +

So in this example, that would be equivalent to measuring an up qubit in $X$. But how does operating in $X$ come into the equation? I understand the mathematical effect it has, but what does this mean for the physical qubit? Is it also being passed through a filter and how is that different from measuring?

+ +

Thanks!

+",8663,,55,,7/26/2020 18:09,7/26/2020 18:09,What's the difference between observing in a given direction and operating in that same direction?,,1,1,,,,CC BY-SA 4.0 +8491,2,,2004,10/16/2019 0:58,,0,,"

Grover's algorithm can be used to solve any numerical optimization problem faster than brute-force search, because any optimization problem can be formulated as a search problem (where you are searching for a function output greater/less than some fixed $M$ within each run, and you repeat for a logarithmic number of runs using binary search to home into the optimal $M$): https://epubs.siam.org/doi/abs/10.1137/040605072?journalCode=sjope8.

+ +

In fact, Grover's algorithm is the best-known quantum algorithm for many difficult optimization problems (such as NP-complete ones) that don't have much structure that is amenable to a classical algorithm cleverer than brute-force search: https://link.springer.com/chapter/10.1007/978-3-540-78773-0_67.

+",551,,,,,10/16/2019 0:58,,,,0,,,,CC BY-SA 4.0 +8492,2,,4263,10/16/2019 1:05,,4,,"

The Kerenidis-Prakash algorithm was groundbreaking, until Ewin Tang fixed the ground back up:

+ +

Quanta Magazine: Major Quantum Computing Advance Made Obsolete by Teenager.

+",551,,26,,10/16/2019 15:25,10/16/2019 15:25,,,,1,,,,CC BY-SA 4.0 +8493,1,,,10/16/2019 6:09,,2,1500,"

Does anybody have any other comparisons between a universal quantum computer and a classical computer that might shed some light into how their performance compares?

+ +

Below is what I've been able to come up with, so far.

+ +
+ +

I am an electrical engineer and have been learning about quantum computing for the last year, and I can hardly believe what I read and hear. It is becoming clearer to me, but it's a very difficult subject.

+ +

Why is there so much fuss about quantum computing? I will attempt here to show that a 19 qubit quantum computer could match the performance of a 200 petaflops IBM supercomputer, and also how its performance improves with more qubits.

+ +

This discussion assumes that all of these qubits are what are termed 'logical qubits'. That is, they are fully error-corrected and have infinite 'coherence' times. These types of qubits are a LONG way off. Contemporary 2019 qubits are short-lived.

+ +

First, the state of a quantum computer is defined by a vector of length 2^n complex values where n is the number of qubits in that quantum computer. For example:

+ +

1 qubit -> 2 values in the state vector
+2 qubits -> 4 values in the state vector
+3 qubits -> 8 values in the state vector
+... ...
+16 qubits -> 65,536 values in the state vector
+... ...
+100 qubits -> 1,267,650,600,228,229,401,496,703,205,376 values in the state vector
+... ...
+and so on.

+ +

The square of any one of the values in the state vector list indicates the probability that this particular list number (index) will be observed at the output of the quantum computer when the MEASURE logic gate (see below) is finally applied.

+ +

To program the quantum computer, a person will apply what are called 'quantum logic gates' or just 'gates' to the system in order to achieve the processing that they desire. Some of the names of the 'gates' are Hadamard, CNOT, Pauli-X, and MEASURE (the last one applied).

+ +

When a programmer starts to manipulate the quantum computer, the state of the qubits is initialized and the first value in the state vector list is set equal to 'one' and all of the other values are set equal to 'zero'. If the MEASURE gate were applied now then the output would always read 0b0...00000 since the probability of observing that first list number is 100%.

+ +

The goal of the programmer is usually to apply the necessary quantum logic 'gates' in such a way that the 100% list value moves from list entry number 0b0...00000 to some other list entry number, and that number is what the scientists have been waiting for.

+ +

Each logic gate takes less than one microsecond to complete, and what each gate does is to modify all of the 2^n current state vector values in order to create (evolve to) the next state vector list. This is equivalent to a 2^n by 2^n matrix multiplied with the 2^n current state vector. This is 2^n * 2^n = 2^2n multiply/accumulate (MAC) operations in one microsecond.

+ +

A contemporary IBM supercomputer allegedly has 200 petaflops of performance. If we let one FLOP (floating-point operation) equal one MAC (multiply/accumulate) operation then the IBM classical computer can do 200*10^15 MACS/sec * 10^-6 sec = 200*10^9 MACs in one quantum computer gate time.

+ +

So, equating the quantum computer to the IBM supercomputer's performance (for one quantum gate time): +2^2n = 200*10^9 +or +n = 18.7 qubits (19 qubits) in order for a quantum computer to match the MAC performance of an IBM 200 petaflop supercomputer.

+ +

This is really amazing, and assuming that this is generally correct then each additional qubit means a 4x increase in MAC performance. Scientists are talking about applications requiring 500 qubits. It's going to be interesting.

+",8788,,8788,,10/19/2019 20:51,10/19/2019 20:51,Quantum computer vs. supercomputer performance,,1,7,,10/19/2019 17:46,,CC BY-SA 4.0 +8494,2,,8481,10/16/2019 6:35,,0,,"

Perhaps you can build a device that simply demonstrates one of the characteristics of a single qubit, and that is the ability to program its 'superposition' probability amplitudes.

+ +

An easy way to visualize this is by a simple coin toss or a coin spin on a table. Think of the coin as being in 'superposition' while it's in the air (or when it's spinning on the table). When you perform a quantum computer MEASURE gate on the coin - by letting it land or by waiting until it stops spinning - the system reveals its answer (""heads"" or ""tails"" as we say here in California).

+ +

If you start with a normal coin, the probability of it landing heads or tails is 50%(heads)+50%(tails). With a qubit, you can change its probabilities to anything you desire.

+ +

As a project, perhaps you could figure out how to make a model of this and have its probabilities adjustment be a knob (Arduino?) or something mechanical. Quantum computers use microwave pulses and magnetic fields to control their qubits.

+ +

Whatever you decide to do, learning quantum computing takes a lot of effort. It sounds like you have the ability.

+ +

Have fun!

+ +

Bob

+",8788,,,,,10/16/2019 6:35,,,,0,,,,CC BY-SA 4.0 +8495,2,,8486,10/16/2019 10:44,,3,,"

If I understand what you are asking for (I don't know much about tensor networks), both equations are singular value decompositions of $U$, just with respect to different indices (and in the latter case highlighting the singular values, which in the first equation is ""hidden"" in $A,B$).

+ +

There are two things to notice here. First of all, given an arbitrary matrix $A_{ij}$ you can write its SVD as (assuming summation over repeated indices, and without paying attention to whether indices are above or below the tensors): +$$A_{ij}= s_k B^k_i \bar C^k_j,\tag1$$ +where $s_k\ge0$ and $B^k_i \bar B^\ell_i=\delta_{k\ell}$, $C^k_j \bar C^\ell_j=\delta_{k\ell}$. +But another way to write the SVD is to ""hide"" the singular values in the matrices in the decomposition, thus writing +$$A_{ij}=D^k_i \bar E^k_j,\tag2$$ +where now $D_i^k \bar D_i^\ell=s_k \delta_{k\ell}$ and $E_i^k \bar E_i^\ell=s_k \delta_{k\ell}$. +You can always do this, being the singular values ensured to be non-negative. The connection between the objects in (2) and (1) is that $D_i^k\equiv\sqrt{s_k} B_i^k$ and $E_j^k\equiv \sqrt{s_k} C^k_j$.

+ +

Another point is that, if you have a tensor with more than two indices, there are multiple ways to apply the SVD. You can choose any way to separate the set of indices of the tensor in two groups, and then apply the SVD between these two groups.

+ +

For example, you can think of $U^{ij}_{kl}$ as a matrix ""sending the indices $(k,l)$ into the indices $(i,j)$"" (hopefully you know what this means formally), which is what you are doing in your second equation (also note that there is need to use two intermediate indices as you are doing, one is enough)/

+ +

Alternatively, you can think of $U^{ij}_{kl}$ as ""sending $(j,l)$ to $(i,k)$"", which gives you the SVD as in your first equation. Note that uou can also do other things here: e.g. separate $(i,l)$ and $(j,k)$.

+",55,,,,,10/16/2019 10:44,,,,0,,,,CC BY-SA 4.0 +8496,2,,8490,10/16/2019 11:00,,4,,"

In general, ""operating on a state with an observable"" does not have direct physical meaning (i.e. you cannot think of it as evolving the state doing something to it).

+ +

What does have physical meaning, is applying a unitary operation to a state. Every unitary operator corresponds to a physical operation that you can (in principle) implement, transforming (reversibly) states into other states according to some rule.

+ +

In the particular case of $X$, you can actually think of it as an evolution, because $X$ is both Hermitian (thus an observable) and unitary (thus an evolution). What this evolution means physically depends on the implementation. If you are dealing with the polarisation of a photon, it can be representing the action of a phase shifter, which rotates the polarisation.

+ +

But it's important to distinguish between ""acting on a state with the evolution $X$"" and ""measuring the state with the observable $X$"". To ""measure $X$"" means physically to apply a measurement which makes the state collapse into one of the eigenstates of $X$. This involves doing something like acting on the state with a Hadamard gate and then measuring in the computational basis, so you can see how this is rather different than evolving with $X$.

+",55,,,,,10/16/2019 11:00,,,,0,,,,CC BY-SA 4.0 +8497,1,8498,,10/16/2019 13:39,,3,469,"

Consider the simplified code below. The code creates a quantum circuit and a simplified noise model.

+ +

When I try to simulate this circuit using the noise model I get error message that the simulation fails.

+ +

I have noticed that I get this when I supply basis_gates to the NoiseModel function, and when I remove basis_gates from NoiseModel it works. But if I do that Qiskit is not simulating the actual circuit that I want but a transpiled version of the actual circuit that I want to simulate.

+ +
import numpy as np
+from qiskit import execute, QuantumCircuit, QuantumRegister, ClassicalRegister
+from qiskit.providers.aer import QasmSimulator
+from qiskit.tools.visualization import plot_histogram
+
+# Qiskit Aer noise module imports
+from qiskit.providers.aer.noise import NoiseModel
+from qiskit.providers.aer.noise.errors import pauli_error
+
+# System Specification
+n_qubits = 2
+circ = QuantumCircuit(n_qubits, n_qubits)
+
+# Test Circuit
+circ.h(0)
+circ.rx(np.pi/4,1)
+circ.cz(0,1)
+circ.rz(np.pi,0)
+circ.measure(range(n_qubits), range(n_qubits))
+
+# Basis gates
+basis_gates = ['id', 'h', 'rx', 'rz', 'cz']
+
+# Example error probabilities
+p = 0.05
+
+# QuantumError objects
+error_gate1 = pauli_error([('X',p), ('I', 1 - p)])
+error_gate2 = error_gate1.tensor(error_gate1)
+
+# Add errors to noise model
+noise_bit_flip = NoiseModel(basis_gates)
+noise_bit_flip.add_all_qubit_quantum_error(error_gate1, [""h"", ""rx"",""rz""])
+noise_bit_flip.add_all_qubit_quantum_error(error_gate2, [""cz""])
+
+print(noise_bit_flip)
+
+# Backend
+simulator = QasmSimulator()
+
+# Run the noisy simulation
+job = execute(circ, simulator,
+              basis_gates = noise_bit_flip.basis_gates,
+              noise_model = noise_bit_flip)
+result_bit_flip = job.result()
+counts_bit_flip = result_bit_flip.get_counts(0)
+
+# Plot noisy output
+plot_histogram(counts_bit_flip)
+
+",2136,,,,,10/16/2019 14:06,Implementing noise model in Qiskit using arbitrary basis gates,,1,0,,,,CC BY-SA 4.0 +8498,2,,8497,10/16/2019 14:06,,2,,"

If you call execute with the parameter optimization_level set to 0, qiskit will not perform any circuit optimizations.

+ +

Your call should therefore be

+ +
job = execute(circ, simulator,
+              optimization_level=0,
+              noise_model = noise_bit_flip)
+
+ +

The optimization level can be 0-3 inclusive depending on how much optimization you would like terra to perform. By default optimization level 1, which performs some light optimization, is chosen.

+",5955,,,,,10/16/2019 14:06,,,,1,,,,CC BY-SA 4.0 +8499,2,,8477,10/16/2019 14:28,,2,,"

Consider a bipartite state $|\psi\rangle=\sum_{ij}\psi_{ij}|i\rangle\otimes|j\rangle$. +In the following, I will work directly on the matrix elements of the objects involved.

+ +

Tracing out the second space amounts to the following mapping +$$\psi_{ij}\rightarrow \rho_{ii'}\equiv\sum_j \psi_{ij}\bar\psi_{i'j}.\tag A$$ +Now forget about the partial trace, and consider what happens when you measure the second system in the computational basis. You will get the $j$-th outcome with probability $p_j\equiv\sum_i |\psi_{ij}|^2$, and the post-measurement state will be some $\phi^{(j)}$ with indices $\phi_i^{(j)}=\frac{1}{\sqrt{p_j}}\psi_{ij}$.

+ +

So now we need to find a way to define an object which contains the information about all the possible post-measurement states with their associated probabilities. This is the ""discarding measurement information"" part. +As it turns out, mapping ket vectors to density matrices makes this very easy, as probabilistic mixtures of states are simply weighted sums of density matrices. +We therefore map each $\phi^{(j)}$ into the corresponding density matrix, +$$\phi^{(j)}_i\rightarrow\rho^{(j)}_{ii'}\equiv \phi^{(j)}_i\bar\phi^{(j)}_{i'} +=\frac{1}{p_j}\psi_{ij}\bar\psi_{i'j},$$ +and now to ""forget"" about what state was measured, we simply sum these density matrices with the relative probabilities, which gives +$$\sum_j p_j\rho^{(j)}_{ii'}=\sum_j \psi_{ij}\bar\psi_{i'j},$$ +which, as you might notice, is the same as (A).

+",55,,,,,10/16/2019 14:28,,,,1,,,,CC BY-SA 4.0 +8500,2,,2603,10/16/2019 16:29,,2,,"

Executing a NISQ-device in a manner that asymptotically outperforms a classical computer invalidates the Extended Church-Turing Thesis (ECT).

+ +

Voluminous tomes written about the (non-extended) Church-Turing Thesis, with implications for branches of philosophy such as the philosophy of mind.

+ +

The fact that the ECT was not only falsifiable but also is likely false merely by virtue of the existence of a NISQ-device reliably preparing a highly entangled state in high-enough dimension, I think likewise has some rather profound philosophical implications.

+ +

It's rare that guiding philosophical principals can be falsified in a laboratory.

+",2927,,2927,,10/19/2019 12:50,10/19/2019 12:50,,,,0,,,,CC BY-SA 4.0 +8501,1,8503,,10/16/2019 19:05,,6,247,"

Assume that a density matrix is given in its eigenbasis as $$\rho = \sum_{k}\lambda_k |k \rangle \langle k|.$$ On page 19 of this paper, it states that the Quantum Fisher Information is given as $$F_{Q}[\rho,A] = 2 \sum_{k,l}\frac{(\lambda_k-\lambda_l)^2}{\lambda_k + \lambda_l}|\langle k|A|l\rangle|^2$$

+ +

Question: I might be missing something simple but can anyone see why, as stated in the paper, for pure states it follows that $$F_{Q}[\rho,A] = 4(\Delta A)^2?$$

+ +

Thanks for any assistance.

+",2032,,55,,6/24/2021 14:44,6/24/2021 14:44,"Why is the quantum Fisher information for pure states $F_Q[\rho,A]=4(\Delta A)^2$?",,1,0,,,,CC BY-SA 4.0 +8503,2,,8501,10/16/2019 23:19,,5,,"

Suppose $\lambda_0 = 1$ and the rest are $0$.

+ +

$$ +F_Q [\rho,A] = 2 \sum_{k,l} \frac{(\lambda_k-\lambda_l)^2}{\lambda_k + \lambda_l} | \langle k |A| l \rangle |^2\\ += 2 \sum_{k=0,l \neq 0} \frac{(1-0)^2}{1 + 0} | \langle 0 |A| l \rangle |^2 + 2 \sum_{k\neq 0,l = 0} \frac{(0-1)^2}{0 + 1} | \langle k |A| 0 \rangle |^2\\ += 4 \sum_{l \neq 0} | \langle l |A| 0 \rangle |^2\\ += 4 \sum_{l \neq 0} \langle 0 |A| l \rangle \langle l |A| 0 \rangle\\ += 4 \langle 0 |A \bigg( \sum_{l \neq 0} | l \rangle \langle l | \bigg) A| 0 \rangle\\ += 4 \langle 0 |A \bigg( \mathbb{I} - |0\rangle\langle 0| \bigg) A| 0 \rangle\\ +$$

+",434,,,,,10/16/2019 23:19,,,,3,,,,CC BY-SA 4.0 +8504,1,13848,,10/17/2019 3:30,,5,86,"

Density functional theory is based on the Hohenberg-Kohn (HK) theorems and aims to compute the ground-state many-body wavefunction of a physical material and/or molecules.

+ +

To put it simply, the HK theorems show that there is a unique one-to-one mapping between a many-body Hamiltonian $\mathcal{H}$ (like you'd encounter in quantum chemistry or in the solid-state), and the electron density $\rho(\mathbf{r})$. This relationship is quite surprising, especially since you reduce the information of the wavefunction $\psi$ with $3N$ variables to a function of just $3$ variables.

+ +

The catch here is that extracting information from $\rho(\mathbf{r})$ is quite difficult, and you can only really do it exactly if you know the exchange-correlation functional term $\frac{\delta E_{xc}[\rho]}{\delta \rho(\mathbf{r})}$, but no one knows what this functional looks like exactly.

+ +

My question is the following:

+ +

Do we know anything about the computational complexity of evaluating the exchange-correlation functional in either the classical or quantum computing cases?

+",2260,,,,,12/23/2022 8:54,Do we know anything about the computational complexity of the exchange-correlation functional?,,1,0,,,,CC BY-SA 4.0 +8505,1,8509,,10/17/2019 8:43,,6,920,"

I would like to prepare the following initial state for variational quantum algorithms: +$$ +\sin\theta_1 \sin\theta_2 \sin\theta_3 |000\rangle + \sin\theta_1 \sin\theta_2 \cos\theta_3 |001\rangle + \sin\theta_1 \cos\theta_2 |010\rangle + \cos\theta_1 |100 \rangle. +$$

+ +

Should I make a circuit for this state from scratch? +Or is there any library to find a circuit to make this state such as Cirq or Qiskit?

+",8673,,55,,10/18/2019 18:23,10/20/2019 16:57,How to prepare a specific initial state of three qubits?,,2,0,,,,CC BY-SA 4.0 +8506,2,,8505,10/17/2019 10:22,,5,,"

You can initialize a quantum state by using the QuantumCircuit.initialize() function. For example, to initialize a circuit into the state |1>, we can perform the initialization as follows :

+ +
vector = [0,1]
+qr = QuantumRegister(1)
+qc = QuantumCircuit(qr)
+
+qc.initialize(vector, [qr[0]])
+
+ +

There is more detail about how to use it in this tutorial

+",5955,,,,,10/17/2019 10:22,,,,0,,,,CC BY-SA 4.0 +8507,1,,,10/17/2019 14:20,,6,151,"

I am interested in learning more about the following: would it be possible for me to simulate a molecule consisting of copper ions through a quantum circuit?

+ +

And if so, can that circuit allow me to measure the decoherence time of that molecule?

+ +

I know it's an open-ended question, so any books, research papers, etc, would be much appreciated it.

+",6253,,26,,10/20/2019 17:28,10/20/2019 17:28,Developing quantum circuits for specific quantum chemistry configurations,,1,1,,,,CC BY-SA 4.0 +8508,1,,,10/17/2019 14:32,,5,120,"

I'm trying to prove that:

+ +

$$ +\langle j_2|\langle j_1| U(|0\rangle\!\langle0|\otimes\rho)U^\dagger|j_2\rangle|j_1\rangle +=\operatorname{Tr}(M_j\rho) +$$

+ +

where $\rho$ is the density operator, $M_j=\frac{1}{2}|\psi_j\rangle\!\langle\psi_j|$, and $U$ is unitary.

+ +

Assuming +$$\rho = a|0\rangle\langle 0|+b|1\rangle \langle 1|$$

+ +

and +$$M = \frac{1}{2}|0\rangle\langle 0|+ \frac{1}{2}|1\rangle\langle 1|$$

+ +

I got :

+ +

$$\mathrm{Tr}(M_j\rho) = \mathrm{Tr}(\frac{1}{2} (a|0\rangle\langle 0|+b|1\rangle \langle 1|)) = \frac{1}{2}ab$$

+ +

I calculated $(|0⟩⟨0|\otimes \rho)$ as well (a matrix of 4x4)

+ +

$$ +\vert 0 \rangle \langle 0 \vert \otimes \rho = + \begin{pmatrix} +1/2 & 0 & 0 & 0\\ +0 & 1/2 & 0 & 0\\ +0 & 0 & 0 & 0\\ +0 & 0 & 0 &0\\ +\end{pmatrix} +$$

+ +

Not sure though how to continue from here and apply $U$ to the matrix.

+",8793,,23,,10/22/2019 21:30,10/22/2019 21:30,Proving $\langle j_2|\langle j_1| U(|0\rangle\!\langle0|\otimes\rho)U^\dagger|j_2\rangle|j_1\rangle =\operatorname{Tr}(M_j\rho)$,,1,1,,,,CC BY-SA 4.0 +8509,2,,8505,10/17/2019 15:18,,4,,"

If you call initialize in this case, you will be specifying a general state in $\mathbb{C}^8$. However what you have is more specialized. For example only having 4 nonzero amplitudes. So the call to initialize won't know this a priori. So it won't realize the initialization circuit can be decomposed easily. Or at least it will need to do some extra simplification steps before realizing this.

+ +

I'm going to change $\sin$ and $\cos$ from your state. You can fix this by changing the angles with appropriate angle redefinitions. $\theta \to \frac{\pi}{2}-\theta$.

+ +

$$ +| \psi_1 \rangle = (\mathrm{R}(\theta_1) \otimes I_4) | 0 0 0 \rangle = \cos \theta_1 | 0 0 0 \rangle + \sin \theta_1 | 1 0 0 \rangle\\ +| \psi_2 \rangle = (\mathrm{CR}(0,\theta_2) \otimes I_2) | \psi_1 \rangle = \cos \theta_1 \cos \theta_2 | 0 0 0 \rangle + \cos \theta_1 \sin \theta_2 | 0 1 0 \rangle + \sin \theta_1 | 1 0 0 \rangle\\ +| \psi \rangle = \mathrm{CCR}(00,\theta_3) | \psi_2 \rangle +$$

+ +

where $\mathrm{R}(\theta)$ is to indicate a 2 by 2 rotation matrix.

+ +

$\mathrm{CR}(0,\theta)$ is to indicate controlled $\mathrm{R}(\theta)$ on the second index but controlled on 0 instead of 1 on the first.

+ +

$\mathrm{CCR}(00,\theta)$ is to indicate controlled $\mathrm{R}(\theta)$ on the third index but controlled on 00 instead of 11 on the first two.

+ +

You should be able to fix the angles and get the controls back to normal from here.

+",434,,26,,10/20/2019 16:57,10/20/2019 16:57,,,,0,,,,CC BY-SA 4.0 +8510,2,,8507,10/17/2019 17:07,,6,,"

Since Google is one of, if not the, industry leaders in molecular simulation with quantum computers, their published work is a reasonable benchmark for what's presently within reach. As you probably know, a few years ago Google reported (commentary) successful electronic structure calculations for a Hydrogen atom, favoring the variational quantum eigensolver approach. A lot has happened since then, but I haven't noticed much recently from Google on VQE (though others are still actively working on VQE).

+ +

The most recent paper from Google uses phase estimation performed on a quantum walk to simulate FeMoco. This simulation requires $8 \times 10^{10}$ Toffoli gates (best case) and about three million qubitweeks of state distillation (a 700x improvement over the previous approach).

+ +

This is an unsatisfactory answer, but obviously the complexity of Copper ions lies somewhere between a Hydrogen atom (feasible) and FeMoco (not yet feasible), though I'm not sure how to quantify where it falls in that spectrum. The recent Google paper has an up-to-date list of references for further reading on the topic.

+",8623,,8623,,10/17/2019 17:50,10/17/2019 17:50,,,,0,,,,CC BY-SA 4.0 +8511,1,,,10/17/2019 19:02,,13,3083,"

I am having some trouble understanding why a SWAP test would work. I meant I read that and understood the concepts as follows:

+ +
    +
  • If the two input states are equal, the output register always results +in a state of $|1\rangle$, so a $1$ outcome will be obtained when applying a READ to this register.

  • +
  • However, as the two inputs become increasingly more different, the +probability of READing a $1$ outcome in the output register decreases

  • +
+ +

But my question is why?

+ +

I meant how can a third qubit being $|0\rangle$ or $|1\rangle$ assure us about the probabilities of them being the same or different? It could only tell us if they are swapped or not.

+",8796,,55,,5/11/2021 10:56,5/11/2021 10:56,How and why does swap test works?,,2,2,,,,CC BY-SA 4.0 +8513,2,,8511,10/17/2019 21:10,,10,,"

What that cSWAP test does (and doesn't) do

+ +

The important thing about the controlled-SWAP test is that what it does isn't just to SWAP, or to not SWAP, the two inputs. The controlled-SWAP test involves a control qubit which is in a superposition of $\def\ket#1{\lvert#1\rangle}\def\bra#1{\langle#1\rvert}\ket{0}$ and $\ket{1}$: that is, we measure the first qubit of the state +$$ \mathrm{cSWAP} \,\Bigl(\ket{+} \otimes \ket{\alpha} \otimes \ket{\beta}\Bigr)$$ +in the basis $\ket{+}, \ket{-}$; or to put it in a different way, we measure the first qubit of the state +$$ \bigl(H \otimes \mathbf 1 \otimes \mathbf 1\bigr)\,\mathrm{cSWAP}\,\bigl(H \otimes \mathbf 1 \otimes \mathbf 1\bigr) \,\Bigl(\ket{0} \otimes \ket{\alpha} \otimes \ket{\beta}\Bigr)$$ +in the standard basis, to obtain information about how similar $\ket{\alpha}$ and $\ket{\beta}$ are.

+ +

Why do we do this? Because what this does is to measure how symmetric the state $\ket{\alpha} \otimes \ket{\beta}$ is.

+ +

The cSWAP test as a simulated two-qubit measurement

+ +

The SWAP operator is Hermitian: that is, it has eigenvalues ±1. Obviously, any state of the form $\ket{\alpha} \otimes \ket{\alpha}$ is a +1 eigenstate: these span a space of dimension 3, which is spanned by $\ket{0}\ket{0}$, $\ket{1}\ket{1}$, and $\ket{+}\ket{+}$ — or, equivalently, $\ket{00}$, $\ket{11}$, and $\tfrac{1}{\sqrt 2}\bigl(\ket{01} + \ket{10}\bigr)$. The remaining state orthogonal to this space is +$$\ket{\Psi^-} = \tfrac{1}{\sqrt 2}\bigl(\ket{01} - \ket{10}\bigr)$$ +which, up to scalar factors, we can equivalently write as +$$\ket{\Psi^-} \propto \tfrac{1}{\sqrt 2}\bigl(\ket{\alpha}\ket{\alpha^\perp} - \ket{\alpha^\perp}\ket{\alpha}\bigr) \,.$$ +What the controlled-SWAP test does is to simulate a measurement of $\bigl\{ \Pi_{\textrm{sym}}, \ket{\Psi^-}\!\bra{\Psi^-} \bigr\}$ on the two qubits, where $\Pi_{\textrm{sym}}$ is the projector onto the span of all symmetric states $\ket{\alpha}\ket{\alpha}$ described above.

+ +

More specifically, the cSWAP test simulates measurement of the SWAP operator as an observable (as opposed to a unitary transformation). The SWAP operator has eigenvalues ±1, after all — in principle, we can measure the two qubits to see whether they are (or they collapse to) a +1 eigenstate.

+ +

The way that the cSWAP test does this is by using cSWAP in place of SWAP, to realise a phase kick, from the two qubits acted on up to the control. +For the eigenstates of SWAP, this records the eigenvalue in the phase of the control; performing a Hadamard then converts this information into a $\ket{0}$ (for symmetric states) or a $\ket{1}$ (for the antisymmetric state $\ket{\Psi^-}$). More generally, it collapses the target states either to the symmetric subspace, or the state $\ket{\Psi^-}$. +The procedure is literally performing a measurement of how symmetric (or antisymmetric) the state is, and producing the result $\ket{0}$ or $\ket{1}$ with some probability accordingly.

+ +

The maximum probability of failing the cSWAP test

+ +

Considering the procedure in this way, it's easy to see that the maximum probability of obtaining the outcome $\ket{1}$ is 0.5: this is the probability of the state $\ket{\alpha}\ket{\alpha^\perp}$ collapsing to the antisymmetric state $\ket{\Psi^-} \propto \tfrac{1}{\sqrt 2}\bigl(\ket{\alpha}\ket{\alpha^\perp} - \ket{\alpha^\perp}\ket{\alpha}\bigr)$, upon measurement.

+",124,,124,,10/18/2019 8:40,10/18/2019 8:40,,,,1,,,,CC BY-SA 4.0 +8514,2,,8511,10/18/2019 7:37,,7,,"

The key to understanding many quantum protocols and circuits is in the following circuit: +

+

This is especially true in the case where $U^2=I$, such that $U$ has eigenvalues $\pm1$. You can readily calculate that if the input, $|\psi\rangle$, of the second qubit has an amplitude $\alpha_+$ for being supported on the $+1$ eigenspace, then at the end of the algorithm, the probability of the first qubit being in the $|0\rangle$ state is $|\alpha_+|^2$.

+

So, consider the case of $U$ being swap. Swapping twice is certainly the identity, so swap has $\pm1$ eigenvalues. You'll also agree that two copies of the same state, when swapped, are the same as the input, so they correspond to a $+1$ eigenvalue. +$$ +\text{SWAP}\cdot|\psi\rangle|\psi\rangle=|\psi\rangle|\psi\rangle +$$ +The more different the two input states, the greater the difference between the input and the output of the swap, i.e. the less support there is on the $+1$ eigenspace there is, and the more likely you are to get the 1 outcome on measurement: +$$ +|\psi\rangle|\phi\rangle=\frac{1}{2}(|\psi\rangle|\phi\rangle+|\phi\rangle|\psi\rangle)+\frac{1}{2}(|\psi\rangle|\phi\rangle-|\phi\rangle|\psi\rangle) +$$ +In the equation above, I've split the input state into two terms: those from the symmetric (+1 eigenvalue) subspace and those from the antisymmetric (-1 eigenvalue) subspace. The lengths of the two vectors convey the probability amplitudes for being found in either subspace.

+",1837,,-1,,6/18/2020 8:31,10/18/2019 9:39,,,,0,,,,CC BY-SA 4.0 +8515,1,8516,,10/18/2019 12:41,,4,73,"

On page 1 of this paper it states that the QFI (Quantum Fisher Information) for pure states $\psi$ is $$\mathcal{Q}(\psi) = \sum_{i,j=1}^n\text{Tr}(X_iX_j\psi)-\text{Tr}(X_i \psi)\text{Tr}(X_j \psi)~~~~~~~~~~(3)$$ +Further down it states:

+ +
+

It is clear from Eq. (3) that if the generators are chosen from the Pauli group such that there are no stabilizers of the form $\pm X_i$ or $-X_iX_j$, then the QFI of the stabilizer state is equal to the number of stabilizers of the form $X_iX_j$.

+
+ +

How does this conclusion follows from equation (3)? What I get as a start is that if $X_iX_j$ are stabilizers then $$\sum_{i,j=1}^n[\text{Tr}(X_iX_j\psi)-\text{Tr}(X_i \psi)\text{Tr}(X_j \psi)] = \sum_{i,j=1}^n[1-\text{Tr}(X_i \psi)\text{Tr}(X_j \psi)]$$

+",2032,,55,,1/3/2021 11:07,1/3/2021 11:07,Stabilizer state QFI lower limit query,,1,0,,,,CC BY-SA 4.0 +8516,2,,8515,10/18/2019 12:47,,4,,"

The state $\psi$ (this is denoting the density matrix, even though it's a pure state) can be described as a sum of all the products of the stabilizers. We are promised that $X_i$ is not in the stabilizer, so every term in the sum of $\psi$, when multiplied by $X_i$, returns a tensor product of terms that is not just identity. Hence, it has zero trace. Thus, $\text{Tr}(X_i\psi)=0$, and you are just left with $\sum 1$, where the sum is taken over all stabilizers of the form $X_iX_j$.

+",1837,,,,,10/18/2019 12:47,,,,5,,,,CC BY-SA 4.0 +8517,1,,,10/18/2019 14:57,,5,162,"

I'm new to Quantum Error Correction, and I have a question on Shor's Code.

+ +

If we have a protected subspace, $V \subset \mathbf{C}^2\otimes \cdots \otimes \mathbf{C}^2$

+ +

$V=\operatorname{span}\{|0_{l}\rangle, |1_{L}\rangle.$ We also consider Pauli basis of $\mathbf{C}^2\otimes \cdots \otimes \mathbf{C}^2$ of 9 copies, and constructed as follows: Take the basis of $M_2$ consisting of: +\begin{eqnarray} \nonumber +X=\begin{pmatrix} +0 & 1\\ +1 & 0 +\end{pmatrix}, +Y= \begin{pmatrix} +0 & i \\ +-i & 0 +\end{pmatrix}, Z=\begin{pmatrix} +1 & 0\\ +0 & -1 +\end{pmatrix} & \text{and} & 1_2. +\end{eqnarray} +We list the 1-Paulis as $U_1,\cdots ,U_{28}.$ +Define the error map as $\mathscr{E}:M_{2^9}\rightarrow M_{2^9}$ by $\mathscr{E}(X)=\frac{1}{28}\sum_{i=1}^{28}U_iXU_i^*$. $\mathscr{E}$ is completely positive and trace preserving. How do we say that it satisfies the Knill Laflamme Theorem and thus ensure the existence of a recovery operator?

+ +
+ +

Cross-posted on math.SE

+",8801,,55,,1/2/2021 11:57,1/2/2021 11:57,Shor's Code: Understanding how it satisfies Knill Laflamme Theorem,,1,0,0,,,CC BY-SA 4.0 +8518,1,8521,,10/19/2019 8:30,,7,649,"

I have recently listened to a talk on quantum computing and was fascinated to learn about IBM Q Experience. Between the explanations in the User Guide and in Nielsen's book, I came to the following question:

+ +

Why does a controlled gate not act as a measurement?

+ +

+ +

In the common example of creating a Bell pair, we first bring a two qubit state from $| \psi \rangle = |00\rangle$ to $\frac{1}{\sqrt{2}} (|00\rangle + |10\rangle)$ with a Hadamard gate. So far so good.

+ +

But now we flip the second qubit only if the first is in state $|1\rangle$. This turns the state of the two-qubit system into $$\frac{1}{\sqrt{2}} (|00\rangle + |11\rangle).$$

+ +

How does that work without measuring the state of the first qubit?

+",8161,,,,,10/19/2019 19:43,Why does a controlled gate not constitute a measurement?,,2,2,,,,CC BY-SA 4.0 +8519,2,,8493,10/19/2019 9:08,,1,,"

Quantum computers are not just the ""conventional computer killer"" or a speedy replacement for the conventional computers as you might have assumed in your question.

+ +

Firstly, some classical tasks that are well suited to quantum computers. They run them really well in a much lesser time. This is because they are able to crunch large numbers using a small number of operations as you have discussed.

+ +

But this is not the only use case. The real strength of the quantum computers is to perform the tasks that are quite impossible to achieve on traditional computers. Considering the the most modest example, you cannot generate a truly random number on any conventional hardware. That's why they are called as Pseudo Random Number Generators. However for a quantum computer it is an astonishingly simple process. Similarly when we try to emulate natural processes (e.g behavior of subatomic particles) with traditional bits it not only lacks perfection but also computationally expensive. It is very convinient to perform such computations on a quantum computer as underlying physical objects representing qubits somehow do the math for you.

+ +

So, quantum computers are not a complete replacement for traditional computers (not just yet) but they help us broadening the kinds of problems tractable within computing.

+",8796,,,,,10/19/2019 9:08,,,,0,,,,CC BY-SA 4.0 +8520,2,,8518,10/19/2019 15:01,,0,,"

A mechanistic way of looking at it that is sure to infuriate any genuine physicists in the discussion :) is that a CNOT is two supercooled transmons interacting as described in the Open Pulse documentation and that the mystical ""observation"" does not occur until there is an interaction outside that environment.

+",7744,,,,,10/19/2019 15:01,,,,0,,,,CC BY-SA 4.0 +8521,2,,8518,10/19/2019 19:36,,4,,"

How it works depends on the choice of quantum system used for computation. For any choice of quantum system, the common theme is that $\text{CNOT}$ does not collapse the wavefunction, i.e. force a choice between $\vert 0 \rangle$ and $\vert 1 \rangle$, while a measurement does.

+ +

A simple example (oversimplified here) uses a non-linear Kerr medium to create a $\text{CNOT}$ gate with two photons acting as qubits. In this case a Hadamard gate ($H$) is created with phase shifters (slabs of transparent media with index of refraction $\ne 1$) and beam splitters (partially silvered glass), which produce the superposition of states.

+ +

The Kerr effect is a change in refractive index based on the presence of an electric field in the Kerr medium, and when two photons pass through a Kerr medium they can experience cross-phase modulation. In other words the atoms in the Kerr medium mediate an interaction between the two photons (qubits).

+ +

The upshot is that the system can be tuned such that the Kerr medium acts as the gate +$$K = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{bmatrix}.$$ +With access to $K$ and $H$, the $\text{CNOT}$ gate ($U_c$) is simply +$$U_c = (I \otimes H) K (I \otimes H) = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}.$$ +In this manner the $U_c$ gate is implemented without collapsing the wavefunction. Conversely, when a photon interacts with a photon detector (measurement) it is absorbed and converted to current or voltage, collapsing the wavefunction and forcing it to choose one definite state.

+ +

As noted above, this is an oversimplified explanation. Since you already have Nielsen and Chuang, you can see a much more rigorous treatment of this example in Section 7.4.2, as well as constructions of $\text{CNOT}$ in the context of ion traps (7.6.3) and nuclear magnetic resonance (7.7.3).

+",8623,,8623,,10/19/2019 19:43,10/19/2019 19:43,,,,0,,,,CC BY-SA 4.0 +8522,1,,,10/19/2019 21:22,,5,350,"

I would like to know if there's an analog for Schmidt rank that can tell me if a two-qubit unitary is entangling?

+ +

Suppose I have a parametrized two-qubit unitary $U^{(2)}(\theta)$. I would like to know a test to tell the degree of entanglement this gate produces, ideally as a function of $\theta$.

+ +

For example, given the following matrix:

+ +

$$ A = +\begin{pmatrix} +1 & 0 & 0 & 0 \\ +0 & -1 & 0 & 0 \\ +0 & 0 & e^{i\theta} & 0 \\ +0 & 0 & 0 & -e^{i\theta} \\ +\end{pmatrix} +$$

+ +

the test should tell me that that $A \propto Z \otimes R_z(\theta)$ is not entangling. But given the matrix: +$$ +B = \begin{pmatrix} +1 & 0 & 0 & 0 \\ +0 & 1 & 0 & 0 \\ +0 & 0 & e^{-i\theta} & 0 \\ +0 & 0 & 0 & e^{i\theta} \\ +\end{pmatrix} +$$ +the test should tell me that $B = CR_z(\theta)$ is entangling (provided $\theta \neq 0$). In the best case, the test would yield some degree of entanglement as a function of $\theta$ though such a metric may depend on the initial state instead of just the gate...

+",1939,,26,,10/20/2019 17:16,10/20/2019 18:38,How to check if a two-qubit gate is entangling?,,1,0,,,,CC BY-SA 4.0 +8523,1,8533,,10/20/2019 11:58,,4,124,"

Given the Hermitian Pauli group products +$$ +\Omega_{a,b}=\{\pm 1,\pm i\}_{a,b}\cdot \{I,X,Y,Z\}_{a,b}^{\otimes n} +$$ +composed of $n$ 2x2 pauli matrices $(I,X,Y,Z)$ in tensor product, such that they span a $2^n$ by $2^n$ matrix space, and $a,b=0,1,\cdots , 2^n-2, 2^n-1$, does there exist a reference for their matrix index representation +$$ +\Omega_{a,b} = \sum_{k=0}^{2^n-1}\sum_{l=0}^{2^n-1}A_{a,b,k,l}\left|k\right>\left<l\right| +$$ +to find the complex coefficients $A_{a,b,k,l}$, where I write them using bras and kets, and matrix multiplication +$$ +\Omega_{a,b}\Omega_{g,h}=f_{a,b,g,h,u,v}\Omega_{u,v} +$$ +to find the complex structure constants $f_{a,b,g,h,u,v}$?

+ +

I have seen references, such as ZX, that use $\Omega_{a,b}\approx Z^aX^b$ notation, but those representations are never scaled by complex values to ensure they are Hermitian, nor have I seen an explicit matrix index representation for them.

+",8812,,26,,10/20/2019 16:58,10/21/2019 6:57,Matrix Index and multiplication rules for Hermitian Pauli group products,,1,1,,,,CC BY-SA 4.0 +8524,1,,,10/20/2019 17:15,,3,77,"

I'm trying to understand an entanglement swapping derivation provided in this PDF (pages 2 - 3)

+ +

I have several things about this process that I don't understand, and I was hoping someone could clarify.

+ +

Are the CNOT and Hadamard gates applied with respect to the $A_c$ bit? If so, am I correct in this math (starting from the same joint state given in the PDF)?

+ +

$$|\psi\rangle = \frac{1}{2}(|0_C0_{Ac}\rangle + |1_C1_{Ac}\rangle) \otimes (|0_A0_{B}\rangle + |1_A1_{B}\rangle)$$

+ +

$$|\psi\rangle = \frac{1}{2}(|0_C0_{Ac}0_A0_B\rangle + |0_C0_{Ac}1_A1_B\rangle + |1_C1_{Ac}0_A0_B\rangle + |1_C1_{Ac}1_A1_B\rangle)$$

+ +

Applying CNOT using $Ac$ as control bit and $A$ as target:

+ +

$$\mathrm{CNOT}|\psi\rangle = \frac{1}{2}(|0_C0_{Ac}0_A0_B\rangle + |0_C0_{Ac}1_A1_B\rangle + |1_C1_{Ac}1_A0_B\rangle + |1_C1_{Ac}0_A1_B\rangle)$$

+ +

Applying Hadamard onto $Ac$ bit:

+ +

$$\mathrm{H}.\mathrm{CNOT}|\psi\rangle = \frac{1}{2}(|0_C\rangle\otimes\frac{1}{\sqrt{2}}(|0_{Ac}\rangle + |1_{Ac}\rangle)\otimes|0_A0_B\rangle + |0_C\rangle\otimes\frac{1}{\sqrt{2}}(|0_{Ac}\rangle + |1_{Ac}\rangle)\otimes|1_A1_B\rangle + |1_C\rangle\otimes\frac{1}{\sqrt{2}}(|0_{Ac}\rangle - |1_{Ac}\rangle)\otimes|1_A0_B\rangle + |1_C\rangle\otimes\frac{1}{\sqrt{2}}(|0_{Ac}\rangle - |1_{Ac}\rangle)\otimes|0_A1_B\rangle)$$

+ +

Grouping and factoring, I end up with the following, which is different from the PDF derivation (and I'm not sure why):

+ +

$$\mathrm{H}.\mathrm{CNOT}|\psi\rangle = \frac{1}{2\sqrt{2}}|0_{Ac}0_A\rangle \otimes (|0_{C}0_B\rangle + |1_{C}1_B\rangle)$$

+ +

$$+ \frac{1}{2\sqrt{2}}|0_{Ac}1_A\rangle \otimes (|0_{C}1_B\rangle + |1_{C}0_B\rangle)$$

+ +

$$+ \frac{1}{2\sqrt{2}}|1_{Ac}0_A\rangle \otimes (|0_{C}0_B\rangle - |1_{C}1_B\rangle)$$

+ +

$$+ \frac{1}{2\sqrt{2}}|1_{Ac}1_A\rangle \otimes (|0_{C}1_B\rangle - |1_{C}0_B\rangle)$$

+ +

Given this final answer, as I understand it, if Alice has bits $00$, then Carol and Bob have the entangled bell state $00$; if Alice has $01$, then Carol and Bob have entangled bell state $10$; if Alice has $10$, then Carol and Bob have entangled bell state $01$, and lastly, if Alice has bits $11$, then Carol and Bob have entangled bell state $11$.

+ +

Is the general idea here that we're teleporting Carol's bit across Alice's entangled bits to then end up entangling Carol and Bob?

+",8568,,26,,10/20/2019 17:20,10/20/2019 17:20,Understanding shared Bell states from quantum entanglement,,0,0,,,,CC BY-SA 4.0 +8525,1,8526,,10/20/2019 18:14,,3,1117,"

As I understand it, you can transform the different Bell states into one another by applying various gates. Wikipedia has the Bell states written out as follows: +

+ +

And says that you can generate bell states 2, 3, and 4 from bell state 1 by applying Pauli gates as follows:

+ +

+ +

I understand the Z gate simply flips the sign in the middle, so I can see how applying that to bell state 1 generates bell state 2. However, I don't get how applying the X/CNOT gate to bell state 1 generates bell state 3. Shouldn't the output of that be $|00 \rangle + |10 \rangle$ instead of $|01 \rangle + |10 \rangle$, since the control qubit is 0 in the first half?

+",8568,,26,,10/20/2019 18:30,10/20/2019 18:30,Transforming the first Bell state into the other Bell states,,1,0,,,,CC BY-SA 4.0 +8526,2,,8525,10/20/2019 18:26,,5,,"

$\mathrm{X}$ is not equivalent to a $\mathrm{CNOT}$ gate. The former is a 1-qubit gate whereas the 2nd is a 2-qubit gate (in essence, a controlled-$\mathrm{X}$). The $\mathrm{X}$ basically flips the state of qubit B i.e., $|0\rangle_B\to|1\rangle_B$ and $|1\rangle\to|0\rangle_B$, and does not depend on the state of qubit A.

+",26,,,,,10/20/2019 18:26,,,,1,,,,CC BY-SA 4.0 +8527,2,,8522,10/20/2019 18:38,,4,,"

The metric you're looking for is known as entangling power.

+ +

Here are some references:

+ + + +

I will expand on this later.

+",26,,,,,10/20/2019 18:38,,,,1,,,,CC BY-SA 4.0 +8528,1,8529,,10/20/2019 18:40,,6,195,"

For the $|W_3\rangle=\frac{1}{\sqrt{3}}(|001\rangle+|010\rangle+|100\rangle)$, what does W stand for? Does it refer to an author name? Anyone knows a reference? Thanks

+",8321,,55,,10/22/2019 10:35,10/22/2019 10:35,What does W stand for in the W entangled state?,,1,1,,,,CC BY-SA 4.0 +8529,2,,8528,10/21/2019 0:37,,5,,"

Apparently $\vert W \rangle$ was first reported (and the naming convention first adopted) by Dür, Vidal and Cirac in this preprint on May 26, 2000 (version 1 of 2).

+ +

This is supported by the footnote on page 4 of this preprint on June 25, 2000 (version 3 of 3, this footnote did not appear in the earlier versions), which states (in part)

+ +
+

Very recently Dürr [sic], Vidal, and Cirac (LANL eprint quantph/0005115) + have found a tripartite pure state of 3 qubits which is stochastically + incomparable with the GHZ state.

+
+ +

Dür, Vidal and Cirac don't explicitly ascribe any special significance to the notational choice $\vert W \rangle$, so it seems that only the authors could say with any confidence whether $W$ has any significance.

+ +

Edit: The lead author's first initial is W. (for Wolfgang), which is plausible motivation for the notation $\vert W \rangle$, but I'm not aware of any evidence to support this.

+",8623,,8623,,10/22/2019 0:47,10/22/2019 0:47,,,,4,,,,CC BY-SA 4.0 +8531,1,,,10/21/2019 5:50,,5,129,"

I am new to the field of quantum algorithms. It is well known that quantum algorithms offer a speedup over classical algorithms in some problems. Regarding the problems in which quantum algorithms offer a speed up, I need to know the problems that don't yet have a quantum algorithm for them. Is there any kind of website that offers such problems that need quantum algorithms?

+",8817,,26,,10/21/2019 13:15,10/21/2019 13:15,Open problems in quantum algorithms,,0,5,,,,CC BY-SA 4.0 +8532,2,,8508,10/21/2019 6:46,,3,,"

In the following I'm assuming you're talking about a two-qubit system. You don't explicitly say, but I infer from the calculation you're showing. If not, this can all be generalised easily enough...

+ +

I would start by writing +$$ +\langle j_2|\langle j_1| U(|0\rangle\!\langle0|\otimes\rho)U^\dagger|j_2\rangle|j_1\rangle=\text{Tr}\left(U(|0\rangle\!\langle0|\otimes\rho)U^\dagger|j_2\rangle\langle j_2|\otimes|j_1\rangle\langle j_1|\right). +$$ +If it's not clear to you why that's correct, work backwards - when you take the trace you can sum over any orthonormal basis. Just pick any basis such that $|j_2\rangle|j_1\rangle$ is a member of that basis, so all other elements are orthogonal.

+ +

Next, I can use the cyclic properties of the trace to move the $U$. +$$ +\text{Tr}\left((|0\rangle\!\langle0|\otimes\rho)U^\dagger|j_2\rangle\langle j_2|\otimes|j_1\rangle\langle j_1|U\right) +$$ +Next, define $|\Psi\rangle=U^\dagger|j_2\rangle|j_1\rangle$, so this is the same as +$$ +\text{Tr}\left((|0\rangle\!\langle0|\otimes\rho)|\Psi\rangle\langle \Psi|\right) +$$

+ +

Now, I can perform the trace by first applying the partial trace on the first qubit, and then the trace on the second qubit: +$$ +\text{Tr}\text{Tr}_1\left((|0\rangle\!\langle0|\otimes\rho)|\Psi\rangle\langle \Psi|\right)=\text{Tr}\left(\rho\cdot\text{Tr}_1\left((|0\rangle\!\langle0|\otimes I)|\Psi\rangle\langle \Psi|\right)\right). +$$ +So, if we define +$$ +M=\text{Tr}_1\left((|0\rangle\!\langle0|\otimes I)|\Psi\rangle\langle \Psi|\right), +$$ +then the answer is expressed as $\text{Tr}(M\rho)$.

+ +

Finally, we can certainly write (without knowing anything more about it) that +$$ +|\Psi\rangle=\alpha|0\rangle|\phi_0\rangle+\beta|1\rangle|\phi_1\rangle, +$$ +for an arbitrary pair of single-qubit states $|\phi_0\rangle,|\phi_1\rangle$ and $|\alpha|^2+|\beta|^2=1$, which would mean that +$$ +M=|\alpha|^2|\phi_0\rangle\langle\phi_0|. +$$ +If you want it to be the more specific form given in the question ($|\alpha|^2=\frac12$), then you need more information about $U$.

+",1837,,,,,10/21/2019 6:46,,,,0,,,,CC BY-SA 4.0 +8533,2,,8523,10/21/2019 6:57,,4,,"

If you write $Z^aX^b$, there's an implicit ""add a phase $i$ to make it Hermitian if necessary"", although I guess there are a couple of different conventions you might use the determine the sign used. So long as you're clear about the convention it doesn't really matter because you've got the extra $\pm 1$ freedom to add in to adjust for it.

+ +

As for an explicit matrix index representation, +$$ +A_{a,b,k,l}=i^{a\cdot b}(-1)^{a\cdot k}\delta_{b\oplus l=k} +$$ +where $\delta$ is the kronecker delta. Here I've chosen a slightly different convention for introducing the $i$ which makes the representation easier to write down: wherever there's a pair $ZX$, assume it's $iZX=Y$.

+ +

If you want to work out the effect of the product of two terms, you could do it long-hand, but I think it's easier to work it our with the Pauli operators first and translate it back: +$$ +Z^aX^bZ^gX^h=(-1)^{b\cdot g}Z^aZ^gX^bX^h=(-1)^{b\cdot g}Z^{a\oplus g}X^{b\oplus h}. +$$

+",1837,,,,,10/21/2019 6:57,,,,2,,,,CC BY-SA 4.0 +8534,2,,8517,10/21/2019 7:13,,2,,"

Strictly, what you have to calculate is that for all $i$ and $j$ +$$ +\langle 0_L|U_iU_j|1_L\rangle=0 +$$ +and +$$ +\langle 0_L|U_iU_j|0_L\rangle=\langle 1_L|U_iU_j|1_L\rangle. +$$ +(I've ignored the Hermitian conjugate because all the single-qubit errors are Hermitian.)

+ +

Obviously there's a lot of work involved in calculating all $28^2$ cases of $i,j$. You can at least simplify this by using symmetry - there's permutation invariance within blocks of three qubits and between blocks of three qubits. This means that you can reduce your work to two sets of cases: (i) two Pauli errors on the same block of 3 qubits (of which there are $9^2$ cases, but we can take the two errors to be on the first two qubits, or two on the first, reducing to $3+3^2$ cases) and (ii) one Pauli error on each of 3 qubits (of which there are $9^2$ cases, but we can assume the errors are on the first qubit of each block, reducing to $3^2$ cases). 21 error combinations is a much more tolerable calculation.

+ +

Could I also recommend finding out about the stabilizer formalism as applied to error correcting codes? This places the calculation in a completely different light which is much more convenient.

+",1837,,,,,10/21/2019 7:13,,,,2,,,,CC BY-SA 4.0 +8535,1,,,10/21/2019 9:38,,2,66,"

Suppose in ""near future"" that we have quantum computers with thousands of qubits that can run Grover, HHL, and so on. Then, can we hope in the ""near future"" to have some web application that will run quantum algorithms in real-time?

+ +

For example, suppose Google or IBM with their quantum computers have a web application. A client sends a request on this application, therefore a classical computer analyses the request and detects an inversion of a huge matrix (that satisfied the HHL conditions). Then the classical computer sends the matrix to the quantum computer that solves instantly the problem with the HHL algorithms and returns the result to the classical computer. Finally, the classical computer sends back the result to the client. All this in a few milliseconds.

+ +

Is this example possible or will we have only applications like on the IBMQ that take some hours to be handled?

+",7762,,55,,10/22/2019 10:37,10/22/2019 10:37,Can we hope in the near future to have web apps running quantum algorithms in real-time?,,0,2,,,,CC BY-SA 4.0 +8536,1,,,10/21/2019 9:45,,5,166,"

Entanglement in Algorithms

+ +

Most algorithms in quantum computing find their strength in making use of entanglement.

+ +

I am interested in evaluating the amount of entanglement generated within an algorithm, maybe even being able to think of knowing how this information changes for different numbers of runs of the algorithm or if the algorithm is run on different numbers of qubits.

+ +

How would one best do this?

+ +

My thoughts are to calculate the density matrix of the computational qubits at every time step and to find the von Neumann entropy of this multipartite state and work from there but it appears that there are many different kinds of entanglement measures useful for different kinds of situations [1].

+ +

Take Shor's factoring algorithm for example. How would you go about calculating the entanglement at each time step? I have found two approaches thus far, [2] which takes into account mixed states using the notion of a Groverian measure and [3] which makes use of standard von Neumann entropy.

+",4373,,55,,1/2/2021 11:56,1/2/2021 11:56,How to measure entanglement in an algorithm?,,1,0,,,,CC BY-SA 4.0 +8537,1,,,10/21/2019 13:56,,2,142,"

I have already asked this question on reddit.com/r/QuantumComputing.

+ +

Cirq supports to create quantum circuits composed by qubits having 2D grid structure.

+ +

We have been preparing educational materials to teach the basics of quantum computing and quantum programming tools. I am looking for an interesting and very basic level example using 2D grid of qubits. It should not be more complex than superdense coding or quantum teleportation but still have some fun.

+ +

Do you know any example or do you have any idea?

+ +

We have used Qiskit until now, and we plan to include the examples by pyQuil and Cirq. Having some good motivation would be pedagogically reasonable when including them, as we would ask the user to install and learn more than one platform.

+ +

Thank you!

+",5208,,,,,10/21/2019 13:56,Cirq: Any interesting introductory level example using 2D grid of qubits?,,0,6,,,,CC BY-SA 4.0 +8538,1,8540,,10/21/2019 16:11,,6,3357,"

I'm struggling to understand the process of how to decompose a unitary transform into two-level unitary matrices. I've been trying to understand the process as detailed in arXiv:1210.7366, but I don't get where those 2x2 matrices in the individual two-level matrices are coming from, or what P actually is. If anyone could walk me through a numerical example of decomposing for example, a 4x4 matrix into two-level unitary matrices, that'd be greatly appreciated!

+",8568,,26,,10/21/2019 16:15,10/21/2019 23:14,How to decompose a unitary transform into two-level unitary matrices?,,2,3,,,,CC BY-SA 4.0 +8539,2,,8538,10/21/2019 20:15,,3,,"

Their approach is more advanced than the simple one, described in the book ""Quantum Computation and Quantum Information"" by M. Nielsen and I. Chuang, section 4.5.1. It's better to understand it first. Basically we are just making zeros under diagonal step by step, where each step is the multiplication by some two-level unitary. Hence there are only $d(d-1)/2$ steps needed.

+ +

In the linked paper, $P$ is just a permutation of $d$ numbers $\{1,2,..,d\}$ represented as a tuple $(j_1, j_2, .. ,j_d)$. For a fixed $P$ we can take two consecutive numbers $j_k,j_{k+1}$ from the tuple $P$ by picking $k$ from the set $\{1,2,..,d-1\}$.

+",5870,,,,,10/21/2019 20:15,,,,1,,,,CC BY-SA 4.0 +8540,2,,8538,10/21/2019 23:14,,4,,"

The basic idea is to multiply $U$ on the left with $2\times 2$ unitaries until the identity is obtained. This method provides a sequence of gates $U_k$ such that $U_1\cdots U_n U=I$, which then gives you the decomposition of $U$ in terms of $2\times2$ unitaries: $U=U_1^\dagger \cdots U_n^\dagger$.

+ +

For example, suppose you start with +$$U=\begin{pmatrix}1/2&\frac{1}{2\sqrt3}&\sqrt{2/3}\\-1/2&\sqrt3/2&0\\1/\sqrt2&1/\sqrt6&-1/\sqrt3\end{pmatrix}.$$ +We start by finding a matrix which only mixes first and third row of $U$, with the goal of annihilating the $(3,1)$ element. +In general, a matrix $U_1$ mixing only first and third column of $U$ has the form +$$\begin{pmatrix}* & 0 & * \\ 0 &1&0\\ *&0&*\end{pmatrix}.$$ +To send $U_{31}$ to zero essentially amounts to finding parameters $a,b$ such that $aU_{11}+b U_{31}=0$, which gives $a=-b U_{31}/U_{11}$ (the case $U_{11}=0$ can be handled separately). You then put the resulting $a,b$ in the third row of $U_1$, and then adjust the rest of the parameters in $U_1$ in order to make it into a unitary. This results in the following $U_1$: +$$U_1=\begin{pmatrix} +1/\sqrt3 & 0 & \sqrt{2/3}\\ +0 & 1 & 0\\ +-\sqrt{2/3} & 0 & 1/\sqrt3 +\end{pmatrix}.$$ +Then, +$$U_1 U = \begin{pmatrix}\sqrt3/2 & 1/2 & 0 \\ -1/2 & \sqrt3/2 & 0 \\ 0 & 0 & -1\end{pmatrix}.$$ +In this case we were lucky in that we obtained two zeros in one step, but this is only due to this particular choice of $U$. You now need to find some $U_2$ which only mixes the first two rows of $U$, that is, a matrix with the structure +$$\begin{pmatrix}* & * & 0 \\ * &*&0\\ 0&0&1\end{pmatrix}.$$ +To send to zero the $(2,1)$ element of $U_1 U$ we can use (again, focus on coefficients that send to zero the elements in the first column of $U_1U$, and put them in the second row of $U_2$, then filling out the rest to make $U_2$ unitary): +$$U_2=\begin{pmatrix}-\sqrt3/2 & 1/2 & 0 \\ 1/2 & \sqrt3/2 & 0 \\ 0 & 0 & 1\end{pmatrix},$$ +so that finally +$$U_2U_1 U=\begin{pmatrix}-1&0&0\\0&1&0\\0&0&-1\end{pmatrix}.$$ +Notice how some of the signs in the resulting matrix are wrong. This is because I didn't put much care in the signs of the matrices $U_i$. Following the more accurate prescription given in the paper (note how they also include the determinants in the expressions, and take care of the cases with complex numbers) you will always obtain the identity at the end.

+ +

Finally, it might be interesting to note that this is essentially the LU decomposition applied to the special case of a unitary matrix.

+",55,,,,,10/21/2019 23:14,,,,2,,,,CC BY-SA 4.0 +8541,2,,8536,10/22/2019 7:38,,4,,"

This is not much of an answer, but is probably too long for a comment...

+ +

I don't believe that there's a canonical way of doing this. You'd be best off understanding why you're asking the question, and what you want to get out of it. From there, you tailor how you're going to measure it. But multipartite entanglement is a really messy problem, even just for pure states.

+ +

Let me give an example of how messy and confusing it can be. There is a paper about ""the power of one clean qubit"" which introduces a computational model that is known as DQC1. One of the first questions asked about this computation was ""is there any entanglement?"" Not even how much, just a simple yes or no. Originally, it was concluded that there is no entanglement is this system because they looked at one particular bipartition of the qubits (the most obvious one), and there was no entanglement across that bipartition (I'm not sure if this is explicitly stated anywhere, but this is how it has been read by many). However, later studies looked more in-depth at other bipartitions and found the existence of entanglement there.

+",1837,,,,,10/22/2019 7:38,,,,1,,,,CC BY-SA 4.0 +8542,1,8555,,10/22/2019 14:34,,6,258,"

Quantum computing refers (occasionally implicitly) to a ""computational basis"". +Some texts posit that such a basis may arise from a physically ""natural"" choice. +Both mathematics and physics require meaningful notions to be invariant under a change of basis.

+ +

So I wonder whether the computational complexity of a problem (say, the k-local Hamiltonian) depends on the basis of the n-qubit tensor product space $\mathbb{C}^{2^n}$ be what is (wrongly) called the ""canonical"" one?

+ +

Specifically, it seems that the ""definition"" for a Hamiltonian to act nontrivially only on k of the n qubits fails the sanity check of invariance under a change of basis.

+ +

Edit for clarification:

+ +

Let $U \in SU(2^n,\mathbb{C})$ be an arbitrary change of basis of the full Hilbert space and $H = A_{2^k} \otimes I_{2^{n-k}}$ be a Hamiltonian that acts nontrivially only the first $k$ qubits. Then $U^\dagger H U$ might not be of the same form as $H$ only acting on $k$ qubits.

+",8824,,8824,,10/23/2019 2:50,10/24/2019 14:03,Is quantum complexity basis-invariant?,,3,2,,,,CC BY-SA 4.0 +8543,1,8556,,10/22/2019 21:42,,9,641,"

How can I demonstrate on the exponential part equality of the Hadamard matrix: +$$H=\frac{X+Z}{\sqrt2}\equiv\exp\left(i\frac{\pi}{2}\frac{X+Z}{\sqrt2}\right).$$

+ +

In general, how can I demonstrate on: +$\exp(i(\pi/2)M) \equiv M$ for any matrix whose eigenvalues are all $\pm 1$, and that such matrices uniquely satisfy $M^2=I$?

+ +

(Actually, I tried a guess: since the eigenvalues are all $\pm 1$ - are real - so the matrix is Hermitian, and since $M^2=I$ so the matrix is Unitary, then this relation $\exp(i(π/2)M) \equiv M$ is valid)

+ +

Source: https://community.qiskit.org/textbook/chEx/Ex2.html

+",8009,,491,,7/26/2020 12:12,7/26/2020 12:12,How do I prove that the Hadamard satisfies $H\equiv e^{i\pi H/2}$?,,4,0,,,,CC BY-SA 4.0 +8544,2,,8542,10/22/2019 21:53,,4,,"

This is a partial answer addressing only what I know: Stoquastic Hamiltonians in the Monte Carlo sign problem. The TLDR is, yes, complexity may depend on the choice of basis.

+ +

A stoquastic Hamiltonian is one that has non-positive off-diagonal matrix +elements in the standard basis. This class of Hamiltonians was quite famously studied first here.

+ +

In the world-line Monte Carlo method, one tries to estimate the quantum partition function $Z=\text{Tr}(e^{-\beta H})$ for inverse temperature $\beta$ by cutting it into many pieces and sampling from it. This is done by writing +$$e^{-\beta H}=(e^{-\beta H/m})^m$$ +The trace can now be written as +$$\text{Tr}(e^{-\beta H})=\sum_i \langle i |e^{-\beta H})|i\rangle =\sum_{i_1,i_2,\dots,i_m}\langle i_1 |e^{-\beta H/m})|i_2\rangle\langle i_2 |\dots \langle i_m |e^{-\beta H/m})|i\rangle=\sum_J a_J +$$ where $|i\rangle$ are basis vectors of canonical/computational/standard basis and $J$ is a shorthand for the index set $i_1,i_2,\dots,i_m$.

+ +

How does this relate to stoquasticity you might ask. +Well, on the right hand side, I have written a big sum of terms I called $a_J$ that one can easily sample from using standard Monte Carlo methods just like one would estimate an integral via Monte Carlo sampling. However, in order for this to work, the summands should be positive! otherwise one samples from a quasi-probability distribution (i.e. a non-positive distribution). +Positivity of the summands is ensured for stoquastic Hamiltonians since to first order $e^{-\beta H}=1-\beta H$ and the sums involve only products of certain entries of this matrix. However, non-stoquastic Hamiltonians exhibit what is famously known as the Monte Carlo sign problem.

+ +

It should be rather self-evident now, that this is a problem of choosing the right basis: Prominently, in the eigenbasis of $H$ there is no problem since $H$ is diagonal. However, finding the eigenbasis or other sign-problem free bases was shown to be NP-complete already for 3-local Hamiltonians.

+ +

If you want to learn more, I suggest you take a look at these two papers addressing the Monte Carlo sign problem and how to alleviate it.

+ +

arxiv.org/abs/1906.02309,

+ +

arxiv.org/abs/1802.03408.

+",5322,,,,,10/22/2019 21:53,,,,0,,,,CC BY-SA 4.0 +8545,2,,8543,10/22/2019 22:23,,4,,"

Hint: Consider the series expansion of the exponential in the case of matrices $M$ that satisfy $M^2=-1$ (in your case $M=i \frac{X+Z}{\sqrt(2)}$. You should find something akin to Euler's formula which renders the proof trivial.

+",5322,,,,,10/22/2019 22:23,,,,0,,,,CC BY-SA 4.0 +8546,1,,,10/22/2019 23:00,,3,74,"

The circuit for Kitaev phase estimation is given as:

+ +

+ +

By varying $\theta$, we are able to determine $\sin(2 \pi M \phi_k)$ and $\cos (2 \pi M \phi_k)$ from sampling the circuit and calculating the probabilities of different outputs of the first qubit ($\phi_k$ is a real number, with $e^{2 \pi i \phi_k}$ being the eigenvalue corresponding to $U$ and $|\xi_k\rangle$). This makes sense, except, the paper I'm reading says we have to take measurements with different values of $M$ to get maximum precision for our algorithm's output. Why is this the case?

+",4907,,,,,10/22/2019 23:00,Why must we take multiple measurements for different values of $M$?,,0,2,,,,CC BY-SA 4.0 +8547,1,,,10/22/2019 23:24,,3,99,"

When I try to put an Ry gate into my circuit in cirq, I get an error saying that it only takes one argument.

+ +
import cirq
+import numpy as np
+q = cirq.LineQubit(0)
+cirq.Circuit(cirq.Ry(np.pi / 2, q))
+
+ +
TypeError: Ry() takes 1 positional argument but 2 were given
+
+",119,,26,,10/24/2019 14:00,10/24/2019 14:00,cirq.Ry complains that it needs one argument,,1,0,,,,CC BY-SA 4.0 +8548,2,,8547,10/22/2019 23:24,,2,,"

cirq.Ry is a method that, given an angle, returns a gate. You then apply the gate to a qubit:

+ +
cirq.Ry(angle).on(qubit)
+
+ +

or, equivalently but a bit more confusingly:

+ +
cirq.Ry(angle)(qubit)
+
+",119,,119,,10/22/2019 23:35,10/22/2019 23:35,,,,0,,,,CC BY-SA 4.0 +8549,2,,8427,10/23/2019 11:11,,4,,"
+

That seems to restrict the output probability distributions of all quantum circuits to rather high entropy distributions.

+
+ +

The output of a typical randomly chosen quantum circuit is rather high entropy. That doesn't mean you can't construct circuits that have low entropy outputs (you can), it just means that picking random gates is a bad strategy for achieving that goal.

+ +
+

how can i P(x_i) equal 1/2^n when the bitstrings x_i are sampled from the uniform distribution?

+
+ +

How could it equal anything else? The probabilities of the target distribution have to add up to one, and you're picking each element 1/2^n of the time. For example, if there was a single element with all the probability, you'd score 0 * (2^n - 1)/2^n + 1/2^n = 1/2^n. You always score 1/2^n on average when picking randomly.

+ +
+

How can the value of F_XEB correspond to ""the probability that no error has occurred while running the circuit""?

+
+ +

When the paper says ""the probability that no error occurs"", what it means is ""In the systemwide depolarizing error model, which is a decent approximation to the real physical error model at least for random circuits, the linear xeb score corresponds to the probability of sampling from the correct distribution instead of the uniform distribution."".

+ +

Physically, it is obviously not the case that either a single error happens or no error happens. For example, every execution of the circuit is going to have some amount of over-rotation or under-rotation error due to imperfect control. But that's all very complicated. To keep things simple you can model the performance of the system as if your errors were from simpler models, such as each gate have a probability of introducing a Pauli error or such as you either sample from the correct distribution or the uniform distribution.

+ +

Simplified models actually do a decent job of predicting system performance, particularly on random circuits. For example, consider the way the fidelity decays as the number of qubits and number of layers are increased. The fidelity decay curve from the paper matches what you would predict if every operation had some fixed probability of introducing a Pauli error.

+",119,,,,,10/23/2019 11:11,,,,3,,,,CC BY-SA 4.0 +8550,2,,8543,10/23/2019 13:35,,6,,"

For questions like this, the conventional physics notation is easier to work with than the QIT gate notation. Define $\vec \sigma = (\sigma_1,\sigma_2,\sigma_3)$ to represent the three Pauli matrices +$$\sigma_1 = X = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}, \;\;\; \sigma_2 = Y = \begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix}, \;\;\; +\sigma_3 = Z = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}.$$ +The Pauli matrices form a basis for the Lie algebra $\mathfrak{su}_2$, and the corresponding Lie group elements, $U \in SU(2)$, are given by the exponential map +$$U = e^{i\, \vec \phi \, \cdot \vec \sigma}, \;\;\; \vec \phi \in \mathbb{R}^3.$$ +Define the vector $\vec \phi$ by a magnitude $\alpha$ and unit vector $\hat \phi = (\phi_1,\phi_2,\phi_3)$ such that $\vec \phi = \alpha \hat \phi$. Simple multiplication shows that $(\vec \phi \cdot \vec \sigma)^2 = \alpha^2$. With this relationship, the Taylor expansion of $U$ works out very nicely. +$$U = \sum \limits_{i=0}^\infty \frac{i^n}{n!} \, (\vec \phi \cdot \vec \sigma)^n = \sum \limits_{j=0}^\infty \frac{(-1)^j}{(2j)!} \alpha^{2j} + i \hat \phi \cdot \vec \sigma \sum \limits_{j=0}^\infty \frac{(-1)^j}{(2j + 1)!} \, \alpha^{2j+1}$$ +$$=I \, \cos \alpha + i \hat \phi \cdot \vec \sigma \sin \alpha = \begin{bmatrix} \cos \alpha + i \phi_3 \sin \alpha && (\phi_2 + i \phi_1) \sin \alpha \\ (-\phi_2 + i \phi_1) \sin \alpha && \cos \alpha - i \phi_3 \sin \alpha \end{bmatrix}.$$

+

With this formula it's simple to find the group element corresponding to given Lie algebra parameters. In the case of your specific question $\alpha = \tfrac{\pi}{2}$ and $\hat \phi = (\tfrac{1}{\sqrt{2}}, 0, \tfrac{1}{\sqrt{2}})$. Plugging this in gives +$$U_{x+z} = \begin{bmatrix} \frac{i}{\sqrt{2}} && \frac{i}{\sqrt{2}} \\ \frac{i}{\sqrt{2}} && -\frac{i}{\sqrt{2}} \end{bmatrix} = \frac{i(X + Z)}{\sqrt{2}}.$$ +In the underlying question from qiskit, $\equiv$ is defined as equivalence modulo global phase, so, as desired, the result equals $\tfrac{X+Z}{\sqrt{2}}$ up to a global phase of $e^{i\frac{\pi}{2}}$.

+

The more general question of determining what other Lie algebra parameterizations share this property (apart from trivial solutions, which are given by multiples of the identity) reduces to finding solutions to the equation +$$e^{i \vec \phi \, \cdot \, \vec \sigma} = e^{i \theta} \, \hat \phi \cdot \vec \sigma \; (\text{mod} \; \theta).$$ +This requires $\cos \alpha = 0$, which means vectors solving this equation will have $\alpha = \pm \tfrac{\pi}{2}$. From there it's relatively straightforward to see that solutions take the form of vectors with $\alpha = \pm \frac{\pi}{2}$ and $e^{\pm i \frac{\pi}{2} \hat \phi \, \cdot \, \vec \sigma} = \pm i \, \hat \phi \cdot \vec \sigma$.

+",8623,,8623,,7/26/2020 1:41,7/26/2020 1:41,,,,0,,,,CC BY-SA 4.0 +8551,1,,,10/23/2019 14:03,,13,617,"

As I understand from this IBM post both the IBM and Google teams have independently built 53-qubit processors. What is the significance of the number 53? It is purely coincidental, or is there a deeper reason why both team have the same number of qubits?

+",2758,,55,,10/23/2019 18:43,11/5/2019 18:15,Why do the IBM and Google processors both have 53 qubits?,,3,2,,,,CC BY-SA 4.0 +8552,1,8714,,10/23/2019 14:15,,7,395,"

I understand that both have 53 qubit devices, yet it is Google that has demonstrated quantum supremacy (although IBM refutes this!). I'm not sure if this is true but it seems like IBM cannot replicate the quantum circuits and measurements that Google has managed on their device. Please correct me if this assumption is wrong.

+ +

Reading the Google paper, the following line was significant

+ +
+

Our largest random quantum circuits have 53 qubits, 1,113 single-qubit gates, 430 two-qubit gates, and a measurement on each qubit, for which we predict a total fidelity of 0.2%.

+
+ +

That fidelity seems pretty good given that you've gone through so many gates. The data on IBM is a bit sketchy but this table seems to suggest that even their IBM-Q System One has 2-qubit gates with an average error of 1.69%. So after 400 odd gates, the fidelity drops below 0.1%. And that's not including the single qubit gates or the measurement at the end.

+ +

Is this the ace card that allows Google to demonstrate what they did? Have they out-engineered IBM in producing high fidelity gates or does the advantage come from something else?

+",4831,,4831,,10/23/2019 14:22,11/8/2019 3:23,Why does Google's quantum processor outperform IBM's?,,1,0,,,,CC BY-SA 4.0 +8553,1,8571,,10/23/2019 14:31,,3,866,"

In Qiskit it is possible to specify noise models to apply to simulations. This allows noise to be defined for certain operations, like measurement or each type of gate.

+ +

Is it also possible to change the noise for different parts of the circuit. Such as turning noise on only for specific parts of the circuit?

+",409,,,,,10/25/2019 19:34,How to selectively apply noise in Qiskit simulations?,,1,0,,,,CC BY-SA 4.0 +8554,1,8557,,10/23/2019 15:48,,21,4321,"

Google recently announced that they have achieved ""Quantum Supremacy"": ""that would be practically impossible for a classical machine.""

+ +

Does this mean that they have definitely proved that BQP ≠ BPP ? And if that is the case, what are the implications for P ≠ NP ?

+",4636,,55,,10/23/2019 18:43,11/5/2019 18:41,"What does Google's claim of ""Quantum Supremacy"" mean for the question of BQP vs BPP vs NP?",,2,10,,,,CC BY-SA 4.0 +8555,2,,8542,10/23/2019 16:19,,4,,"

The computational basis is ""natural"" in the sense that it provides a practical representation of measurement outcomes. Other bases are also ""natural"" for other tasks, and bases cannot be interchanged aribtrarily if such a change impacts the underlying tensor structure of the system.

+ +

For example the Bell states form a basis in four dimensional Hilbert space representing two maximally entangled qubits. Bell states are not bilinear combinations of computational basis states, so we cannot simply choose to represent separable states over the Bell basis, or entangled states over the computational basis.

+ +

What seems to be missing from your assumptions is a recognition that the tensor product structure over the computational basis is of fundamental importance because it comports with measurement outcomes - our only connection to the quantum realm. In other words, the computational basis for an $n$-qubit system, $\vert \psi_0 \rangle$, is a tensor product space of the form +$$\vert \psi_0 \rangle = \vert b_0 \rangle \otimes \vert b_1 \rangle \otimes ... \otimes \vert b_{n-1} \rangle \in (\mathbb{C}^2)^{\otimes n},$$ +where $\vert b_i \rangle \in \mathbb{C}^2$. +A transformation that preserves the tensor structure of $\vert \psi_0 \rangle$, i.e. does not induce entanglement, takes the form +$$U = U_0 \otimes U_1 \otimes , ... , \otimes U_{n-1} \in U(2)^{\otimes n} \subset U(2^n).$$ +Hamiltonians of this form are regularly employed in both theory and practice, where any given $U_i$ can act trivially or non-trivially.

+ +

However, generally in practice only a discrete set of single qubit transformations are available. By the Solovay-Kitaev theorem $U_i$ can be approximated to precision $\epsilon$ using $\Theta(\log^c(\tfrac{1}{\epsilon}))$ gates from a fixed discrete set, where $c$ is a constant between 1 and 2 (as far as I know its exact value is still an open problem).

+ +

When multilevel gates are applied to the system to induce entanglement, we still need to be able to track the relationship back to the tensor structure of $\vert \psi_0 \rangle$. For sufficiently large $n$, applying an arbitrary $SU(2^n)$ transformation to $\vert \psi_0 \rangle$ amounts to complete decoherence of the system because any meaningful description of the wavefunction is lost (i.e., breaking $SU(2^n)$ down into a Tensor Network representation, discussed below, becomes intractable.)

+ +

Such transformations need to be applied in very rigorous and non-trivial ways. As Carlton Caves said ""Hilbert space is a big place,"" and it's easy to get lost. Notice, for example, that the space of linear transformations spanned by $U(2^n)$ is exponentially larger than that of $U(2)^{\otimes n}$, e.g. $U(2^n)$ has real dimension $2^{2n}$, whereas $U(2)^{\otimes n}$ has real dimension $4n$.

+ +

In practice, low energy systems can only access a relatively small portion of the full Hilbert space because physically realistic states are heavily constrained by locality. Tensor networks are a good example of a class of approaches to managing this challenge by limiting the description of a system to physically realistic regions of Hilbert space (see, e.g. section 3.3 here).

+",8623,,8623,,10/23/2019 21:09,10/23/2019 21:09,,,,4,,,,CC BY-SA 4.0 +8556,2,,8543,10/23/2019 18:28,,9,,"

First of all, note that the statement, as written, is wrong (or rather, it is correct only as long as the ""$\equiv$"" symbol is taken to mean ""equal up to a phase""). An easy way to see it is by computing the determinant of $H=e^{i\pi H/2}$, which gives $-1=1$ (using $\det[\exp(A)]=\exp[\operatorname{Tr}(A)] $ for all $A$ and $\operatorname{Tr}(H)=0$).

+ +
+ +

Now, assume $A$ is any matrix satisfying $A^2=I$ (note that we don't even need to assume that $A$ has a specific dimension). Then, $\exp(i\alpha A)=\cos(\alpha)I + i\sin(\alpha)A$ (you can see this by expanding the exponential in power series as shown in another answer, or using directly the formula $\exp(A)=\cos(A)+i\sin(A)$, which also works for matrices). +It follows that +$$e^{i\pi A/2}=i A.$$ +Your formula is a special case of this. You can check that, given any direction $\hat{\mathbf n}$ with $|\hat{\mathbf n}|=1$, denoting with $\boldsymbol\sigma_i$ the $i$-th Pauli matrix, you have +$$(\hat{\mathbf n}\cdot\boldsymbol \sigma)^2=I,$$ +thus the conclusion follows.

+ +

Finally, because you also referenced the eigenvalues, note that $A^2=I$ if and only if $A=PDP^{-1}$ with $P$ invertible and $D$ diagonal with $\pm1$ elements. See this answer on math.SE for a proof.

+",55,,124,,10/24/2019 23:07,10/24/2019 23:07,,,,5,,,,CC BY-SA 4.0 +8557,2,,8554,10/23/2019 18:39,,16,,"

Google's paper/results are kind of sideways to questions in computational complexity about the relation between $\mathrm{BPP}$ and $\mathrm{BQP}$ (and even further from questions about whether $\mathrm{P}\ne\mathrm{NP}$). It's more as if Google relies on the hypothesis that $\mathrm{BPP}\ne\mathrm{BQP}$ as evidence that their quantum computer performs a task many orders of magnitude faster than a classical computer could.

+ +

Google performed a sampling task on their quantum computer, that they have strong theoretical reasons to believe is not easily performed on a classical computer. If we say that these complexity classes live in some idealized platonic universe, then Google's results don't shed any light about the difficulty of proving whether or not they are equal to one another - because Google's paper assumes that they are not equal to one another.

+ +

What Google's paper does do, is provide evidence that the hypothesis that ""a probabilistic Turing machine can efficiently simulate any realistic model of computation"" is incorrect. They have prepared and maintained coherence of a state of their choosing in a Hilbert space of dimension $2^{53}$. As Aaronson argues, is akin to the Wright Flyer providing evidence that ""heavier-than-air human-controlled powered flight is impossible"" is incorrect.

+",2927,,2927,,11/5/2019 18:41,11/5/2019 18:41,,,,3,,,,CC BY-SA 4.0 +8558,1,8564,,10/23/2019 20:48,,2,1193,"

I'm trying to understand the following derivation of decomposing a controlled $R_k$ (phase) gate into a combination of CNOTs and single qubit gates, but there's one main thing about the process that I'm not following and that is:

+ +

What is the effect that the CNOT gate is having on $|\psi_{mn} \rangle$?

+ +

I thought that CNOT simply flipped the target bit if the control qubit was 1, but in that answer, it doesn't seem like the CNOT is having this effect at all. The arbitrary state just seems to be staying the same (in the first example where they show the effect of CNOT on $|\psi_{mn} \rangle$)?

+ +

Then in the full derivation later in the post, the CNOT seems to be removing parts of the phases from the qubits? I don't quite understand that either.

+",8568,,55,,10/24/2019 9:58,10/24/2019 9:58,Decomposing a controlled phase gate into CNOTs,,1,0,,,,CC BY-SA 4.0 +8559,1,,,10/24/2019 4:18,,1,56,"

I was wondering if the multi-prime factoring problem can be solved in a hybrid approach using DWave (to factor) and Shor's algorithm (in Qiskit)? Please let me know your thoughts.

+ +

Thanks!

+",8837,,26,,10/24/2019 13:52,10/24/2019 13:52,Suggestions for hybrid factoring algorithm on DWave and Qiskit,,0,1,,,,CC BY-SA 4.0 +8560,2,,8554,10/24/2019 5:22,,3,,"

Paraphrasing some tweets on the matter earlier, the result is rather underwhelming because it plays on a discrepancy between what they mean by quantum supremacy (QS) and what people tend to think QS means.

+ +

What I find most people think QS is supposed to mean, and what I assumed it meant until a month or so ago, was that there exists a computable problem (in the CTT sense of computation) and an actual quantum computer, such that, at some scales, the problem is tractable on the quantum computer but intractable on all classical computers.

+ +

The problem the Google QC folks have demonstrated is not computation in the CTT sense. It is a physical process of sampling that involves computations as part of the process, and as with any physical process, it can be simulated approximately by computation. They have good reason to believe (proof? I'm not sure but it should reasonably be assumed true by default anyway) that computation to similate the process is going to be intractably slow. This is not surprising at all. It's a fundamental consequence of quantum mechanics that lots of physical processes will have that property.

+ +

That's not to say it's entirely uninteresting. There are likely useful applications of the sampling problem they implemented, and as I understand it, it provides examples of large classes of physical systems which are not amenable to efficient computational simulation. But it has nothing to do with whether or how soon a QC will be able to compete with a (classical, CTT) computer solving computable problems.

+",2874,,55,,10/24/2019 9:37,10/24/2019 9:37,,,,19,,,,CC BY-SA 4.0 +8563,2,,8542,10/24/2019 8:04,,4,,"

I give this second answer to address a misconception that might be lurking in the question and to look at the local Hamiltonian problem: I am not entirely convinced by my answer and happy to hear what others have to say about it.

+ +

A Hamiltonian $H$, is first and foremost a Hermitian operator on the Hilbert space $\mathcal{H}=(\mathbb{C}^2)^{\otimes n}$, i.e. +$$ H: \mathcal{H}\to \mathcal{H}$$

+ +

Consider for example the Hamiltonian $H=Z\otimes I$ acting on two qubit. This is an operator not a matrix: For example the $Z$ operator acting on the first qubit can be represented by the Pauli matrix everyone is familiar with but in order to do so, you have to (implicitly) pick the computational basis. Otherwise, this operator $Z$ just maps certain vectors to certain vectors. The notion of $k$-locality here (in this case $1$-locality), I believe, exists completely separately from the concept of a basis. That also means, that for any unitary $U$ that you want to conjugate $H$ with, you simply get a different Hamiltonian! (Of course, once you write down $H$ as a matrix in some basis, the conjugation by unitary matrices corresponds to a basis change)

+ +

Now, the local Hamiltonian problem is essentially about finding the smallest eigenvalue but formulated as a decision problem. It is a computational problem and thus we need to resort to picking a basis for our Hilbert space. Note that the decision problem would be trivial if you knew the eigenbasis of the Hamiltonian! Thus, it is entire clear again that the complexity of this computational problem is related to the choice of basis, but this is independent of the $k$-locality.

+",5322,,5322,,10/24/2019 14:03,10/24/2019 14:03,,,,0,,,,CC BY-SA 4.0 +8564,2,,8558,10/24/2019 9:56,,2,,"

In the linked post, $|\psi_{mn}\rangle$ is defined as +$$ +|\psi_{mn}\rangle = a_{00}|0_m 0_n\rangle + a_{10}|1_m 0_n\rangle + a_{01}|0_m 1_n\rangle + a_{11}|1_m 1_n\rangle, +$$ +and the action of a CNOT operating between $m$-th and $n$-th qubit is written as +$$ +\mathrm{CNOT}^{(m,n)}|\psi_{mn}\rangle = a_{00}|0_m 0_n\rangle + a_{10}|1_m 0_n\rangle + a_{11}|0_m 1_n\rangle + a_{01}|1_m 1_n\rangle. +$$

+ +

Note how the last two coefficients are swapped in the second expression, so the expressions are not identical. +Here, $\mathrm{CNOT}^{(m,n)}$ denotes a CNOT having the $m$-th qubit as control and the $n$-th one as target, so its action on the basis states is: +\begin{align} +\mathrm{CNOT}^{(m,n)}|0_m 0_n\rangle &= |0_m 0_n\rangle, \\ +\mathrm{CNOT}^{(m,n)}|1_m 0_n\rangle &= |1_m 0_n\rangle, \\ +\mathrm{CNOT}^{(m,n)}|1_m 1_n\rangle &= |0_m 1_n\rangle, \\ +\mathrm{CNOT}^{(m,n)}|0_m 1_n\rangle &= |1_m 1_n\rangle. +\end{align}

+",55,,,,,10/24/2019 9:56,,,,1,,,,CC BY-SA 4.0 +8565,2,,8427,10/24/2019 14:23,,4,,"

After some further consideration I think it's quite clear that the only probability mass function evaluated in the computation of $\mathcal{F}_{\text{XEB}}$ is that of the classically computed ideal distribution, denoted $P(x_i)$ in the main paper.

+ +

This leads me to the conclusion that the phrasing of the following excerpt from section IV.C of the Supplemental Information (and especially the part underlined in red) is a bit unfortunate/misleading:

+ +

+ +

Just because the empirically measured bitstrings are coming from the uniform distribution doesn't mean that $P(x_i)$ is suddenly $1/2^n$ for all $i$. $P(x_i)$, as it goes into the calculation of the $\mathcal{F}_{\text{XEB}}$, is still the probability of sampling bitstring $x_i$ from the classically computed ideal distribution. This is in general not $1/2^n$.

+ +

The correct reasoning is that the fact that $\langle P(x_i)\rangle_i$ will be $1/2^n$ (and $\mathcal{F}_{\text{XEB}} = 0$) when bitstrings $x_i$ are sampled from the uniform distribution follows from the definitions of expectation and probability mass function:

+ +

The definition of expected value is the following sum +$$ +\langle P(x_i)\rangle_i = \sum_{i=1}^{2^n} P(x_i) p_i +$$ +where $P(x_i)$ is the probability of bitstring $x_i$ being sampled from the classically computed ideal quantum circuit, $p_i$ is the probability of $x_i$ being sampled from the non-ideal empirical distribution, and the sum runs over all possible bitstrings.

+ +

When bitstrings are coming from the uniform distribution $p_i$ will always be $1/2^n$ so can be broken out of the sum: +$$ +\langle P(x_i)\rangle_i = \frac{1}{2^n} \sum_{i=1}^{2^n} P(x_i) +$$ +When you sum any probability mass function (of which $P(x_i)$ is one example) over all the possible outcomes you by definition get 1, and thus: +$$ +\langle P(x_i)\rangle_i = \frac{1}{2^n} +$$

+",8704,,,,,10/24/2019 14:23,,,,1,,,,CC BY-SA 4.0 +8566,1,8569,,10/24/2019 15:22,,15,2307,"

Is VQE a class of algorithms or a specific algorithm? For example, is QAOA a VQE or is VQE an algorithm distinct from QAOA that solves the same class of problems?

+ +

If VQE is a specific algorithm, what are its defining features that distinguish it from other algorithms such as QAOA?

+",4943,,4943,,10/24/2019 19:06,10/25/2019 8:09,Is VQE a class of algorithms or a specific algorithm?,,1,1,,,,CC BY-SA 4.0 +8567,1,,,10/24/2019 22:48,,5,129,"

I'm doing a practice assignment where I'm asked to identify specific features of the Grover Search Algorithm's second operator (picture in post, further on ""$Us$""), which mirrors the system relative to the $|s\rangle$ vector, defined as the equal-weighted sum of the input parameter's subspace basis vectors (definition below). Naturally, this only concerns the contents of a single iteration.

+ +

$$|s\rangle=H|0\rangle^{\otimes n}=\frac{1}{2^{n/2}}\sum_{x=0}^{2^n-1}|x\rangle.$$

+ +

The operator is defined by the following scheme, which I have, for reference, built in the Quirk QC simulator.

+ +

+ +

It has the following proposed features (which I need to verify as true or false):

+ +
    +
  1. The Hadamard and NOT gates applied to the qubits 1 and 2 (further on $|C_I\rangle$, $|C_{II}\rangle$) in succession map the $|s\rangle$ vector onto the $|11\rangle$ vector.

  2. +
  3. The Hadamard and NOT gates applied to the qubits 1 and 2 (further on $|C_I\rangle$, $|C_{II}\rangle$) in succession map the $|s\rangle$ vector onto the $|00\rangle$ vector.

  4. +
  5. The CNOT gate (with $C_I$ and $C_{II}$ as controls) affects only the $|11C_{III}\rangle$ vector.

  6. +
  7. The CNOT gate multiplies the $|11C_{III}\rangle$ vector by $-1$ and does not affect other vectors.

  8. +
  9. The Hadamard, then the NOT gate applied to $C_I$ and $C_{II}$ maps $|11\rangle$ onto $|s\rangle$. The $|s\rangle$ component in the system vector is thus multiplied by $-1$ while components orthogonal to it are unaffected.

  10. +
  11. The NOT gate on $C_{III}$ multiplies the system vector by $-1$, thus the system vector is reflected relative to $|s\rangle$.

  12. +
  13. The NOT gate on the $C_{III}$ qubit is unnecessary.

  14. +
+ +

My perspective:

+ +

For the first two points, I don't fully grasp the concept of the mapping described here. However, it should be noted that by definition, as far as I understand, the Hadamard transformation on either side of the scheme is to allow the ""$Us$"" operator to function as a reflection relative to the $|0\rangle^{\otimes n}$ vector.

+ +

For (3) and (4), while I have maintained the original wording, I understand the question misnames the CCNOT gate as CNOT - I'm not sure how important this distinction is, other than technically referring to two different types of gates. Both of these are true if only the controlled vector is affected, which I believe to be correct.

+ +

I believe (5) is incorrect as, by definition, ""$Us$"" is a reflection relative to $|s\rangle$. Because of this definition, I believe (6) is correct.

+ +

I believe (7) is incorrect because it changes the outcome of the ""$Us$"" operator.

+ +

My understanding of quantum computing is severely limited at the moment, so I'm hoping that I'll be able to gain some much-needed intuition by having my logic here fact-checked.

+",8849,,26,,10/25/2019 16:18,10/25/2019 16:18,Exact functions of a single-iteration Grover Search Algorithm's operators,,0,3,,,,CC BY-SA 4.0 +8568,1,,,10/25/2019 6:04,,5,51,"

There is a huge gap between basic physical laws and predicting many particle systems from first principles. It will be so amazing if we can predict most properties of many particle systems (from mass of an atomic nuleus to density/conductivy/bandgap of a material to properties of any small or big molecule) from first principles with high precision at low cost.

+ +

From Google's desclared ""quantum supremacy"" news I hear that they can be applied to computational physics too. But from ""Quantum simulator"" in Wikipedia, I feel that this still only applies to a very narrow types of problems , and we still can never close the gap to amazingness.

+ +

What is the current research advance and is there a hope to close the gap?

+ +

Note: The question is more a physics question, but physics site doesn't accept this type of question so I moved it here.

+",8853,,8853,,10/27/2019 0:17,10/27/2019 0:17,What is the current research status in simulating many-particle systems from first principles?,,0,8,,,,CC BY-SA 4.0 +8569,2,,8566,10/25/2019 8:09,,17,,"

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 we usually just call Hamiltonian. As a byproduct, we also obtain a classical description of the approximate ground state. It does so by classically varying over efficiently preparable ansatz states $|\psi(\theta)\rangle$ and a quantum subroutine determines the expectation value +$$\mu=\langle \psi (\theta)|H|\psi(\theta)\rangle$$ by a sampling procedure.

+ +

In QAOA (Quantum Approximate Optimization Algorithm), your cost function (or Hamiltonian if you will) is given by $H=\sum_i C_i(z)$ where the $C_i(z)$ are operators diagonal in the computational basis. Importantly, the eigenbasis of $H$ is thus the computational basis and one of the computational eigenstates encodes the solution to the problem! This, is not the case in VQE! +So how does QAOA procece? On a high level, without going into too many details, it procedes very similarly to VQE:

+ +
    +
  1. Optimize over variational parameters in some ansatz state. The state is called $|\gamma, \beta \rangle$ in QAOA and it ought to minimize/maximize the expectation value +$$\langle \gamma, \beta|H|\gamma, \beta\rangle$$ +In this step, VQE can be used as a subroutine as this is precisely the task VQE can achieve (finding good parameters $\beta, \gamma$) but it might not be necessary. In the original QAOA paper, the authors argued, that for particular instances of MaxCut (i.e. some particular classes of graphs), an efficient classical optimization method exists, that is, they could optimize over the ansatz state without ever preparing it (no quantum device involved)!
  2. +
  3. Here, we necessarily go quantum (here you need a quantum device): Prepare the optimized ansatz state $|\psi_{opt} \rangle$ over and over again and measure it in the computational basis until you statistically converged enough to be able to pick the right computational basis state encoding the solution with high probability. (Note that because of the previous optimization routine, the state $|\psi_{opt} \rangle$ should have a large overlap with the eigenstate to the smallest eigenvalue which I stress once again is one of the basis vectors of the computational basis)
  4. +
+ +

How is QAOA approximate you might ask now: Well, depending on how much computational resources you are willing to invest into finding good parameters, your $|\psi_{opt} \rangle$ might vary in quality. A bad quality state might not be close enough fidelity-wise to the eigenstate one is looking for. So the algorithm is approximate in the sense, that it tries to find a trade-off in the optimization procedure between optimization rounds and fidelity of the optimized state.

+ +

Note, that QAOA is just one possible application of VQE and there are many more, first and foremost quantum chemistry problems!

+",5322,,,,,10/25/2019 8:09,,,,1,,,,CC BY-SA 4.0 +8570,1,12759,,10/25/2019 17:16,,5,192,"

In Cavalcanti and Skrzypczyk (2017), section IIA, pag. 3, while introducing the idea of quantum steering, the authors introduce the idea of Local Hidden State model as following (emphasis mine):

+ +
+

A LHS model refers to the situation where a source sends a classical message $\lambda$ to one of the parties, say Alice, and a corresponding quantum state $\rho_\lambda$ to the other party, Bob. Given that Alice decides to apply measurement $x$, the variable $\lambda$ instructs Alice’s measurement device to output the result a with probability $p(a|x, \lambda)$. Additionally it is also considered that the classical message $\lambda$ can be chosen according to a distribution $\mu(\lambda)$. Bob does not have access to the classical variable $\lambda$, so the final assemblage he observes is composed by the elements + $$\sigma_{a|x}=\int d\lambda \mu(\lambda)p(a|x,\lambda)\rho_\lambda.$$

+
+ +

I'm struggling to grasp the general picture here. +Isn't this equivalent to saying that Alice and Bob share a state of the form +$$\sum_\lambda |\lambda\rangle\!\langle\lambda|\otimes \rho_\lambda,$$ +for some choice of a computational basis $|\lambda\rangle$ for Alice? +In particular, it's the wording that ""the source sends a classical message to Alice"" that confuses me. What is a ""classical message"" here? Do we just mean that Alice is not allowed to perform measurements or operations that probe the coherence between different states $|\lambda\rangle$, for some choice of computational basis that was chosen beforehand?

+",55,,55,,12/20/2020 22:22,12/20/2020 22:22,"Understanding the idea of ""local hidden state model""",,1,0,,,,CC BY-SA 4.0 +8571,2,,8553,10/25/2019 19:34,,7,,"

Yes you can: When you build a noise model the noise is defined with respect to the name or label of gate objects, so you can use the labelto create multiple versions of a single gate but reference different errors in a noise model (NB: the transpiler strips away label information when it unrolls a gate not in the basis gates set).

+ +

Selective noise on standard gates

+ +

For example: Suppose I wanted to create two version of a XGate gate.

+ + + +
from qiskit import *
+from qiskit.extensions import XGate
+from qiskit.providers.aer.noise import NoiseModel, errors
+
+x_gate = XGate()  # regular X gate
+x1_gate = XGate(label=""x1"")  # first labelled X gate 
+x2_gate = XGate(label=""x2"")  # second labelled X gate
+
+x1_error = errors.depolarizing_error(0.1, 1)
+x2_error = errors.depolarizing_error(0.01, 1)
+
+noise_model = NoiseModel()
+noise_model.add_all_qubit_quantum_error(x1_error, x1_gate.label)
+noise_model.add_all_qubit_quantum_error(x2_error, x2_gate.label)
+noise_model.add_basis_gates(['x'])
+print(noise_model)
+
+
+ +

This makes the noise model:

+ +
NoiseModel:
+  Basis gates: ['cx', 'id', 'u3', 'x']
+  Instructions with noise: ['x2', 'x1']
+  All-qubits errors: ['x1', 'x2']
+
+ +

Notice the line noise_model.add_basis_gates(['x']), since we added a label that isn't recognised as a standard basis gate, we have to tell the noise model that x should be in our basis gates (Aside: I hope to streamline this a bit in future versions)

+ +

Now to use this in a circuit I could have:

+ + + +
qc = QuantumCircuit(3, 3)
+qc.append(x_gate, [0])  # regular noise-free x gate
+qc.append(x1_gate, [1])  # noisy x1 gate
+qc.append(x2_gate, [2])  # noisy x2 gate
+qc.measure([0, 1, 2], [0, 1, 2])
+
+result = execute(qc, Aer.get_backend('qasm_simulator'),
+                 basis_gates=basis_gates,
+                 noise_model=noise_model).result()
+result.get_counts(0)
+
+# Returns something like:
+
+{'101': 40, '111': 980, '011': 4}
+
+ +

So we can see that we have different noise for all 3 X gates.

+ +

Selective noise on arbitrary unitary gates

+ +

You can use this to build noisy or ideal versions of any standard gate, and for custom gates using the unitary gate object. Below I will do same example but with the X gates applied as a unitary matrix using the same labels for the noise model. Note that I need to add 'unitary' to the noise model basis gates so that the unitaries aren't converted into u3 gates:

+ + + +
from qiskit.extensions import UnitaryGate
+
+x_mat = XGate().to_matrix()
+
+qc = QuantumCircuit(3, 3)
+qc.unitary(x_mat, [0], label='x')
+qc.unitary(x_mat, [1], label='x1')
+qc.unitary(x_mat, [2], label='x2')
+qc.measure([0, 1, 2], [0, 1, 2])
+
+# We need to add unitary to noise model basis gates
+noise_model.add_basis_gates('unitary')
+basis_gates = noise_model.basis_gates
+
+result = execute(qc, Aer.get_backend('qasm_simulator'),
+                 basis_gates=basis_gates,
+                 noise_model=noise_model).result()
+result.get_counts(0)
+
+# Returns something like
+
+{'101': 37, '111': 983, '011': 4}
+
+ +

Selective noise on reset and measurement

+ +

You can also make ideal / noisy measurements or resets using the above trick with a custom gate before measurement or after reset. Eg:

+ + + +
# Make a noisy measure instruction
+from qiskit.extensions import IdGate
+tmp = QuantumCircuit(1, 1)
+tmp.append(IdGate(label='noise_meas'), [0])
+tmp.measure(0, 0)
+noise_meas = tmp.to_instruction()  # convert tmp circuit to instruction
+
+# Create a noise model
+noise_model = NoiseModel()
+meas_error = errors.depolarizing_error(0.1, 1)
+noise_model.add_all_qubit_quantum_error(meas_error, 'noise_meas')
+basis_gates = noise_model.basis_gates
+
+# Example circuit
+circuit = QuantumCircuit(2, 2)
+circuit.measure([0], [0])
+circuit.append(noise_meas, [1], [1])
+
+result = execute(circuit, Aer.get_backend(""qasm_simulator""),
+                 basis_gates=basis_gates,
+                 noise_model=noise_model).result()
+result.get_counts(0)
+
+# Returns something like
+{'10': 55, '00': 969}
+
+ +

Selective noise with basic_device_noise_model

+ +

Finally a comment on using this with basic device noise model. This is a little tricky but can be done. The problem is that if you are not building a noise model from scratch (and so choosing your own labels) the standard unlabelled gates u1,u2,u3,cx will be the noisy gates, and you can add custom labels for the ideal u1, u2, u3, cx gates.

+ +

The transpiler will always convert gates to the noisy u3 etc (eg x->u3) So if you want ideal x you must insert as u3 gate, because all labels of x gates will get unrolled to the noisy u3.

+",8650,,,,,10/25/2019 19:34,,,,1,,,,CC BY-SA 4.0 +8572,1,,,10/26/2019 9:03,,2,36,"

Background

+ +

So I came across a question on conditional probability in quantum mechanics: There's an interesting comment which tells why this does not work for ""the non-commutative case"".

+ +

I was wondering, however, since there are more than operators in quantum mechanics one could ask about their relation. For example, there is time which is a parameter. It seems straightforward to compute the conditional probability of an outcome given the time was say $t$ by (for example):

+ +

$$ P( A|T_1) = |\langle x_A, t_1 | \psi, t_1 \rangle|^2 $$

+ +

where $A$ denotes the event of say measuring the position at a $x = x_a$, $T_1$ represents the time being say $t_1$ and let pre-measurement state be $\psi$. But what if one swaps things as:

+ +

$$P(T_1|A) = \frac{| \langle x_a, t_1| \psi, t_1\rangle |^2}{\int_{t_{A-}}^{t_{A+}} | \langle x_a, t| \psi, t\rangle |^2 dt}$$

+ +

This something I figured out here: Physics SE: Conditional probability between parameter and operator in quantum mechanics

+ +

Question

+ +

How does this change if we update the question to multiple measurements. For example what is the probability of $P(A|T_1)$ and $P(B|T_2)$ (with $T_2 > T_1$ as the time evolution of the wave-function to see $B$ at $T_2$ depends on the outcome A) - here $A$ and $B$ can be different observable's outcomes? How is this related to probability of the times being $T_1$ and $T_2$ when $A$ and $B$ are observed?

+",5045,,55,,1/2/2021 11:56,1/2/2021 11:56,Conditional probability between parameter and operator in quantum mechanics?,,0,0,,,,CC BY-SA 4.0 +8573,1,,,10/26/2019 11:30,,3,295,"

Per Wikipedia, in Grover's algorithm the probability of observing search string $\omega$ after $r$ iterations is:

+ +

$$\left|\begin{bmatrix}\langle \omega | \omega \rangle &\langle \omega | s \rangle\end{bmatrix} (U_sU_\omega )^r \begin{pmatrix} 0 \\ 1\end{pmatrix}\right|^2.$$

+ +

How to derive this expression? Shouldn't it just have been $|\langle \omega |(U_sU_\omega)^r|s\rangle|^2$?

+",26,,55,,12/30/2021 14:55,12/30/2021 14:55,What is the probability of observing a search string $\omega$ after $r$ iterations of Grover's algorithm?,,2,9,,,,CC BY-SA 4.0 +8574,1,8605,,10/26/2019 11:41,,7,447,"

In the context of Grover's algorithm, the diffusion operator is defined as $U_s = 2|s\rangle \langle s| - I$ with $|s\rangle\equiv |+\rangle^{\otimes n}$. What is the significance of the term ""diffusion""? Does it refer to some physical phenomena?

+",26,,55,,10/26/2019 23:03,10/30/2019 12:43,"Significance of the term ""diffusion"" in Grover's diffusion operator",,2,3,,,,CC BY-SA 4.0 +8575,1,,,10/26/2019 21:12,,4,95,"

Presumably quantum mechanics really is the way the universe works, and it appears we don't really understand where the boundary between quantum mechanical phenomena like interference end and classical phenomena begin, but presumably it is not a discrete transition but rather a smooth transition from quantum to classical. Therefore, shouldn't there be computers which are intermediate between ""fully quantum"" and ""fully classical"" devices? and might have some intermediate speed-up over fully classical?

+",8877,,,,,10/27/2019 7:36,"If classical physics emerges in some limit of quantum mechanics, shouldn't there be intermediate classical-quantum computers?",,2,0,,,,CC BY-SA 4.0 +8576,2,,8574,10/26/2019 23:41,,2,,"

The operator was named ""diffusion transform"" in the original Grover's paper (see second column of pag. 3) but no explanation is given for the terminology there (and I don't know whether it was ""common"" at the time).

+ +

You can think of Grover's algorithm as a repeated application of an operator $\mathcal U=-\mathcal S_i\mathcal S_t$ that is the product of two reflections, the first with respect to the target state, and the second one with respect to the initial state: +$$\mathcal S_t\equiv 2|t\rangle\!\langle t| - I, +\qquad +\mathcal S_i\equiv 2|i\rangle\!\langle i| - I,$$ +if $|i\rangle$ and $|t\rangle$ are initial and target states. These operators satisfy by construction $\mathcal S_t|t\rangle=|t\rangle$ and $\mathcal S_t|t_\perp\rangle=-|t_\perp\rangle$ for all $\langle t_\perp|t\rangle=0$, and similarly for $|i\rangle$.

+ +

To connect this with the more common notation used in expositions of Grover's algorithm, just use $|i\rangle=|+\rangle^{\otimes n}$ as the initial state. Then, $\mathcal S_t$ is what is often (e.g. in the Wikipedia page) written as $U_\omega$ and $\mathcal S_i$ is the diffusion operator.

+ +

One possible rationale for naming $\mathcal S_i$ a ""diffusion operator"" is that, of the two operators, it is the one that changes the probability of measuring the target. Indeed, for any state $|\psi\rangle$, you have +$$|\langle t|\mathcal S_t|\psi\rangle|^2=|\langle t|\psi\rangle|^2.$$ +You can, therefore, picture the action of $\mathcal U$ as being comprised of one operation ($\mathcal S_t$) that only changes the phases of $|\psi\rangle$ without really moving it closer to the target, and another diffusion operation ($\mathcal S_i$) that moves the state towards $|t\rangle$.

+ +

To be fair though, this interpretation only makes sense if you are just looking at the probability of finding the evolving state to be $|t\rangle$ at every step. One could make the same exact argument but looking at the probability of finding $|\psi\rangle$ on the initial state, and then we would conclude that $\mathcal S_t$ should be called ""diffusion operator"" rather than $\mathcal S_i$. Ultimately, the algorithm is entirely symmetric in the way the two reflections act, so I wouldn't read too much into the way the terminology ""diffusion operator"" is used in this context.

+",55,,55,,10/29/2019 15:01,10/29/2019 15:01,,,,1,,,,CC BY-SA 4.0 +8577,1,8579,,10/27/2019 1:31,,4,96,"

In Horodecki et al. (1998), to prove that distillability implies having a negative partial transpose (being NPT). The authors use the fact that ""a state $\rho$ is NPT if and only if $\rho^{\otimes N}$ is"".

+ +

A state $\rho$ being ""NPT"" means here that that the operator $\rho^{T_B}$ with matrix elements +$$(\rho^{T_B})_{ij,k\ell}\equiv\langle ij|\rho^{T_B}|k\ell\rangle=\langle i\ell|\rho|kj\rangle\equiv \rho_{i\ell,kj},$$ +is not positive (and therefore not a state).

+ +

This is taken in the paper as an elementary fact, and not explicitly proven.

+ +

How can we prove that $\rho^{T_B}$ is not positive if and only if $(\rho^{\otimes n})^{T_B}$ isn't?

+",55,,55,,3/9/2021 22:06,3/9/2021 22:06,Why is $\rho$ NPT if and only if $\rho^{\otimes N}$ is NPT?,,1,2,,,,CC BY-SA 4.0 +8578,2,,8575,10/27/2019 1:47,,0,,"

All quantum computers now are partly classical. The experiment is set up using classical math libraries like Numpy.

+ +

I think your instinctive ""ur-question"", i.e., ""is there really a clear line?"", is a good one.

+ +

As time goes by (as the song goes) the line will no doubt get very blurry. Or perhaps better put, our understanding of concepts like ""classical"" and ""quantum"" will be transformed by our interaction with these devices.

+",7744,,,,,10/27/2019 1:47,,,,0,,,,CC BY-SA 4.0 +8579,2,,8577,10/27/2019 2:24,,4,,"

The short answer is that $(\rho^{\otimes N})^{T_B}=(\rho^{T_B})^{\otimes N}$.

+ +

More explicitly, if $\rho=\sum_{ii'jj'}\rho_{ii',jj'}|i\rangle\!\langle i'|\otimes |j\rangle\!\langle j'|$, then we can write +$$\rho^{\otimes N}=\sum_{I I' JJ'}\rho_{II',JJ'}\bigotimes_{k=1}^N \Big(|i_k\rangle\!\langle i_k'|\otimes |j_k\rangle\!\langle j_k'|\Big),$$ +where $I\equiv(i_1,...,i_N)$ and same for $I',J,J'$. +Alternatively, we can write this state highlighting the bipartite structure still present in $\rho^{\otimes N}$ as +$$\rho^{\otimes N}= +\sum_{I I' JJ'}\rho_{II',JJ'} +\left(\bigotimes_{k=1}^N |i_k\rangle\!\langle i_k'|\right) +\otimes +\left(\bigotimes_{k=1}^N |j_k\rangle\!\langle j_k'|\right).$$ +The partial transpose operator then acts on it as +\begin{align} +(\rho^{\otimes N})^{T_B} = +\sum_{I I' JJ'}\rho_{II',JJ'} +\left(\bigotimes_{k=1}^N |i_k\rangle\!\langle i_k'|\right) +\otimes +\left(\bigotimes_{k=1}^N |j_k'\rangle\!\langle j_k|\right).\end{align} +In short, this means that the partial transpose effectively operates by changing $\rho_{II',JJ'}\to \rho_{II',J'J}$. +But the coefficients $\rho_{II',JJ'}$ also have a known structure, given by the tensor product operation: +$$\rho_{II',JJ'}=\prod_{k=1}^N \rho_{i_k i_k',j_k j_k'},$$ +and the coefficients on the RHS of this expression are exactly what you would get computing explicitly the matrix elements of $(\rho^{T_B})^{\otimes N}$, thus the result follows:

+ +

\begin{align} +(\rho^{T_B})^{\otimes N} &= +\left(\sum_{ii',jj'}\rho_{ii',jj'}\big(|i\rangle\!\langle i'|\otimes|j'\rangle\!\langle j|\big)\right)^{\otimes N}\\ +&= +\sum_{II'JJ'}\rho_{II',JJ'} +\bigotimes_{k=1}^N \Big(|i_k\rangle\!\langle i_k'|\otimes |j_k'\rangle\!\langle j_k|\Big) \\ +&\simeq \sum_{II'JJ'}\rho_{II',JJ'} +\left(\bigotimes_{k=1}^N |i_k\rangle\!\langle i_k'|\right) +\otimes +\left(\bigotimes_{k=1}^N |j_k'\rangle\!\langle j_k|\right) +=(\rho^{\otimes N})^{T_B}. +\end{align}

+",55,,55,,10/27/2019 16:07,10/27/2019 16:07,,,,0,,,,CC BY-SA 4.0 +8580,2,,8575,10/27/2019 7:36,,2,,"

You're presumably thinking of a spectrum with classical mechanics at one end and quantum mechanics at another, with some hazy ""classical-quantum"" in between. That's not a great way to think about it. Classical mechanics is more of a practical approximation of quantum mechanics under certain conditions (cf. classical limit), as per the correspondence principle. Even in semiclassical physics, one part of the system is approximated to be classical (say external electromagnetic fields), as it's a pretty good working approximation anyway, while for the other part the precision of quantum mechanics is required (e.g. electrons in an electromagnetic field).

+ +

There certainly are ""semiclassical methods"" of computation that provide speedup over regular classical computation but are, in theory, slower than full-fledged quantum computation. For instance, the Fourier sampling in Shor's algorithm for factorization on a quantum computer can be carried out in a semiclassical way by using the “classical” (macroscopic) signal resulting from measuring one bit to determine the type of measurement carried out on the next bit, and so forth (cf. Phys. Rev. Lett. 76, 3228). However, this is quite different from your mental image of computers working in some transition regime between classical and quantum physics. In essence, it's just that for some part of the computation we're using classical techniques while for others we're using the speedup of quantum algorithms.

+",26,,,,,10/27/2019 7:36,,,,0,,,,CC BY-SA 4.0 +8583,1,8591,,10/27/2019 9:30,,7,406,"

Let us consider Pauli YY coupling gate of the following form

+ +

$$ +YY_\phi= +\left(\begin{matrix} + \cos(\phi) & 0 & 0 & i \sin(\phi) \\ + 0 & \cos(\phi) & -i \sin(\phi) & 0 \\ + 0 & -i \sin(\phi) & \cos(\phi) & 0 \\ + i \sin(\phi) & 0 & 0 & \cos(\phi) +\end{matrix}\right) +$$

+ +

I want to use this gate but I struggle rewriting it as product of unitaries representing the basic universal quantum gates ($Rz(\phi)$, CNOT, $H$ and $\frac{\pi}{8}$ gate).

+ +

A textbook by Nielsen & Chuang provides some gate identities allowing to write them (page 185, (4.32)-(4.39)) but YY is not listed.

+ +

I tried to match this form using by trial and error but there was always at least one sign that was wrong.

+ +

Could someone give some hints how to factor it out into usable gates or maybe provide a reference with circuit which implements this gate?

+",8883,,26,,10/27/2019 17:44,10/28/2019 7:49,How to factor Ising YY coupling gate into product of basic gates?,,1,0,,,,CC BY-SA 4.0 +8585,1,8594,,10/27/2019 19:00,,6,173,"

I've been trying to figure this out for a while and I'm totally lost.

+ +

My goal is to show that for two density operators $p$, $q$, that $$||p^{\otimes n} - q^{\otimes n}|| \leq n ||p-q||$$

+ +

So far I have constructed a weak inductive hypothesis over n to get

+ +

$$||p^{\otimes (n-1)} - q^{\otimes (n-1)}|| \leq (n-1) ||p-q||$$ +However, I'm having a great deal of difficulty manipulating my tensor products on the LHS to be able to use my IH. What first steps can be taken?

+ +

Note: The norm being used here is the trace norm.

+",8889,,26,,10/27/2019 19:30,10/30/2019 8:46,"Prove that $\|p^{\otimes n} - q^{\otimes n}\| \leq n \|p-q\|$ for density operators $p,q$",,2,0,,,,CC BY-SA 4.0 +8586,1,,,10/27/2019 22:47,,8,140,"

$\def\braket#1#2{\langle#1|#2\rangle}\def\bra#1{\langle#1|}\def\ket#1{|#1\rangle}$ +In MW05 the authors demonstrate so-called ""in-place"" amplitude amplification for QMA, exhibiting a method for Arthur to amplify his success probability without requiring any increase in the size of Merlin's witness state. Call the original machine $M$ and the amplified machine $M'$.

+ +

Suppose that $x$ is the input, the original machine is $M(x,w)$ and the amplified machine is $M'(x,w)$. The approach of MW05 does not guarantee that a witness state that was in the accepting set for $M(x,\cdot)$ (i.e. that made $M$ accept input $x$ with probability exceeding, say, $\frac{2}{3}$) is still in the accepting set for $M'(x, \cdot)$ (i.e. those states that make $M'(x, \cdot)$ accept with amplified probability). I explain why I think that it's actually not possible to make their method do this below the line.

+ +

Q: Is there a way to perform amplification of QMA machines without increasing the length of Merlin's witness and while also guaranteeing that all initially valid witnesses for a given input stay valid witnesses for this input?

+ +
+ +

Without explaining too much context and using their notation, the issue that seems to arise is that MW05 first proves that their approach works for states that are eigenvectors of $Q$. This is good enough for completeness because if there's a state that accepts with probability $p \geq a$ then there's an eigenvector with success probability at least $p$. However, I don't think this can be used to show that any ""good"" witness also accepts w.h.p. after amplification.

+ +

In general a ""good"" witness $\ket{\psi}$. will be some linear combination of eigenvectors $\sum_j \alpha_j\ket{\psi_j}$, some of which are ""good"" and have acceptance probability $\geq a$ and others of which are ""bad"" and have acceptance probability $\leq b$. Let $S$ be the set of ""good"" witness eigenvectors. Then, once we amplify, our success probability is roughly (for $r$ large enough I guess)

+ +

$$\sum_{j \in S} |\alpha_j|^2(1-2^{-r}).$$

+ +

In general $\sum_{j \in S} |\alpha_j|^2$ isn't $1$ so we're in trouble. In the worst case of witness eigenvectors, we can even construct a ""good"" witness $\ket{\psi}$ that after $r$-rounds of amplification accepts with probability roughly $\frac{a-b}{1-b}(1-2^{-r}) \leq \frac{1}{2}$ for $(a,b) = (\frac{2}{3}, \frac{1}{3})$.

+",8758,,55,,10/28/2019 10:14,10/28/2019 10:14,"Better ""In-Place"" Amplification of QMA",,0,0,,,,CC BY-SA 4.0 +8587,1,,,10/27/2019 23:59,,4,226,"

I was wondering if anyone had a sample code for running a general MILP problem. I saw some coding for some very specific problems and I thought they were kind of far away from what we needed.

+

$$ +\text{minimize } \, D^TX+E^TY \, \text{ s.t. }\\ +AX + BY + C \le 0 \\ +x_i \ge 0 \\ +y_i \in \mathbb{Z} +$$

+

If anyone has already started generalizations or would like to start I would love to be a part of that. I also tried to get on Slack but was unable to, could anyone help me with that?

+",8892,,10480,,1/22/2021 21:26,1/22/2021 21:26,General mixed integer linear programming problem with quantum computers,,0,4,,,,CC BY-SA 4.0 +8588,1,,,10/28/2019 4:15,,1,36,"

How do I get from equation 1.31 to equation 1.32? It seems like some terms are changing.

+ +

+",8897,,26,,10/28/2019 8:22,10/28/2019 8:22,Clarification of bra-ket notation,,0,0,,10/28/2019 8:54,,CC BY-SA 4.0 +8589,1,,,10/28/2019 4:59,,1,75,"

Some countries like India are using standalone electronic voting machines (EVM) for elections. They are not interconnected, use no power cables (run on battery), no wireless cards and are secure because after every voter votes he can tally his vote by looking at a printed paper slip (on The Voter Verifiable Paper Audit Trail (VVPAT) Unit) which has his/her candidate and party symbol displayed for 7 seconds and no one can take this paper slips out of the machine. If an attack happens on the EVM machine then votes counted on the machine won't get tallied with manual paper slips. +Theoretically, we go for quantum voting because classical voting is based on Prime Factorization, Discrete Log Problem which can be broken by Shor's Algorithm. But can quantum voting machines (if developed) have any practical advantage over the EVM?

+",8249,,26,,10/28/2019 8:30,10/28/2019 8:30,Can Quantum Voting Machine replace Electronic Voting Machine (EVM) in future?,,0,1,,,,CC BY-SA 4.0 +8590,2,,5921,10/28/2019 5:55,,7,,"

In the paper I called it the Burnside decomposition, but it looks like the standard name is the Wedderburn decomposition. That might simply have been a mistake in terminology on my part.

+ +

Anyway, there are two good ways to get the summands to be $V \otimes V^*$. (Of course they are closely related.)

+ +

1) You can interpret $\mathbb{C}[G]$ as an associative algebra. In this case, the theorem is that $\mathbb{C}[G]$ is a direct sum of matrix algebras, one for each irrep $V$ of $G$. You can identify the vector space of operators on $V$ with $V \otimes V^*$. This interpretation motivates the terminology which is sometimes used that $V$ is the ""column space"" and $V^*$ is the ""row space"".

+ +

2) You can interpret $\mathbb{C}[G]$ as a bimodule with both a left and right $G$ action. In this case each summand can be read as $V_{\text{left}} \otimes V^*_{\text{right}}$. By definition $G_\text{left}$ acts trivially on $V^*_{\text{right}}$ and vice versa, so that each of the two tensor factors is the multiplicity space for the opposite action.

+ +

The bimodule picture also shows up in other cases such as Schur-Weyl duality. In the case of Schur-Weyl duality, both $\text{GL}(V)$ (or $U(V)$ if you want to be quantum) and $S_n$ act on $V^{\otimes n}$. You again get this cool decomposition into summands $M_\lambda \otimes V_\lambda$, where $M_\lambda$ is an irrep of $S_n$, $V_\lambda$ is an irrep of $\text{GL}(V)$ or $U(V)$, and each tensor factor is the multiplicity space of the action of the other group.

+",8880,,8880,,10/28/2019 18:41,10/28/2019 18:41,,,,0,,,,CC BY-SA 4.0 +8591,2,,8583,10/28/2019 7:49,,3,,"

I did it like this (no promises that it's minimal!): + +Basically, I realised that by swapping the second and last rows and columns of your target matrix (achieved using the first and last controlled-nots in the circuit), you get something this is very nearly of the form $I\otimes R_x(\phi)$, except that one of the $2\times 2$ blocks would need to have the angle $-\phi$ instead of $\phi$. I used a controlled phase gate and the relation $ZR_x(\phi)Z=R_x(-\phi)$ to change the angle of that block. Then it was a case of rewriting it into the specified gate set.

+",1837,,,,,10/28/2019 7:49,,,,3,,,,CC BY-SA 4.0 +8592,1,8596,,10/28/2019 8:10,,6,412,"

I am trying to implement the following circuit

+ +

and my code is

+ +

+ +

The above circuit has size 5 and depth 3. My question is, how can I run the circuit parallelly. I mean, the gate circuit.cx(qr[0], qr[1]) and gate circuit.cx(qr[2], qr[3]) will be run at the same time and the total running time is dominated by the depth.

+ +

I found a related question in Creating and running parallel circuits in Qiskit. However, in that question, the author tries to run several independent experiments rather than run the gates in a circuit parallelly.

+",8901,,26,,10/28/2019 9:08,10/28/2019 12:04,How to parallelly run a quantum circuit on IBMQ?,,1,1,,,,CC BY-SA 4.0 +8593,1,,,10/28/2019 9:48,,5,523,"

Beginners question, so please stay on the beginner's level with possible answers.

+ +

I know very well what a qubit, superposition, and entanglement is. Also, I am familiar with several physical realizations so to speak of qubits and entanglement and their lifetime, coherence factors, etc.

+ +

Still, I don't understand how a ""computation"" inside e.g. 1 or 2 qubits actually runs. And when I understand it correctly multiple ""computations"" may run in parallel? How to imagine this?

+ +

I cannot find texts that essentially explain this.

+",8904,,55,,10/30/2019 15:40,10/30/2019 15:40,Can I imagine quantum computers as working via parallel computing?,,1,3,,,,CC BY-SA 4.0 +8594,2,,8585,10/28/2019 10:26,,7,,"

Hint: To make your induction work, write

+ +

$$\eqalign{p^{\otimes n} - q^{\otimes n} & = & \left(p^{\otimes(n-1)}\otimes p \right)-\left(q^{\otimes (n-1)} \otimes q\right)\\ +& = & \left(p^{\otimes(n-1)}-q^{\otimes (n-1)} \right)\otimes p+\left(q^{\otimes (n-1)} \right) \otimes (p-q)}$$

+ +

Then, use triangle inequality and finally the fact that your norm is the trace norm, i.e. you will need $\text{Tr}(A\otimes B) = \text{Tr}(A) \text{Tr}(B)$. Then, note that $p$ and $q^{\otimes (n-1)}$ are density operators with have unit trace by definition.

+",5322,,121,,10/30/2019 8:46,10/30/2019 8:46,,,,0,,,,CC BY-SA 4.0 +8596,2,,8592,10/28/2019 12:04,,6,,"

Qiskit implements a transpiler which optimizes the circuits that you provide. This means it modifies the circuit so that it can be run on the backend and also optimizes it so that anything that can possibly be run in parallel is done so. To run with the maximum level of optimization you can run execute(circuit, optimization_level=3). There is more information about the transpiler here.

+ +

If you would like even finer control of when things are executed you can create a Pulse Schedule. There is more information about this here.

+",5955,,,,,10/28/2019 12:04,,,,1,,,,CC BY-SA 4.0 +8597,1,8598,,10/28/2019 14:37,,2,130,"

So I was wondering about the following:

+ +

I can encode an algorithm in position $\hat x$ in quantum mechanics. +However, in QFT position is not an operator it becomes a parameter $x$.

+ +

Has anyone expressed concern that quantum field theory (QFT) will become relevant in the scale-up when creating a quantum computer and thus one should be careful about the second quantization of operators?

+",5045,,55,,1/2/2021 11:56,1/2/2021 11:56,Could second quantisation and QFT become a problem when scaling up quantum computers?,,1,1,,,,CC BY-SA 4.0 +8598,2,,8597,10/28/2019 17:04,,2,,"

QFT (more specifically QED) is already at the heart of quantum computation. Second quantization formalism is used even in constructing toy models for quantum computers (see e.g., Section 7.3.2 of Nielsen and Chuang).

+ +

Many of the rapid advances in superconducting quantum processors over the past decade can be attributed to the introduction of circuit Quantum Electrodynamics (cQED, introduced here and here, full exposition, lecture notes), and the closely related introduction of the transmon (here). As suggested by the nomenclature these architectures are built on QED rather than non-relativistic QM.

+",8623,,,,,10/28/2019 17:04,,,,3,,,,CC BY-SA 4.0 +8599,2,,8585,10/28/2019 20:10,,8,,"

Marsl is correct, and his ""hint"" is really more a sketch of a solution than a hint. Rather than viewing the question or its solution as just formal algebra, you can also approach his same solution more conceptually. The conceptual reasoning is really identical to the algebra, just phrased differently.

+ +

You can rely on the following two facts:

+ +

1) Trace norm is a type of distance between states; in particular it satisfies the triangle inequality. Sometimes it is called trace distance.

+ +

2) Since trace norm represents distinguishability of states, it satisfies the relation $\mathrm{dist}(p \otimes r,q \otimes r) = \mathrm{dist}(p,q)$. In other words, Alice's state $p$ and Bob's state $q$ become no more and no less distinguishable if you also give Alice and Bob each a copy of another state $r$. You are allowed to have a copy of the state $r$ in your brain if you are asked to distinguish $p$ from $q$.

+ +

Now the argument is that using (1) and (2), you can get from $n$ copies of $p$ to $n$ copies of $q$, i.e., from $p^{\otimes n}$ to $q^{\otimes n}$, by replacing the states one by one. You thus get an upper bound of $n$ times $\mathrm{dist}(p,q)$.

+",8880,,8880,,10/28/2019 23:05,10/28/2019 23:05,,,,1,,,,CC BY-SA 4.0 +8600,2,,8573,10/29/2019 5:49,,3,,"

The mapping scheme set up by the author in this section is different from that of normal unitary operations. In the context of this equation, the author is referring to the (non-unitary) action of $U_s U_\omega$ on a particular two dimensional subspace of the full Hilbert space, specifically on the plane defined by the (non-orthogonal, non-complete) basis vectors $\lbrace \vert \omega \rangle, \vert s \rangle \rbrace$.

+ +

The action of $U_s U_\omega$ in this basis is shown to be $$U_s U_\omega = \begin{bmatrix} 1 & \frac{2}{\sqrt{N}} \\ \frac{-2}{\sqrt{N}} & 1- \frac{4}{N} \end{bmatrix},$$ which is clearly not unitary. $U_s U_\omega$ refers to this specific action in both the referenced equation and the following discussion. In this context, $U_s U_\omega$ is an element of $SL(2, \mathbb{R})$, and the system is set up geometrically such that $U_s U_\omega$ effects rotations within the plane spanned by $\lbrace \vert \omega \rangle, \vert s \rangle \rbrace$.

+ +

The mapping for the action of $U_s U_\omega$ is given by +$$U_s U_\omega : a \vert \omega \rangle + b \vert s \rangle \mapsto \begin{bmatrix} \vert \omega \rangle & \vert s \rangle \end{bmatrix} U_s U_\omega \begin{bmatrix} a \\ b \end{bmatrix},$$ +where $\begin{bmatrix} \vert \omega \rangle & \vert s \rangle \end{bmatrix}$ is an $N \times 2$ matrix. The author uses this mapping to rotate $\vert s \rangle$ into $\vert \tilde s \rangle$ (the latter designation introduced here for clarity) according to +$$\vert s \rangle = 0 \vert \omega \rangle + 1 \vert s \rangle \xrightarrow{(U_s U_\omega)^r} \begin{bmatrix} \vert \omega \rangle & \vert s \rangle \end{bmatrix} (U_s U_\omega)^r \begin{bmatrix} 0 \\ 1 \end{bmatrix} = \vert \tilde s \rangle, $$ +where the transformed vector, $\vert \tilde s \rangle$, is $\vert s \rangle$ rotated by $(U_s U_\omega)^r$ within the desired plane. The inner product of the rotated vector $\vert \tilde s \rangle$ with the dual vector of the marked state $\vert \omega \rangle$ is evaluated, using the Jordan normal form provided in the article, as +$$\langle \omega \vert \tilde s \rangle = \begin{bmatrix} \langle \omega \vert \omega \rangle & \langle \omega \vert s \rangle \end{bmatrix} U_s U_\omega \begin{bmatrix} 0 \\ 1 \end{bmatrix}$$ +$$ = \begin{bmatrix} 1 & \frac{1}{\sqrt{N}} \end{bmatrix} \begin{bmatrix} -i & i \\ e^{i t} & e^{-i t} \end{bmatrix} \begin{bmatrix} e^{i \, 2rt} & 0 \\ 0 & e^{-i \, 2rt} \end{bmatrix} \left( \tfrac{i}{2 \cos{t}} \right) \begin{bmatrix} e^{-i t} & -i \\ -e^{i t} & -i \end{bmatrix} \begin{bmatrix} 0 \\ 1 \end{bmatrix},$$ +where $\langle \omega \vert s \rangle = \tfrac{1}{\sqrt{N}}$ from earlier in the article and $t \equiv \arcsin \tfrac{1}{\sqrt{N}}$. Carrying through the multiplication leads to +$$\langle \omega \vert \tilde s \rangle = \tfrac{1}{2\cos t} \left(\tfrac{1}{\sqrt{N}}(e^{i(2rt+t)}+e^{-i(2rt+t)}) - i (e^{i\,2rt}-e^{-i\,2rt}) \right)$$ +$$=\tfrac{1}{\cos t} \left(\sin t \cos(2rt+t) + \sin 2rt \right).$$ +Using the angle sum identity for $\cos(2rt+t)$ gives +$$\langle \omega \vert \tilde s \rangle = \tfrac{1}{\cos t} \left( \sin t (\cos t \cos 2rt - \sin t \sin 2rt ) + \sin 2rt \right)$$ +$$=\sin t \cos 2rt + \sin 2rt \left( \tfrac{1-\sin{}^2t}{\cos t} \right) = \sin ((2r+1)t),$$ +which is the identity the author was working towards. The probability of observing $\omega$ after $r$ iterations is then simply +$$\vert \langle \omega \vert \tilde s \rangle \vert^2 = \sin{}^2((2r+1)t),$$ +as desired. Note, however, that in this case the norm on the LHS could be replaced by parentheses, since the derivation above shows that $\langle \omega \vert \tilde s \rangle$ is guaranteed to be real. This is not surprising since the operator in the relevant plane is in $SL(2,\mathbb{R})$.

+ +

While not directly responsive to the question, there is some interesting group/representation theory underpinning the math above. Without going into detail, it seems worth noting that $\vert \text{Tr}(U_s U_\omega) \vert <2$ implies that $U_s U_\omega$ is elliptic and therefore conjugate to a rotation, and that $SL(2,\mathbb{R}) \cong SU(1,1) \cong Sp(2,\mathbb{R})$.

+",8623,,8623,,10/30/2019 21:53,10/30/2019 21:53,,,,2,,,,CC BY-SA 4.0 +8601,1,,,10/29/2019 6:23,,1,103,"

So let's say there are $2$ experimentalists who have density matrix systems $A$ and $B$. They both agree that for the experiment they need identical density matrices $\rho_A = \rho_B$ which is a mixed state. My question is how do they agree upon $\rho_A = \rho_B$? (Like the classical probabilities might be approximately the same but not exact)

+ +

I mean if they do a measurement they change the density matrix and get a pure state. They can't use Noether's theorem of energy for time invariance as the measurement is immune to that since the measurement can have different outcomes to the same initial condition (Born rule).

+ +

Now one can argue that the production of the density matrices uses some kind Noether invariant for example it would mean they that they were created at spatially different locations but are the same due construction invariance. However, $A$ can still say his measurement of the invariant is correct versus the measurement of $B$? (where the invariant is the net momentum)

+ +

Question

+ +

Is there an algorithm to count how many ""eigenvalues"" / quantify how much information $A$ and $B$ disagree upon?

+",5045,,55,,12/21/2020 23:51,12/21/2020 23:51,About production and disagreements between density matrices,,1,3,,,,CC BY-SA 4.0 +8603,2,,8601,10/29/2019 13:04,,3,,"

There are a few strategies/arguments one might make.

+ +

Firstly, density matrices often represent an individual's state of knowledge rather than some absolute state. To that end, if two experimentalists aim to produce the same state, and have the same level of uncertainty in their equipment: random number generators, basis choice etc., then their descriptions of their outcomes are identical, and those would be the best descriptions anyone could give them.

+ +

You may not feel entirely satisfied with that answer, so I have another idea which may be a little more convincing: tell each experiemntalist to make their own maximally entangled state of two systems. Then take one of those systems as their density matrix. It should be a maximally entangled state. This has certain advantages about being basis independent, and not involving any randomness. However, there's still the issue of experimental inaccuracy and not quite producing a maximally entangled state. I think there will always be something like that that you can't really deal with if you don't accept my first comment.

+ +

One possible route would be to consider random states. If you create a large enough random state, then subsystems of it are almost certainly maximally entangled (that's a very crude paraphrasing. It's a sort of result that Andreas Winter made a lot of use of, so that's probably where you can find a better statement.) Random states, and that sort of result, are likely to be quite robust against experimental imperfections.

+",1837,,,,,10/29/2019 13:04,,,,1,,,,CC BY-SA 4.0 +8604,1,,,10/29/2019 13:13,,5,55,"

In this talk, and the corresponding slides on page 24/44, Brandao talks about the max eigenvalue problem which is: Given a Hermitian $n\times n$ matrix $H$, approximate its largest eigenvalue. (Note that this is basically the problem of finding the ground state energy for Hamiltonian $-H$) He then suggests the following algorithm to solve this problem with a quantum computer:

+
    +
  1. Prepare the Gibbs state $\rho=e^{\beta H}/\text{tr}(e^{\beta H})$
  2. +
  3. Cool down the system, i.e. take the limit $\beta \to \infty$
  4. +
+

I can see, how in this limit, the Gibbs state tends to the ground state of $-H$, i.e. the maximum eigenvalue state of $H$ since in the eigenbasis with eigenvalues of $H$ given by $E_1\geq E_2 \geq \dots \geq E_n$, we have +\begin{align} +\rho=e^{\beta H}/\text{tr}(e^{\beta H})&=\frac{1}{\sum_{i=1}^n e^{\beta E_i}}\text{diag}(e^{\beta E_1}, \dots,e^{\beta E_n} )\\ +&=\frac{1}{1+\sum_{i=2}^n e^{\beta (E_i-E_1)}}\text{diag}(1, e^{\beta (E_2-E_1)} \dots,e^{\beta (E_n-E_1)} )\\ +& \overset{\beta\to\infty}{\to} \text{diag}(1, 0, \dots, 0) +\end{align} +and thus the state ends up in the pure state $\rho=|\psi_{max}\rangle \langle \psi_{max}|$ where $|\psi_{max}\rangle $ is the eigenstate to the maximum eigenvalue $E_1$.

+

So far, so good. Now, I have two questions:

+
    +
  1. Brandao has on his slides the result that cooling down to $\beta = O(\log (n) /\delta)$ one can approximate the max eigenvalue to precision $\delta$. How do you derive this? Does one need to solve $|E_1-\text{tr}(\rho H)|<\delta$ for $\beta$?
  2. +
  3. In this abstract algorithm, how does one actually get the eigenvalue from the cooled down Gibbs state? One still has to measure the system somehow as far as I understand.
  4. +
+",5322,,-1,,6/18/2020 8:31,10/29/2019 13:13,Max eigenvalue algorithm via annealing starting from Gibbs state,,0,0,,,,CC BY-SA 4.0 +8605,2,,8574,10/29/2019 14:29,,9,,"

I had forwarded this question to Dr. Lov Grover and received the following response.

+
+

I guess inversion about average is a better name for the $\mathrm{W}\mathbb I_0\mathrm{W}$ +transformation. When I initially did the algorithm, I called this the +diffusion transform because I was familiar with classical diffusion +and this is what this transform accomplished - it drove an equal +probability from any state to every other state (at least initially).

+

Later on, I realized this was the same as the Householder +transformation in Linear Algebra. There probably exist more +applications in that direction (e.g. using quantum computing to +implement given rotations in optimization) but I have not pursued +them.

+

Best wishes,
Lov

+
+

I think he means classical diffusion in this (random walk) sense. It's still not exactly clear what he means by "drove an equal probability from any state to every other state"; if anyone can decipher it, let me know in a comment!

+
+

Updates:

+
+

Ahh! You computer scientists don't understand much of that language, unfortunately.

+

The physical idea is to scatter the particle rapidly, then apply a potential function, that attracts the particle to the T state - a potential function is just a phase rotation & the IAA is the diffusion transform.

+
+
+
+

IAA = Inversion about average

+

For the relation between rotation and accumulation see any QM text under Schrödinger equation. I wrote a paper on that - From Schrödinger’s equation to the quantum search algorithm.

+
+

The cited paper actually addresses the physical motivation for the diffusion transform! You may access a preprint version of the paper here. It looks like a phenomenal paper that gives us glimpses into how Grover thought of and designed his flagship algorithm. It's interesting to note that the motivation for the search algorithm was mostly from physics (Grover wasn't a computer scientist), and by the same token it's unfortunate that none of the quantum computing textbooks, as far as I know, mention this aspect of the algorithm.

+",26,,-1,,6/18/2020 8:31,10/30/2019 12:43,,,,6,,,,CC BY-SA 4.0 +8606,1,8687,,10/29/2019 21:28,,3,256,"

Suppose we have an operator $U$, and a register $|\lambda\rangle$ in an eigenstate of $U$ with eigenvalue $\lambda=1$. Repeatedly applying $U$ to $|\lambda\rangle$ does not affect $|\lambda\rangle$ - that is, $\langle\lambda|U^r|\lambda\rangle=1$ for all $r\in \mathbb{Z}$.

+ +

However suppose we have another register $|\mu\rangle$, which is only ""close to"" the eigenstate $|\lambda\rangle$. That is, suppose we have a state $|\mu\rangle$ with $\langle\lambda|\mu\rangle=1-\delta$, for some small $\delta$. I believe repeated applications of $U$ will eventually scramble $|\mu\rangle$ beyond recognition. But, with respect to $\delta$, how quickly does this scrambling take place?

+ +
+

How much do we have to know about $U$ and $\langle\lambda|\mu\rangle$ to be able to say anything about how big $r$ has to be before $\langle\mu|U^r|\mu\rangle\lt 1/3$?

+
+ +

I think this is akin to asking for more spectral properties of $U$. Do we need to know about other eigenvalues of $U$ to answer how big $\delta$ has to be before $\langle\mu|U^r|\mu\rangle\lt 1/3$?

+ +

If we are able to prepare two separate registers, both initially ""close to"" an eigenstate, we can apply $U$ many times to the second register, and do a SWAP test between the first register $|\mu\rangle$ and the second register $U^r|\mu\rangle$. If the SWAP test fails then we know that $r$ was large enough to scramble $U$.

+ +

I think this is a natural question that comes about from thinking of the BBBV theorem, but I'm not sure, and my only intuition is that if $U$ is more ""connected"" then $U^r$ acts rapidly to scramble $|\mu\rangle$.

+",2927,,,,,11/6/2019 12:41,"If a state is only ""close to"" an eigenstate of an operator, how many applications of the operator does it take to scramble the state?",,2,0,,,,CC BY-SA 4.0 +8607,2,,4126,10/29/2019 21:32,,9,,"

To fix what we are talking about, I think you mean +$$ H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} \quad +S = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix} \quad +T = \begin{pmatrix} 1 & 0 \\ 0 & \exp(i\pi/4) \end{pmatrix} = +\begin{pmatrix} 1 & 0 \\ 0 & \frac{1+i}{\sqrt{2}} \end{pmatrix}.$$ +If these are your matrices, then no, you can't make gate set 1 from gate set 2. Let's look at these gates in superoperator form, i.e., as matrices acting on density matrices, so that we ignore global phase as we should. Then all of the entries of the superoperator forms of $H$ and $S$, call them $\mathcal{H}$ and $\mathcal{S}$, lie in the field of Gaussian rationals $\mathbb{Q}(i)$. In other words, the entries of these matrices are complex numbers whose real and imaginary parts are rational numbers. The same is true of the controlled $S$ gate. Two other quantum maps or superoperators that are important for the question are ancilla creation and qubit discard (or partial trace), and both of these also have all entries in $\mathbb{Q}(i)$. This property is also preserved when you either tensor or compose superoperators to make a circuit out of gates.

+ +

The superoperator form $\mathcal{T}$ of the gate $T$ does not have entries in $\mathbb{Q}(i)$. The field of definition for those numbers is instead $\mathbb{Q}(i,\sqrt{2})$. Thus $\mathcal{T}$ is unreachable by a finite circuit of $H$ and $cS$ gates (and creation and destruction of ancillas). Although as you note, the Solovay-Kitaev theorem says that every gate under the sun, or at least every gate with efficiently computable matrix entries, can be efficiently approximated.

+ +

I don't entirely know what you mean in your description of gate set 3. However, I think that in any reasonable interpretation of that gate set, the same argument applies. Certainly if you take the gate set verbatim and ignore the fact that it only produces real matrices, then something sharper happens; in superoperator form, it only produces rational matrices.

+ +

Finally, where you say that you could also accept creating any new phase gate, in fact, the only phase gates that are reachable using gate set 2 are those that are powers of $S$, although you have to do a bit more work than to trap the superoperator matrix entries in $\mathbb{Q}(i)$. In fact the superoperator entries of the gate 2 set or any circuit made from it are all Gaussian integers, elements of $\mathbb{Z}[i]$, except for a global denominator to make the superoperator trace-preserving. The only Gaussian integers that lie on the unit circle are $\pm 1$ and $\pm i$.

+",8880,,,,,10/29/2019 21:32,,,,0,,,,CC BY-SA 4.0 +8608,1,8609,,10/29/2019 23:05,,4,592,"

I came here after reading about the announcement regarding the Sycamore processor and Google's Quantum Supremacy claim. I am hung up on several key things and I am hoping that I could find those answers here, or at least direction to the answers.

+ +

First, I am trying to make sense of the comparison, i.e. Sycamore is a 53-qubit processor (54 but 1 is not functional). One the paper itself (doi: 10.1038/s41586-019-1666-5) figure caption 4,

+ +
+

... hereas an equal-fidelity classical sampling would take 10,000 years on a million cores, and verifying the fidelity would take millions of years

+
+ +

I assume this a million cores refers to IBM Summit at Oak Ridge, right?

+ +

My actual questions revolve around the power consumption. I assume it takes a lot of power to use that a million cores to simulate quantum state; how much power did the Sycamore consume to perform the same task? In other words, how much power did the Sycamore use along with its other auxiliary/peripheral devices for that span of 200 seconds vs. how much power theoretically Summit would use in the span of 2.5 days (IBM's counter-claim) if not 10,000 years (Google's claim)?

+ +

Second question with regard to power consumption, given power consumed as percent fraction, how much power does Sycamore consume, how much goes to the dilution refrigerator?

+ +

Thank you!

+",8920,,26,,10/30/2019 3:30,10/30/2019 19:56,Making sense of the Sycamore's computing prowess - power consumption,,1,5,,,,CC BY-SA 4.0 +8609,2,,8608,10/30/2019 3:13,,7,,"

They say in Section X.H of the supplement that the Summit supercomputer has a power capacity of 14 megawatts. They compare that to their own setup. Their power consumption is mainly their dilution fridge, which they say is about 10 kilowatts plus about another 10 for chilled water for its supporting equipment. Their own supporting PCs and other electronics is about 3 kilowatts, they say. They give themselves a total power budget of 26 kilowatts, tops.

+ +

I would say that the comparison is so one-sided that a precise estimate seems a bit silly. Maybe you could reduce the estimate with free chilled water if the experiment were done in Alaska. Or maybe you could up the estimate by including the electricity to heat lunch for the coauthors.

+ +
+ +

Addendum: I guess there is a more serious answer based on the second question in the post, and related to my joke second paragraph. Aizan asks how much power Sycamore itself consumes, vs all of the other equipment around it. Indeed, most of the power consumption of the comparison Summit supercomputer in Oak Ridge is from the core activity of the computer itself, from the trillions of transistors and wires between them as they carry electrical current. Moreover, carrying current is unavoidable when a classical electronic computer changes state. Some of the power budget might go to air condition the computer and the data center to release all of the computer's heat to the outside. That is a serious extra power requirement that can be called peripheral, but it is not the main power cost.

+ +

However, all of the listed power budget for the Sycamore process is for peripheral equipment, especially but not only the dilution refrigerator. For several reasons, the power consumption of the Sycamore chip itself is negligible. One reason is that the Sycamore is only 53 qubits, which for this question is a lot like 53 bits. (How much power do you need for an old Z80 chip?) Another reason is more interesting: In a natural sense, a perfect quantum circuit always operates at zero temperature and never draws any power! Unitary quantum circuits are reversible, both in the sense of computation and in the sense of physics. In the sense of physics, that means that no heat is generated and no energy is wasted. This was indeed part of the original motivation for quantum computers in the old papers of Feynman, at a time when people could only vaguely guess that the same model might also lead to superior algorithms.

+",8880,,8880,,10/30/2019 19:56,10/30/2019 19:56,,,,1,,,,CC BY-SA 4.0 +8610,2,,8606,10/30/2019 4:55,,2,,"

You certainly need to know all the other eigenvectors and eigenvalues. It's also important to know $|\mu\rangle$ and the nature of the operator $U$. Say, if $U$ is unitary, then the eigenvectors form an orthonormal set and their eigenvalues have modulus $1$. It's easy to resolve $|\mu\rangle$ along these orthonormal vectors.

+ +

To be concrete, suppose the orthonormal eigenvectors are $|\lambda_1\rangle, |\lambda_2\rangle, \ldots, |\lambda_n\rangle$, with eigenvalues $c_1, c_2, \ldots, c_n$. Now consider $\langle\lambda_1|\mu\rangle = 1 - \delta$ (where $\delta \in \mathbb R^+$). Contrary to your intuition, if $c_1 = 1$ and $|c_2|, \ldots, |c_n| = 1$, then after each application of the operator $U$, $\langle\lambda_1|\mu\rangle$ remains constant i.e, $1-\delta$. Repeated applications of $U$ would not necessarily scramble it.

+ +

Note that, in general, $\langle \lambda_1|U^r|\mu\rangle$ is not necessarily real and it doesn't make sense to directly compare it with a real number like $\frac{1}{3}$. Though, $|\langle \lambda_1|U^r|\mu\rangle|$ will always remain constant for a unitary transformation $U$ ($\forall r \in \Bbb N$), as all the eigenvalues of $U$ have a magnitude of $1$.

+ +

As $|\mu\rangle = a_1|\lambda_1\rangle + a_2|\lambda_2\rangle + \ldots a_n|\lambda_n\rangle$ (where $a_i \in \Bbb C$), the value of $\langle \mu|U^r|\mu\rangle$ would very much depend on the exact values of $c_1, c_2, \ldots, c_n$.

+ +
+ +

Example:

+ +

The phase shift ($R_\phi$) gate has eigenvalue $e^{i\phi}$ corresponding to eigenvector $|\lambda\rangle = |1\rangle$.

+ +

Say $|\mu\rangle = \frac{1|0\rangle + 99|1\rangle}{\sqrt{1^2+99^2}}$ and $|\langle 1|\mu\rangle| = \frac{99}{\sqrt {1^2+99^2}}$.

+ +

$$\therefore U^r|\mu\rangle = \frac{1|0\rangle + 99e^{ir\phi}|1\rangle}{\sqrt{1^2+99^2}}$$ +$$\implies \langle 1|U^r|\mu\rangle = \frac{99 e^{ir\phi}}{\sqrt {1^2+99^2}}$$ +$$\implies |\langle 1|U^r|\mu\rangle| = \frac{99 }{\sqrt {1^2+99^2}}.$$

+ +

So the magnitude of $\langle \lambda|U^r|\mu\rangle$ clearly remains constant, irrespective of $r$. Though, it certainly might pick up a phase factor upon each application of $U$.

+ +

Now, $$\langle \mu |U^r|\mu\rangle = \frac{1^2+99^2e^{ir\phi}}{1^2+99^2}.$$

+ +

Unless you take the magnitude it's not possible to compare this with $\frac{1}{3}$, and even then the value very much depends on $\phi$. Notice that if $\phi = 0$, $\langle \mu |U^r|\mu\rangle$ remains $1$ irrespective of how large $r$ is. If $\phi = \pi$, the magnitude keeps flipping between $1$ and $|\frac{1^2-99^2}{1^2+99^2}|$ as $r$ increases, without ever reaching below $\frac{1}{3}$.

+",26,,26,,10/30/2019 6:34,10/30/2019 6:34,,,,10,,,,CC BY-SA 4.0 +8612,1,,,10/30/2019 9:26,,2,225,"

We are using an open account. +We can not load the account even when we use the code on new notebook. +The error message is:

+ +
TypeError                                 Traceback (most recent call last)
+<ipython-input-3-217ef0eaf621> in <module>
+      6 from qiskit.visualization import *
+      7 # Loading your IBM Q account(s)
+----> 8 provider = IBMQ.load_account()
+
+/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/ibmqfactory.py in load_account(self)
+    152 
+    153         # Check for valid credentials.
+--> 154         credentials_list = list(discover_credentials().values())
+    155 
+    156         if not credentials_list:
+
+/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/credentials/__init__.py in discover_credentials(qiskitrc_filename)
+     61     for display_name, (reader_function, kwargs) in readers.items():
+     62         try:
+---> 63             credentials = reader_function(**kwargs)
+     64             logger.info('Using credentials from %s', display_name)
+     65             if credentials:
+
+/opt/conda/lib/python3.7/site-packages/qiskit/providers/ibmq/credentials/configrc.py in read_credentials_from_qiskitrc(filename)
+     65         if 'verify' in single_credentials.keys():
+     66             single_credentials['verify'] = bool(single_credentials['verify'])
+---> 67         new_credentials = Credentials(**single_credentials)
+     68         credentials_dict[new_credentials.unique_id()] = new_credentials
+     69 
+
+TypeError: __init__() missing 1 required positional argument: 'url' 
+
+ +

Is there any fundamental problem about the accounts?

+",8928,,55,,10/30/2019 17:17,10/30/2019 17:17,"Error on loading account with qiskit: ""TypeError: __init__() missing 1 required positional argument: 'url'""",,1,1,,,,CC BY-SA 4.0 +8613,2,,8593,10/30/2019 12:01,,5,,"

As I suggest in the comments, I don't think that it is going to help you to understand quantum computation in terms of parallelism. To illustrate why, I will describe a simple two-qubit computation, in which — if you were absolutely adamant — you could claim there is computation happening in parallel; but which I would suggest does not in any meaningful sense. +$\def\ket#1{\lvert#1\rangle}$

+ +

Consider the following circuit, acting on some standard basis state $\ket{x}\ket{y}$ provided as input:

+ +

+ +

To smooth the analysis slightly for those who haven't seen a lot of quantum computation, let's consider how we could most easily represent the effects of these operations on some states.

+ +
    +
  • The middle gate, which is a $\mathrm{CNOT}$ gate (""controlled-not""), performs the following transformation of standard basis states: +$$ \mathrm{CNOT} \ket{x}\ket{y} = \ket{x}\ket{y \!\oplus\! x}$$ +and performs the same transformation, independently, on each term of a superposition of standard basis states. This aspect of performing things independently on individual terms is what is sometimes described as the 'parallel' behaviour of quantum computation.

  • +
  • The gates surrounding the $\mathrm{CNOT}$ gate in the circuit are Hadamard gates, +$ H = \tfrac{1}{\sqrt 2}\bigl[\begin{smallmatrix} 1 & \phantom- 1 \\ 1 & -1 \end{smallmatrix}\bigr], $ +which we may describe as performing the following transformation on standard basis states: +$$ \ket{x} \;\xrightarrow{\;H\;}\; \tfrac{1}{\sqrt 2}\Bigl( \ket{0} + (-1)^x \ket{1} \Bigr) .$$ +On pairs of standard basis states, we may represent the effect of Hadamards on both qubits by +$$ \ket{x}\ket{y} \;\xrightarrow{\;H \otimes H\;}\; \tfrac{1}{2}\Bigl( \ket{00} + (-1)^y \ket{01} + (-1)^x \ket{10} + (-1)^{x \oplus y} \ket{11}\Bigr); $$ +and because the Hadamard gate is self-inverse, we also have the reverse transformation of states, +$$ \tfrac{1}{2}\Bigl( \ket{00} + (-1)^y \ket{01} + (-1)^x \ket{10} + (-1)^{x \oplus y} \ket{11}\Bigr) \;\xrightarrow{\;H \otimes H\;}\; \ket{x}\ket{y}. $$

  • +
+ +

So: given these observations, let's take a look at what happens when we perform the circuit illustrated above on an input state $\ket{x}\ket{y}$: reading off transformations of the state, time-step by time-step, we have +$$ +\begin{align} +& + \ket{x}\ket{y} +\\[1ex]&\xrightarrow{\;H \otimes H \;} + \tfrac{1}{2}\Bigl( \ket{00} + (-1)^{y} \ket{01} + (-1)^x \ket{10} + (-1)^{x \oplus y} \ket{11}\Bigr) +\\[1ex]&\xrightarrow{\;\mathrm{CNOT} \;} + \tfrac{1}{2}\Bigl( \ket{00} + (-1)^{y} \ket{01} + (-1)^x \ket{11} + (-1)^{x \oplus y} \ket{10}\Bigr) +\\&\qquad\qquad= + \tfrac{1}{2}\Bigl( \ket{00} + (-1)^{y} \ket{01} + (-1)^{x\oplus y} \ket{10} + (-1)^{x} \ket{11}\Bigr) +\\&\qquad\qquad= + \tfrac{1}{2}\Bigl( \ket{00} + (-1)^{y} \ket{01} + (-1)^{(x\oplus y)} \ket{10} + (-1)^{(x\oplus y) \oplus y} \ket{11}\Bigr) +\\[1ex]&\xrightarrow{\;H \otimes H \;} + \ket{x \!\oplus\! y}\ket{y}. +\end{align}$$ +In the middle of the computation, we have a superposition of standard basis states, and $\mathrm{CNOT}$ can be said to be operating independently on each of them. But if we were to describe this as ""parallel computation"", you should ask yourself:

+ +
    +
  1. What is the data that the computation is acting on?
  2. +
  3. What is the output of these 'parallel' processes?
  4. +
+ +

It seems to me that the standard basis terms that the $\mathrm{CNOT}$ is 'acting' on, aren't data at all: they do not individually correspond to any information about the input state. Furthermore, information about individual terms in the computation aren't represented in the output. It is customary — and in some contexts, essentially correct — to describe the terms in the superposition as representing random bits (or bit-strings), and you could say that it is on this random information that the process acts in parallel; but this 'randomness' does not in any way affect the output.

+ +

What this example demonstrates is that quantum computation allows information to be stored in different ways (using different orthogonal bases) of a single-qubit or multi-qubit system, and that the way in which operations act on these different bases is determined by — but may have qualitatively different features from — the way it acts on the standard basis. It's possible to describe parts of computation as acting 'in parallel over different possibilities', but such descriptions shouldn't be taken too seriously, because the 'parallelism' is one that one cannot directly exploit, any more than you can exploit the similar 'parallelism' that exists in randomised algorithms.

+",124,,,,,10/30/2019 12:01,,,,2,,,,CC BY-SA 4.0 +8614,2,,8612,10/30/2019 13:54,,2,,"

This was an error but it should now be fixed. If this happens again in future, the work around is to remove that line and use IBMQ.enable_account(my_token) instead.

+",5955,,5955,,10/30/2019 14:53,10/30/2019 14:53,,,,0,,,,CC BY-SA 4.0 +8616,2,,3793,10/30/2019 17:56,,6,,"

Here is a more general view of your question that might offer some clarity: An operator $A$ on a Hilbert space $\mathcal{H}$ is called normal if it commutes with its adjoint, $AA^\dagger = A^\dagger A$. Equivalently, any operator $A$ decomposes as $A = B + iC$, where $B$ and $C$ are self-adjoint, and $A$ is normal if and only if $B$ and $C$ commute. This means that $B$ and $C$ are simultaneously measurable, which means that you can interpret $A$ as a complex-valued measurable. In conclusion, normal operators are the same as complex-valued measurables. If $A$ is self-adjoint, that is the real-valued special case; if $A$ is unitary, that is the circle-valued special case.

+ +

If $f$ is any function from the complex numbers $\mathbb{C}$ to itself and $A$ is normal, then the usually inevitable definition of $f(A)$ is through spectral decomposition. I.e., you should replace each eigenvalue $\lambda$ with $f(\lambda)$ and let its eigenvector stay put. In this vast generality, this concept goes back to von Neumann. To be sure, there could also be other definitions of $f(A)$, but another definition is usually only credible when it agrees with the spectral definition. For instance, if $f$ has a power series whose domain of convergence contains the spectrum of $A$, for instance $f(z) = e^z$, then $f(A)$ can also be defined by a power series --- but you get the same answer as the spectral definition. A more fun case is the absolute value $|A|$, which doesn't have a good power series. The spectral definition says, duh, just replace each $\lambda$ by $|\lambda|$. This agrees with the more creative-looking formula $|A| = \sqrt{A^\dagger A}$.

+ +

With fractional powers, the problem that you run into is that the scalar fractional power function $f(z) = z^\alpha$ is multivalued in the complex plane, unless the exponent $\alpha$ is an integer. The paradox doesn't actually lie with operators, but just with complex numbers. Just as $z^{1/2}$ naturally has two values when $z$ is a general complex number, $A^{1/2}$ naturally has many values when $A$ is a general normal (or unitary) operator. (In fact more than two, since you can make a separate binary choice for each eigenvalue.) The standard solution in complex analysis, which is often more of a convention than truly a solution to anything, is to resolve $f(z) = z^\alpha$ to a single-valued function using a branch cut. If you do that, then $f(A)$ becomes a well-defined single-valued function as well, again assuming that $A$ is normal.

+ +

If you use the formula $z^\alpha = e^{\alpha \ln z}$, and if you use the standard branch cut for logarithm and apply the result to the SWAP gate, then I think you get exactly the answer that you gave. The SWAP gate has eigenvalue $1$ thrice and eigenvalue $-1$ once, and you are indeed moving the non-trivial eigenvalue in a counterclockwise arc around the unit circle from $1$ to $-1$.

+ +

This answer, which can be motivated by abstract mathematics, also has a nice property for quantum control, which might be your real motivation here. Namely, it is a shortest geodesic in the space of unitaries, a path where the Hamiltonian evolution does the least work. You can always use the $z^\alpha = e^{\alpha \ln z}$ formula together with the standard branch cut for the logarithm to achieve this. The main wrinkle is that if you do not care about global phase as you shouldn't, then you can adjust the global phase of $A$ to optimize for the best geodesic. But that would not improve the particular solution that you found for SWAP. Another wrinkle is that there are two shortest geodesics between $1$ and $-1$ on the unit circle, so that there is more than one optimal geodesic from the identity operator to a unitary operator with $-1$ eigenvalues.

+",8880,,,,,10/30/2019 17:56,,,,0,,,,CC BY-SA 4.0 +8617,2,,8348,10/30/2019 18:44,,4,,"

Although it doesn't explicitly say it in the paper from Google, the diagrams in the paper are missing a qubit along the top edge. Most likely this is the ""bad"" qubit that wasn't used. +

+ +

+",8934,,,,,10/30/2019 18:44,,,,0,,,,CC BY-SA 4.0 +8618,1,8621,,10/30/2019 19:33,,2,131,"

According to these lecture notes from Berkeley, the Extended Church-Turing Thesis (ECT) asserts that:

+ +
+

...any ""reasonable"" model of computation can be efficiently simulated on a standard model such as a Turing Machine or a Random Access Machine or a cellular automaton. (Emphasis added).

+
+ +

Google is claiming that, by preparing and sampling from a highly-entangled random state in a Hilbert space of dimension $2^{53}$, they are marching towards quantum supremacy. As intimated by, for example, Aaronson here, a successful demonstration of sampling from a large-enough Hilbert space with a high-enough fidelity will indeed invalidate the Extended Church-Turing Thesis.

+ +

There seems to be at least two challenges to this claim.

+ +
    +
  1. Random circuit sampling (even from a Hilbert space of high-enough dimension) does not constitute a demonstration of quantum supremacy, because random circuit sampling does not correspond to ""classic"" applications of quantum computing (such as Shor's algorithm), or does not appear to be a ""computation"" in the sense of an action performed by a computer.

  2. +
  3. Even granting that random circuit sampling does constitute a demonstration of quantum supremacy, it's not clear that the Efficient Church-Turing Thesis requires any physical instantiation of a hypothetical quantum device, and the ""reasonable"" model of computation only needs to be a purely platonic description of different complexity classes. Thus the ECT is only invalidated if one were to prove, e.g., that $\mathrm{BQP}\ne\mathrm{BPP}$ or something similar.

  4. +
+ +

My question: Why can we say that the ECT falls with a successful demonstration of random circuit sampling from a large enough Hilbert space?

+ +

That is, what are the rejoinders to the above positions? Are there other potential faults in the logic connecting random circuit sampling to the negation of the ECT?

+",2927,,2927,,10/31/2019 15:30,10/31/2019 15:30,How does successfully sampling from a random quantum circuit invalidate the Extended Church-Turing Thesis?,,1,5,,,,CC BY-SA 4.0 +8620,1,8622,,10/30/2019 21:11,,4,218,"

Note: This has been cross-posted to CS Theory SE.

+ +

If we assume $\mathsf{BQP} \neq \mathsf{BPP}$, then we can say with reasonable certainty that Google's random sampling experiment falsifies the Extended Church Turing thesis. However, in a related thread, a user raised the objection that the random circuit sampling problem might not be a computation in the Church Turing sense:

+ +
+

@glS: Decision problems, computable functions, etc. are equivalent, so whichever form you like. Sampling is not even a function, much less a computable one. It's a physical process outside the scope of computing/functions.

+
+ +

Could someone elaborate on this apparent discrepancy? Can the random circuit sampling problem indeed be framed in terms of computable functions and effective calculability or a decision problem, as the CT thesis requires?

+",26,,55,,9/23/2020 12:20,9/23/2020 12:20,How exactly is solving the random circuit sampling problem a computation in the Church-Turing thesis sense?,,2,3,,,,CC BY-SA 4.0 +8621,2,,8618,10/30/2019 21:17,,4,,"
    +
  1. A computational task doesn't have to have or be an application in order to be part of a valid model. If you claim that you can run a mile faster than I can, your four-minute mile doesn't have to be profitable employment in order to count. On the other hand, the random sampling demonstration with Sycamore certainly is an action of some kind performed by a computer. It is sort-of the same thing as (but much more sophisticated than) a computer algorithm to random-sort a list of numbers.

  2. +
  3. CS theorists have lived for decades with artificial complexity classes that they can't prove are different from P, or for that matter BPP. PSPACE is a vast complexity class that has to be bigger than P, but no one can prove that. But it isn't considered a realistic complexity class. For that matter the logicians who came before the CS theorists, including Church and Turing themselves, could and did define computation classes that they know are different from the Church-Turing standard of computability. It is Turing's own theorem (one of them anyway) that the class RE, recursively enumerable, is larger than R, recursive or computable. The Church-Turing thesis says that all realistic computability roads lead to the same Rome, namely R. The fact that you can also define something bigger like RE doesn't disprove that thesis. Any version of Church-Turing is about what is realistic, not about what you can define.

  4. +
  5. (Actually more 2.) The ECT says that all roads of polynomial computability also lead to the same Rome, P or BPP. In this case people cannot prove as much. In fact, even faith in ECT ultimately depends on the open conjecture that P and BPP are equal. BQP ≠ BPP is another thing that people can't prove, because they are both sandwiched between P and PSPACE and no one can prove that P ≠ PSPACE either. (In fact it's worse than that, there are major results on how not to prove that P ≠ PSPACE.) But that's okay, we can still believe these things based on evidence even if we can't prove them. Everyone also believes that there are infinitely many twin primes, etc. The relation between the quantum supremacy demo and ECT comes down to whether you believe that there is an efficient classical algorithm for what the Sycamore chip does.

  6. +
+",8880,,,,,10/30/2019 21:17,,,,0,,,,CC BY-SA 4.0 +8622,2,,8620,10/30/2019 21:43,,3,,"

The Church-Turing thesis is not in and of itself a rigorous concept, but rather a judgment on rigorous concepts of computability. As such, it's negotiable. The language in Rosser's 1939 expository paper about provability and computability is biased towards deterministic algorithms. There is an important simplifying theorem here: If you only care about what is ever computable, then you don't need randomness or quantum randomness, because you can simulate them using exponentially more time. Like many simplifying results, it can be taken in the wrong way. It meant that in the 1930s, back when mainly logicians were defining what was computable at all, randomized algorithms were not yet on their radar.

+ +

If you extend your thinking to the Extended Church-Turing thesis, then you should also extend your scope to randomized computation. You have no choice, because even if an algorithm answers a deterministic question (like whether a number is prime), the method of calculation could be randomized (like Miller-Rabin or ECPP). And then it's not very natural to demand that the answer be deterministic even if the solution doesn't have to be.

+ +

On the other hand, you're free to be a stickler in your personal interpretation of ECT, because it's not a rigorous concept. You're free to say that Google's quantum supremacy gets a bronze medal in its fight against ECT, but not a gold medal, because it doesn't answer a deterministic question.

+ +

Or you could be even more of a stickler and say that none of this counts because quantum computing isn't deterministic. Then I would say that I believe this reactionary version ECT after all --- a TM with a linear tape is polynomially equivalent to one with a 2D tape, etc. But I would also say that that's not the right question.

+",8880,,,,,10/30/2019 21:43,,,,9,,,,CC BY-SA 4.0 +8623,2,,8573,10/31/2019 2:21,,2,,"

Another answer already addressed how the specific expression in the OP means and how to derive it. +Here I'll show another way to derive the same result (very similar to the derivation in this other answer on another question, though with different notation).

+ +

Using the notation $\mathbb P_\psi\equiv|\psi\rangle\!\langle\psi|$, we have $U_s\equiv 2\mathbb P_s-I$ and $U_\omega\equiv I-2\mathbb P_\omega$, +and thus +$$U_s U_\omega=-I+2(\mathbb P_s+\mathbb P_\omega)-4\mathbb P_s\mathbb P_\omega.\tag{AA}$$

+ +

Consider the decomposition of $|s\rangle$ in a basis containing $|\omega\rangle$: +$$|s\rangle=\sin\alpha |\omega\rangle+\cos\alpha e^{i\phi}|\omega_\perp\rangle,\tag{A}$$ +for $\alpha,\phi\in\mathbb R$, and with $|\omega_\perp\rangle$ a state orthogonal to $|\omega\rangle$ ${}^{(1)}$. The state $|\omega_\perp\rangle$ here is uniquely determined by $|s\rangle,|\omega\rangle$, and the orthogonality requirement. +Expanding the various elements of (AA) we then have +$$I=\mathbb P_\omega + \mathbb P_{\omega_\perp} + \mathbb P_\perp,$$ +$$\mathbb P_s=\sin^2(\alpha)\,\mathbb P_\omega + \cos^2(\alpha)\mathbb P_{\omega_\perp} + \sin\alpha\cos\alpha(e^{-i\phi}|\omega\rangle\!\langle\omega_\perp|+e^{i\phi}|\omega_\perp\rangle\!\langle\omega|),$$ +$$\mathbb P_s\mathbb P_\omega=\sin^2(\alpha) \mathbb P_\omega + \sin\alpha\cos\alpha e^{i\phi}|\omega_\perp\rangle\!\langle\omega|,$$ +where we defined $\mathbb P_\perp$ as the projector onto the space orthogonal to $|\omega\rangle$ and $|\omega_\perp\rangle$. +Putting everything together we get +$$U_s U_\omega += -\mathbb P_\perp + \cos(2\alpha)(\mathbb P_\omega+\mathbb P_{\omega_\perp}) ++\sin(2\alpha)(e^{-i\phi}|\omega\rangle\!\langle\omega_\perp|-e^{i\phi}|\omega_\perp\rangle\!\langle\omega|).\tag B$$ +This is telling us that $U_s U_\omega$ is really a rotation matrix in $\mathrm{span}(|\omega\rangle,|\omega_\perp\rangle\}$ (which we should have expected from it being a product of two reflections), and acts trivially (modulo minus sign) on the rest of the space.

+ +

If we assume to be working on states in $\mathrm{span}(|\omega\rangle,|\omega_\perp\rangle\}$ (which contains $|s\rangle$ by definition of $|\omega_\perp\rangle$), we can then ignore the $\mathbb P_\perp$ term. +We can furthermore ease the notation by relabeling $|\omega\rangle\to|0\rangle$ and $|\omega_\perp\rangle\to|1\rangle$. Then, +$$U_s U_\omega = +\begin{pmatrix}\cos(2\alpha) & e^{-i\phi}\sin(2\alpha) \\ +-e^{i\phi}\sin(2\alpha) & \cos(2\alpha)\end{pmatrix}\in\mathrm{SU}(2)\tag C$$ +Note that all of this, going from (AA) to (C), doesn't have that much to do with Grover's algorithm or anything quantum: we are simply showing how the product of two reflections with respect to vectors with internal angle $\alpha$, amounts to a rotation by an angle of $2\alpha$.

+ +

The conclusion is now at hand: $U_s U_\omega$ is a rotation matrix in this space. From this observation, it is not hard to see that the matrix powers can be written as: +$$(U_s U_\omega)^r = \begin{pmatrix}\cos(2r\alpha) & e^{-i\phi}\sin(2r\alpha) \\ +-e^{i\phi}\sin(2r\alpha) & \cos(2r\alpha)\end{pmatrix}.$$ +Finally, +$$(U_s U_\omega)^r \begin{pmatrix}\sin\alpha \\ e^{i\phi}\cos\alpha\end{pmatrix} += \begin{pmatrix}\sin((2r+1)\alpha) \\ e^{i\phi}\cos((2r+1)\alpha)\end{pmatrix}.$$ +The final probability after $r$ steps is therefore $\sin^2((2r+1)\alpha)$.

+ +

An interesting observation is that at no point in all of this we are using the fact that the dynamic happens in a high-dimensional space. Indeed, we could have identified $|\omega\rangle\sim|0\rangle$ and $|\omega_\perp\rangle\sim|1\rangle$ from the beginning and thought in terms of the evolution of a single qubit, and no generality would have been lost. In other words, Grover's algorithm really only involves an evolution in an effective two-dimensional space. +You can then visualise what's going on in the Bloch sphere, and if you do that you find the state evolving along the geodesic path connecting initial and target point (which can also be understood as due to the fact that Grover's algorithm is indeed nothing but a discretisation of such geodesic path).

+ +

See also this answer on math.SE for a different way to prove this result.

+ +
+ +

${}^{(1)}$ +I could write this decomposition more explicitly, being $|s\rangle$ in the OP a specific state (the balanced superposition over all states). However, I don't want to use properties of this particular $|s\rangle$, in order to make the result hold equally for any choice of $|s\rangle$.

+",55,,55,,11/6/2019 21:53,11/6/2019 21:53,,,,1,,,,CC BY-SA 4.0 +8625,1,,,10/31/2019 4:58,,1,442,"

The m level n-particle state $|X_{N}\rangle$ is defined as

+ +
+

$$\boxed{|X_{N}\rangle = \frac{1} {m^\frac{n-1}{2}}\sum_{\sum_{k=0}^{n-1} j_k \mathrm{mod}\ m \ = \ 0}|j_{0}\rangle |j_{1}\rangle ....|j_{n-1}\rangle}$$

+
+ +

How can this state be prepared?

+",8249,,55,,11/12/2019 11:56,11/12/2019 11:56,"How to generate a superposition of m-level n-particle states $|j_{0} ,j_{1}, ....,j_{n-1}\rangle$ with $\sum_{k=0}^{n-1} j_k \mathrm{mod}\ m \ = \ 0$?",,2,0,,,,CC BY-SA 4.0 +8626,2,,6088,10/31/2019 5:06,,6,,"

I will address the first two parts based on what I understood so far.

+
    +
  1. The extended Church–Turing thesis or (classical) complexity-theoretic Church–Turing thesis states that "A probabilistic Turing machine can efficiently simulate any realistic model of computation.", whereas the quantum extended Church–Turing thesis or quantum complexity-theoretic Church–Turing thesis states "A quantum Turing machine can efficiently simulate any realistic model of computation.". The key point being:

    +
    +

    If BQP is shown to be a strict superset of BPP, it would invalidate the complexity-theoretic Church–Turing thesis. In other words, there would be efficient quantum algorithms that perform tasks that do not have efficient probabilistic algorithms. This would not, however, invalidate the original Church–Turing thesis, since a quantum computer can always be simulated by a Turing machine, but it would invalidate the classical complexity-theoretic Church–Turing thesis for efficiency reasons.

    +
    +
  2. +
  3. A quantum Church-Turing thesis such as "A quantum Turing machine can simulate any realistic model of computation" would not be essentially different from the original Church-Turing thesis which states "A classical Turing machine can simulate any realistic model of computation", because without efficiency considerations they're equivalent. A classical Turing machine can certainly simulate a quantum Turing machine, although not necessarily efficiently, and vice-versa.

    +
  4. +
+",26,,-1,,6/18/2020 8:31,10/31/2019 5:06,,,,0,,,,CC BY-SA 4.0 +8627,2,,8625,10/31/2019 6:29,,5,,"

To get you started, the $m = 2$ (qubit) case:

+ +

Start with n qubits all in the 0 state. Apply Hadamard gates to the first n-1 qubits. Apply n-1 controlled nots, each one controlled by a different one of the hadamarded qubits, and each targeting the nth qubit (the one we didn’t hadamard).

+ +

Here's an example circuit for $n=3$: +

+ +

To understand how this works, recall how a controlled-not functions:

+ +

+ +

So, if after applying the Hadamard gates we have the state +$$ +\frac{1}{\sqrt{2^{n-1}}}\sum_{x\in\{0,1\}^{n-1}}|x\rangle|0\rangle, +$$ +then after all the controlled-nots I'm suggesting, the final bit is in the state +$$ +x_1\oplus x_2\oplus x_3\oplus\ldots \oplus x_{n-1}. +$$ +The overall parity of the final $n$-bit string is +$$ +x_1\oplus x_2\oplus x_3\oplus\ldots \oplus x_{n-1}\oplus (x_1\oplus x_2\oplus x_3\oplus\ldots \oplus x_{n-1})=0, +$$ +as required.

+ +

As ChainedSymmetry pointed out, the $m$-dimensional generalisation is near-identical. You apply a gate +$$ +|0\rangle\mapsto \frac{1}{\sqrt{m}}\sum_{i=0}^{m-1}|i\rangle +$$ +on the first $n-1$ spins. The controlled from each of these spins, targeting the $n^{th}$ spin, you apply a generalisation of the controlled-not of the form +$$ +|j\rangle|k\rangle\mapsto|j\rangle|-j+k\text{ mod }m\rangle. +$$

+",1837,,1837,,11/2/2019 7:27,11/2/2019 7:27,,,,8,,,,CC BY-SA 4.0 +8628,2,,8625,10/31/2019 6:50,,3,,"

For the general case, $m>2$, do what DaftWullie said, except apply gates corresponding to the $m$-point DFT matrix instead of the Hadamard gate (which is the 2-point DFT matrix).

+ +

Edit Per Request

+ +

For the $m=3$, $n=3$ use a gate ($M$) corresponding to the 3-point DFT matrix instead of the Hadamard gate to effect the transformation $\vert j \rangle =\tfrac{1}{\sqrt{3}} \sum \limits_{n=0}^2 e^{\frac{i 2 \pi jk}{k}} \vert k \rangle$. Define $\omega \equiv e^{\frac{i 2\pi}{3}} = -\tfrac{1}{2} + i\tfrac{\sqrt{3}}{2}$, and $M$ is explicitly +$$M = \frac{1}{\sqrt{3}} \begin{bmatrix} 1 & 1 & 1 \\ 1 & \omega & \omega^2 \\ 1 & \omega^2 & \omega \end{bmatrix}$$ +(note that $\omega^4=\omega$). The relevant circuit is almost identical to DaftWullie's except $H$ is replaced with $M$ and the computational basis now has three states. Any other changes are superficial to aid the explanation.

+ +

+ +

You can see that $M \vert 0 \rangle = \tfrac{1}{\sqrt{3}}(\vert 0 \rangle + \vert 1 \rangle + \vert 2 \rangle)$, so trivially +$$\vert \psi_0 \rangle= \tfrac{1}{3}(\vert 0 \rangle + \vert 1 \rangle + \vert 2 \rangle)\otimes (\vert 0 \rangle + \vert 1 \rangle + \vert 2 \rangle) \otimes \vert 0 \rangle.$$

+ +

Application of $\text{CNOT}$ between the bottom two registers gives +$$\text{CNOT} (\tfrac{1}{\sqrt{3}}(\vert 0 \rangle + \vert 1 \rangle + \vert 2 \rangle) \otimes \vert 0 \rangle)=\tfrac{1}{3}(\vert 0 \rangle + \vert 1 \rangle + \vert 2 \rangle) \otimes (\vert 0 \oplus 0 \rangle + \vert 0 \oplus 1 \rangle + \vert 0 \oplus 2 \rangle),$$ +where $\oplus$ is addition modulo 3. This gives +$$\vert\psi_1 \rangle = \tfrac{1}{3\sqrt{3}}(\vert 0 \rangle + \vert 1 \rangle + \vert 2 \rangle)\otimes (\vert 00 \rangle + \vert 01 \rangle + \vert 02 \rangle + \vert 10 \rangle + \vert 11 \rangle + \vert 12 \rangle + \vert 20 \rangle + \vert 21 \rangle + \vert 22 \rangle).$$

+ +

The same $\text{CNOT}$ process is repeated between the first and third register to get to $\vert \psi_2 \rangle$ and arrive at the desired result +$$\vert \psi_2 \rangle = \tfrac{1}{3 \sqrt{3}} \sum \limits_{p,q,r=0}^2 \vert p \, q \, r \rangle.$$

+",8623,,8623,,11/2/2019 14:33,11/2/2019 14:33,,,,7,,,,CC BY-SA 4.0 +8630,2,,6088,10/31/2019 14:34,,2,,"

Regarding the ""quantum (non-extended) Church-Turing Thesis,"" I think this asserts that there is no physical process, like a quasar or some other astronomical woo, that we know could produce a steady supply of qubits all in the same state $\alpha|0\rangle+\beta|1\rangle$, with the property that $\beta^2=\Omega_C$, that is, Chaitin's halting probability. We can also say classically that there is no magic coin that we know lands heads with probability precisely $\Omega_C$.

+ +

However, after recent proofs that $\mathrm{NEEXP}\subset\mathrm{MIP^*}$ (multi-prover interactive proofs with entangled provers), there is some indication that perhaps two God-like entities that are able to share an infinite amount of entanglement can convince a mere mortal of some undecidable proposition, maybe even in only a polynomial amount of time! See here I think.

+",2927,,,,,10/31/2019 14:34,,,,1,,,,CC BY-SA 4.0 +8631,2,,6088,10/31/2019 15:46,,6,,"

Taking the questions head on.

+ +
    +
  1. I'm not sure that original references are very much the point, although there are some. It's not a hard question. The statement is that realistic polynomial time equals what a quantum computer (if you want to be rigorous, say a QTM) can do in polynomial time.

  2. +
  3. The question has been answered many times in QCSE that a quantum computer can be simulated by a classical computer with exponential overhead. Therefore, without the ""extended"" part, meaning limits on computation time, quantum computability is the same as classical computability.

  4. +
  5. I read Deutsch's paper differently. He argues that quantum mechanics disproves the classical extended Church-Turing thesis, and his quote basically states that there should be some realistic or ""physical"" ECT. But I think that his paper conservatively does not say what the true version of ECT should be, only that it should be at least as much as what a quantum computer can do.

  6. +
+ +

All that said, my own view is that when you see a revolution in science, you don't usually need or get another one of the exact same kind. In other words, even when scientists (as a group) get a fundamental question wrong on the first try, they usually get it right on the second or third try. I think that quantum computers are realistic in principle, but I have never seen any good argument for some fantastic new thing afterwards that is even more powerful than quantum computers. It's hard to call that impossible, but only because there is no way to argue against the unforseeable.

+",8880,,8880,,10/31/2019 15:55,10/31/2019 15:55,,,,2,,,,CC BY-SA 4.0 +8632,2,,8620,10/31/2019 16:01,,3,,"

In the framing of the question (which I believe to be asked in good faith), there seems to be at least two objections.

+ +
    +
  1. Sampling from a set of strings is not clearly a function, and

  2. +
  3. Sampling is a physical process, outside of computation.

  4. +
+ +
+ +

Initially, with regard to the first objection, I assert that sampling is a function, as a search problem. For example, as noted by Ryan O'Donnell in comment #13, we can think of sampling as akin to searching for a set of strings that have an expected probability sufficiently $\gt 1/2^n$ of being sampled.

+ +

To me this has a similar feel to the following:

+ +
    +
  • Given a set of strings $\{0,1\}^*$, suppose we wish to uniformly sample from the strings, with a probability, say, $p$. We can do this by searching for a set of strings such that a hash of the strings is $\le p$ (for a hash with nice enough properties.)
  • +
+ +
+ +

With regard to the second objection, I assert that the process of sampling from a random quantum circuit, although a physical process, is not outside of computation.

+ +

For example, Martinis likes to relate sampling to speckle patterns - that is, to shining a light through fractured glass and determining where the peaks of coherent light may lie. This is clearly a ""physical process."" However, a difference between a quantum computer performing the task and a laser shown through glass is that the quantum computer is programmable to perform the said task, whereas the crushed glass does not.

+ +

That is, a quantum computer is able to prepare and sample from a state of someone's choosing. Although a physical process, I assert that it meets the definition of a computation.

+",2927,,26,,10/31/2019 16:08,10/31/2019 16:08,,,,0,,,,CC BY-SA 4.0 +8634,1,8636,,10/31/2019 17:18,,4,299,"

Quick question on the paper Entanglement in Graph States. On page 14. a definition of a graph state:

+ +
+

Given $|+\rangle=\frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$. Let + $G=(V,E)$ be a graph. The graph state $|G\rangle$ that corresponds to + the graph $G$ is the pure state with vector $$|G\rangle = + \prod_{\{a,b\}\in E}U_{ab}|+\rangle^{V} $$ where + $$U_{ab}|+\rangle^a|+\rangle^b = + \frac{1}{\sqrt{2}}(|0\rangle^a|+\rangle^b+|1\rangle^a|-\rangle^b)~~~~~(*)$$ is + maximally entangled (Bell state).

+
+ +

Why is (*) stated as being a maximally entangled Bell state, this does not seem to correspond to any of the four maximally entangled Bell states?

+ +

Lastly, as an example, on page 37, it states

+ +
+

This is easily seen by applying Hadamard unitaries $H^{V\setminus a}$ to all + but one qubit $a$ in the GHZ state, which yields the star graph state + with $a$ as the central qubit.

+
+ +

+ +

If we start with an empty graph, with vertices representing states $|+\rangle$, then how would Hadamard operations which are local on each qubit site going to produce an entangled state? Why are they not using the above definition, using $U_{ab}|+\rangle$, to define the GHZ state?

+ +

Thanks for any assistance.

+",2032,,2032,,11/1/2019 10:19,11/1/2019 10:19,Query on paper on entanglement in graph states,,2,0,,,,CC BY-SA 4.0 +8636,2,,8634,10/31/2019 18:16,,5,,"

The state of Equation * is local unitary equivalent to all of the four Bell states. That is, there exists a unitary matrix of tensor-product structure $V_a \otimes V_b$, such that

+ +

$U_{ab}|+\rangle\otimes |+\rangle = V_a \otimes V_b \frac{1}{\sqrt{2}}\left(|00\rangle + |11\rangle\right)$

+ +

In terms of its entanglement properties, Equation * is completely equivalent to the Bell state. You can check this for pure bipartite states by looking at the eigenvalues of its reduced density matrices.

+ +

Page 37 again refers to local unitary equivalence, where a tensor product of Hadamards on all but one qubit maps the GHZ state to the star graph state. +Again, both states have the same entanglement properties.

+",2192,,23,,10/31/2019 23:22,10/31/2019 23:22,,,,2,,,,CC BY-SA 4.0 +8637,2,,8463,10/31/2019 23:59,,2,,"

In fact, you would need an astronomical circuit depth in order to get close to a uniformly random state, or even close to a randomly chosen probability distribution on the $2^{53}$ outputs.

+ +

As a first estimate, consider how many different distributions you need in order to be within 1/8 of the total variation distance of any distribution on $N$ outputs. There is special formula that the TVD ball of radius $r$, in the space of these distributions, has volume $r^{N-1}\binom{2N-2}{N-1}$ times the volume of the entire simplex of distributions. Recall also the elementary inequality $\binom{2N-2}{N-1} < 4^{N-1}$. Therefore, to get within a TVD distance of $\frac18$ of even half of the space of measures on the simplex, you need at least $2^{N-2}$ examples. Recall also that $N = 2^n$ is exponential in the number of qubits. The result is a doubly exponential lower bound for the number of needed circuits.

+ +

On the other side, technically speaking there are infinitely many random circuits of any given depth, because a 2-qubit gate has continuous parameters. However, there is some finite set of gates that comes close to all of the 2-qubit gates. Skipping over some calculation, the end result is that unitary operators that you can make with circuits of depth $d$ acting on $n$ qubits is well-approximated by $2^{\mathrm{poly}(n,d)}$ distinct examples, which is only singly exponential with a polynomial exponent, rather than doubly exponential.

+ +

However, if circuits of any reasonable size don't produce a randomly chosen distribution, small circuits might still produce states or distributions with the same features as one that is actually randomly chosen. For many natural types of features, such as the spectrum of probabilities of the individual outcomes, that is exactly what happens. The approximate $t$-design property is a related standard, and is much weaker than actually achieving a uniformly random distribution on outputs or anything close to it.

+",8880,,,,,10/31/2019 23:59,,,,2,,,,CC BY-SA 4.0 +8638,1,,,11/1/2019 1:50,,0,258,"

I am not a scientist, so that's why I've come here...to hopefully find out if this would be possible.

+ +

Ok, so I started learning about quantum entanglement and I stumbled upon an idea for instant data transmission through space.

+ +

The idea is fairly basic, +because quantum entangled particles are dependent on each other to create 1 shared state...(I think) we could separate two entangled particles and then modify one to create an instant change on the other particle.

+ +

This change would be read and computed as binary code 1-0-0-1-1-0-1-0 for example.

+ +

Here's the best way i can explain my theory,

+ +

+ +

Simply put as one question, is instant data transmission possible in this way? Or at least faster than light (laser arrays)?

+",8949,,26,,11/1/2019 10:31,11/2/2019 8:04,Faster than light data transmission using entanglement,,1,4,,11/2/2019 8:04,,CC BY-SA 4.0 +8639,1,8703,,11/1/2019 1:56,,4,161,"

Does IBM compute a measurement error mitigation calibration matrix that can be accessed from its device properties or somewhere else? Or does the user have to do that every time?

+",8950,,2293,,8/17/2020 2:52,8/17/2020 2:52,Existing measurement error mitigation,,1,0,,,,CC BY-SA 4.0 +8640,1,8641,,11/1/2019 6:06,,1,981,"

Tried executing plot_histogram(result.get_counts(circuit)) +where result has the job result and circuit is the Quantum circuit

+ +

But an attribute error hits every time.

+ +
AttributeError: 'function' object has no attribute 'get_counts'
+
+ +

I tried going through the qiskit tutorial documentation, but couldn't help myself with it.

+ +

Can somebody point out what's wrong here?

+",8953,,26,,11/1/2019 10:28,11/1/2019 10:28,Attribute error in Qiskit,,1,0,,,,CC BY-SA 4.0 +8641,2,,8640,11/1/2019 8:50,,1,,"

It sounds like maybe one of the calls is missed. To get results you need to run

+ +
backend = Aer.get_backend('qasm_simulator')
+job = execute(circ, backend)
+result = job.result()
+plot_histogram(result.get_counts(circuit)) 
+
+",5955,,,,,11/1/2019 8:50,,,,1,,,,CC BY-SA 4.0 +8642,2,,8638,11/1/2019 8:55,,3,,"

No, you cannot use this for faster than light communication. The two typical ways that people think this could work are:

+ +
    +
  • Alice measures her qubit in a fixed basis, creating an instantaneous change in Bob's qubit. This is true, but the measurement outcome is random. Alice has no control over what measurement outcome she gets, so no information is transmitted in that protocol.

  • +
  • Alice chooses a measurement basis, and that choice is the bit she tries to communicate. Bob's qubit is instantaneously updated, but he has no way do determine what basis she used.

  • +
+ +

Either way, there's no way around it.

+",1837,,,,,11/1/2019 8:55,,,,7,,,,CC BY-SA 4.0 +8643,2,,8634,11/1/2019 9:03,,4,,"

Felix Huber's answer is correct, but I thought I'd fill in a few more details.

+ +

You've written the two-qubit state of ($\star$) as $(|0\rangle|+\rangle+|1\rangle|-\rangle)/\sqrt{2}$. Notice that if you apply a Hadamard to the second qubit, you change it to $(|0\rangle|0\rangle+|1\rangle|1\rangle)/\sqrt{2}$, a Bell state. The point is that from the perspective of entanglement, you cannot change how much entanglement is there by applying unitaries on individual qubits, so ($\star$) must be just as entangled as a Bell state. We say that it's equivalent up to local unitaries.

+ +

The GHZ case is very similar. The way I find it easiest to think about this case is to start with the $|+\rangle^{\otimes 7}$ state, before we apply controlled-phases, and split up the central qubit of the star: +$$ +\frac{1}{\sqrt{2}}(|0\rangle|+\rangle^{\otimes 6}+|1\rangle|+\rangle^{\otimes 6}). +$$ +Now, we apply the controlled-phase gate 6 times, each time controlled by the central qubit. So, if that qubit is 0, nothing happens. If that qubit is $|1\rangle$, a $Z$ is applied on all the other qubits. But $Z|+\rangle=|-\rangle$, so we're left with +$$ +\frac{1}{\sqrt{2}}(|0\rangle|+\rangle^{\otimes 6}+|1\rangle|-\rangle^{\otimes 6}). +$$ +This is locally equivalent to a GHZ state because if we apply Hadamards to those 6 non-central qubits, we get +$$ +\frac{1}{\sqrt{2}}(|0\rangle|0\rangle^{\otimes 6}+|1\rangle|1\rangle^{\otimes 6}). +$$

+",1837,,,,,11/1/2019 9:03,,,,4,,,,CC BY-SA 4.0 +8644,1,8646,,11/1/2019 11:09,,5,534,"

I'm confused about what precisely is the difference between Grover's Algorithm and Amplitude Amplification. I've heard some sources say they are different algorithms and others say they are the same thing. As I currently understand it,

+ +
    +
  • In Grover's algorithm you are searching for a state $|\omega\rangle$ (or multiple states) marked by an oracle, and you find this by applying Grover iterations that comprise of phase inversion $I-2|\omega\rangle\langle \omega|$ and mean inversion $I-2|s\rangle\langle s|$ in alternation.

  • +
  • In Amplitude Amplification, you have a projection operator P that projects you on to a ""good"" subspace, which seems to essentially boil down to marking a set of states. Then you have an operator $S_P = 1 - 2P$ that does phase inversion on those states and $S_\psi = 1 - 2|\psi\rangle\langle \psi|$ which seems to invert about your initial state $|\psi\rangle$.

  • +
+ +

So is the difference that in AA you are starting in an arbitrary state $|\psi\rangle$ and in Grover's you set $|\psi\rangle$ to be the uniform superposition state $|s\rangle$? Are there other important differences I am missing?

+",4841,,,,,11/1/2019 19:56,What is the difference between Grover's and Amplitude Amplification?,,1,0,,,,CC BY-SA 4.0 +8645,1,8648,,11/1/2019 11:35,,7,1989,"

I've just gotten started with Nielsen and Chuang's text, and I'm a little stuck. They mention that theoretically, it would be possible to store an infinite amount of information in the state of a single qubit. I'm not sure I completely comprehend this.

+ +

Here's how I rationalized it: You take all the information you want to store, put it in binary form, and make it the real component of $\alpha $ or $\beta$ (the coefficients of the computational basis states).

+ +

Now I'm not sure if I've understood it right, but since it's still fuzzy in my head it would be great to get some kind of ELI5 explanation or possibly a more detailed picture of how this would, even theoretically, be possible.

+ +

Apologies if the question doesn't meet standards. I'm new to the forum and would be open to feedback regarding asking questions or answering them.

+",8955,,55,,12/21/2020 23:51,12/23/2020 16:09,How can infinite information be theoretically encoded or stored in a single qubit?,,3,3,,,,CC BY-SA 4.0 +8646,2,,8644,11/1/2019 11:55,,5,,"

Grover's algorithm is a special case of the amplitude amplification algorithm where the number of good entries $G$ in the $N$-item database is $1$.

+

In a nutshell:

+
    +
  1. In the Grover's algorithm Wiki page that you linked, the keyword is "unique". Given $f:\{0, \ldots, N-1\} \to \{0, 1\}$ such that $f(x) = 1$ for exactly one $x$ (say $\omega$), Grover's algorithm amplifies the quantum state corresponding to $\omega$. Amplitude amplification is the generalized version that can amplify the quantum states corresponding to multiple entries, given their output is $1$.

    +
  2. +
  3. In both the algorithms you begin with a uniform superposition state

    +

    $$|\psi\rangle = \frac{1}{\sqrt N}\sum_{k=0}^{N-1}|k\rangle$$ +where $N$ is the number of database entries (cf. here). No difference there.

    +
  4. +
  5. The amplitude amplification algorithm calls the subspace (of the Hilbert space $\mathcal{H}$) of strings $x$'s for which output of $f$ is $1$ as the good subspace. They are just dividing the entire Hilbert space $\mathcal{H}$ into two mutually orthogonal subspaces $\mathcal{H}_1$ and $\mathcal{H}_0$, just like in Grover's algorithm, but there the good subspace $\mathcal{H}_1$ was single-dimensional i.e., corresponding to the unique marked state $|\omega\rangle$.

    +
  6. +
+
+

Edit: Upon further reading, it appears Brassard et al. (2000) generalized Grover's original algorithm (1997) in more ways than one, and were the first to coin the term quantum amplitude amplification. For a quick summary, refer to the concluding remarks section on pages 25-26.

+",26,,-1,,6/18/2020 8:31,11/1/2019 19:56,,,,10,,,,CC BY-SA 4.0 +8647,2,,8645,11/1/2019 12:21,,6,,"

Highly Relevant: (Physics SE) Informational capacity of qubits and photons

+
+
+

Here's how I rationalized it: You take all the information you want to store, put it in binary form, and make it the real component of $\alpha $ or $\beta$ (the coefficients of the computational basis states).

+
+

Yes, and then if you could then prepare a qubit precisely in the $\alpha|0\rangle + \beta|1\rangle$, in some sense you would be storing infinite information in a single qubit.

+

Though, the drawback is, firstly it's not possible to prepare quantum states that precisely in practice due to noise and other engineering limitations. Secondly, even if you managed to do that, you wouldn't be able to recover that information by measuring the qubit, as qubits immediately collapse to one of their basis states ($|0\rangle$ and $|1\rangle$ being the standard basis states).

+

The "encoding infinite information" idea is funny because it's certainly possible to claim that hypothetically if you can produce radio waves with frequency an integer multiple of $\pi$ or any other non-recurring, non-terminating irrational number for that matter that has unlimited decimal places, you are storing infinite information in that radio wave. It doesn't mean that the information is useful or practically retrievable!

+",26,,14237,,12/23/2020 16:09,12/23/2020 16:09,,,,1,,,,CC BY-SA 4.0 +8648,2,,8645,11/1/2019 16:13,,14,,"

I'm not sure what passage in Nielsen and Chuang you have in mind and I see all of this differently. I don't see any need to believe that it is ""theoretically"" possible store an infinite amount of information in a qubit. My answer to the paradox is that amplitudes aren't stored information. A qubit does not know its amplitudes any more than a randomized bit knows the chance that it is a 1. If the bit has 0.637 chance of being 1, that does not mean that 0.637 has been stored anywhere. The size of the bit's brain is exactly one bit; it can only tell you 0 or 1 if you ask it the one question that it can answer. Now a qubit can answer any one out of a continuous family of binary questions; but it can still only answer one such question in the sense that that completely determines its posterior state for future questions. A qubit is still too small to give a clean answer to any question with more than two answers, and it certainly does not have room to store decimal expansions of numbers.

+ +

To reiterate, quantum amplitudes are similar to classical probabilities. They are statistical features that are not directly stored by the systems that obey the statistics.

+ +

The Holevo-Nayak theorem says that n qubits cannot store any more than n classical bits. That's the real answer to the question of how a qubit can encode or store infinite information, ""theoretically"" or otherwise. Answer: It can't.

+",8880,,8880,,11/2/2019 16:46,11/2/2019 16:46,,,,12,,,,CC BY-SA 4.0 +8649,1,,,11/1/2019 16:20,,4,1305,"

I am a computer engineer and have recently started understanding quantum computers.

+ +

I am still struggling to wrap my head around some concepts.

+ +

One such query is the following - +It is said that during the computation the qubits exist in the multiple states with some probability until it is measured. Once the act of measurement is done all the probabilities collapse and one answer is the output.

+ +

Now, what I am not able to get my head around is, how are we sure that this collapsed answer is the right answer? +Since the superposition states are probabilistic in nature, there is a probability (though slim) of a wrong answer being output too.

+ +

Also since we cannot see or measure the intermediate superposition states we do not know which state has the highest probability. So how do we make quantum computer output the right answer?

+ +

I would highly appreciate someone to guide me through this.

+",8822,,8822,,11/2/2019 3:47,11/4/2019 18:41,How do quantum states collapse to the right answer?,,3,5,,,,CC BY-SA 4.0 +8650,2,,3932,11/1/2019 19:16,,2,,"

Initially let's consider some registers and operators.

+ +
    +
  1. The register $\vert A\rangle$, which encodes superpositions of states of the cube (e.g. a permutation of the cube $G$);
  2. +
  3. The operator $U$, which acts on $\vert A\rangle$ to map the all-0's ket $\vert 00\cdots 0\rangle$ to the uniform superposition over all $\Vert G\Vert$ states;
  4. +
  5. The register $\vert B\rangle=\vert b_1\rangle\vert b_2\rangle\cdots\vert b_k\rangle$, which encodes superpositions of a set of Singmaster moves to be applied to a given position (e.g., superpositions of words of Singmaster moves of length $k$);
  6. +
  7. The operators $V$ and $V^{-1}$, which act on $\vert B\rangle$ to map the all-0's ket $\vert 00\cdots 0\rangle$ to the uniform superposition of all $18^k$ words of Singmaster moves of length $k$ (and vice-versa); and
  8. +
  9. The (controlled) operator $W$, which applies Singmaster move $b$ to to a given cube position.
  10. +
+ +

If $\vert A\rangle$ is in the uniform superposition over all elements of $G$, then $\vert A\rangle$ is in an eigenstate of $W$, and repeated applications of $W$ will not be kicked back to affect $\vert B\rangle$.

+ +

+ +

That is, $V^{-1}$ should return $\vert B\rangle$ in the above circuit to the all-zeroes ket $\vert 00\cdots 0\rangle$.

+ +

However, as noted by @DaftWullie, if $\vert u\rangle$ is not in an eigenstate, then a difference between $\vert u \rangle$ and $\rho^k \vert u\rangle$ builds up very rapidly - I believe a speed at which this difference builds up depends precisely on the mixing properties of the operator of interest.

+ +

Thus, if we are able to prepare a state $\vert A\rangle$ that is perturbed from the uniform distribution, such that $\vert A\rangle$ is not an eigenstate, then repeated applications of $W$ will rapidly build a difference, and $V^{-1}\vert B\rangle$ may not be the all-zeroes ket.

+ +

+ +

If we had a function $F$ acting on $\vert A\rangle$ and an answer qubit $\vert C\rangle$ that determines, say, whether some hash $\{0,1\}^{\log_2 \Vert G\Vert}\mapsto (0,1)$ of the Rubik's cube position is less than some threshold $\delta$, and we use this $F$ to control a rotation of $\vert A\rangle$, then I believe that $V^{-1}\vert B\rangle$ in the circuit above will not read the all-zeros ket, and instead will likely deviate from the all-zeroes ket in a manner depending only on $\delta$ and the mixing time of the Rubik's cube group with the Singmaster generating set.

+ +

That is, I expect measurement of $\vert B\rangle$ in the above circuit will read $\vert 00000\cdots000101101\rangle$ or something similar, where the index of the first $1$ depends solely on the mixing time and the threshold $\delta$.

+",2927,,2927,,11/30/2019 20:17,11/30/2019 20:17,,,,0,,,,CC BY-SA 4.0 +8651,1,11866,,11/1/2019 20:41,,5,237,"

Are there any distributed consensus protocols which make use of quantum phenomena for improved performance? For example, symmetry breaking with a shared quantum state.

+",4153,,,,,5/5/2020 22:01,Entanglement and distributed consensus,,1,1,,,,CC BY-SA 4.0 +8652,1,8654,,11/1/2019 20:50,,4,186,"

An instructional quantum computing article I'm reading (How the quantum search algorithm works) states that the following circuit takes $\vert x\rangle\vert 0\rangle$ to $−\vert x\rangle\vert 0\rangle$, when $\vert x\rangle$ is anything other than $\vert 00\rangle$.

+ +

+ +

My question is: how can an operation (-Z gate) on the target qubit (the bottom one) affect the control qubits (the top 4 ones)?

+ +

I would expect the result of this circuit, when $|x\rangle$ is anything other than $\vert 0000\rangle$, to be $\vert x\rangle(−\vert 0\rangle)$. I understand that, algebraically, $(x)(-y)$ is the same as $-xy$, but intuitively, looking at this circuit, I don't see how those top 4 qubits would be affected by something happening to the bottom qubit. (I know, intuition doesn't have much place in quantum mechanics.) My hunch is that entanglement is at play.

+",8959,,2927,,11/2/2019 13:27,11/2/2019 13:38,How does a single-qubit gate affect other qubits?,,2,2,,,,CC BY-SA 4.0 +8653,1,,,11/1/2019 21:40,,4,300,"

I am attempting to mitigate measurement error while running on one of IBM's real devices and am doing so by passing CompleteMeasFitter into measurement_error_mitigation_cls in QuantumInstance. However, when I run the program, I receive the following error:

+ +
qiskit.aqua.aqua_error.AquaError: 'The qubit mapping of circuits are different. 
+Currently, we only support single mapping.'
+
+ +

I can see that the problem is coming from get_measured_qubits_from_qobj in measurment_error_mitigation.py. After a few iterations, the measured_qubits and qubit_mapping are not equal. I figured that the problem could be arising from the transpiler since the default optimization level is 1, meaning it will optimize based on connectivity. So, I tried changing optimization_level to 0 in quantum instance in hopes that qubit_mapping and measured_qubit will not be different, but have not had any luck.

+ +

How can I go about fixing this problem?

+",8961,,2293,,8/17/2020 2:53,8/17/2020 2:53,Problem with measurement error mitigation using VQE,,0,0,,,,CC BY-SA 4.0 +8654,2,,8652,11/2/2019 5:35,,4,,"

The phase of -1 generated on the ancilla is just a global phase. You can shift it to any qubit without affecting the statistics of the system. Nothing to do with entanglement.

+

Quantum mechanics is a mathematical framework that describes reality insofar that it predicts the correct observable statistics of a system. Shifting around a global phase factor from one qubit to another doesn't cause any deviation in the observable statistics and thus, they're all equivalent quantum states of the 5 qubits, mathematically as well as physically.

+

$$-(|x\rangle\otimes |0\rangle) \equiv |x\rangle \otimes (-|0\rangle) \equiv (-|x\rangle)\otimes|0\rangle$$

+
+

As you're beginning to learn quantum computing you'll soon also hit another conceptual block.

+

Though your question doesn't ask about it, I'll briefly point out a couple of things. For some reason people seem to believe that state of control qubits should not change when a controlled-$U$ gate is applied. The actual statement is that only the standard basis states $|\{0, 1\}^c\rangle$ ($c$ being the number of control qubits) remain unaffected by controlled-$U$ gates.

+

If the control qubits are in a state that is different from one of the standard basis states, then theoretically their state could very well be affected. Moreover, as Niel de Beaudrap beautifully illustrates here, you should not attach too much significance to the standard basis!

+

The phenomenon is known as phase kickback mechanism:

+
+

If we apply a controlled-$U$ gate to $|\psi_k\rangle$ (an eigenstate of $U$; $e^{i\phi_k}$ being the eigenvalue), $|\psi_k\rangle$ is unchanged, and $|0\rangle\langle 0| + e^{i\phi_k}|1\rangle\langle 1|$ is applied to the control qubit.

+

+
+

For a detailed explanation, check DaftWullie's answer and the subsequent discussion in the comments.

+",26,,-1,,6/18/2020 8:31,11/2/2019 6:18,,,,0,,,,CC BY-SA 4.0 +8655,2,,8645,11/2/2019 12:27,,2,,"

Here is another way to think about it. +You can, in principle, store an infinite amount of information into a qubit, in the sense that you might need arbitrarily many bits to exactly pinpoint its state.

+ +

However, this is not as weird or surprising as one could think. You can make the same argument about a (classical) probability distributions. +Given any amount of information, I can always find a way to encode it into a probability distribution over a bit. For example, given $N$ bits of classical information in the form of a bitsring $\equiv(x_1,...,x_N)$, just define $x$ as the number having that bitstring as binary decomposition, and then use a probability distribution with $p_0=x 2^{-M}$ for a big enough $M$. + + +

About the matter of retrieving the information ""stored"" this way, you find in both classical and quantum case that there is no way to do that with a single measurement. In other words, the more information you want to retrieve from a probability distribution, the more you need to sample from it. Holevo's theorem essentially tells you that quantum mechanics doesn't give any advantages over the classical case in this task.

+",55,,55,,11/2/2019 13:00,11/2/2019 13:00,,,,5,,,,CC BY-SA 4.0 +8656,2,,8649,11/2/2019 12:33,,2,,"

I see maybe three questions here:

+ +
    +
  1. Given an efficient (quantum) algorithm, how is it that the efficient algorithm will give the correct answer with high probability?

  2. +
  3. Given an efficient (quantum) algorithm, how do we know that the efficient algorithm will give the correct answer with high probability?

  4. +
  5. Upon executing our efficient quantum algorithm, how can we be sure that the probabilistic answer so achieved is correct?

  6. +
+ +

Regarding the first question, this is answered in the comments. The quantum algorithm choreographs the probability amplitudes to interfere constructively to the correct answer.

+ +

Regarding the second question, many algorithms are proved both efficient and correct with high probability, but indeed there are some quantum algorithms and heuristics that we are not sure will give a correct answer in an efficient amount of time. For example, as I understand it the quantum adiabatic algorithm or the quantum approximate optimization algorithm in many cases lack a proof that an answer will be provided in an efficient amount of time. That is, although the correct answer may eventually be given with high-enough probability, it is unknown whether the answer will be given in a short-enough amount of time.

+ +

Regarding the third question, for very many problems of interest, we hope a quantum algorithm will give an answer to a problem in the so-called $\mathrm{TFNP}$ class of problems (see comments). The implication is that if our quantum computer provides one answer, we can test that answer on our classical computer to determine whether the answer is correct. For example, the oft-repeated quip that quantum computers have used Shor's algorithm to successfully factor $21$ into $3\times 7$ ""with high probability"" has a joke hidden therein. Namely, the quantum computer successfully determined that $3$ is a factor of $21$ with high probability, or that $7$ is a factor of $21$ with high probability, and we can classically check that $21=3\times 7$. The same could be said for any problem in $\mathrm{TFNP}$ that also happens to have an efficient quantum algorithm - e.g. problems in the so-called so-called $\mathrm{BQP}$ complexity class.

+ +

However, interestingly there are indeed some problems that have an efficient quantum algorithm to find a putative answer, but likely do not have an efficient classical verification algorithm that can verify the putative answer. For example, determining certain properties of mathematical knots falls into this category, as does, for example, Google's approach to quantum supremacy, and there are indeed issues about the classical verification of the output of such algorithms - but I don't think that's the direction the OP was going.

+",2927,,2927,,11/2/2019 17:32,11/2/2019 17:32,,,,4,,,,CC BY-SA 4.0 +8657,2,,8652,11/2/2019 13:38,,3,,"

This is not an attempt to answer the question directly, but might help with the intuition. They key point is that multi-qubit gates can propagate the effect of a single-qubit rotation to other qubits. So, there's the technicality of what effect is propagated that I'll leave to other answers, but just to convince you that it can propagate:

+ +

Take a very simple circuit of two qubits. We apply the sequence SWAP - single-qubit rotation on qubit 2 - SWAP. I hope you'll agree that the net effect of this is simply that the single-qubit rotation is actually applied to the first qubit, not the second. So, it's all about those multi-qubit gates...

+",1837,,,,,11/2/2019 13:38,,,,0,,,,CC BY-SA 4.0 +8658,1,,,11/2/2019 20:44,,3,222,"

What information can we get out about the eigenvalues of a reduced density matrix knowing the eigenvalues of the original matrix?

+ +

For example, it can be proved that if all the eigenvalues of a density matrix are positive, then the eigenvalues of the reduced density matrix are positive too.

+ +

From here, it looks like knowing all the eigenvalues is a hard problem, but what information can we possibly obtain? Information about the determinant perhaps?

+",2832,,55,,12/21/2020 23:50,12/21/2020 23:50,What can we know about the eigenvalues of a reduced density matrix knowing the eigenvalues of the original matrix?,,1,4,,,,CC BY-SA 4.0 +8659,1,8660,,11/3/2019 12:22,,3,895,"

By the classic theory of computation, every classic gate can be build with NAND operation, for example XOR (""the classic CNOT"") is build by net of NANDs, +I saw that the quantum analogue for NAND can be build with CCNOT gate (Toffoli gate) and that is indeed a universal gate.

+ +

My question\request is can you please draw me a quantum circuit that express CNOT using universal CCNOT gate?

+",4524,,55,,11/7/2019 11:14,11/7/2019 11:14,How to build a CNOT out of universal CCNOT gates?,,2,2,,,,CC BY-SA 4.0 +8660,2,,8659,11/3/2019 12:57,,2,,"

CNOT is a Boolean function $f:\{0,1\}^2\to\{0,1\}^2$ that eats two input bits and spits two output bits. As Wikipedia explains, Toffoli gates require some ancillary (extra) qubits to do emulate any Boolean function. In this case, just one extra qubit will do the job. As MarkS mentioned in the comments, set one of the control qubits of the Toffoli gate to $|1\rangle$ (that is now your ancilla qubit), and you're done.

+ +

The circuit will be no different than any ordinary circuit diagram of a Toffoli. You can play with it yourself on Quirk (the top qubit is the ancilla).

+ +

+ +

If you're wondering why this method works, have a look at the truth table of the Toffoli. Note that if the first bit is set at 1, the reduced truth table for the other two bits will basically match the CNOT's table.

+",26,,26,,11/3/2019 13:26,11/3/2019 13:26,,,,0,,,,CC BY-SA 4.0 +8661,1,,,11/3/2019 12:59,,4,393,"

I would like to add noise to existing gates in Cirq, i.e. to define something like

+ +
NewGate = cirq.Gate(qubit) 
+
+ +

followed by

+ +
cirq.DepolarizingChannel(p).on(qubit)
+
+ +

How can I do this?

+",8979,,55,,11/7/2019 11:24,11/7/2019 23:29,How to add noise to existing gates in Cirq?,,1,0,,,,CC BY-SA 4.0 +8662,1,8674,,11/4/2019 0:23,,33,8544,"

I have heard a few times that one way of describing quantum computers is that they essentially use the computing power of their counterparts in alternate realities that they access through superposition. My first question is, of course,

+ +
    +
  1. is this actually an accurate description of how quantum computers work, or just a misrepresentation?
  2. +
+ +

Also, if it were to be assumed true and taken literally, then presumably all the possible outcomes of any given computation done would be experienced by each of these alternate realities. I have a few questions regarding the implications of this:

+ +
    +
  1. Would it be correct to say that our universe essentially ""spawns"" these alternate realities to use for each computation, or that they all exist simultaneously in a higher dimension and only come into contact via the initiation of superposition by each computer at the same time?
  2. +
  3. Would it be possible to create contact between universes via this connection? I'd expect that, if it was, it would be entirely random, and so not only would not cause any information transfer, it also would be completely undetectable, because the deviations would be within the expected probabilities of error rates - but is there any way to circumvent this?
  4. +
+",8984,,55,,11/7/2019 11:01,4/16/2021 17:30,Effects of quantum computing on parallel universes,,4,6,,,,CC BY-SA 4.0 +8663,2,,8662,11/4/2019 1:19,,24,,"

Regarding your first question, you are essentially asking about the validity of a position taken by David Deutsch - a founder of quantum computing! For example, in his book 'The Fabric of Reality', Deutsch states:

+ +
+

When Shor’s algorithm has factorized a number, using $10^{500}$ or so times the computational resources that can be seen to be present, where was the number factorized? There are only about $10^{80}$ atoms in the entire visible universe, an utterly minuscule number compared with $10^{500}$. So if the visible universe were the extent of physical reality, physical reality would not even remotely contain the resources required to factorize such a large number. Who did factorize it, then? How, and where, was the computation performed?

+
+ +

The implication is that the number was factored in the multiverse.

+ +

However, there are some issues with Deutsch's position that others have pointed out.

+ +

For example, quantum computers can’t seem to access all of the multiverse to efficiently solve any problem - they still seem to have limitations! Aaronson, I believe in his book 'Quantum Computing Since Democritus', notes that Deutsch's arguments about multiple universes working together would apply equally well to problems in the so-called $\mathrm{NP\:Complete}$ complexity class. However, quantum computers likely cannot efficiently solve such problems.

+ +

So if we ""use the computing power of their counterparts in alternate realities that they access through superposition,"" as espoused by Deutsch, then the computing power so-granted is still very limited - and then the question becomes why can the interacting universes within the multiverse allow us to factor large integers efficiently but not allow all other problems in $\mathrm{NP}$ to be solved efficiently?

+ +

Because the above question is not clearly answerable, the idea that the multiverse works together to factor a large number is maybe incomplete...

+",2927,,2927,,11/4/2019 18:50,11/4/2019 18:50,,,,6,,,,CC BY-SA 4.0 +8664,2,,8658,11/4/2019 8:15,,3,,"

I cannot answer the question completely. But we can have look at some of the edge cases. +For the case of a bipartite pure system with the same number of qubits on both sides, nothing can be said about the eigenvalues of a reduced system from the eigenvalues of the full system. This is because any density matrix can be purified using this setup.

+ +

Now on the other hand if the full system is in the maximally mixed state then its reduced density matrices are also maximally mixed. So, in this case, we know all the eigenvalues of the reduced density matrices.

+",2663,,,,,11/4/2019 8:15,,,,0,,,,CC BY-SA 4.0 +8665,1,,,11/4/2019 8:44,,5,217,"

First of all, since I am not a specialist, sorry if this question does not make sense. But, I can't resist to ask as I have not found any direct information while googling.

+ +

I hope some of you know/remember the Eternity II puzzle. According to its Wikipedia page, it has still not been solved.

+ +

Here is my ""simple"" question(s): (1a) Could quantum computing help in solving that particular problem? (1b) Is this puzzle a problem within the scope of what QC can do faster? If yes, (2) could we already write an algorithm to solve it, even if the required hardware is not yet available? (3) What would be required hardware, and (4) how far is it from today's Google Sycamore processor?

+",4121,,26,,11/4/2019 8:51,11/4/2019 8:51,Could quantum computing help solving the Eternity II puzzle?,,0,1,,,,CC BY-SA 4.0 +8666,2,,8662,11/4/2019 13:14,,8,,"

In the many worlds interpretation (MWI) reality consists of a structure called the multiverse that looks like a collection of slightly interacting parallel universes in some circumstances:

+ +
+

Deutsch, David. ""The structure of the multiverse."" Proceedings of the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences 458.2028 (2002): 2911-2923. + [arXiv:quant-ph/0104033]

+
+ +

In the MWI each system exists in multiple instances. Some of those instances are identical to one another in the sense that any measurement you could perform on them can't tell them apart. These correspond to elements of a superposition that are in the same state $|\psi\rangle$. You can write this state as $1/2|\psi\rangle+1/2|\psi\rangle$, or $1/3|\psi\rangle+2/3|\psi\rangle$ or any other combination of numbers that add up to 1. A collection of instances in the same state can evolve to be in multiple different states, like so:

+ +

$$|\psi\rangle \to \tfrac{1}{\sqrt{2}}|\psi\rangle + \tfrac{1}{\sqrt{2}}|\alpha\rangle$$

+ +

There is no fact of the matter about which instances in the initial state $|\psi\rangle$ have ended up in the state $|\alpha\rangle$ because the instances in the same state can't be distinguished from one another by any measurement. So changing a superposition involves changing the state of some of the instances so that there are multiple different versions of the system. This process doesn't spawn the existence of new instances.

+ +

The interference that takes place in a quantum computation combines the information in the different instances to produce a single state with the correct outcome with some probability large enough to make the computation worth doing. Since the intermediate states are all combined to produce a single answer it's not the case that there is one version that receives messages from the other versions. Rather there is a process that uses all those versions to produce a correct answer. You can't copy information between different versions of a system because the process of copying information out of a system in a superposition produces decoherence that prevents interference:

+ +
+

Zurek, Wojciech H. ""Wave-packet collapse and the core quantum postulates: Discreteness of quantum jumps from unitarity, repeatability, and actionable information."" Physical Review A 87.5 (2013): 052111. + [arXiv:1212.3245]

+
+ +

Interference is the process that puts information about all of the different versions into a single version so trying to copy information between different versions of the same system is forbidden by the laws of physics.

+",1788,,26,,11/4/2019 16:55,11/4/2019 16:55,,,,0,,,,CC BY-SA 4.0 +8667,2,,8661,11/4/2019 13:27,,4,,"

One simple way to do it is by defining a composite gate, like this:

+ + + +
class MyGateThenDepolarize(cirq.SingleQubitGate):
+    def _decompose_(self, qubits):
+        q = qubits[0]
+        return [MyGate.on(q), cirq.depolarize(p).on(q)]
+
+ +

If you want a depolarizing gate on every qubit at the end of every moment, you can do a noisy simulation:

+ + + +
cirq.sample(circuit, noise=cirq.depolarize(p))
+
+ +

Or get a noisy version of the circuit:

+ + + +
circuit = circuit.with_noise(cirq.depolarize(p))
+
+ +

If you specifically want a noise model that depolarizes the one gate, you can define a custom noise model that does that:

+ + + +
class MyGateDepolarizingNoiseModel(cirq.NoiseModel):
+    def noisy_operation(self, op):
+        if isinstance(op.gate, MyGate):
+            return [op, cirq.depolarize(p).on(op.qubits[0])]
+        return op
+
+ +

And here's a test confirming that it works:

+ + + +
import cirq
+
+def test_custom_noise_model():
+    p = 0.1
+
+    class MyGate(cirq.Gate):
+        def _num_qubits_(self):
+            return 1
+        def _decompose_(self, qubits):
+            return cirq.X(*qubits)
+
+    class MyGateDepolarizingNoiseModel(cirq.NoiseModel):
+        def noisy_operation(self, op):
+            if isinstance(op.gate, MyGate):
+                return [op, cirq.depolarize(p).on(op.qubits[0])]
+            return op
+
+    a, b = cirq.LineQubit.range(2)
+    c = cirq.Circuit(
+        MyGate().on(a),
+        cirq.X.on(b),
+        cirq.measure(a, key='a'),
+        cirq.measure(b, key='b'),
+    )
+    results = cirq.sample(
+        c,
+        noise=MyGateDepolarizingNoiseModel(),
+        repetitions=1000)
+    assert sum(results.data['a']) < 1000  # yes depolarized
+    assert sum(results.data['b']) == 1000  # not depolarized
+
+    print(results.data['a'].value_counts())
+    # 1    942
+    # 0     58
+    # Name: a, dtype: int64
+
+    print(results.data['b'].value_counts())
+    # 1    1000
+    # Name: b, dtype: int64
+
+",119,,119,,11/7/2019 23:29,11/7/2019 23:29,,,,0,,,,CC BY-SA 4.0 +8669,1,8671,,11/4/2019 15:37,,5,218,"

In Martinis' recent Caltech lecture on the Sycamore paper, he appears to make much of the fact that FIG. 4 of the paper show straight-line fidelity - that is, the fidelity decreases log-linearly with an increase in the number of qubits, and an increase in the depth (number of gates) of the circuit.

+ +

I believe a position of Martinis is that the scientific value of Sycamore, which is independent of the claims of supremacy, is that errors can be modeled collectively as digital Pauli errors, and further these errors are independently distributed and don't cluster. This seems to conflict with, for example, Kalai's objection to quantum computing that errors collude and coordinate with increasing qubit count/depth.

+ +

Martinis notes that ""high school probability"" can be used to model the decrease in fidelity with an increase in qubit count/gate count.

+ +
+

But what is this ""high school probability"" that Martinis refers to?

+
+ +

If I were to model insertion of errors into a large-depth circuit, I might decide, with probability $p$, to insert a randomly selected Pauli error (bit-flip and/or phase shift) between any two gates. The probability would be independent of the depth/qubit count of the circuit.

+ +

Is this ""Poisson-process"" of error-insertion similar to the high school probability to which Martinis refers?

+",2927,,26,,11/5/2019 9:56,11/5/2019 9:56,Can we conclude that errors on Sycamore are Poisson-distributed Pauli errors?,,1,0,,,,CC BY-SA 4.0 +8670,2,,8649,11/4/2019 16:34,,-1,,"

Technically, there is no way to determine with perfect accuracy, and the same applies to any event. Everything that happens in our universe involves interactions between quantum states, and therefore is probabilistic. When we do a simple math calculation in our minds or on a calculator, there is always a small chance that the ""wrong"" answer will be produced by unlikely though possible quantum events. Every observation we make is under this influence as well. In essence, there won't be any difference in error rates among classical vs. quantum computers, ignoring mechanical failures and decoherence interference. Any calculation done by any computer, whether it's classical, quantum, or even a brain, will only provide an answer according to certain probabilities, and even our observation of that answer will follow the same probabilistic functions, so there is technically a) no way to know for certain whether an answer is correct.

+ +

However, the likelihood of any computation being influenced by external quantum events is so astronomically low that we can assume, beyond a reasonable doubt, the accuracy of any given computation - including those done by a quantum computer. Ignoring external factors, all computations follow the probabilistic rules which they are privy to, and the correct answer will usually be the result, because the likelihood of the quantum events which compose the computation behaving outside the expected probability is close to zero.

+",8984,,8984,,11/4/2019 16:47,11/4/2019 16:47,,,,3,,,,CC BY-SA 4.0 +8671,2,,8669,11/4/2019 17:57,,4,,"

The model's accuracy is purely empirical observation. The error trend (Fig 4, or 41:50 in the video) demonstrates that the error of the system (cross entropy fidelity with respect to simulated results) is tracked closely by the ""high school probability"" model he mentions.

+ +

The way this basic model would work is to assume 1- and 2-qubit gate errors are Markovian (time-independent) and also occur independently of other qubits' behavior and then take the product of all the fidelities of gates acting on a single qubit as its total error at measurement time. So if I have the circuit $X(q_0) CNOT(q_0, q_1) X(q_0)$ with an X-gate fidelity of 95% and a CNOT fidelity of 90%, I might say the total error (before applying measurement error) on $q_0$ is $.95 \times .90 \times .95 = 82\%$ and the error on $q_1$ is $90\%$. This probably isn't the exact way they implemented this but it captures how you can might predict the fidelity of the full circuit assuming that qubit errors occur independently.

+ +
+

This seems to conflict with, for example, Kalai's objection to quantum computing that errors collude and coordinate with increasing qubit count/depth.

+
+ +

That objection is probably still valid in general. Since this model's performance was an empirical observation using the results of a specific family of circuits, the validity of such a model won't necessarily generalize to more complicated circuits. Its likely that there will be types of circuits for which correlated errors contribute significantly to the output accuracy.

+",1939,,,,,11/4/2019 17:57,,,,5,,,,CC BY-SA 4.0 +8672,2,,8649,11/4/2019 18:32,,2,,"

Some algorithms do have deterministic answers or a high probability of getting the correct answer when implemented. For example, Deutsch's algorithm (Deutsch-Jozsa) which tells us with certainty whether a function is constant or balanced. On the other hand, however, you have Grover's search. Grover's has a high probability of giving you the correct answer but it is not definite. The more iterations of Grover's that are done in a circuit, the higher the probability of the correct answer appearing. It's really about trusting the mathematics. If you were to implement these algorithms by hand and work out the math (and use Born's Rule of squaring the coefficients of states to find that state's probability) you'll find that you will arrive at the correct answer or you will see that the correct answer has a high probability of appearing (relative to the other states).

+ +

And if you're interested in a book for starting out, I highly suggest: +Quantum Computation and Quantum Information by Nielson and Chuang.

+",8995,,26,,11/4/2019 18:41,11/4/2019 18:41,,,,2,,,,CC BY-SA 4.0 +8673,2,,8551,11/4/2019 18:51,,1,,"

I'm sure that this has something to do with quantum decoherence or ""noise"" which is caused when more qubits are added. It's likely that they are both at the frontlines of research so 53 qubits are the best that they can do given the hardware that they have access to. As they add more qubits it gets tougher to compute and prompts them to find some suitable method to reduce this noise through quantum error correction.

+",8995,,26,,11/5/2019 3:36,11/5/2019 3:36,,,,0,,,,CC BY-SA 4.0 +8674,2,,8662,11/4/2019 20:49,,15,,"

Question 1

+

This description lies somewhere between the two extremes of a theory and mysticism, depending on how amiable one is to the concept. David Deutsch is vocal proponent of the former, Lee Smolin of the latter (he categorizes it as "Mystical Realism").

+

The general idea was initiated by one of John Wheeler's PhD students, Hugh Everett III, in his 1957 doctoral thesis, which introduced relative state functions and provided the mathematical foundation for what is commonly known as the many-worlds interpretation (MWI).

+

In The Beginning of Infinity David Deutsch defines quantum computation as "Computation in which the flow of information is not confined to a single history." This definition is consistent with his expressed belief that MWI is a testable theory and the only theory with any power to explain the operation of quantum computers (here - note that Deutsch takes issue with the label MWI).

+

Deutsch is highly regarded and was the first to explicitly describe a universal quantum computer (ibid.). However, +MWI is a minority view, and many other thought leaders disagree with his stance in this regard (see, e.g., Peter Shor's comment to Mark S's answer below). Another notable thinker, Richard Feynman, commented with regard to MWI, "It's possible, but I'm not very happy with it" (here).

+

To answer your question explicitly, it's not clear whether or not this is an accurate description.

+

Question 2

+

At a fundamental level, Everett describes the situation in his thesis:

+
+

...from the standpoint of our theory, it is not so much the +system which is affected by an observation as the observer, who +becomes correlated to the system.

+
+

Feynman expanded on this point of view (here),

+
+

...that many-world picture says that the wave function $\psi$ is what's +real, and damn the torpedos if there are so many variables, $N^R$. All +these different worlds and every arrangement of configurations are all +there just like our arrangement of configurations, we just happen to +be sitting in this one.

+
+

Deutsch has further refined the concept considerably over the years in both scientific papers (e.g., early: 1, 2; recent: 3) and popular science books (4, 5). He generally speaks of an infinite variety of universes within the multiverse, some proportion of which align with each other in particular instances.

+

In that sense, your second statement is closer to MWI. From what I understand, I think it would be more accurate to say the universes "doing the computation" were identical at the point of state preparation and branch on measurement.

+

Question 3

+

Contact in the form of "message sending" between universes is prohibited by special relativity. As stated by Everett (page 98-99 of his thesis)

+
+

Only the totality of these observer states, with their diverse +knowledge, contains complete information about the original +object-system state - but there is no possible communication between +the observers described by these separate states.

+
+

If I understand Deutsch correctly, there is a possibility of some form of directed interference that would allow "an observer to 'feel' himself split into two branches" (experiment proposed here), but message sending between the two branches is still prohibited. Apparently, classification of MWI as interpretation or theory (under conventional scientific methodology) depends largely on the viability of this experiment, or one very similar.

+

Edit 1: Revised after reading Everett and Deutsch more carefully.

+

Edit 2: I recently learned that Sean Carroll (CalTech physicist and prolific writer) is also an advocate for the Everett formulation of quantum mechanics. He makes his case in Something Deeply Hidden.

+",8623,,8623,,4/16/2021 17:30,4/16/2021 17:30,,,,1,,,,CC BY-SA 4.0 +8675,2,,8551,11/4/2019 21:44,,19,,"

It's just a coincidence.

+ +

I can speak from personal recollection on the Google side. Google originally intended to use a 72 qubit chip (Bristlecone) where qubits were essentially directly connected to each other. They then switched to an architecture where qubits were connected indirectly via a coupler. The coupler requires a control line, so this increased the number of wires per qubit. The fridge was only setup for so many wires, so the total number of qubits was reduced to 54 to fit. Then one of the qubits didn't work, so it was excluded from the experiment leaving 53.

+ +

That being said, an underlying reason that you would expect slightly-more-than-50 qubits to be a common target is that that's roughly the number of qubits where the wavefunction becomes so large that it can't be directly stored on modern supercomputers.

+",119,,,,,11/4/2019 21:44,,,,0,,,,CC BY-SA 4.0 +8676,2,,8551,11/4/2019 21:58,,2,,"

My guess is that this is an example of co-opetition, i.e. collaborative competition. Number of qubits is just a single characteristic of a quantum processor, but there are a lot more, like tolerance, topology, etc. Also this characteristic is the only one that most people understand. Thus it's not reasonable to put all the resources on the increasing just this number (or use some shady marketing). It's better to be aligned and invest into the overall performance of a chip. Until a breakthrough, of course.

+",5870,,5870,,11/5/2019 18:15,11/5/2019 18:15,,,,1,,,,CC BY-SA 4.0 +8677,2,,5028,11/5/2019 3:33,,2,,"

Every time you run a code on one of IBM's Q.computers, you'll need to validate your access token which you can find in your IBM Q experience dashboard under the user category. +In case, you've done it beforehand but still doesn't seem to work, make sure to delete all your previous account details using

+ +
IBMQ.delete_accounts()
+
+ +

Then try regenerating a new access token, save the credentials and run again.

+ +

Or you could try reading the tutorials in IBM Q experience portal

+",8953,,,,,11/5/2019 3:33,,,,0,,,,CC BY-SA 4.0 +8679,1,8680,,11/5/2019 6:10,,-3,117,"

Today I(z) walked into an elevator and did not press the key to the floor to which I wanted to go.

+ +

As there were 2 other people x and y who had pressed the keys 2 and 3 respectively.

+ +

I wanted to go to the 2nd floor but nither x or y knew about it, so using a quantum computer or circuit how can x or y deduce whether I want to go to there floor or the probabilities of me going to 2nd or the 3rd floor.

+ +

Can we transform the question to ask what is the probability of z exiting on every floor, Please suggest?

+",9003,,9003,,11/5/2019 8:00,11/6/2019 17:02,The Elevator Problem,,1,4,,11/5/2019 15:12,,CC BY-SA 4.0 +8680,2,,8679,11/5/2019 8:43,,2,,"

Any ""person"" (x or y) can obtain the state of z using the quantum circuit consisting of CNOT and Hadamard gates and $Z$ gate; the circuit is actually a simplified version of quantum teleportation; let x be in the state $|0\rangle$, that is he wants to go to the floor 2 (state $|1\rangle$ means floor 3). Applying CNOT to z (control qubit) and x entangles z and x, and then you need to apply Hadamard gate to z and measure it.

+ +

If you measure $|1\rangle$, x already contains the initial state of z; if you measure $|0\rangle$, you need to apply $Z$ gate to x.

+ +

Either way in the end x contains the initial state of z while the state of z is destroyed by measurement.

+ +

For more details see Prof. Vazirani's lecture.

+",2105,,26,,11/6/2019 17:02,11/6/2019 17:02,,,,9,,,,CC BY-SA 4.0 +8681,1,8684,,11/5/2019 9:18,,4,130,"

The Appendix to a recent paper Graph States as a Resource for Quantum Metrology states:

+
+

We model an $n$ qubit graph state $G$ undergoing iid dephasing via $$G + \to G^{\text{dephasing}} = + \sum_{\vec{k}}p^{k}(1-p)^{n-k}Z_{\vec{k}}GZ_{\vec{k}}$$ where $p$ is +the probability that a qubit undergoes a phase flip. This effectively +maps the graph state onto the orthonormal basis +$\{Z_{\vec{k}}|G\rangle\}_{\vec{k}}$.

+
+

Question: +Is it clear why this expression is given in this form (in particular what does the $Z_{\vec{k}}$ denote and how do we know that $\{Z_{\vec{k}}|G\rangle\}_{\vec{k}}$ is an orthonormal basis)?

+

These might be trivial questions but I am new to this area hence some of the conventions I am still unfamiliar with.

+",2032,,10480,,1/22/2021 21:07,1/22/2021 21:07,Dephasing in graph states,,1,0,,,,CC BY-SA 4.0 +8682,1,8683,,11/5/2019 12:42,,5,1024,"

I am trying to build a circuit for quantum teleportation. On the simulator, everything runs fine and according to expectations, however, I am not able to run the algorithm on the real quantum processor.

+ +

ERROR_RUNNING_JOB is returned without any other explanation. I tried to implement two different circuits, the first one with controlled X and Z gates, the second one with gates X and Z are controlled by a value in the classical register. Please find both circuits below.

+ +

I appreciate any help.

+ +

Thanks.

+ +

+

+",9006,,55,,11/7/2019 11:20,11/7/2019 11:20,Trying to build a circuit for quantum teleportation on IBMQ I get ERROR_RUNNING_JOB error,,2,0,,,,CC BY-SA 4.0 +8683,2,,8682,11/5/2019 13:11,,9,,"

The issue is that you are applying operations after measurement gates and this is currently not available on the real hardware. I think the hardware also does not support reset operations mid-way through a circuit at the moment.

+ +

The best way forward is to keep running this on the simulator or try to find a different way of expressing the circuit such that it avoids these features.

+",5955,,,,,11/5/2019 13:11,,,,3,,,,CC BY-SA 4.0 +8684,2,,8681,11/5/2019 13:27,,4,,"

Imgine that there is a bit string $\vec{k}\in\{0,1\}^n$. We use this to specify sites (bit value 1) where an error has occurred, and sites (bit value 0) where no error has occurred. The number of 1s in the bit string is $k$. The probability of this particular error arising is then $p^k(1-p)^{n-k}$ because there are $k$ sites with an error and $n-k$ sites with no error. The error is decribed as $Z_{\vec{k}}$, i.e. specifying which qubits (bit values 1) the Pauli $Z$s are applied to.

+ +

As for why $Z_{\vec{k}}|G\rangle$ are all orthogonal, consider the inner product of two: +$$ +\langle G|Z_{\vec{k}}Z_{\vec{l}}|G\rangle +$$ +Now, we can write the graph state as $U|+\rangle^{\otimes n}$, where $U$ corresponds to the set of controlled-phase gaes that entangle the system. Phase gates commute with $U$, so $U^\dagger Z_{\vec{k}}=Z_{\vec{k}}U^\dagger$, +so this means that the inner product is +$$ +\langle+|^{\otimes n}Z_{\vec{k}}Z_{\vec{l}}|+\rangle^{\otimes n}. +$$ +Provided $\vec{l}\neq\vec{k}$, this is clearly 0 because there is at least one site where there is an inner product $\langle+|-\rangle$.

+",1837,,,,,11/5/2019 13:27,,,,3,,,,CC BY-SA 4.0 +8685,1,,,11/5/2019 13:33,,3,100,"

I have a secret say $s$. I have a dealer $D$ and three participants $A, B, C$. I want to share this secret $s$ in such a way that the participation of all $3$ is essential to reconstruct the secret. Now for creating the shares, I use some classical sharing algorithms and create shares $s_A,s_B,s_C$. Now how do I distribute these shares among the participants quantum mechanically using qudits? What I thought is the following steps.

+ +

First, let the basis be $\{|0\rangle, |1\rangle,.....,|d-1\rangle\}.$ Now since each of the participant $A, B, C$ has his/her share, one of them starts the reconstruction process by first preparing a $|0\rangle$ and taking its Fourier transform, so I get $$|\phi\rangle_1=\sum_{y=0}^{d-1}|y\rangle_1$$Now the next step is to initialize two $|0\rangle$ states and perform the CNOT gate on them with the first qudit as the control, so to get $$|\phi\rangle_2=\sum_{y=0}^{d-1}|y\rangle_1|y\rangle_2|y\rangle_3$$After this step we perform the Quantum Fourier transformation on all the particles to get $$|\phi\rangle_3=\sum_{y=0}^{d-1}\sum_{k_1=0}^{d-1}\sum_{k_2=0}^{d-1}\sum_{k_3=0}^{d-1}\omega^{(k_1+k_2+k_3)y}|k_1\rangle_1|k_2\rangle_2|k_3\rangle_3$$ +Now since the summation is finite i rearrange the terms to get $$|\phi\rangle_3=\sum_{k_1=0}^{d-1}\sum_{k_2=0}^{d-1}\sum_{k_3=0}^{d-1}\sum_{y=0}^{d-1}\omega^{(k_1+k_2+k_3)y}|k_1\rangle_1|k_2\rangle_2|k_3\rangle_3$$ +With $\sum_{i=0}^{d-1}\omega^i=0$, we have the condition that the state left after this operation will be subject to the condition that $k_1+k_2+k_3=0\;mod\;d$ , we will have $$|\phi\rangle_3=\sum_{k_1=0}^{d-1}\sum_{k_2=0}^{d-1}\sum_{k_3=0}^{d-1}|k_1\rangle_1|k_2\rangle_2|k_3\rangle_3$$

+ +

now after preparing this state each participant $A,B,C$ applies a transformation $U_{s_B},U_{s_A},U_{s_C}$ which gives the state as $$|\phi\rangle_3=\sum_{k_1=0}^{d-1}\sum_{k_2=0}^{d-1}\sum_{k_3=0}^{d-1}|k_1+s_A\rangle_1|k_2+s_B\rangle_2|k_3+ s_C\rangle_3$$ +After peparing this state the state is returned by the participants to the dealer who measures state for the shares and if it is right then announces the result/secret. Now my questions are:

+ +

(i) Even though this is a very preliminary effort, can somebody tell me whether can we can actually do this?

+ +

(ii) My second question is if this is possible then can we improve this scheme to achieve the condition for the detection of a fraudulent participant? +Can somebody help??

+",6070,,6070,,11/6/2019 9:18,11/7/2019 2:52,Secret sharing though quantum operations,,1,0,0,,,CC BY-SA 4.0 +8686,2,,8662,11/5/2019 14:06,,0,,"

The multiverse is not commonly accepted as the right description of reality and is just one of many interpretations of what exactly happens at the moment of the ""wave function collapse"". +The multiverse is in its core just an idea to preserve determinism in nature by the argument: If you know in which exact universe you are, you can trace back every particle back to its original position at the big bang. +This is not true in reality as quantum mechanics is inherently unpredictable (Copenhagen interpretation) or in the multiverse (we don't know in which universe we are).

+ +

So, if there are no multiverses then your entire question becomes pointless.

+ +

For the use in quantum mechanics (and therefore in quantum computers), it is probably more useful to understand how interference of wavefunctions works and interpret the computation in a quantum computer as constructive or destructive interference.

+",9009,,26,,11/5/2019 14:10,11/5/2019 14:10,,,,1,,,,CC BY-SA 4.0 +8687,2,,8606,11/5/2019 19:11,,2,,"

Given the constraints of the problem, we have for $U$ unitary, +$$ +\newcommand{\ketbra}[1]{\lvert#1\rangle\!\langle #1\rvert} +\newcommand{\ket}[1]{\lvert#1\rangle} +\newcommand{\bra}[1]{\langle#1\rvert} +\newcommand{\sqoverlap}[2]{|\langle #1|#2\rangle|^2} +U=\ketbra{\lambda}+\sum_k e^{i\varphi_k}\ketbra{\lambda_k},$$ +for some orthonormal basis $\{\ket\lambda\}\cup\{\ket{\lambda_k}\}_k$ and phases $\varphi_k\in\mathbb R$. +Given a target $\ket\mu$, the expectation value of $U^r$ equals

+ +

+ +

$$ + \bra\mu U^r\ket\mu=\sqoverlap{\mu}{\lambda} + + \underbrace{ + \sum_k e^{ir\varphi_k} \sqoverlap{\mu}{\lambda_k} + }_{\equiv F_r}. +$$

+ +

Note also that the normalisation of $\ket\mu$ implies +$$ + \sqoverlap\mu\lambda + + \sum_k |\langle\mu|\lambda_k\rangle|^2 = 1 +$$ +The problem here is clearly in how to handle $F_r\in\mathbb C$, which has a pretty nasty behaviour: as a function of $r$, it oscillates wildly in the complex plane. Without any constraint on the possible $\ket{\lambda_k}$ and $\varphi_k$, or on the total dimension of $U$, pretty much any shape is possible (and here I cannot not link this beautiful video by 3Blue1Brown). Just to give a mental picture of what I mean, here are two examples of what you can get when you plot $r\mapsto F_r$ for randomly sampled phases and overlaps, for a six-dimensional $U$:

+ +

+

+ +

The black dots correspond to the integer values of $r$, the blue line gives the value of $F_r$ for the real values in-between, and the red circle has radius $1-\sqoverlap{\mu}{\lambda}$. Only values of $r$ between $1$ and $100$ are shown.

+ +

Plotting even more points (all $r$ between $1$ and $10^3$), we see that the circle is essentially filled:

+ +

+ +

This is telling us that, in the general case, all we can say about $F_r$ is that it satisfies +$$ + |F_r|\le1-\sqoverlap\mu\lambda. +$$ +Now, to get the probability of finding the initial state $\ket\mu$ unchanged after $r$ applications of $U$, we need to study the quantity +$|\langle\mu|U^r|\mu\rangle|=\big|\sqoverlap\mu\lambda+F_r\big|$. +When $\sqoverlap\mu\lambda\ge1/2$ we know that $|F_r|\le\sqoverlap\mu\lambda$, and we thus have the bound +$$ + (2\sqoverlap{\mu}{\lambda}-1)^2 \le |\langle\mu|U^r|\mu\rangle|^2 \le 1,\quad \forall r. +$$ +On the other hand, when the initial squared overlap is smaller than $1/2$, we can have $F_r=-\sqoverlap\mu\lambda$, and thus we get the trivial bound $|\langle\mu|U^r|\mu\rangle|\in[0,1]$.

+ +

Putting the two cases together, if we plot the possible values of $|\langle\mu|U^r|\mu\rangle|^2$ as a function of $p\equiv\sqoverlap\mu\lambda$ we get the following:

+ +

+ +

The interesting conclusion is that we can say something about the possible probabilities of a state remaining unchanged after a number of applications of the same unitary $U$, provided that the initial overlap between the state and one of the eigenvectors of $U$ is big enough. +Let me remark a few other things here:

+ +
    +
  • There is no loss of generality in our initial assumption that the eigenvalue of some $\ket\lambda$ is $1$. We can repeat the same identical argument by just taking an arbitrary eigenvector of $U$ with eigenvalue $e^{i\varphi}$, by only replacing each instance of $U$ with $U e^{-i\varphi}$. Most notably, this does not affect the final result on $|\langle\mu|U^r|\mu\rangle|$.

  • +
  • If $\sqoverlap\mu\lambda=1-\delta$ with $\delta\ge0$ small, then the bound can be simplified to $|\langle\mu|U^r|\mu\rangle|^2\ge 1-4\delta$.

  • +
  • Because we are not putting any constraint on $U$ or $r$ other than the initial overlap $\sqoverlap\mu\lambda$, we can also understand this result as telling us about the probability of $\ket\mu$ being unchanged upon a single application of a unitary $U$, or more generally about the probability of $\ket\mu$ being unchanged upon arbitrary applications of arbitrary unitaries all having an eigenvector close enough to $\ket\mu$.

  • +
+ +
+ +

Mathematica code to generate the plots of $F_r$:

+ +
dim = 5;
+probs = 0.8 * # / Total @ # & @ RandomReal[{0, 1}, dim];
+phases = RandomReal[{0, 2 Pi}, dim];
+otherFactor[probs_, phases_, r_] := Total[Exp[I r phases] probs];
+Show[
+ ParametricPlot[ReIm@otherFactor[probs, phases, r], {r, 0, 100}, 
+  PlotPoints -> 60, MaxRecursion -> 10, 
+  PlotRange -> ConstantArray[{-.9, .9}, 2]],
+ Graphics[{ 
+   Point@Table[ReIm@otherFactor[probs, phases, r], {r, 1, 100}],
+   Thick, Red, Circle[{0, 0}, 0.8]
+   }]
+ ]
+
+",55,,55,,11/6/2019 12:41,11/6/2019 12:41,,,,8,,,,CC BY-SA 4.0 +8688,2,,8659,11/5/2019 22:32,,2,,"

CNOT is more simple gate than Toffoli (CCNOT). Actually, CCNOT is realized with six CNOT gates (see Wikipedia link above for a CCNOT circuit). Additionally, CNOT is relized physically on a quantum computer. To sum up, direct usage of CNOT is better because it enable the quantum circuit to be more simple.

+",9006,,,,,11/5/2019 22:32,,,,2,,,,CC BY-SA 4.0 +8689,2,,8682,11/5/2019 22:46,,1,,"

Thanks for help, it works. Here is a changed circuit and results on IBM Q (Vigo processor). Just note that q-bit $0.5|0\rangle + \sqrt {0.75}|1\rangle$ is teleported from q-bit q0 to q2. Angle in Ry gate is $2\pi/3$.

+ +

,

+",9006,,26,,11/6/2019 9:38,11/6/2019 9:38,,,,6,,,,CC BY-SA 4.0 +8692,1,8713,,11/6/2019 5:51,,0,578,"

I have tried to program universal quantum computer simulator in MatLab. +Please find a code here:

+ +

https://www.mathworks.com/matlabcentral/fileexchange/73035-quantum-computer-simulator

+ +

Can be this code used as a good simulator of quantum computer? +Thanks for answer.

+",9006,,9006,,4/30/2020 21:49,4/30/2020 21:49,Can my MatLab code be used as a good simulator of a quantum computer?,,1,6,,,,CC BY-SA 4.0 +8693,1,,,11/6/2019 6:27,,3,260,"

I still don't understand what makes the Deutsch algorithm faster in a quantum computer. Why is it not same as in a classical computer? But this algorithm is just mathematics. All gates can be represented in a matrix.

+ +

Please, can someone explain this to me? What parts of this algorithm are better in a quantum computer, assuming only this Deutsch algorithm?

+",9029,,55,,11/6/2019 22:08,8/6/2020 0:36,Why is the Deutsch algorithm faster on a quantum computer?,,2,5,,,,CC BY-SA 4.0 +8694,1,8700,,11/6/2019 8:57,,8,414,"

I have been going through Cirq's VQE background tutorial and after examining the Ansatz it seems to me that the only layer that actually affects the final measurement is the rot_x_layer. The other layers simply act on the phases and therefore seem to have no impact on the final measurement probabilities.

+ +

I've also replicated the example using Quirk and the displays seem to confirm my suspicion.

+ +

Additionally I've come across a paper on QAOA that also outlines a solution with a different Ansatz and the Hamiltonian they use though, is slightly different in that the sigma that multiplies the external field h has an x on top instead of a z.

+ +

Is this a mistake on Cirq's tutorial or am I missing something fundamental in here?

+",7322,,,,,11/6/2019 18:15,Is there a mistake in the VQE Ansatz in Cirq's tutorial?,,1,3,,,,CC BY-SA 4.0 +8695,1,8696,,11/6/2019 10:35,,3,217,"

When I execute the following circuit, I expect that in both classical registers, the content is identical.

+ + + +
q = QuantumRegister(1)
+c = ClassicalRegister(2)
+circuit = QuantumCircuit(q, c)
+circuit.h(q[0])
+circuit.measure(q[0], c[0])
+circuit.measure(q[0], c[1])
+
+backend = BasicAer.get_backend('qasm_simulator')
+job = execute(circuit, backend, shots=100)
+result = job.result()
+counts = result.get_counts(circuit)
+
+print(counts)
+
+ +

And the results are {'01': 44, '00': 56}, however I expect {'11': 44, '00': 56}

+ +

When I run the same circuit in the IBM Quantum Experience with the same simulator, I get the expected results.

+ +

What do I miss?

+",5461,,55,,11/8/2019 17:16,11/8/2019 17:16,"In qiskit, doing 2 subsequent measurements of a Hadamard gate on the same qubit always gives 0 on the 2nd one",,1,2,,,,CC BY-SA 4.0 +8696,2,,8695,11/6/2019 11:01,,7,,"

When I run your code on the most recent version of qiskit I get the expected results {'11': 55, '00': 45}. It could be the case therefore that you are running an older version of qiskit and this has been fixed recently. I would suggest updating your version using pip install --upgrade qiskit

+",5955,,,,,11/6/2019 11:01,,,,1,,,,CC BY-SA 4.0 +8697,2,,8693,11/6/2019 11:18,,2,,"

On a classical computer, you can recycle memory, so there is no need for storing all intermediate results. The main source of the higher performance of quantum computers is the possibility to do an operation with all different values you can store in n q-bits register at once. However, this is not a case always. For example, the evaluation of Boolean function parity has the same complexity both on a classical and quantum computer.

+",9006,,26,,11/6/2019 15:36,11/6/2019 15:36,,,,5,,,,CC BY-SA 4.0 +8700,2,,8694,11/6/2019 13:34,,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 changing phases, then applying another layer of gates (like $Rx$) can in fact change the probabilities of the measurement outcomes!

+ +

Consider the system of one qubit in an even superposition, where we apply an $S$ gate (which is just the square root of the $Z$ gate), then apply a $Rx(\theta)$ gate:

+ +

$$$$

+ +

$$\Rightarrow \ Rx(\theta) S \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix} \ = \ \frac{1}{\sqrt{2}} Rx(\theta) \begin{pmatrix} 1 \\ i \end{pmatrix} \ = \ \frac{1}{\sqrt{2}}\begin{pmatrix} \cos \theta/2 & -i\sin \theta/2 \\ -i\sin \theta/2 & \cos \theta/2 \end{pmatrix} \begin{pmatrix} 1 \\ i \end{pmatrix}$$

+ +

$$\Rightarrow \frac{1}{\sqrt{2}} \begin{pmatrix} \cos \theta/2 \ + \ \sin \theta/2 \\ i(\cos \theta/2 \ - \ \sin \theta/2) \end{pmatrix}$$

+ +

So the probability of measuring each of the outcomes is given as:

+ +

$$\text{Pr}(0) \ = \ \frac{1}{2}(\cos \theta/2 \ + \ \sin \theta/2)^2$$ +$$\text{Pr}(1) \ = \ \frac{1}{2}(\cos \theta/2 \ - \ \sin \theta/2)^2$$

+ +

In most cases, these are not equal! Thus, this is a concrete example of a time when we apply some kind of phase, then a non-commuting mixer, and the probabilities of the different measurement outcomes are changed!

+ +

Now consider what happens if we didn't apply the $S$ gate:

+ +

$$\Rightarrow \ Rx(\theta) \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix} \ = \ \frac{1}{\sqrt{2}} Rx(\theta) \begin{pmatrix} 1 \\ 1 \end{pmatrix} \ = \ \frac{1}{\sqrt{2}}\begin{pmatrix} \cos \theta/2 & -i\sin \theta/2 \\ -i\sin \theta/2 & \cos \theta/2 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \end{pmatrix}$$

+ +

$$\Rightarrow \ \frac{1}{\sqrt{2}} \begin{pmatrix} \cos \theta/2 \ - \ i\sin \theta/2 \\ \cos \theta/2 \ - \ i\sin \theta/2 \end{pmatrix}$$

+ +

And the probabilities are:

+ +

$$\text{Pr}(0) \ = \ \frac{1}{2} (\cos \theta/2 \ - \ i\sin \theta/2)(\cos \theta/2 \ + \ i\sin \theta/2) \ = \ \frac{1}{2} (\sin^2 \theta/2 \ + \ \cos^2 \theta/2) \ = \ \frac{1}{2}$$ +$$\text{Pr}(1) \ = \ \frac{1}{2} (\cos \theta/2 \ - \ i\sin \theta/2)(\cos \theta/2 \ + \ i\sin \theta/2) \ = \ \frac{1}{2} (\sin^2 \theta/2 \ + \ \cos^2 \theta/2) \ = \ \frac{1}{2}$$

+ +

So they don't change, no matter what we set $\theta$ to.

+ +

If you still don't believe me, let's run a simulation in Quirk!

+ +

+ +

Look at how the probabilities change with different values of $\theta$! It's pretty cool!

+ +

Now look what happens without the $S$ gate:

+ +

+ +

There is no change in the probabilities, thus we require the change in phase for something interesting to happen!

+ +

EDIT (IMPORTANT)

+ +

The tutorial seems to apply the mixer before the cost unitary, which is strange. To my understanding QAOA should be cost, then mixer, especially if the circuit depth is only $1$.

+",4907,,4907,,11/6/2019 18:15,11/6/2019 18:15,,,,4,,,,CC BY-SA 4.0 +8702,1,8704,,11/6/2019 19:03,,6,1382,"

I'm trying to follow the instructions here https://qiskit.org/documentation/getting_started.html. It says

+ +
+

The default backend for qiskit.visualization.circuit_drawer() or + QuantumCircuit.draw() is the text backend. However, depending on your + local environment you may want to change these defaults to something + better suited for your use case. This is done with the user config + file. By default the user config file should be located in + ~/.qiskit/settings.conf and is a .ini file.

+
+ +

I don't see this config file anywhere. Can anyone tell me how I can find the location of this file in order to make the change from the text based plotter to the nicer plotter?

+",4831,,55,,8/31/2020 11:45,11/27/2020 22:14,What is the location of the Qiskit config file?,,3,0,,,,CC BY-SA 4.0 +8703,2,,8639,11/6/2019 19:37,,1,,"

The user has to create the error mitigation calibration matrix for their experiments. You could always just create the matrix for the subset of qubits you are experimenting on if you are sending your experiment to a larger device.

+",6180,,,,,11/6/2019 19:37,,,,0,,,,CC BY-SA 4.0 +8704,2,,8702,11/6/2019 19:57,,7,,"

If you are working in Windows, the default location should be C:\Users\[user]\.qiskit, which might be hidden by default. Create a text file in that folder named settings.conf and set it up how you like.

+ +

For example by default

+ +
from qiskit import *
+qc = QuantumCircuit(2)
+qc.h(0)
+qc.x(1)
+qc.draw()
+
+ +

produces

+ +

+ +

With settings.conf in the folder referenced above, containing the two lines

+ +
[default]
+circuit_drawer=mpl
+
+ +

the same code produces

+ +

+",8623,,5955,,11/6/2019 20:33,11/6/2019 20:33,,,,5,,,,CC BY-SA 4.0 +8705,2,,8685,11/7/2019 2:52,,3,,"

There is one main key point in the description of your question: Is $s$ meant to be a classical secret or a quantum secret?

+ +

If $s$ is meant to be a classical secret, then the answer is yes, but there is not really much quantum in the positive answer. If $s_A$, $s_B$, and $s_C$ are all $d$-state digits, then there is a simple construction that works in which $s$ is also a $d$-state digit. (There is also a simple argument that you cannot make $s$ any larger than this.) Namely, you should choose $s_A$ and $s_B$ uniformly and independently at random, and the then choose $s_C$ such that $s = s_A + s_B + s_C$ in the abelian group $\mathbb{Z}/d$. If you want to make this look quantum, then you can, because you store a digit in a qudit. You can turn $s_A$ into $|s_A\rangle$, etc. Then you are free to measure all three and take their sum, or just measure their sum. The problem with this answer is that you did more than necessary to share the secret. You only used the qudits as classical digits of the same size. This is like taking a million-dollar luxury car to the supermarket when you could have done the exact same thing with a \$5,000 used car.

+ +

Let's say instead that $s$ is meant to be a quantum secret $|s\rangle$. Then first of all, your language for extracting the secret is not correct. If the dealer measures everything to gain the secret, then the result cannot be a quantum state $|s\rangle$, because everything has been measured and all quantum superposition is then gone. Moreover, the shares must be entangled for this to work, so they are not separate states $|s_A\rangle$, $|s_B\rangle$, and $|s_C\rangle$, but rather a joint state $|s_{ABC}\rangle$. To extract $|s\rangle$, the dealer must carefully apply some unitary operator to the joint state to get out $|s\rangle$ as a piece of some larger state, without measuring $|s\rangle$ itself.

+ +

So let's say those are the rules. We can go back and borrow a different concept from classical secret-sharing. Namely, instead of 3 parties we may have $\ell$ parties. Instead of saying that we need all of the parties together to learning everything and with any fewer we know nothing, we can have the weaker condition that for some $t < \ell$, any set of $t$ or fewer parties cannot say anything about the secret. Then there is a remarkable fact that a quantum secret-sharing with these rules is exactly the same thing as a quantum error-correcting code (QECC) of length $\ell$ using $d$-state qudits, with minimum error distance $t+1$. Classical error correction is in a natural sense dual to classical secret-sharing. Quantum error correction turns out to be a self-dual problem that is the same as quantum secret-sharing.

+ +

If we take the original question in its quantum form, the question becomes finding a QECC of length 3 with $d$-state qudits and minimum distance 3. I don't think that any such code exists that can store any non-trivial information, although I would have to do some review to remember how to prove that. I don't even expect there to be such a code with minimum distance 2 (so that only each individual party has no glimpse of the secret) if you want to the secret to have as many as $d$ states when $d=2$. I can check this in the special class of additive codes, and I can say non-rigorously that additive codes are sometimes optimal. However, if the parameters are $\ell = 3$, $t = 2$, and $d$ an odd integer, then I think that there is an additive QECC of this type. We can assume that $d=p$ is prime (because otherwise we can factor $d$ and make separate codes). Then we can choose three non-zero exponents $s,t,u \in \mathbb{Z}/p$ that sum to zero, and we can make a quantum code that stores one qudit using the quantum parity checks $X \otimes X \otimes X$ and $Z^s \otimes Z^t \otimes Z^u$.

+",8880,,,,,11/7/2019 2:52,,,,0,,,,CC BY-SA 4.0 +8706,2,,8693,11/7/2019 10:21,,3,,"

Deutsch's algorithm is not faster on a quantum computer, Deutsch's algorithm is only possible on a quantum computer.

+

A classical computer cannot perform Deutsch's algorithm, it can only simulate Deutsch's algorithm. Forget about speed, more fundamental is that we are performing a type of computation that can never be performed, in any amount of time, by any classical system.

+

Consider the case of two possible evaluations, $f(0)$ and $f(1)$. In any classical computation these evaluations are mutually exclusive. We can design a classical system that evaluates $f(0)$ or $f(1)$ probabilistically to simulate Deutsch's algorithm, but any given evaluation is either $f(0)$ or $f(1)$. Evaluating one means we did not evaluate the other.

+

In contrast, Deutsch's algorithm is not evaluating $f(0)$ with some probability $p$ and $f(1)$ with probability $1-p$, this is only the outcome that we can simulate classically. In Deutsch's algorithm the two evaluations $f(0)$ and $f(1)$ exist simultaneously (in superposition) and interfere with each other.

+

I suggest forgetting about performance until you have a very clear understanding of the fundamental difference between a quantum algorithm and a classical simulation of a quantum algorithm. In other words, until you have convinced yourself that Deutsch's algorithm can never be performed by a classical computer.

+",8623,,8623,,8/6/2020 0:36,8/6/2020 0:36,,,,2,,,,CC BY-SA 4.0 +8709,1,8711,,11/7/2019 13:02,,12,681,"

Consider the trace distance between two quantum states $\rho,\sigma$, defined via +$$D(\rho,\sigma)=\frac12\operatorname{Tr}|\rho-\sigma|,$$ +where $|A|\equiv\sqrt{A^\dagger A}$.

+

When $\rho$ and $\sigma$ are one-qubit states, the trace distance can be understood as the Euclidean distance between the Bloch representations of the two states. Indeed, if +$$\rho=\frac{I+ \vec r\cdot \vec \sigma}{2}, +\qquad +\sigma=\frac{I+ \vec s\cdot \vec \sigma}{2},$$ +then $\operatorname{Tr}|\rho-\sigma|=\frac12\operatorname{Tr|}(\vec r-\vec s)\cdot\vec\sigma|=|\vec r- \vec s|$, and thus +$$D(\rho,\sigma)=\frac12|\vec r-\vec s|.$$ +This works because $\vec\sigma$ are the Pauli matrices, which have the property that $\vec r\cdot\vec \sigma$ has always eigenvalues $\pm|\vec r|$.

+

Is there a similar geometric interpretation for the trace-distance of more general states?

+

We can always write states in their Bloch representation as +$$\rho=\frac{I+\vec r\cdot\vec \sigma}{N},$$ +however this $\vec\sigma$ is not a vector of Pauli matrices anymore, but rather a more general orthogonal basis of Hermitian traceless operators (a canonical choice for these operators is used in this answer). Still, there might be a suitable basis to represent the states in which such geometrical picture works.

+",55,,55,,4/24/2021 8:36,4/24/2021 8:36,Does the trace distance have a geometric interpretation?,,1,0,,,,CC BY-SA 4.0 +8710,2,,12,11/7/2019 19:07,,0,,"

Here is my code for simulation of a quantum computer in MatLab: https://www.mathworks.com/matlabcentral/fileexchange/73035-quantum-computer-simulator

+",9006,,,,,11/7/2019 19:07,,,,0,,,,CC BY-SA 4.0 +8711,2,,8709,11/7/2019 19:20,,9,,"

There is a geometric interpretation that you certainly can take seriously, but the geometry that you get is not as clean as you might have hoped.

+ +

Trace distance between operator states is an example of a Banach norm on a vector space $V$. The rules for such a norm are that $||v|| > 0$ when $0 \ne v \in V$, $||\lambda v|| = |\lambda|\cdot||v||$ for $\lambda$ as scalar, and $||w+v|| \le ||v||+||w||$. (There is also the condition that Cauchy sequences converge. This is automatic for any norm in finite dimensions and also happens to be true for density operators on an infinite-dimensional Hilbert space.) Any Banach norm can be thought of as a geometry of some kind. The norm $||v||$ can be thought as the length of $v$; $||v-w||$ can be thought of as the distance from $v$ to $w$, i.e., it makes $V$ a metric space; and the unit ball of the norm is some convex body that is analogous to the unit ball in Euclidean geometry. However, general Banach norm doesn't usually come from an inner product. When it doesn't, the unit ball isn't round and the geometry that you get isn't Euclidean.

+ +

The norm and metric in this case are defined on density operators with trace 1. This is not technically a vector space; it is a translate of the vector space of density operators with trace 0. You have to be careful about that in calculations, but this is close enough for our purposes. For a $d$-state qudit, this vector space has dimension $d^2-1$. When $d=2$, as you say, the unit ball of the norm is a round ball and the geometry is Euclidean. When $d > 2$, first of all the Bloch ball itself is replaced by a more complicated state region of positive semi-definite operators with trace 1. Both the state region itself and the unit ball of the trace norm are somewhat nondescript convex bodies. Since they are invariant under conjugation by $U(d)$, they have enough symmetry to have an unambiguous center point; but they don't have enough symmetry to be round. They are not smooth convex bodies and they are not polytopes with corners either. Rather, they have ridges of several different dimensions and otherwise they are smooth.

+ +

There is in fact an accompanying Euclidean geometry on density operators given by the Hilbert-Schmidt norm, but the trace norm is not that. The fact that the two norms are equivalent in the Bloch ball for qubits is a coincidence induced by symmetry.

+ +

You can get a simplified picture if you restrict to diagonal density operators. Diagonal density operators are equivalent to probability distributions, and in this case the trace distance is also called total variation distance. In this restricted geometry, the state region and the unit ball of trace distance are both polytopes. The state region is a simplex with $d+1$ corners, while the unit ball of trace distance is a more complicated polytope with $d^2+d$ corners. For instance if you have a classical trit, the state region is an equilateral triangle and the unit ball of trace distance is a regular hexagon with three sides parallel to those of the triangle. Since every density operator is diagonal in some basis, geometric slices representing the states of a classical digit are a helpful glimpse of the larger geometry of states of a qudit.

+",8880,,,,,11/7/2019 19:20,,,,2,,,,CC BY-SA 4.0 +8712,2,,7197,11/7/2019 21:16,,1,,"

Quantum computers are susceptible to these errors/noise because of physical disturbances. An example of this is if some molecule in the surrounding air were to bump or approach the qubit it would transfer some kinetic energy and maybe affect the state. Another example is if a qubit interferes with any adjacent qubit, if they ""bump"" into one another their wavefunctions can constructively or destructively interfere to give an odd result. This reason is why adding more qubits into the system greatly increases the noise. There's much higher chances of a qubit ""spilling over"" onto another one because there's more energy contained. These are some of the reasons why quantum systems are super-cooled and kept in a vacuum.

+ +

The way that I like to imagine it physically is sort of like the quantum ""egg carton"" or ions trapped in an optical lattice. The qubits are stuck in those craters but as you add more it becomes harder to keep them from interacting with other ones. Hence placing more qubits into these craters and conducting large amounts of operations increases the probability of error.

+",8995,,,,,11/7/2019 21:16,,,,0,,,,CC BY-SA 4.0 +8713,2,,8692,11/7/2019 22:59,,2,,"

After using the simulator, I am very impressed! From what I can tell, it has everything necessary to be universal. I will likely be using this quite a bit.

+ +

To test drive it, I implemented a simple 3-qubit Fourier transform and applied it to a set of random initial states, then compared the result to the well known 3-qubit unitary DFT (dft) applied to the same set of states. The code I ran is below, and the results agreed.

+ +

There are a few quirks, but they are relatively minor. For example, several design constraints led me (for the sake of simplicity) to make the circuit ""upside down"" and invert the initial register tensor product rather than bit-swap at the end.

+ +

This made me interested in attempting to build out a simulation of Shor's algorithm based on this library.

+ +
>> circ=fourier_3bit
+
+circ = 
+
+  3×6 string array
+
+    ""I""    ""I""    "".""    ""I""    "".""    ""H""
+    ""I""    "".""    """"     ""H""    ""S""    ""I""
+    ""H""    ""S""    ""T""    ""I""    ""I""    ""I""
+
+>> dft=fourier_3bit_mtx
+
+dft =
+
+   0.3536 + 0.0000i   0.3536 + 0.0000i   0.3536 + 0.0000i   0.3536 + 0.0000i   0.3536 + 0.0000i   0.3536 + 0.0000i   0.3536 + 0.0000i   0.3536 + 0.0000i
+   0.3536 + 0.0000i   0.2500 + 0.2500i   0.0000 + 0.3536i  -0.2500 + 0.2500i  -0.3536 + 0.0000i  -0.2500 - 0.2500i   0.0000 - 0.3536i   0.2500 - 0.2500i
+   0.3536 + 0.0000i   0.0000 + 0.3536i  -0.3536 + 0.0000i   0.0000 - 0.3536i   0.3536 + 0.0000i   0.0000 + 0.3536i  -0.3536 + 0.0000i   0.0000 - 0.3536i
+   0.3536 + 0.0000i  -0.2500 + 0.2500i   0.0000 - 0.3536i   0.2500 + 0.2500i  -0.3536 + 0.0000i   0.2500 - 0.2500i   0.0000 + 0.3536i  -0.2500 - 0.2500i
+   0.3536 + 0.0000i  -0.3536 + 0.0000i   0.3536 + 0.0000i  -0.3536 + 0.0000i   0.3536 + 0.0000i  -0.3536 + 0.0000i   0.3536 + 0.0000i  -0.3536 + 0.0000i
+   0.3536 + 0.0000i  -0.2500 - 0.2500i   0.0000 + 0.3536i   0.2500 - 0.2500i  -0.3536 + 0.0000i   0.2500 + 0.2500i   0.0000 - 0.3536i  -0.2500 + 0.2500i
+   0.3536 + 0.0000i   0.0000 - 0.3536i  -0.3536 + 0.0000i   0.0000 + 0.3536i   0.3536 + 0.0000i   0.0000 - 0.3536i  -0.3536 + 0.0000i   0.0000 + 0.3536i
+   0.3536 + 0.0000i   0.2500 - 0.2500i   0.0000 - 0.3536i  -0.2500 - 0.2500i  -0.3536 + 0.0000i  -0.2500 + 0.2500i   0.0000 + 0.3536i   0.2500 + 0.2500i
+
+>> regs=initializeRegisters(v1,v2,v3)
+
+regs =
+
+   0.0000 - 0.2804i
+  -0.2349 + 0.0000i
+   0.0000 + 0.5541i
+   0.4643 + 0.0000i
+   0.2029 + 0.0000i
+   0.0000 - 0.1700i
+  -0.4009 + 0.0000i
+   0.0000 + 0.3359i
+
+>> regs_rev=initializeRegisters(v3,v2,v1)
+
+regs_rev =
+
+   0.0000 - 0.2804i
+   0.2029 + 0.0000i
+   0.0000 + 0.5541i
+  -0.4009 + 0.0000i
+  -0.2349 + 0.0000i
+   0.0000 - 0.1700i
+   0.4643 + 0.0000i
+   0.0000 + 0.3359i
+
+>> dft*regs
+
+ans =
+
+   0.0111 + 0.1555i
+  -0.4009 + 0.2265i
+   0.3923 - 0.5422i
+   0.3405 - 0.3100i
+  -0.1511 + 0.0381i
+  -0.1343 - 0.1412i
+   0.0346 - 0.0478i
+  -0.0921 - 0.1717i
+
+>> quantumComputer(circ,[1 2 3],regs_rev)
+
+ans =
+
+   0.0111 + 0.1555i
+  -0.4009 + 0.2265i
+   0.3923 - 0.5422i
+   0.3405 - 0.3100i
+  -0.1511 + 0.0381i
+  -0.1343 - 0.1412i
+   0.0346 - 0.0478i
+  -0.0921 - 0.1717i
+
+ +

+",8623,,8623,,11/7/2019 23:14,11/7/2019 23:14,,,,3,,,,CC BY-SA 4.0 +8714,2,,8552,11/8/2019 3:23,,2,,"

Both IBM and Google unveiled 53-qubit processors. At this time, only Google published performance metrics such as 1- and 2-qubit gate errors. Until IBM publishes similar metrics we simply cannot even tell whether Google's processor outperforms IBM's.

+ +

What we can tell is that the connectivity of the two processors is different - Google's Sycamore processor has nearest-neighbor connectivity on a rectangular grid, while IBM's Rochester processor has a reduced connectivity on what appears to be an edge-centered hexagonal lattice. It will be interesting to see how the different connectivities play out with regards to performance benchmarks, such as quantum volume.

+ +

With regards to universality, an issue that was raised in the comments, Section VII.F in the supplement of the Google paper shows that the gate-set used in the experiment is universal:

+ +
+

The proof consists of two parts. First, we show that + the CZ gate can be obtained as a composition of two + fSim gates and single-qubit rotations. Second, we outline + how the well-known proof that the H and T gates are + universal for SU(2) [56] can be adapted for X1/2 and + W1/2 + . The conclusion follows from the fact that the gate + set consisting of the CZ gate and SU(2) is universal [57].

+
+ +

To the extent that universality means ""the processor uses a universal gate set"", the Google processor is universal. If however, you rather define universality to require a fault-tolerant quantum processor, then no currently existing device can be considered as universal.

+",127,,,,,11/8/2019 3:23,,,,0,,,,CC BY-SA 4.0 +8715,1,,,11/8/2019 4:57,,2,255,"

Background

+ +

Let's say I know my experimentalist friend has been measuring the eigenvalues of a physical system. I can see the $M$ measurements are noted in a sheet of paper and I assume the dimensionality of the Hamiltonian to be $K$. I also note the dimensions of eigenvalues of that of energy. I see non-unique eigenvalues and (randomly) guess an eigen-operator $\hat O$ was measured in between the measurements ,i.e, a measurement of operator $\hat O$ was done after every eigenenergy measurement. I would like to guess the Hamiltonian of the system.

+ +

Question

+ +

Now, my question how to quantify this probability of a reasonable guess of the Hamiltonian (any strategy is allowed including the one given below) of it being particular dimension $K$ given $M$ measurements as correct ? I would prefer if one included degerate Hamiltonians in their calculations (if possible)?

+ +

Why it's a difficult problem

+ +

This only means to show the probabilistic nature of the problem. We will think of this in terms of eigen-energies primarily other formulation will require another layer of probability. Now:

+ +

Let, us write a variable Hamiltonian $H_j$ where $j$ is a counting system adopted which avoids redundancy . From the eigenvalue equation for energy:

+ +

$$ H_j |\lambda_i \rangle= \tilde \lambda_i|\lambda_i \rangle$$

+ +

From the spectral theorem I can reconstruct a particular Hamiltonian, see:

+ +

$$ H_j= \sum_{i} \tilde \lambda_i |\lambda_i \rangle \langle \lambda_i| $$

+ +

Now, if we include degeneracies in the argument after measuring $\tilde \lambda_\alpha$ one can conclude:

+ +

$$ \frac{\partial}{\partial \tilde \lambda_\alpha} H_j= \sum_{\kappa} |\lambda_\kappa \rangle \langle \lambda_\kappa| $$ +How does one conclude this? When one measures a particular eigenvalue and assumes a degenerate $H_j$:

+ +

$$ \tilde \lambda_\alpha \to \sum_{\kappa}^M |\lambda_\kappa \rangle$$

+ +

Note: all degeneracies obey:

+ +

$$H_j |\lambda_\kappa \rangle= \tilde \lambda_\alpha|\lambda_\kappa \rangle $$

+ +
+ +

Non-uniqueness: given the same eigenvalue $\tilde \lambda_\alpha$ cannot one distinguish between $H_j$ from $H_\delta = H_j - |\tilde \lambda_\alpha \rangle \langle \tilde \lambda_\alpha |$

+ +
+",5045,,55,,8/20/2020 8:05,5/12/2022 13:07,Quantify the probability in guessing the Hamiltonian?,,1,0,,,,CC BY-SA 4.0 +8716,1,,,11/8/2019 5:05,,2,45,"

My experiments show that the runtime of actually applying the measurement filter matrices to circuit execution results is much slower for tensored mitigation than ordinary mitigation. Tensored mitigation quickly becomes almost intractable as circuit gets larger.

+ +

I thought since tensored mitigation only accounts for local measurement errors, it would be faster to compute the matrices as well as applying them to circuit results? I am using measurement mitigation as described +here.

+",8950,,2293,,8/17/2020 2:53,8/17/2020 2:53,Tensored vs ordinary measurement mitigation runtime,,0,0,,,,CC BY-SA 4.0 +8717,1,8723,,11/8/2019 5:29,,4,387,"

Scott Aaronson's blog notably states:

+ +
+

Quantum computers would not solve hard search problems + instantaneously by simply trying all the possible solutions at once.

+
+ +

Is this a statement of a law, as in, is there some no-go theorem that prevents this, or is this a statement about what we know, that is, it's possible in theory, but we have not found an algorithm that does this?

+ +

Edit: +People are pointing out that the word 'simply' carries the meaning of the popular science explanations, whereby once the quantum state contains all the possible amplitudes, then the computer tells us the one we're looking for.

+ +

Now, the first part seems manifestly possible to me. It's not hard to create a quantum state who's amplitudes do represent all the possibilities at once. So what if we drop the word 'simply' from his statement. Is there some complicated mechanism that can cancel out all the other possibilities?

+ +

It seems like as long as 1) Every gate is unitary and 2) Every measurement is Hermitian, it's a valid quantum circuit. And the task is to determine that to-be-specified complicated mechanism.

+ +

Why isn't this an active area of research?

+",1867,,1867,,11/9/2019 1:59,11/12/2019 6:17,Is quantum parallel search impossible?,,2,10,,,,CC BY-SA 4.0 +8718,1,,,11/8/2019 8:57,,8,100,"

Reduced graph states are characterized as follows (from page 46 of this paper): Let $A \subseteq V$ be a subset of vertices of a graph $G = (V,E)$ and $B = V\setminus A$ the complement of $A$ in $V$. The reduced state $\rho_{G}^{A}:= \mathrm{tr}_{B}(|G\rangle\langle G|)$ is given by $$\rho^{A}_{G} = \frac{1}{2^{|A|}}\sum_{\sigma \in \mathcal{S_{A}}}\sigma,~~~~~~~~~~~~~~~~~~(1)$$where $\mathcal{S}_{A}:=\{ \sigma \in \mathcal{S}| \text{supp}(\sigma) \subseteq A \}$ denotes the subgroup of stabilizer elements $\sigma \in \mathcal{S}$ for $|G\rangle$ with support on the set of vertices within $A$. $\rho_{G}^{A}$ is up to some factor a projection, i.e. $$(\rho_{G}^{A})^2 = \frac{|\mathcal{S}_{A}|}{2^{|A|}}\rho_{G}^{A}~~~~~~~~~~~~~~~~~~~(2)$$It projects onto the subspace in $\mathbf{H}^{A}$ spanned by the vectors $$|\mathbf{\Gamma}'B'\rangle_{G[A]} = \sigma_{z}^{\mathbf{\Gamma}'B'}|G[A]\rangle~~~~~~~(B' \subseteq B)~~~~~~~~~(3)$$where $G[A] = G\setminus B$ is the subgraph of $G$ induced by $A$ and $\mathbf{\Gamma}':=\mathbf{\Gamma}^{AB}$ denotes the $|A| \times |B|-$off diagonal sub-matrix of the adjacency matrix $\mathbf{\Gamma}$ for $G$ that represents the edges between $A$ and $B$: +\begin{align} +\begin{pmatrix} +\mathbf{\Gamma}_{A} & \mathbf{\Gamma}_{AB} \\ +\mathbf{\Gamma}^{T}_{AB} & \mathbf{\Gamma}_{B} +\end{pmatrix} = \mathbf{\Gamma}. +\end{align} +In this basis, $\rho_{G}^{A}$ can be written as $$\rho_{G}^{A} = \frac{1}{2^{|B|}}\sum_{B' \subseteq B}| \mathbf{\Gamma}' B' \rangle_{G[A]} \langle \mathbf{\Gamma}'B'|.~~~~~~~~~~~~~(4)$$ +Question: +The results of equation (1) and (2) are understood. I'm trying to understand the motivation for defining the basis states $| \mathbf{\Gamma}' B' \rangle_{G[A]}$ as shown in equation (3). As I understand, $\mathbf{\Gamma} B' $ in the exponent of equation (3), is some string in $\{0,1\}^{|B'|}$. In this way they would show that there are sufficient permutations of $\mathbf{\Gamma}' B'$, where $B' \subseteq B$, to produce orthogonal states $| \mathbf{\Gamma}' B' \rangle_{G[A]}$ which spans a subspace of $\mathbf{H}^{A} \subseteq (\mathbb{C})^V$. Explicitly how is the term '| $\mathbf{\Gamma}' B' \rangle_{G[A]}$' defined? I don't really understand why the exponent is chosen as $\mathbf{\Gamma} B'$ in to begin with to characterize the basis states?

+

Thanks for any assistance.

+",2032,,10480,,1/22/2021 21:06,1/22/2021 21:06,Query on Reduced Graph States,,0,0,,,,CC BY-SA 4.0 +8719,1,,,11/8/2019 10:35,,1,68,"

I am running a VQE calculation running from a cluster using nohup.

+ +

However, some of my jobs keep hanging with 'creating' and therefore my VQE is not converging/not working.

+ +

However, at the same time, a subset of my jobs are still running.

+ +

Please, can you help me diagnose the problem?

+ +

Here is a selection of Job IDs of the 63 (at present) hanging jobs:

+ +
5dc539d363f7360011c42a62
+
+5dc51254ac8b9a0011fb486d
+
+5dc51254ac8b9a0011fb486d
+
+5dc51254ac8b9a0011fb486d
+
+",9063,,26,,11/16/2019 17:37,11/16/2019 17:37,Many jobs hanging after creating,,0,3,,,,CC BY-SA 4.0 +8720,1,,,11/8/2019 11:50,,1,532,"

Recently I've got a new machine and had to start over again (Qiskit installation).

+ +

As this was not my first time in creating a Qiskit environment on Anaconda, I was able to work out the errors.

+ +

But someone starting afresh will have trouble mitigating errors. And hence would like to find out the stable Python version!

+",9061,,26,,11/16/2019 16:40,11/16/2019 16:40,How do I find out which stable Python version Qiskit will be compatible to?,,2,2,,,,CC BY-SA 4.0 +8721,2,,8720,11/8/2019 13:53,,2,,"

The python version that is supported by Qiskit is supported is written in the documentation here - Qiskit supports Python 3.5 or later.

+",5955,,,,,11/8/2019 13:53,,,,0,,,,CC BY-SA 4.0 +8722,2,,8717,11/8/2019 14:23,,3,,"

The statement is meant to get in front of any misconceptions, for example by the science press, about how quantum computers operate.

+ +

It's not a ""no-go"" in the sense of a theorem, nor do I believe many researchers have spent much time considering a possible algorithm that ""simply tries all possible solutions at once.""

+ +

I believe it's meant to say that quantum computers achieve a speedup through means such as, especially, constructive and destructive interference, as opposed to ""simply trying all the possible solutions at once.""

+",2927,,,,,11/8/2019 14:23,,,,2,,,,CC BY-SA 4.0 +8723,2,,8717,11/9/2019 4:24,,6,,"

The point is that free parallel computation or cloning of your existence is a wholesale misinterpretation of the concept of quantum superposition. Quantum states are analogous to probability distributions. If you might wash the dishes or you might wash the floor and you flip a coin to decide which one, then no one takes that to mean that you will wash both of them in parallel. Quantum superposition is the same sort of thing, except with complex-valued amplitudes rather than real-valued probabilities. That fact leads to some amazing effects and extra computational power --- but it's still statistics, not replication. In that sense, quantum algorithms are much more similar to randomized algorithms than to parallel computation.

+ +
+ +

To address the amended version of the question, there is a fundamental result that Grover's algorithm is optimal for unstructured search, i.e., a search whose predicate $f(x) = \text{yes}$ is given by a black-box algorithm. Grover's algorithm gives you only a quadratic speedup, which means that unstructured search still takes exponential time, just with a better exponent. Thus, with the black-box assumption, free parallel search is provably impossible for a quantum computer.

+ +

On the other hand, if the predicate is given by a white-box algorithm, then you can't even prove that something as good as free parallel search is classically impossible, because this is exactly the question $\mathsf{P}$ vs $\mathsf{NP}$. There is a more specific conjecture that with a bad enough predicate your only option is exhaustive search or similar; it is a version of the exponential time hypothesis. I think that reasonable people in QC believe the same exponential time hypothesis for quantum computing too, except for the square root that you get from Grover's algorithm. (Or, if I can't speak for reasonable people, I tend to believe it.)

+",8880,,8880,,11/12/2019 6:17,11/12/2019 6:17,,,,0,,,,CC BY-SA 4.0 +8724,1,,,11/9/2019 6:23,,3,146,"

There are tools like QuTip helping you simulate a given Hamiltonian. However, I am wondering if is there any tool/library or something that takes e.g. a graph (G, V, E) of qubits and resonators, and returns a Hamiltonian. It does not have to be graph though, it can be anything, simply returning "approximated Hamiltonian" from the circuit.

+",9070,,16092,,6/18/2021 18:13,6/18/2021 18:14,Is there any tool for generating Hamiltonian for circuit-QED?,,2,0,,,,CC BY-SA 4.0 +8725,1,8726,,11/9/2019 12:43,,13,5896,"

Is it possible to decompose a hermitian and unitrary matrix $A$ into the sum of the Pauli matrix Kronecker products?

+ +

For example, I have a matrix 16x16 and want it to be decomposed into something like $$A =\sum_{i,j,k,l}h_{ijkl}\sigma_i\otimes\sigma_j\otimes\sigma_k\otimes\sigma_l$$ +I can't find any clear explanation how it can be done. +I found only this for two-dimentional case: +https://michaelgoerz.net/notes/decomposing-two-qubit-hamiltonians-into-pauli-matrices.html

+",6071,,55,,6/4/2020 15:01,6/4/2020 15:01,Can arbitrary matrices be decomposed using the Pauli basis?,,2,0,,11/12/2019 23:03,,CC BY-SA 4.0 +8726,2,,8725,11/9/2019 13:49,,17,,"

For any matrix $A$ we can write +$$ +A =\sum_{i,j,k,l}h_{ijkl}\cdot \frac{1}{4}\sigma_i\otimes\sigma_j\otimes\sigma_k\otimes\sigma_l, +$$ +where +$$ +h_{ijkl} = \frac{1}{4}\text{Tr}\big((\sigma_i\otimes\sigma_j\otimes\sigma_k\otimes\sigma_l)^\dagger \cdot A\big) = \frac{1}{4}\text{Tr}\big((\sigma_i\otimes\sigma_j\otimes\sigma_k\otimes\sigma_l) \cdot A\big) +$$ +This is because 256 matrices $\frac{1}{4}\sigma_i\otimes\sigma_j\otimes\sigma_k\otimes\sigma_l$ form an orthonormal basis in the linear space of all $16 \times 16$ matrices under Hilbert-Schmidt inner product given by $( A,B) = \text{Tr}(B^\dagger A)$.

+ +

If you have an orthonormal basis $e_i$ then any element of a Hilbert space can be written as $v = \sum_i (v,e_i)e_i$. That's it.

+ +

If dimension is not power of 2, then it's impossible, of course. But there are generalizations of Pauli matrices https://en.wikipedia.org/wiki/Generalizations_of_Pauli_matrices. So the similar formula can be written.

+",5870,,5870,,11/9/2019 14:55,11/9/2019 14:55,,,,2,,,,CC BY-SA 4.0 +8727,1,,,11/9/2019 14:32,,2,109,"

If we apply Hadamard gate 2 times on a qubit $|0\rangle$ then we will get $|0\rangle$. +So there must be something else which is unique for both $|1\rangle$ and $|0\rangle$ which is constant even in superposition. What is it?

+",9029,,55,,11/9/2019 15:11,11/9/2019 18:00,What is the difference between superposition of $|0\rangle$ and superposition of $|1\rangle$ at physical level?,,1,2,,,,CC BY-SA 4.0 +8728,2,,8725,11/9/2019 14:47,,14,,"

$\newcommand{\bs}[1]{{\boldsymbol #1}} +\newcommand{\tildebssigma}{\tilde{\bs\sigma}} +\newcommand{\bssigma}{{\bs\sigma}}$Yes, products of Pauli matrices form a basis for the set of Hermitian matrices (of dimensions that are powers of $2$).

+ +

More specifically, fix an integer $n$ and let $N\equiv 2^n$, define $\bssigma\equiv(\sigma_x,\sigma_y,\sigma_y)$, and $\tildebssigma\equiv (I,\sigma_x,\sigma_y,\sigma_y)$. +Moreover, let $J\in\{0,1,2,3\}^{n}$ be a tuple of $n$ integers with each $J_i\in\{0,1,2,3\}$. +Consider the matrices of the form +$$ +\tildebssigma_J\equiv\prod_{k=1}^n \tildebssigma^{(k)}_{J_k}, +$$ +where $\tildebssigma_j^{(k)}$ denotes the Pauli matrix $\tildebssigma_j$ applied on the $k$-th qubit. +You can check that these are all Hermitians. Moreover, $\tildebssigma_J$ is traceless for all $J\neq(0,...,0)$ (for which $\tildebssigma_{(0,...,0)}=I$).

+ +

There are $4^n=N^2$ matrices of this form (one for each possible choice of $J$), and for any pair of tuples $J,K$ we have +$\operatorname{Tr}(\tildebssigma_J\tildebssigma_K)=N\delta_{JK}$. +Moreover, the space of Hermitian $N\times N$ matrices also has dimension $N^2$. It follows that $\{\tildebssigma_J\}_J$ is a basis for this space. Explicitly, you can decompose an arbitrary Hermitian matrix $H$ as +$$H=\frac{1}{N}\sum_J \operatorname{Tr}(\tildebssigma_J H)\tildebssigma_J.$$ +Note that the coefficients in any such expansion are always real. This is not by chance. Indeed, being more careful, we should state that the set of real linear combinations of products of Pauli matrices give the set of Hermitian matrices (notice that if $A$ is Hermitian then $\alpha A$ is Hermitian iff $\alpha\in\mathbb R$, so this is not surprising).

+ +

+ +

More general matrices can be generated if we allow for complex coefficients in the expansion. +Indeed, note that +$$\frac{I+Z}{2}=\begin{pmatrix}1&0 \\ 0 & 0\end{pmatrix}, +\qquad \frac{I-Z}{2}=\begin{pmatrix}0&0 \\ 0 & 1\end{pmatrix}, \\ +\frac{X+iY}{2}=\begin{pmatrix}0 & 1 \\ 0 & 0\end{pmatrix} +\qquad +\frac{X-iY}{2}=\begin{pmatrix}0 & 0 \\ 1 & 0\end{pmatrix}. +$$ +Therefore the complex span of Pauli matrices can be used to generate arbitrary $2\times 2$ matrices. This then translates into the same result for arbitrary $2^n$-dimensional spaces, as if $\mathcal V\equiv\{v_k\}$ is a basis for $V$, then the sets of tensor products of elements of $\mathcal V$ form a basis for $V^{\otimes n}$.

+ +

This is a special instance of the more general fact that any matrix can be decomposed uniquely as sum of a Hermitian and a skew-Hermitian matrix, as +$$A=\frac{A+A^\dagger}{2}+i\frac{A-A^\dagger}{2i},$$ +and the fact that products of Pauli matrices give you a basis for the set of Hermitian matrices.

+",55,,55,,11/11/2019 9:57,11/11/2019 9:57,,,,1,,,,CC BY-SA 4.0 +8729,1,8735,,11/9/2019 15:22,,7,296,"

In these lecture notes by Scott Aaronson, the author states the following (towards the end of the document, just before the Linearity section):

+ +
+

There's actually another phenomenon with the same ""Goldilocks"" flavor, which was observed by Bill Wootters -- and this leads to my third reason why amplitudes should be complex numbers. Let's say we choose a quantum state $$\sum_{i=1}^N \alpha_i |i\rangle$$ + uniformly at random (if you're a mathematician, under the Haar measure). And then we measure it, obtaining outcome $\lvert i\rangle$ with probability $|\alpha_i|^2$. The question is, will the resulting probability vector also be distributed uniformly at random in the probability simplex? It turns out that if the amplitudes are complex numbers, then the answer is yes. But if the amplitudes are real numbers or quaternions, then the answer is no! (I used to think this fact was just a curiosity, but now I'm actually using it in a paper I'm working on...)

+
+ +

Numerically, I can see that this seems to be the case. Indeed, using $N=3$ as an example, if I generate random elements in the sphere, and look at the resulting distribution of the squares of the coordinates, I get the picture below on the left, while doing the same with complex coefficients (that is, with random states), I get the one on the right:

+ +
(* sampling wiht real coefficients *)
+#/Norm@# & /@ RandomReal[{-1, 1}, {10000, 3}] // Graphics3D[{Point[#^2]}] &
+(* sampling with complex coefficients *)
+RandomUnitary[m_] := Orthogonalize @ Function@ Map[
+    Function[#[[1]] + I * #[[2]]], #, {2}
+] @ RandomReal[NormalDistribution[0, 1], {m, m, 2}];
+Table[First @ RandomUnitary @ 3, 10000] // Abs[#]^2 & // Graphics3D[{Point[#]}] &
+
+ +

+

+ +

Notice how different for example the edge are. +Sampling with real coefficients clearly gives a much denser distribution towards the edges of the simplex. +Plotting the associated histograms shows clearly that the real coefficients do not give a uniform distribution, while the complex ones do.

+ +

Why is this the case?

+",55,,55,,11/9/2019 18:27,11/10/2019 4:20,Why is the probability vector of a uniformly random state $\sum_i\alpha_i|i\rangle$ uniformly random only if $\alpha_i\in\mathbb C$?,,1,8,,,,CC BY-SA 4.0 +8731,2,,8727,11/9/2019 18:00,,3,,"

Much as in CMOS we almost always equate a low voltage with binary zero, and high voltage with binary one, and a classical $\mathsf{AND}$ gate as implementing the truth-table by adjusting voltages to be consistent, we have similar requirements in quantum computing to call $\vert 0\rangle$, $\vert 1\rangle$, and the Hadamard gate acting on it in the manner you described. We could have a convention of low-voltage being one and high-voltage being zero; we would have to adjust how we implement $\mathsf{AND}$ appropriately.

+ +

The polarity of photons is straightforward to visualize as qubits. If we settle on what we mean by $\vert 0\rangle$ and $\vert 1\rangle$ with respect to the polarity of photons, then a Hadamard gate would be the one that rotates the polarity appropriately.

+",2927,,,,,11/9/2019 18:00,,,,6,,,,CC BY-SA 4.0 +8734,1,8746,,11/9/2019 23:58,,0,68,"

I want to get a large collection of quantum circuits that matter to practitioners in quantum computing. I want a get many complete quantum circuits. For example, 1 million QASM files. +However, I could not readily find a large dataset. +Are there any places I could find it?

+",9078,,9078,,11/10/2019 4:13,11/12/2019 8:31,How to get a large collection of quantum circuits that are valuable to practitioners?,,1,4,,11/12/2019 23:04,,CC BY-SA 4.0 +8735,2,,8729,11/10/2019 4:12,,3,,"

We can begin this question by comparing two small cases, a qubit with a ""rebit"", the latter being a qubit confined to real amplitudes. The set of pure state of a rebit makes a great circle in the Bloch sphere, say a vertical circle. The corresponding measure on the probability interval is given by projecting uniform measure on the circle onto the $z$ axis, i.e., a diameter of the circle. If you draw a picture of this, it leaps out at you that of course it's not uniform, because the circle is parallel to its diameter at the middle, but angled near the poles. If we parametrize the projection interval as $[-1,1]$, which is different from the probability parametrization $[0,1]$ but convenient here, then the projected density is the same as the arc length integrand for a circle, namely it is $\frac{dz}{\pi\sqrt{1-z^2}}$. Just as the geometry suggests, the density goes to infinity at the endpoints.

+ +

If you repeat this same thinking for the Bloch sphere of a qubit, then you see a coincidence that has been celebrated for a very long time. Borrowing from spherical coordinates, let $z = \cos \theta$. Then a latitude band at a polar angle of $\theta$ of height $dz$ is tilted to give you its area a factor of $1/(\sin \theta)$, but its radius is $\sin \theta$ rather than 1. The factors cancel! The area of the band is always $2\pi dz$, independent of $\theta$, and the projection onto the $z$ axis is indeed uniform measure on the probability interval. I said that this has been celebrated for a long time, but I didn't say how long. In geometric form, it was first published by Archimedes.

+ +

Note that the argument only works for the Bloch sphere surface, i.e., for pure states. For mixed states, the middle of a ball is always fatter than its ends, so uniform measure does not project to uniform measure.

+ +

Another case that does not work is a qubit with quaternionic amplitudes, which I guess you could call a ""ququbit"". The analogue of a Bloch sphere in this case is a 4-sphere in $\mathbb{R}^5$. The beautiful coincidence of Archimedes is now wrecked because the polar regions are too small rather than too large as in the case of a circle. The tilt still gives you a factor of $1/(\sin \theta)$, but a radius of $\sin \theta$ now gives you a factor of $(\sin \theta)^3$ in the 3-dimensional volume, to give you a total answer proportional to $(\sin \theta)^2$ or $(1-z^2)dz$.

+ +
+ +

You might still wonder how this is going to work for higher-dimensional qudits. There are various ways to argue this. Some of them (like the moment map interpretation in symplectic geometry) are so elegant that they give you a uniform measure coincidence that is vastly more general than the original question; but these arguments tend to pull in more advanced mathematics (like symplectic geometry). One good argument relies on a pair of algorithms, which are valuable tricks in computer software, for generating either a uniformly random point in the unit sphere in $\mathbb{R}^n$ or the regular simplex subtended by the standard basis in $\mathbb{R}^n$.

+ +

In the former case, you should choose each coordinate of a vector using Gaussian measure proportional to $\exp(-x^2)$, and then rescale the total vector to have Euclidean length 1. This works because the joint density is proportional to +$$ \exp(-x_1^2 - x_2^2 - \cdots - x_n^2),$$ +which is constant on concentric sphere surfaces. Similarly, to get a uniformly random point on the simplex of non-negative vectors with coordinate sum 1, you should choose each coordinate with exponential measure $\exp(-x)$, and now rescale to make the coordinate sum 1. This time the joint density is +$$ \exp(-x_1 - x_2 - \cdots - x_n),$$ +which is constant on parallel simplices in the positive orthant $\mathbb{R}^n_{\ge 0}$.

+ +

Now let $n = 2d$ and interpret $\mathbb{R}^n$ as $\mathbb{C}^d$, and look at what happens when you choose each complex coordinate $z = x+iy$ using Gaussian measure $\exp(-x^2-y^2)$ in the complex plane. If $z$ is an amplitude, the corresponding probability is $p = |z|^2 = x^2 + y^2 = r^2$. To convert the measure from $z \in \mathbb{C}$ to $p \in \mathbb{R}_{\ge 0}$, we project onto a radial ray and then square the radius. To do this competently, we need to remember infinitesimal length and area factors from calculus. We get +$$ \exp(-x^2-y^2)\, dx\, dy = \exp(-r^2)\, r\, dr\, d\theta. $$ +That extra factor of $r$ (remember that the length of a circle is proportional to its radius) is crucial given that $dp = 2r\,dr$. It means that if we ditch $\theta$ and substitute $p$ for $r$, we get a density of $\exp(-p)\, dp$ for the distribution of $p$.

+ +

In conclusion, if we pass from a vector of complex amplitudes in $\mathbb{C}^d$ to its corresponding real vector of probabilities in $\mathbb{R}_{\ge 0}^d$, then Gaussian measure +$$ \exp(-|z_1|^2-|z_2|^2- \cdots - |z_d|^2)$$ +projects to exponential measure +$$ \exp(-p_1-p_2- \cdots - p_d).$$ +Thus the algorithm to generate a uniformly random point in the unit sphere in $\mathbb{C}^d$ matches the algorithm to generate a uniformly random point in the standard simplex in $\mathbb{R}_{\ge 0}^d$.

+",8880,,8880,,11/10/2019 4:20,11/10/2019 4:20,,,,6,,,,CC BY-SA 4.0 +8737,1,8738,,11/10/2019 22:27,,1,447,"

I tried to measure quantum state with a quantum state tomography. However, I encountered a situation when two different quantum states had the same density matrix. In particular, these states were $\frac{1}{\sqrt{2}}|0\rangle + \frac{1+i}{2}|1\rangle$ and $\frac{1-i}{2}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle$.

+ +

My question is: Is there any possibility how to distinguish these two states (or any other two states with the same density matrix) with quantum state tomography?

+",9006,,,,,11/10/2019 23:59,How to distinguish two states with same density matrix using a quantum state tomography?,,2,1,0,,,CC BY-SA 4.0 +8738,2,,8737,11/10/2019 23:54,,3,,"

There isn't. A density matrix encodes all the knowledge available about a state, therefore if two states are described by the same density matrix, they are indistinguishable.

+ +

Ket vectors differing by only a global phase have always the same density matrix, and represent the same physical state.

+",55,,55,,11/10/2019 23:59,11/10/2019 23:59,,,,2,,,,CC BY-SA 4.0 +8739,2,,8737,11/10/2019 23:57,,5,,"

The question presupposes a misconception that the vector form of a state $|\psi\rangle$ exists independently of its density operator form $|\psi\rangle\langle\psi|$, which is often described as secondary. In reality, the density operator of a state is all that truly exists --- and even then, it only exists as statistical information. In fact, you can construct quantum mechanics using density operators $\rho$ as the primary model of states. The formalism for this is similar to the Heisenberg picture of quantum mechanics, in which operators evolve over time. In a Heisenberg-type picture, you don't strictly need Hilbert spaces at all at first, you can define everything with abstract ""operators"". You can introduce a Hilbert space $\mathcal{H}$ later as an algebra representation of all of the operators. You can also introduce vector states $|\psi\rangle$ later as a simplified formalism for operator states that happen to have the form $\rho = |\psi\rangle\langle\psi|$.

+",8880,,,,,11/10/2019 23:57,,,,0,,,,CC BY-SA 4.0 +8740,2,,8724,11/11/2019 3:27,,1,,"

Not sure if this answers your question directly, but Docplex, which is IBM's Decision Optimization CPLEX Modeling for Python is capable of generating an Ising hamiltonian from a cost function. Take a look at this qiskit tutorial.

+",8707,,,,,11/11/2019 3:27,,,,1,,,,CC BY-SA 4.0 +8741,1,,,11/11/2019 3:35,,5,311,"

$\def\braket#1#2{\langle#1|#2\rangle}\def\bra#1{\langle#1|}\def\ket#1{|#1\rangle}$ +In MW05 the authors demonstrate so-called ""in-place"" amplitude amplification for QMA, exhibiting a method for Arthur to amplify his success probability without requiring any increase in the size of Merlin's witness state. Because QMA is a language of classical bitstrings, this in some sense amplification with a classical input and quantum witness.

+ +

Is there an analogue of Mariott-Watrous amplification for when the input is quantum? To me it seems like naively pushing it through fails for the following reason:

+ +

In the classical case, if $x$ is the input and $A(x,\ket{w})$ is the verifier, then Marriott-Watrous amplification relies being able to apply $A_x := A(x, \cdot)$ and $A_x^{\dagger}$ many times. This is fine because even if we modify $x$ throughout the course of computing $A_x$, we can just prepare a copy in advance so that we always have $x$ accessible to us. However, if the input is instead an arbitrary quantum state $\ket{x}$, no-cloning forbids us from doing this. As such, we may corrupt $\ket{x}$ over the course of computation and all bets are off.

+",8758,,55,,12/21/2020 9:57,1/13/2021 22:02,Marriott-Watrous style amplification with a quantum input,,1,0,,,,CC BY-SA 4.0 +8742,1,,,11/11/2019 16:14,,5,476,"

I was reading the CSS ( Steane Code) from the Nielsen & Chuang book. It asked in Ex. 10.27 to prove that: suppose $C_1$ and $C_2$ are $[n,k_1]$ and $[n,k_2]$classical linear codes such that $C_2\subset C_1$ and $C_1$ and $C_2^\perp$ both correct $t$ errors. Codes defined by $$|x+C_2\rangle\equiv \dfrac{1}{\sqrt{|C_2|}}\sum_{y\in C_2}(-1)^{u.y}|x+y+v\rangle $$ and parametrized by $u$ and $v$ are equivalent to $\mathrm{CSS}(C_1, C_2)$ in the sense that they have the same error-correcting properties.

+ +

My attempt for this was let the corrupted state be for the bit flip case: $$\dfrac{1}{\sqrt{|C_2|}}\sum_{y\in C_2}(-1)^{u.y}|x+y+v+e_1\rangle$$ now proceeding on the lines of the code $\mathrm{CSS}(C_1,C_2)$, I apply the Parity matrix $H_1$ for $C_1$, on the ancilla to obtain $$ \dfrac{1}{\sqrt{|C_2|}}\sum_{y\in C_2}(-1)^{u.y}|x+y+v+e_1\rangle|H_1e_1\rangle$$ where $H_1(x+y+v)=0$. so i get the position of the flipped qubit by inspecting the position where $1$ occurs.

+ +

Now for the phase flip case here is my try $$\dfrac{1}{\sqrt{|C_2|}}\sum_{y\in C_2}(-1)^{u.y}(-1)^{(x+y+v).e_2}|x+y+v\rangle $$ now I apply the Hadamard gate on the qubit to obtain $$\dfrac{1}{\sqrt{|C_2|2^n}}\sum_z\sum_{y\in C_2}(-1)^{u.y}(-1)^{(x+y+v).e_2}(-1)^{(x+y+v).z}|z\rangle $$$$= \dfrac{1}{\sqrt{|C_2|}2^n}\sum_z\sum_{y\in C_2}(-1)^{u.y}(-1)^{(x+y+v).(e_2+z)}|z\rangle$$ +Now let $e_2+z=z'$, we get $$ \dfrac{1}{\sqrt{|C_2|2^n}}\sum_z\sum_{y\in C_2}(-1)^{u.y}(-1)^{(x+y+v).z'}|z'+e\rangle$$, proceeding from here the final step that I got was $$\dfrac{1}{\sqrt{2^n/|C_2|}}\sum_{z'+u\in C_2^{\perp}}(-1)^{(x+v)z'}|z'+e_2\rangle$$, Now is this correct, if so how do I proceed, and what should be the answer?

+",6070,,7460,,11/27/2019 11:59,11/27/2019 11:59,Nielsen & Chuang Exercise Question on CSS code,,2,0,,,,CC BY-SA 4.0 +8743,1,,,11/11/2019 22:29,,1,54,"

I'm new to IBM Quantum Experience. When I initially create a circuit using the composer, all is well, but when I save the circuit and open it again, the composer window is blank - no gates or wires. I have tried it under Safari, Chrome, and Firefox on a MacBook Pro running 10.11.6 and on an iPad. I have tried disabling content blockers. Java, JavaScript, and Flash are all updated and enabled.

+",9094,,,,,6/13/2021 17:45,IBM Circuit Composer pane is blank,,1,2,,,,CC BY-SA 4.0 +8744,1,8747,,11/12/2019 0:19,,0,61,"

For example, backend.properties() returns following:

+ +
{'last_update_date': '2019-11-11T07:16:13+00:00',
+ 'backend_name': 'ibmq_essex',
+ 'general': [],
+ 'qubits': ...
+
+ +

Is the above time UTC or local time(although in Essex it is the same value)?

+",9095,,26,,11/16/2019 16:45,11/16/2019 16:45,What is the time zone for the time returned by backend.properties()?,,1,0,,,,CC BY-SA 4.0 +8745,2,,8742,11/12/2019 0:56,,3,,"

I am not following all of the calculations in your post (for one thing because your first displayed equation does not mention $C_1$), but I know why the goal of the exercise is true. In fact it is true for any code at all, not just a CSS code. If $\mathcal{C} \subseteq \mathcal{H}_\text{qubit}^{\otimes n}$ is any code, then you get an equivalent code $\mathcal{C}'$ if you apply a separate unitary operator to each of the $n$ qubits. After all, the definition of the error properties does not depend on a choice of basis for each for the $n$ qubits; who is to say whether the code ""is"" $\mathcal{C}$ or $\mathcal{C}'$ before you have chosen qubit bases.

+ +

In the case at hand, translation by your vector $x$ is equivalent to applying a flip operator $X$ in each position $k$ with $x_k = 1$. So this is just applying independent unitaries (either $X$ or $I$) for each of the qubits. In fact you can check the error properties in a particularly explicit way, since $X$ is a Pauli operator. Applying $X$ to the code in some position amounts to replacing the $Y$ and $Z$ errors with $-Y$ and $-Z$ and keeping $X$ just itself; you can see this from whether they commute or anti-commute.

+ +

There is a nifty corollary that applies to all additive codes, not just CSS codes. Namely, an additive code is normally defined by demanding that a set of commuting parity check operators all report the value $1$. However, you get an equivalent code if you use any mutual eigenspace of the parity check operators. In fact, if $\mathcal{C} \subseteq \mathcal{H}_\text{qubit}^{\otimes n}$ is an additive code, then the outer Hilbert space $\mathcal{H}_\text{qubit}^{\otimes n}$ is partitioned into equivalent codes.

+",8880,,8880,,11/12/2019 1:09,11/12/2019 1:09,,,,0,,,,CC BY-SA 4.0 +8746,2,,8734,11/12/2019 8:31,,0,,"

I would recommend this paper: https://arxiv.org/abs/1804.03719. You can find there information on algorithms and how to deal with noise and errors in quantum circuits. Moreover, it can help you to ""generate bunch of QASM files"" implementing algorithms presented there.

+",9006,,,,,11/12/2019 8:31,,,,0,,,,CC BY-SA 4.0 +8747,2,,8744,11/12/2019 9:11,,0,,"

The time you are looking at there, last_update_time, shows when the properties dict was last updated, so you can see whether it is a recent dict or an older one. This is why you are getting the same value for multiple backends.

+ +

This time is set here and so it shows the local date and time with the UTC offset, +0:00 in this case. All the times returned for the different properties are in UTC.

+",5955,,5955,,11/12/2019 10:10,11/12/2019 10:10,,,,1,,,,CC BY-SA 4.0 +8748,1,,,11/12/2019 11:45,,3,90,"

Given a $d$-dimensional Hilbert space $\mathcal{H} \approx \mathbb{C}^{d}$ (i.e. a qudit system) if I have $N$ identical copies of a mixed state I can use Schur-Weyl duality to decompose the state as +$$ +\rho^{\otimes N} = \left( U \rho_0 U^{\dagger} \right)^{\otimes N} = \bigoplus_{\lambda \in \mathcal{Y}_{N,d} } p_{\lambda,N} \left( U^{(\lambda)} \rho_{0,\lambda} U^{(\lambda) \dagger} \otimes \frac{I_{m_\lambda}}{m_\lambda} \right) +$$ +where $\mathcal{Y}_{N,d}$ is the set of Young diagrams with $N$ boxes and $d$ rows and $U^{(\lambda)}$ are irreps of $\mathrm{SU}(d)$, see, e.g., here for an explanation and an application in quantum information.

+ +

I know that it is possible to obtain a closed formula for the probabilities $p_{\lambda,N}$, as detailed in this paper, which if I understand correctly should be equivalent to use formulas for group characters.

+ +

However, I want to find the irreps $U^{(\lambda)}$ and the states $\rho_{0,\lambda}$. This should be equivalent to finding the so-called ""Schur transform"", a task for which a quantum algorithm exists, see this paper and this paper by Bacon, Chuang and Harrow.

+ +

I am still in the process of understanding and learning the maths, but in the meantime I am here to ask:

+ +
    +
  1. do you know of any available (classical) implementation of this (even if it's not efficient)? I.e. some algorithm that given $U$ and $\rho_0$ and $N$ gives all the $U^{(\lambda)}$ and $\rho_{0,\lambda}$.
  2. +
  3. is there some relevant reference where somebody explicitly computes this Schur-Weyl decomposition for a system that is not qubits (ideally with applications in quantum information)?
  4. +
+",350,,55,,12/21/2020 9:57,12/21/2020 9:57,How to construct Schur-Weyl decomposition of independent and identically distributed mixed qudit states?,,0,0,,,,CC BY-SA 4.0 +8749,1,8750,,11/12/2019 13:34,,4,511,"

I have the following matrix which I have to translate into Dirac's notations. +\begin{array}{cccccccc} + \frac{1}{2} \left(q_0+q_3\right){}^2 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{2} \left(q_0-q_3\right){}^2 \\ + 0 & \frac{1}{2} \left(q_1+q_2\right) \left(q_0+q_3\right) & 0 & 0 & 0 & 0 & \frac{1}{2} \left(q_1-q_2\right) \left(q_0-q_3\right) & 0 \\ + 0 & 0 & \frac{1}{2} \left(q_1+q_2\right) \left(q_0+q_3\right) & 0 & 0 & \frac{1}{2} \left(q_1-q_2\right) \left(q_0-q_3\right) & 0 & 0 \\ + 0 & 0 & 0 & \frac{1}{2} \left(q_1+q_2\right){}^2 & \frac{1}{2} \left(q_1-q_2\right){}^2 & 0 & 0 & 0 \\ + 0 & 0 & 0 & \frac{1}{2} \left(q_1-q_2\right){}^2 & \frac{1}{2} \left(q_1+q_2\right){}^2 & 0 & 0 & 0 \\ + 0 & 0 & \frac{1}{2} \left(q_1-q_2\right) \left(q_0-q_3\right) & 0 & 0 & \frac{1}{2} \left(q_1+q_2\right) \left(q_0+q_3\right) & 0 & 0 \\ + 0 & \frac{1}{2} \left(q_1-q_2\right) \left(q_0-q_3\right) & 0 & 0 & 0 & 0 & \frac{1}{2} \left(q_1+q_2\right) \left(q_0+q_3\right) & 0 \\ + \frac{1}{2} \left(q_0-q_3\right){}^2 & 0 & 0 & 0 & 0 & 0 & 0 & \frac{1}{2} \left(q_0+q_3\right){}^2 \\ +\end{array}

+ +

It is diagonal and would be very nice if someone could help me. :)

+",8027,,55,,12/21/2020 9:56,12/21/2020 9:56,Does anyone has some code for Mathematica or Python to convert a diagonal matrix into Dirac (bra-ket) notation?,,1,1,,,,CC BY-SA 4.0 +8750,2,,8749,11/12/2019 14:18,,3,,"

Let's define the kets,

+ +
ket0 = {{1},{0}};ket1 = {{0},{1}};
+
+ +

This function produces input from a string,

+ +
f[x_?StringQ] := ToExpression[StringJoin[""ket"",x]];
+
+ +

This function produces the diagonal matrix corresponding to a string ""000"",

+ +
matrixFunc[x_]:= KroneckerProduct@@ f/@ StringPartition[x,1] . 
+ConjugateTranspose[KroneckerProduct@@ f/@ StringPartition[x,1] ] ;
+
+matrixFunc[""0001""];
+
+A = RandomReal[1,{8,8}];M (* = INPUT MATRIX*);
+
+ +

This function gives the coefficient corresponding to the string (say) ""001""

+ +
overlap[x_?StringQ]:= Tr[matrixFunc[x] .A];
+
+ +

All possible permutations in lexical (dictionary) order for comparison,

+ +
allkets = StringJoin/@ Tuples[{""0"",""1""},3]
+
+",9102,,,,,11/12/2019 14:18,,,,1,,,,CC BY-SA 4.0 +8752,1,8754,,11/12/2019 16:44,,1,116,"

I want to make a 2 qubit circuit such that the non-unitary program will transform the regular basis in the way that:

+ +

$|0 0\rangle \to |00\rangle$

+ +

$|0 1\rangle \to |01\rangle$

+ +

$|10\rangle \to |01\rangle$ (the only one that affected)

+ +

$|11\rangle \to |11\rangle$

+ +

The only way I think of doing it, is after measuring the circuit I will change the classical outcomes so it will fit the transformation, for example in the classic way I would code:

+ +
if c[0]==1 & c[1]==0
+       c[0]==0
+       c[1]==1
+
+ +

but I didn`t find a way to write it in Qiskit language, please help.

+",4524,,26,,11/17/2019 6:03,11/17/2019 6:03,Trying to make irreversable operation in the quantum circuit,,1,4,,,,CC BY-SA 4.0 +8753,1,,,11/12/2019 17:54,,2,56,"

We know that the symbol of a quantum gate like ""x gate"", ""z gate"" is an abstraction notation. +For example, the Not-gate in classical computer is composed of 2 transistors. +How can we know quantum gate's exact circuit implementation?

+",9105,,,,,11/12/2019 17:54,What is quantum gate's correponding circuit implementation?,,0,4,,11/12/2019 23:09,,CC BY-SA 4.0 +8754,2,,8752,11/12/2019 19:15,,3,,"

I tried to implement your transformation on IBM Q. Here is the result: +

+ +

Input is $|00\rangle$ in this case. You can set input values by application of $X$ gates on q-bits $|q0\rangle$ and $|q1\rangle$.

+ +

Please note that this circuit run on a simulator only as reset gate has not been implemented on real IBM Q quantum hardware. But it is possible to simply measure $|q2\rangle$ and $|q3\rangle$. In that case your transformation become reversible.

+",9006,,,,,11/12/2019 19:15,,,,5,,,,CC BY-SA 4.0 +8755,2,,8720,11/13/2019 13:42,,2,,"

If you're just trying to figure out which specific versions a released version of qiskit works with we document that in the trove classifiers in the package metadata for that release, see: https://pypi.org/project/qiskit/ on the bottom left under ""Programming Language"". The meta-package there and all the individual elements have the same metadata in the package.

+ +

But if you're trying to answer the question more generally outside of a specific released package, then Qiskit strives to support all currently supported versions of python. For right now that's >=3.5. It will be >=3.6 in September 2020 when the upstream python community drops support for python 3.5. The problem with python 3.8 right now though is that new version updates do not happen in a vacuum and can't happen instantly. Python 3.8 was released less than 1 month ago and the entire python ecosystem is working to both make sure code is updated to work with the new version (because new python versions are never 100% compatible) and push out releases with binary wheels that support the new version (because all packages with compiled extensions need to be rebuilt for new versions).

+ +

For qiskit this is also true, there are several patches to add python 3.8 support to multiple elements already Qiskit/qiskit-terra#3268 Qiskit/qiskit-aer#428 Qiskit/qiskit-ignis#298 but until this week we weren't even in a place where we could install all of qiskit's upstream dependencies on python 3.8 (and some are still missing, but it's not blocking testing). The difficulties with python 3.8 right now are just a temporary blip that is happening right now because new release is so recent. Things will likely all be sorted within the next month and won't be a problem again (well at least for another 12-18 months when python 3.9 is released)

+",5529,,,,,11/13/2019 13:42,,,,0,,,,CC BY-SA 4.0 +8756,1,,,11/13/2019 17:09,,3,335,"

I have been reading about secret sharing schemes, and they regularly come up with a line that says 'that a person upon receiving a state measures the state in one of the basis say the computational basis $|0\rangle,|1\rangle$ or the Hadamard basis $\dfrac{|0\rangle+|1\rangle}{\sqrt{2}}$ and $\dfrac{|0\rangle-|1\rangle}{\sqrt{2}}$. Now what I don't understand is suppose I have state say $$\alpha|0\rangle+\beta|1\rangle$$ that I get from someone and that someone will give me the secret when I 'measure' the state in the right Basis.

+ +
    +
  1. Now If I chose the standard basis $|0\rangle,|1\rangle$ what will be the result I will get? If I measure with respect of the projection operator $\langle 0|$ I get $\alpha$ and If I measure with respect of the projection operator $\langle 1|$ I get $\beta$.

  2. +
  3. If I measure with respect to the Hadamard basis $\dfrac{|0\rangle+|1\rangle}{\sqrt{2}}$ I get $\dfrac{\alpha+\beta}{\sqrt{2}}$ +and if i measure with respect $\dfrac{|0\rangle-|1\rangle}{\sqrt{2}}$ I get $\dfrac{\alpha-\beta}{\sqrt{2}}$.

  4. +
  5. My first question basically means just selecting a Basis wouldn't serve the cause, because the basis themselves involve different projection operators and hence different operators. can somebody explain this concept?

  6. +
  7. Suppose I have a state $\omega|0\rangle$ and I measure in the standard basis then I either get a $0$ or $1$ depending on the projection operator chosen. So does that mean that $\omega$ has nothing to do with the result?

  8. +
+",6070,,55,,11/13/2019 18:22,11/13/2019 18:33,"What does ""measuring a state"" mean?",,2,0,,,,CC BY-SA 4.0 +8757,2,,8756,11/13/2019 18:33,,6,,"

Look like a lot of misunderstanding.

+ +

If you measure a state $\alpha|0\rangle+\beta|1\rangle$ in computational basis, the state collapses either to $|0\rangle$ or $|1\rangle$. In Quantum Information we say that we measured state $|0\rangle$ or $|1\rangle$, or simply we measured $0$ or $1$. There is no chance to know $\alpha$ and $\beta$ from the measurement.

+ +

If you measure a state in Hadamard basis, the state collapses either to $|+\rangle =\dfrac{|0\rangle+|1\rangle}{\sqrt{2}}$ or to $|-\rangle = \dfrac{|0\rangle-|1\rangle}{\sqrt{2}}$, and we say we measured either $+$ or $-$.

+",2105,,,,,11/13/2019 18:33,,,,0,,,,CC BY-SA 4.0 +8758,2,,8756,11/13/2019 18:33,,5,,"
+

Now If I chose the standard basis $|0\rangle,|1\rangle$ what will be the result I will get? If I measure with respect of the projection operator $\langle 0|$ I get $\alpha$ and If I measure with respect of the projection operator $\langle 1|$ I get $\beta$.

+
+ +

This is wrong. +First of all, arguably the most natural kind of measurement in QM consists in choosing a basis and having the state collapse in that basis. For example, if you have a single qubit, you can ""measure in the computational basis"", which makes the state collapse in either $|0\rangle$ or $|1\rangle$ with some probabilities. +You can think of measurements as the types of ""questions"" you can ask to a state. If you ask the system whether it's in the state $|0\rangle$ or $|1\rangle$, the state will collapse into one of these possibilities. You could instead ask whether the state is $|0\rangle+|1\rangle$ or $|0\rangle-|1\rangle$, and that will make the state collapse into of the elements of this other basis.

+ +

When you write $|\psi\rangle=\alpha|0\rangle+\beta|1\rangle$, what you are saying is that $|\psi\rangle$ is a state which, if you measure it in the computational basis (that is, the basis $\{|0\rangle,|1\rangle\}$), will be found in the state $|0\rangle$ with probability $|\alpha|^2$ and in the state $|1\rangle$ with probability $|\beta|^2$. If you take many copies of this state and measure it in the computational basis every time, you will get sometimes one result and sometimes the other (unless of course $\alpha=0$ or $\alpha=1$).

+ +

It is also worth noting that when I say ""you get $|0\rangle$ or $|1\rangle$"", what I mean is that you can have two different experimental outcomes, and you associate these two experimental outcomes with the labels ""$|0\rangle$"" and ""$|1\rangle$"". How this association is made depends on the context and is at least partially a matter of convention. For example, if you are talking about a photon's polarisation, you can decide that $|0\rangle$ means ""horizontal polarisation"" and $|1\rangle$ means ""vertical polarisation"".

+ +
+

Suppose I have a state ω|0⟩ and I measure in the standard basis then I either get a 0 or 1 depending on the projection operator chosen. So does that mean that ω has nothing to do with the result?

+
+ +

In the bra-ket formalism, states are defined up to multiplication by complex scalars. This means that $|\psi\rangle$ and $\lambda|\psi\rangle$ represent the same physical state for any $\lambda\in\mathbb C$.

+",55,,,,,11/13/2019 18:33,,,,4,,,,CC BY-SA 4.0 +8759,1,,,11/13/2019 19:24,,-1,242,"

I've implemented Grover's search algorithm in qiskit, and I'd like to pass in an input to run through the circuit. How is that done?

+",9113,,23,,11/19/2019 22:25,11/19/2019 22:25,How do you pass input to a circuit?,,2,2,,11/19/2019 22:31,,CC BY-SA 4.0 +8760,1,8770,,11/13/2019 23:07,,3,216,"

Let's say I have more than one qbits $|0\rangle|1\rangle$ and I want to perform a $H$ on both of them. I know the matrix representation for the Hadamard on a single qbit is

+ +

$$\frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1\\1 & -1\end{bmatrix}$$

+ +

If I represent the qbits with the vector $$\begin{bmatrix} 0 \\ 1 \\ 0 \\ 0\end{bmatrix}$$ I think that the representation for a two qbit Hadamard is the tensor $H\otimes H$ giving

+ +

$$\frac{1}{2}\begin{bmatrix}1 & 1 & 1 & 1\\1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & -1 & -1 & 1 \end{bmatrix}$$

+ +

and so

+ +

$$\frac{1}{2}\begin{bmatrix}1 & 1 & 1 & 1\\1 & -1 & 1 & -1 \\ 1 & 1 & -1 & -1 \\ 1 & -1 & -1 & 1 \end{bmatrix} \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0\end{bmatrix} = \frac{1}{2} \begin{bmatrix} 1 \\ -1 \\ 1 \\ -1 \end{bmatrix}$$

+ +

which feels correct as

+ +

$$ +\begin{align}\frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1\\1 & -1\end{bmatrix} \begin{bmatrix} 1 \\ 0 \end{bmatrix} \otimes \frac{1}{\sqrt{2}}\begin{bmatrix}1 & 1\\1 & -1\end{bmatrix} \begin{bmatrix} 0 \\ 1 \end{bmatrix} +&= \\ \frac{1}{\sqrt{2}} \begin{bmatrix} 1 \\ 1 \end{bmatrix} \otimes \frac{1}{\sqrt{2}} \begin{bmatrix} 1 \\ -1 \end{bmatrix} +&= \\ \frac{1}{2} \begin{bmatrix} 1 \\ -1 \\ 1 \\ -1 \end{bmatrix} +\end{align} +$$

+ +

But is this actually correct? And how does it (or is it possible to?) generalize to different gate compositions like $H \otimes CNOT$? Does it scale to $n$ qbits?

+",5289,,55,,11/14/2019 18:22,11/14/2019 18:22,What is the matrix representation for $n$-qubit gates?,,2,2,,,,CC BY-SA 4.0 +8761,2,,8759,11/14/2019 4:08,,1,,"

It would be helpful to get a code sample, but from how you've phrased the question, the circuit assumes that the register is originally initialized to the ${|00..0\rangle }$ state. You'll need to initialize the register into the uniform superposition of all states, and then your Grover's algorithm should work.

+ +

*full disclosure - it would be super helpful to have more context in your question.

+",8343,,,,,11/14/2019 4:08,,,,0,,,,CC BY-SA 4.0 +8762,2,,8760,11/14/2019 6:16,,2,,"

What you are looking for is https://en.wikipedia.org/wiki/Kronecker_product

+ +

Note that a column-vector can be considered as a matrix with the size $n \times 1$, so the Kronecker product rule also applies.

+",5870,,,,,11/14/2019 6:16,,,,0,,,,CC BY-SA 4.0 +8763,1,8791,,11/14/2019 6:46,,4,91,"

System 1: This has a Hilbert space of dimension $N$.

+ +

System 2: This has a Hilbert space of dimension $N'$, with the condition that $N' \ll N$. We want to simulate system 1 using the system 2, and so we use a ""nearly orthogonal"" basis of $N$ vectors to ""span"" the Hilbert space, with the vectors satisfying the following relations:

+ +

$$ \langle V_i | V_i \rangle = 1, \quad |\langle V_i | V_j \rangle| \leq \epsilon \, \forall \, i \neq j.$$

+ +

Note that $\epsilon$ is a small number and can be adjusted so as to create the basis of $N$ vectors in the System 2's space.

+ +

Now we know that if we probe these two systems using $N'$ number of operators then one can easily distinguish between these two systems, e.g. using $N'$ number of operations. However say if $N = 10^{23}$ and $N' = 10^5$, it isn't feasible to use $10^5$- point correlation functions. So we look for simpler observables to distinguish between the two systems. Which observable(s) / series of operations can demonstrate whether System 2 has a smaller Hilbert space?

+ +

As an example, let's say the system we want to understand is a gas at a temperature $T$ and is our System 1. What exactly goes wrong if we try to simulate it using a smaller Hilbert space, i.e. System 2? Do laws of thermodynamics hold?

+",2669,,,,,11/16/2019 7:32,What goes wrong if I try to simulate a system with a larger Hilbert space with a smaller Hilbert space?,,1,0,,,,CC BY-SA 4.0 +8765,2,,8759,11/14/2019 11:09,,1,,"

To give you an example, at the last Qiskit Camp I was part of a team that implemented some Groverian Iterations in an Algorithm which as an input took positions on a complete graph.

+ +

The repository is here.

+ +

So if we want to encode for example two walkers on the graph below, since it has 4 vertices we require 2 qubits to encode the position of each walker. Thus our input will be some state using these 4 qubits. + +In our case we Hadamarded over all the qubits to distribute the walkers over the whole graph evenly before iteration. This you could say was our state preparation.

+ +

Take Home Message +Think about how to encode your problem in terms of qubits. This will then allow you to think about what your algorithm is going to act on and so what your input will be and what registers you need and so on.

+",4373,,,,,11/14/2019 11:09,,,,0,,,,CC BY-SA 4.0 +8766,1,,,11/14/2019 12:08,,4,269,"

I am experimenting with concepts in Quantum Computing and I have landed on using entangled Qubits to perform certain actions.

+ +

My question is this: is it possible to have (let's say) 3 entangled Qubits in a system. If it is, then how much information is retrievable/usable when only 2 of these Qubits are measured? The application I am thinking of is using 2 of the 3 Qubits for a one-time access code and then the 3rd becomes useless (and almost automatically gets locked out).

+ +

I realise my mathematics is basic but it is the application I am curious about.

+ +

Any help would be appreciated.

+",9123,,55,,11/14/2019 18:03,10/22/2022 0:54,Is it possible to have entanglement between more than two qubits?,,2,3,,,,CC BY-SA 4.0 +8767,1,8788,,11/14/2019 15:01,,3,181,"

I am new to the quantum world and it's computing. But it accidentally hit in my mind that DWave built a quantum computer with 2000 qubits which can be use to simulate the whole observable universe or to simulate whole brain for finding what out about consciousness. And the future plan of Dwave is to build a quantum computer with 5000 qubits, which is a lot higher.

+ +

Recently Google made a quantum computer and claims to have achieved quantum supremacy.

+ +

But what is the problem with running the experiment, which can solve the centuries-old problem using quantum computer with 2000 qubits?

+ +

Any help would be appreciated.

+",9125,,55,,12/21/2020 9:56,3/18/2022 3:18,What is the problem in demonstrating quantum supremacy?,,2,4,0,,,CC BY-SA 4.0 +8768,2,,8766,11/14/2019 15:01,,4,,"

Here is a circuit for preparation of state $\frac{1}{\sqrt{2}}(|000\rangle + |111\rangle)$.

+ +

+ +

And here one for state $\frac{1}{\sqrt{3}}(|001\rangle + |010\rangle+ |100\rangle)$

+ +

+",9006,,9006,,11/15/2019 14:02,11/15/2019 14:02,,,,1,,,,CC BY-SA 4.0 +8769,1,8789,,11/14/2019 16:37,,4,189,"

Given that operator $S_M$, which consists entirely of $Y$ and $Z$ Pauli operators, is a stabilizer of some graph state $G$ i.e. the eigenvalue equation is given as $S_MG = G$.

+ +

In the paper 'Graph States as a Resource for Quantum Metrology' (page 3) it states that the expectation value is given by

+ +

\begin{align} +\langle S_M \rangle &= \text{Tr}(e^{i\frac{\theta}{2}\sum_{i=0}^{n}X_i}S_M e^{-i\frac{\theta}{2}\sum_{i=0}^{n}X_i}G) \\ + &= \text{Tr}(e^{i \theta \sum_{i=0}^{n}X_i}G). +\end{align}

+ +

It seems that they are working in the Heisenberg picture and the above equations imply that +$$S_M e^{-i\frac{\theta}{2}\sum_{i=0}^{n}X_i} = (S_M e^{-i\frac{\theta}{2}\sum_{i=0}^{n}X_i})^{\dagger} = e^{i\frac{\theta}{2}\sum_{i=0}^{n}X_i^\dagger}S_{M}^{\dagger} = e^{i\frac{\theta}{2}\sum_{i=0}^{n}X_i}S_{M},$$ +but in order to do this I assumed that $S_M e^{-i\frac{\theta}{2}\sum_{i=0}^{n}X_i}$ +is Hermitian. We only know that $S_M$ is Hermitian and unitary (being Pauli operators) and $e^{-i\frac{\theta}{2}\sum_{i=0}^{n}X_i}$ is unitary. What am I missing that allows the above simplification?

+ +

Thanks for any help.

+",2032,,55,,12/7/2020 11:56,12/7/2020 11:56,Expectation Value of Stabilizer,,1,4,,,,CC BY-SA 4.0